From f3153d45bcd7426a40505e7ba11ba5640ee19541 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sat, 11 Feb 2023 03:53:15 +1300 Subject: [PATCH 01/39] Initial Implementation - Model Conversion Backend --- invokeai/backend/invoke_ai_web_server.py | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/invokeai/backend/invoke_ai_web_server.py b/invokeai/backend/invoke_ai_web_server.py index 4bff5dfecc..002ddec688 100644 --- a/invokeai/backend/invoke_ai_web_server.py +++ b/invokeai/backend/invoke_ai_web_server.py @@ -393,6 +393,55 @@ class InvokeAIWebServer: traceback.print_exc() print("\n") + @socketio.on('convertToDiffusers') + def convert_to_diffusers(model_to_convert: str): + try: + if (model_info := self.generate.model_manager.model_info(model_name=model_to_convert)): + if 'weights' in model_info: + ckpt_path = Path(model_info['weights']) + original_config_file = Path(model_info['config']) + model_name = model_to_convert + model_description = model_info['description'] + else: + self.socketio.emit("error", {"message": "Model is not a valid checkpoint file"}) + else: + self.socketio.emit("error", {"message": "Could not retrieve model info."}) + + if not ckpt_path.is_absolute(): + ckpt_path = Path(Globals.root,ckpt_path) + + if original_config_file and not original_config_file.is_absolute(): + original_config_file = Path(Globals.root, original_config_file) + + diffusers_path = Path(f'{ckpt_path.parent.absolute()}\\{model_name}_diffusers') + + if diffusers_path.exists(): + shutil.rmtree(diffusers_path) + + self.generate.model_manager.convert_and_import( + ckpt_path, + diffusers_path, + model_name=model_name, + model_description=model_description, + vae = None, + original_config_file = original_config_file, + commit_to_conf=opt.conf, + ) + + new_model_list = self.generate.model_manager.list_models() + socketio.emit( + "newModelAdded", + {"new_model_name": model_name, + "model_list": new_model_list, 'update': True}, + ) + print(f">> Model Converted: {model_name}") + except Exception as e: + self.socketio.emit("error", {"message": (str(e))}) + print("\n") + + traceback.print_exc() + print("\n") + @socketio.on("requestEmptyTempFolder") def empty_temp_folder(): try: From 92322909509b343412ac92f6f08d390536b3a07d Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sat, 11 Feb 2023 03:53:31 +1300 Subject: [PATCH 02/39] Initial Implementation - Model Conversion Frontend --- invokeai/frontend/src/app/socketio/actions.ts | 4 +++ .../frontend/src/app/socketio/emitters.ts | 3 ++ .../frontend/src/app/socketio/middleware.ts | 6 ++++ .../components/ModelManager/ModelList.tsx | 4 +++ .../components/ModelManager/ModelListItem.tsx | 31 +++++++++++++++++-- 5 files changed, 45 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/src/app/socketio/actions.ts b/invokeai/frontend/src/app/socketio/actions.ts index 35c9955def..7f0dbcfb8d 100644 --- a/invokeai/frontend/src/app/socketio/actions.ts +++ b/invokeai/frontend/src/app/socketio/actions.ts @@ -38,6 +38,10 @@ export const addNewModel = createAction< export const deleteModel = createAction('socketio/deleteModel'); +export const convertToDiffusers = createAction( + 'socketio/convertToDiffusers' +); + export const requestModelChange = createAction( 'socketio/requestModelChange' ); diff --git a/invokeai/frontend/src/app/socketio/emitters.ts b/invokeai/frontend/src/app/socketio/emitters.ts index bc90f9c58b..501450deb2 100644 --- a/invokeai/frontend/src/app/socketio/emitters.ts +++ b/invokeai/frontend/src/app/socketio/emitters.ts @@ -178,6 +178,9 @@ const makeSocketIOEmitters = ( emitDeleteModel: (modelName: string) => { socketio.emit('deleteModel', modelName); }, + emitConvertToDiffusers: (modelName: string) => { + socketio.emit('convertToDiffusers', modelName); + }, emitRequestModelChange: (modelName: string) => { dispatch(modelChangeRequested()); socketio.emit('requestModelChange', modelName); diff --git a/invokeai/frontend/src/app/socketio/middleware.ts b/invokeai/frontend/src/app/socketio/middleware.ts index c8dd0d4c29..4d3549da4e 100644 --- a/invokeai/frontend/src/app/socketio/middleware.ts +++ b/invokeai/frontend/src/app/socketio/middleware.ts @@ -64,6 +64,7 @@ export const socketioMiddleware = () => { emitSearchForModels, emitAddNewModel, emitDeleteModel, + emitConvertToDiffusers, emitRequestModelChange, emitSaveStagingAreaImageToGallery, emitRequestEmptyTempFolder, @@ -199,6 +200,11 @@ export const socketioMiddleware = () => { break; } + case 'socketio/convertToDiffusers': { + emitConvertToDiffusers(action.payload); + break; + } + case 'socketio/requestModelChange': { emitRequestModelChange(action.payload); break; diff --git a/invokeai/frontend/src/features/system/components/ModelManager/ModelList.tsx b/invokeai/frontend/src/features/system/components/ModelManager/ModelList.tsx index fc2adae357..5f7e45197a 100644 --- a/invokeai/frontend/src/features/system/components/ModelManager/ModelList.tsx +++ b/invokeai/frontend/src/features/system/components/ModelManager/ModelList.tsx @@ -85,6 +85,7 @@ const ModelList = () => { name={model.name} status={model.status} description={model.description} + format={model.format} /> ); if (model.format === isSelectedFilter) { @@ -94,6 +95,7 @@ const ModelList = () => { name={model.name} status={model.status} description={model.description} + format={model.format} /> ); } @@ -105,6 +107,7 @@ const ModelList = () => { name={model.name} status={model.status} description={model.description} + format={model.format} /> ); } else { @@ -114,6 +117,7 @@ const ModelList = () => { name={model.name} status={model.status} description={model.description} + format={model.format} /> ); } diff --git a/invokeai/frontend/src/features/system/components/ModelManager/ModelListItem.tsx b/invokeai/frontend/src/features/system/components/ModelManager/ModelListItem.tsx index 398b61c634..671465ed31 100644 --- a/invokeai/frontend/src/features/system/components/ModelManager/ModelListItem.tsx +++ b/invokeai/frontend/src/features/system/components/ModelManager/ModelListItem.tsx @@ -1,18 +1,27 @@ import { DeleteIcon, EditIcon } from '@chakra-ui/icons'; import { Box, Button, Flex, Spacer, Text, Tooltip } from '@chakra-ui/react'; import { ModelStatus } from 'app/invokeai'; -import { deleteModel, requestModelChange } from 'app/socketio/actions'; +import { + convertToDiffusers, + deleteModel, + requestModelChange, +} from 'app/socketio/actions'; import { RootState } from 'app/store'; import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIAlertDialog from 'common/components/IAIAlertDialog'; import IAIIconButton from 'common/components/IAIIconButton'; -import { setOpenModel } from 'features/system/store/systemSlice'; +import { + setIsProcessing, + setOpenModel, +} from 'features/system/store/systemSlice'; import { useTranslation } from 'react-i18next'; +import { MdSwitchLeft } from 'react-icons/md'; type ModelListItemProps = { name: string; status: ModelStatus; description: string; + format: string | undefined; }; export default function ModelListItem(props: ModelListItemProps) { @@ -28,7 +37,7 @@ export default function ModelListItem(props: ModelListItemProps) { const dispatch = useAppDispatch(); - const { name, status, description } = props; + const { name, status, description, format } = props; const handleChangeModel = () => { dispatch(requestModelChange(name)); @@ -38,6 +47,11 @@ export default function ModelListItem(props: ModelListItemProps) { dispatch(setOpenModel(name)); }; + const convertModelHandler = () => { + dispatch(setIsProcessing(true)); + dispatch(convertToDiffusers(name)); + }; + const handleModelDelete = () => { dispatch(deleteModel(name)); dispatch(setOpenModel(null)); @@ -83,6 +97,7 @@ export default function ModelListItem(props: ModelListItemProps) { > {t('modelmanager:load')} + } size={'sm'} @@ -91,6 +106,16 @@ export default function ModelListItem(props: ModelListItemProps) { isDisabled={status === 'active' || isProcessing || !isConnected} className=" modal-close-btn" /> + {format !== 'diffusers' && ( + } + size={'sm'} + onClick={convertModelHandler} + aria-label="Convert Model" + isDisabled={status === 'active' || isProcessing || !isConnected} + className=" modal-close-btn" + /> + )} Date: Sat, 11 Feb 2023 20:41:18 +1300 Subject: [PATCH 03/39] Add Initial Checks for Inpainting The conversion itself is broken. But that's another issue. --- invokeai/backend/invoke_ai_web_server.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/invokeai/backend/invoke_ai_web_server.py b/invokeai/backend/invoke_ai_web_server.py index 002ddec688..7c49cbb0d4 100644 --- a/invokeai/backend/invoke_ai_web_server.py +++ b/invokeai/backend/invoke_ai_web_server.py @@ -394,13 +394,14 @@ class InvokeAIWebServer: print("\n") @socketio.on('convertToDiffusers') - def convert_to_diffusers(model_to_convert: str): + def convert_to_diffusers(model_to_convert: dict): try: - if (model_info := self.generate.model_manager.model_info(model_name=model_to_convert)): + + if (model_info := self.generate.model_manager.model_info(model_name=model_to_convert['name'])): if 'weights' in model_info: ckpt_path = Path(model_info['weights']) original_config_file = Path(model_info['config']) - model_name = model_to_convert + model_name = model_to_convert["name"] model_description = model_info['description'] else: self.socketio.emit("error", {"message": "Model is not a valid checkpoint file"}) @@ -412,6 +413,13 @@ class InvokeAIWebServer: if original_config_file and not original_config_file.is_absolute(): original_config_file = Path(Globals.root, original_config_file) + + if model_to_convert['is_inpainting']: + original_config_file = Path( + 'configs', + 'stable-diffusion', + 'v1-inpainting-inference.yaml' if model_to_convert['is_inpainting'] else 'v1-inference.yaml' + ) diffusers_path = Path(f'{ckpt_path.parent.absolute()}\\{model_name}_diffusers') From 6e52ca33072d2cb8bed832ee1656d8a7f44deaa3 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sat, 11 Feb 2023 20:41:49 +1300 Subject: [PATCH 04/39] Model Convert Component --- .../public/locales/modelmanager/en.json | 13 +- invokeai/frontend/src/app/invokeai.d.ts | 5 + invokeai/frontend/src/app/socketio/actions.ts | 7 +- .../ModelManager/CheckpointModelEdit.tsx | 4 +- .../components/ModelManager/ModelConvert.tsx | 115 ++++++++++++++++++ .../components/ModelManager/ModelList.tsx | 4 - .../components/ModelManager/ModelListItem.tsx | 30 +---- 7 files changed, 142 insertions(+), 36 deletions(-) create mode 100644 invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx diff --git a/invokeai/frontend/public/locales/modelmanager/en.json b/invokeai/frontend/public/locales/modelmanager/en.json index ad320d0969..71c69f2fbe 100644 --- a/invokeai/frontend/public/locales/modelmanager/en.json +++ b/invokeai/frontend/public/locales/modelmanager/en.json @@ -63,5 +63,16 @@ "formMessageDiffusersModelLocation": "Diffusers Model Location", "formMessageDiffusersModelLocationDesc": "Please enter at least one.", "formMessageDiffusersVAELocation": "VAE Location", - "formMessageDiffusersVAELocationDesc": "If not provided, InvokeAI will look for the VAE file inside the model location given above." + "formMessageDiffusersVAELocationDesc": "If not provided, InvokeAI will look for the VAE file inside the model location given above.", + "convert": "Convert", + "convertToDiffusers": "Convert To Diffusers", + "convertToDiffusersHelpText1": "This model will be converted to the 🧨 Diffusers format.", + "convertToDiffusersHelpText2": "This process will replace your Model Manager entry with the Diffusers version of the same model.", + "convertToDiffusersHelpText3": "Your checkpoint file on the disk will NOT be deleted or modified in anyway. You can add your checkpoint to the Model Manager again if you want to.", + "convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.", + "convertToDiffusersHelpText5": "This process will create a Diffusers version of this model in the same directory as your checkpoint. Please make sure you have enough disk space.", + "convertToDiffusersHelpText6": "Do you wish to convert this model?", + "inpaintingModel": "Inpainting Model", + "customConfig": "Custom Config", + "pathToCustomConfig": "Path To Custom Config" } diff --git a/invokeai/frontend/src/app/invokeai.d.ts b/invokeai/frontend/src/app/invokeai.d.ts index 4c978abd80..652c651bd5 100644 --- a/invokeai/frontend/src/app/invokeai.d.ts +++ b/invokeai/frontend/src/app/invokeai.d.ts @@ -219,6 +219,11 @@ export declare type InvokeDiffusersModelConfigProps = { }; }; +export declare type InvokeModelConversionProps = { + name: string; + is_inpainting: boolean; +}; + /** * These types type data received from the server via socketio. */ diff --git a/invokeai/frontend/src/app/socketio/actions.ts b/invokeai/frontend/src/app/socketio/actions.ts index 7f0dbcfb8d..e0a8dbc9e4 100644 --- a/invokeai/frontend/src/app/socketio/actions.ts +++ b/invokeai/frontend/src/app/socketio/actions.ts @@ -38,9 +38,10 @@ export const addNewModel = createAction< export const deleteModel = createAction('socketio/deleteModel'); -export const convertToDiffusers = createAction( - 'socketio/convertToDiffusers' -); +export const convertToDiffusers = + createAction( + 'socketio/convertToDiffusers' + ); export const requestModelChange = createAction( 'socketio/requestModelChange' diff --git a/invokeai/frontend/src/features/system/components/ModelManager/CheckpointModelEdit.tsx b/invokeai/frontend/src/features/system/components/ModelManager/CheckpointModelEdit.tsx index f189dbd964..4d258834ef 100644 --- a/invokeai/frontend/src/features/system/components/ModelManager/CheckpointModelEdit.tsx +++ b/invokeai/frontend/src/features/system/components/ModelManager/CheckpointModelEdit.tsx @@ -27,6 +27,7 @@ import type { InvokeModelConfigProps } from 'app/invokeai'; import type { RootState } from 'app/store'; import type { FieldInputProps, FormikProps } from 'formik'; import { isEqual, pickBy } from 'lodash'; +import ModelConvert from './ModelConvert'; const selector = createSelector( [systemSelector], @@ -101,10 +102,11 @@ export default function CheckpointModelEdit() { return openModel ? ( - + {openModel} + state.system.model_list + ); + + const retrievedModel = model_list[model]; + + const [isInpainting, setIsInpainting] = useState(false); + const [customConfig, setIsCustomConfig] = useState(false); + + const dispatch = useAppDispatch(); + const { t } = useTranslation(); + + const isProcessing = useAppSelector( + (state: RootState) => state.system.isProcessing + ); + + const isConnected = useAppSelector( + (state: RootState) => state.system.isConnected + ); + + useEffect(() => { + setIsInpainting(false); + setIsCustomConfig(false); + }, [model]); + + const modelConvertHandler = () => { + dispatch(setIsProcessing(true)); + dispatch(convertToDiffusers({ name: model, is_inpainting: isInpainting })); + }; + + return ( + + 🧨 {t('modelmanager:convertToDiffusers')} + + } + > + + {t('modelmanager:convertToDiffusersHelpText1')} + + {t('modelmanager:convertToDiffusersHelpText2')} + {t('modelmanager:convertToDiffusersHelpText3')} + {t('modelmanager:convertToDiffusersHelpText4')} + {t('modelmanager:convertToDiffusersHelpText5')} + + {t('modelmanager:convertToDiffusersHelpText6')} + + + { + setIsInpainting(!isInpainting); + setIsCustomConfig(false); + }} + label={t('modelmanager:inpaintingModel')} + isDisabled={customConfig} + /> + { + setIsCustomConfig(!customConfig); + setIsInpainting(false); + }} + label={t('modelmanager:customConfig')} + isDisabled={isInpainting} + /> + + {customConfig && ( + + + {t('modelmanager:pathToCustomConfig')} + + + + )} + + + + ); +} diff --git a/invokeai/frontend/src/features/system/components/ModelManager/ModelList.tsx b/invokeai/frontend/src/features/system/components/ModelManager/ModelList.tsx index 5f7e45197a..fc2adae357 100644 --- a/invokeai/frontend/src/features/system/components/ModelManager/ModelList.tsx +++ b/invokeai/frontend/src/features/system/components/ModelManager/ModelList.tsx @@ -85,7 +85,6 @@ const ModelList = () => { name={model.name} status={model.status} description={model.description} - format={model.format} /> ); if (model.format === isSelectedFilter) { @@ -95,7 +94,6 @@ const ModelList = () => { name={model.name} status={model.status} description={model.description} - format={model.format} /> ); } @@ -107,7 +105,6 @@ const ModelList = () => { name={model.name} status={model.status} description={model.description} - format={model.format} /> ); } else { @@ -117,7 +114,6 @@ const ModelList = () => { name={model.name} status={model.status} description={model.description} - format={model.format} /> ); } diff --git a/invokeai/frontend/src/features/system/components/ModelManager/ModelListItem.tsx b/invokeai/frontend/src/features/system/components/ModelManager/ModelListItem.tsx index 671465ed31..2b712d969a 100644 --- a/invokeai/frontend/src/features/system/components/ModelManager/ModelListItem.tsx +++ b/invokeai/frontend/src/features/system/components/ModelManager/ModelListItem.tsx @@ -1,27 +1,18 @@ import { DeleteIcon, EditIcon } from '@chakra-ui/icons'; import { Box, Button, Flex, Spacer, Text, Tooltip } from '@chakra-ui/react'; import { ModelStatus } from 'app/invokeai'; -import { - convertToDiffusers, - deleteModel, - requestModelChange, -} from 'app/socketio/actions'; +import { deleteModel, requestModelChange } from 'app/socketio/actions'; import { RootState } from 'app/store'; import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIAlertDialog from 'common/components/IAIAlertDialog'; import IAIIconButton from 'common/components/IAIIconButton'; -import { - setIsProcessing, - setOpenModel, -} from 'features/system/store/systemSlice'; +import { setOpenModel } from 'features/system/store/systemSlice'; import { useTranslation } from 'react-i18next'; -import { MdSwitchLeft } from 'react-icons/md'; type ModelListItemProps = { name: string; status: ModelStatus; description: string; - format: string | undefined; }; export default function ModelListItem(props: ModelListItemProps) { @@ -37,7 +28,7 @@ export default function ModelListItem(props: ModelListItemProps) { const dispatch = useAppDispatch(); - const { name, status, description, format } = props; + const { name, status, description } = props; const handleChangeModel = () => { dispatch(requestModelChange(name)); @@ -47,11 +38,6 @@ export default function ModelListItem(props: ModelListItemProps) { dispatch(setOpenModel(name)); }; - const convertModelHandler = () => { - dispatch(setIsProcessing(true)); - dispatch(convertToDiffusers(name)); - }; - const handleModelDelete = () => { dispatch(deleteModel(name)); dispatch(setOpenModel(null)); @@ -106,16 +92,6 @@ export default function ModelListItem(props: ModelListItemProps) { isDisabled={status === 'active' || isProcessing || !isConnected} className=" modal-close-btn" /> - {format !== 'diffusers' && ( - } - size={'sm'} - onClick={convertModelHandler} - aria-label="Convert Model" - isDisabled={status === 'active' || isProcessing || !isConnected} - className=" modal-close-btn" - /> - )} Date: Sat, 11 Feb 2023 23:34:24 +1300 Subject: [PATCH 05/39] Add support for custom config files --- invokeai/backend/invoke_ai_web_server.py | 152 +++++++++++------- .../public/locales/modelmanager/en.json | 3 +- invokeai/frontend/src/app/invokeai.d.ts | 1 + .../frontend/src/app/socketio/emitters.ts | 6 +- .../components/ModelManager/ModelConvert.tsx | 33 +++- 5 files changed, 134 insertions(+), 61 deletions(-) diff --git a/invokeai/backend/invoke_ai_web_server.py b/invokeai/backend/invoke_ai_web_server.py index 7c49cbb0d4..d7e0a4d11a 100644 --- a/invokeai/backend/invoke_ai_web_server.py +++ b/invokeai/backend/invoke_ai_web_server.py @@ -43,7 +43,8 @@ if not os.path.isabs(args.outdir): # normalize the config directory relative to root if not os.path.isabs(opt.conf): - opt.conf = os.path.normpath(os.path.join(Globals.root,opt.conf)) + opt.conf = os.path.normpath(os.path.join(Globals.root, opt.conf)) + class InvokeAIWebServer: def __init__(self, generate: Generate, gfpgan, codeformer, esrgan) -> None: @@ -189,7 +190,8 @@ class InvokeAIWebServer: (width, height) = pil_image.size thumbnail_path = save_thumbnail( - pil_image, os.path.basename(file_path), self.thumbnail_image_path + pil_image, os.path.basename( + file_path), self.thumbnail_image_path ) response = { @@ -264,14 +266,16 @@ class InvokeAIWebServer: # location for "finished" images self.result_path = args.outdir # temporary path for intermediates - self.intermediate_path = os.path.join(self.result_path, "intermediates/") + self.intermediate_path = os.path.join( + self.result_path, "intermediates/") # path for user-uploaded init images and masks self.init_image_path = os.path.join(self.result_path, "init-images/") self.mask_image_path = os.path.join(self.result_path, "mask-images/") # path for temp images e.g. gallery generations which are not committed self.temp_image_path = os.path.join(self.result_path, "temp-images/") # path for thumbnail images - self.thumbnail_image_path = os.path.join(self.result_path, "thumbnails/") + self.thumbnail_image_path = os.path.join( + self.result_path, "thumbnails/") # txt log self.log_path = os.path.join(self.result_path, "invoke_log.txt") # make all output paths @@ -301,14 +305,16 @@ class InvokeAIWebServer: try: if not search_folder: socketio.emit( - "foundModels", - {'search_folder': None, 'found_models': None}, - ) + "foundModels", + {'search_folder': None, 'found_models': None}, + ) else: - search_folder, found_models = self.generate.model_manager.search_models(search_folder) + search_folder, found_models = self.generate.model_manager.search_models( + search_folder) socketio.emit( "foundModels", - {'search_folder': search_folder, 'found_models': found_models}, + {'search_folder': search_folder, + 'found_models': found_models}, ) except Exception as e: self.socketio.emit("error", {"message": (str(e))}) @@ -396,7 +402,6 @@ class InvokeAIWebServer: @socketio.on('convertToDiffusers') def convert_to_diffusers(model_to_convert: dict): try: - if (model_info := self.generate.model_manager.model_info(model_name=model_to_convert['name'])): if 'weights' in model_info: ckpt_path = Path(model_info['weights']) @@ -404,15 +409,18 @@ class InvokeAIWebServer: model_name = model_to_convert["name"] model_description = model_info['description'] else: - self.socketio.emit("error", {"message": "Model is not a valid checkpoint file"}) + self.socketio.emit( + "error", {"message": "Model is not a valid checkpoint file"}) else: - self.socketio.emit("error", {"message": "Could not retrieve model info."}) - + self.socketio.emit( + "error", {"message": "Could not retrieve model info."}) + if not ckpt_path.is_absolute(): - ckpt_path = Path(Globals.root,ckpt_path) - + ckpt_path = Path(Globals.root, ckpt_path) + if original_config_file and not original_config_file.is_absolute(): - original_config_file = Path(Globals.root, original_config_file) + original_config_file = Path( + Globals.root, original_config_file) if model_to_convert['is_inpainting']: original_config_file = Path( @@ -420,19 +428,24 @@ class InvokeAIWebServer: 'stable-diffusion', 'v1-inpainting-inference.yaml' if model_to_convert['is_inpainting'] else 'v1-inference.yaml' ) - - diffusers_path = Path(f'{ckpt_path.parent.absolute()}\\{model_name}_diffusers') - + + if model_to_convert['custom_config'] is not None: + original_config_file = Path( + model_to_convert['custom_config']) + + diffusers_path = Path( + f'{ckpt_path.parent.absolute()}\\{model_name}_diffusers') + if diffusers_path.exists(): shutil.rmtree(diffusers_path) - + self.generate.model_manager.convert_and_import( ckpt_path, diffusers_path, model_name=model_name, model_description=model_description, - vae = None, - original_config_file = original_config_file, + vae=None, + original_config_file=original_config_file, commit_to_conf=opt.conf, ) @@ -440,7 +453,7 @@ class InvokeAIWebServer: socketio.emit( "newModelAdded", {"new_model_name": model_name, - "model_list": new_model_list, 'update': True}, + "model_list": new_model_list, 'update': True}, ) print(f">> Model Converted: {model_name}") except Exception as e: @@ -448,7 +461,7 @@ class InvokeAIWebServer: print("\n") traceback.print_exc() - print("\n") + print("\n") @socketio.on("requestEmptyTempFolder") def empty_temp_folder(): @@ -463,7 +476,8 @@ class InvokeAIWebServer: ) os.remove(thumbnail_path) except Exception as e: - socketio.emit("error", {"message": f"Unable to delete {f}: {str(e)}"}) + socketio.emit( + "error", {"message": f"Unable to delete {f}: {str(e)}"}) pass socketio.emit("tempFolderEmptied") @@ -478,7 +492,8 @@ class InvokeAIWebServer: def save_temp_image_to_gallery(url): try: image_path = self.get_image_path_from_url(url) - new_path = os.path.join(self.result_path, os.path.basename(image_path)) + new_path = os.path.join( + self.result_path, os.path.basename(image_path)) shutil.copy2(image_path, new_path) if os.path.splitext(new_path)[1] == ".png": @@ -491,7 +506,8 @@ class InvokeAIWebServer: (width, height) = pil_image.size thumbnail_path = save_thumbnail( - pil_image, os.path.basename(new_path), self.thumbnail_image_path + pil_image, os.path.basename( + new_path), self.thumbnail_image_path ) image_array = [ @@ -554,7 +570,8 @@ class InvokeAIWebServer: (width, height) = pil_image.size thumbnail_path = save_thumbnail( - pil_image, os.path.basename(path), self.thumbnail_image_path + pil_image, os.path.basename( + path), self.thumbnail_image_path ) image_array.append( @@ -572,7 +589,8 @@ class InvokeAIWebServer: } ) except Exception as e: - socketio.emit("error", {"message": f"Unable to load {path}: {str(e)}"}) + socketio.emit( + "error", {"message": f"Unable to load {path}: {str(e)}"}) pass socketio.emit( @@ -626,7 +644,8 @@ class InvokeAIWebServer: (width, height) = pil_image.size thumbnail_path = save_thumbnail( - pil_image, os.path.basename(path), self.thumbnail_image_path + pil_image, os.path.basename( + path), self.thumbnail_image_path ) image_array.append( @@ -645,7 +664,8 @@ class InvokeAIWebServer: ) except Exception as e: print(f">> Unable to load {path}") - socketio.emit("error", {"message": f"Unable to load {path}: {str(e)}"}) + socketio.emit( + "error", {"message": f"Unable to load {path}: {str(e)}"}) pass socketio.emit( @@ -683,7 +703,8 @@ class InvokeAIWebServer: printable_parameters["init_mask"][:64] + "..." ) - print(f'\n>> Image Generation Parameters:\n\n{printable_parameters}\n') + print( + f'\n>> Image Generation Parameters:\n\n{printable_parameters}\n') print(f'>> ESRGAN Parameters: {esrgan_parameters}') print(f'>> Facetool Parameters: {facetool_parameters}') @@ -726,9 +747,11 @@ class InvokeAIWebServer: if postprocessing_parameters["type"] == "esrgan": progress.set_current_status("common:statusUpscalingESRGAN") elif postprocessing_parameters["type"] == "gfpgan": - progress.set_current_status("common:statusRestoringFacesGFPGAN") + progress.set_current_status( + "common:statusRestoringFacesGFPGAN") elif postprocessing_parameters["type"] == "codeformer": - progress.set_current_status("common:statusRestoringFacesCodeFormer") + progress.set_current_status( + "common:statusRestoringFacesCodeFormer") socketio.emit("progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) @@ -904,7 +927,8 @@ class InvokeAIWebServer: init_img_url = generation_parameters["init_img"] - original_bounding_box = generation_parameters["bounding_box"].copy() + original_bounding_box = generation_parameters["bounding_box"].copy( + ) initial_image = dataURL_to_image( generation_parameters["init_img"] @@ -981,7 +1005,8 @@ class InvokeAIWebServer: elif generation_parameters["generation_mode"] == "img2img": init_img_url = generation_parameters["init_img"] init_img_path = self.get_image_path_from_url(init_img_url) - generation_parameters["init_img"] = Image.open(init_img_path).convert('RGB') + generation_parameters["init_img"] = Image.open( + init_img_path).convert('RGB') def image_progress(sample, step): if self.canceled.is_set(): @@ -1040,9 +1065,9 @@ class InvokeAIWebServer: }, ) - if generation_parameters["progress_latents"]: - image = self.generate.sample_to_lowres_estimated_image(sample) + image = self.generate.sample_to_lowres_estimated_image( + sample) (width, height) = image.size width *= 8 height *= 8 @@ -1061,7 +1086,8 @@ class InvokeAIWebServer: }, ) - self.socketio.emit("progressUpdate", progress.to_formatted_dict()) + self.socketio.emit( + "progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) def image_done(image, seed, first_seed, attention_maps_image=None): @@ -1089,7 +1115,8 @@ class InvokeAIWebServer: progress.set_current_status("common:statusGenerationComplete") - self.socketio.emit("progressUpdate", progress.to_formatted_dict()) + self.socketio.emit( + "progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) all_parameters = generation_parameters @@ -1100,7 +1127,8 @@ class InvokeAIWebServer: and all_parameters["variation_amount"] > 0 ): first_seed = first_seed or seed - this_variation = [[seed, all_parameters["variation_amount"]]] + this_variation = [ + [seed, all_parameters["variation_amount"]]] all_parameters["with_variations"] = ( prior_variations + this_variation ) @@ -1116,7 +1144,8 @@ class InvokeAIWebServer: if esrgan_parameters: progress.set_current_status("common:statusUpscaling") progress.set_current_status_has_steps(False) - self.socketio.emit("progressUpdate", progress.to_formatted_dict()) + self.socketio.emit( + "progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) image = self.esrgan.process( @@ -1139,12 +1168,15 @@ class InvokeAIWebServer: if facetool_parameters: if facetool_parameters["type"] == "gfpgan": - progress.set_current_status("common:statusRestoringFacesGFPGAN") + progress.set_current_status( + "common:statusRestoringFacesGFPGAN") elif facetool_parameters["type"] == "codeformer": - progress.set_current_status("common:statusRestoringFacesCodeFormer") + progress.set_current_status( + "common:statusRestoringFacesCodeFormer") progress.set_current_status_has_steps(False) - self.socketio.emit("progressUpdate", progress.to_formatted_dict()) + self.socketio.emit( + "progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) if facetool_parameters["type"] == "gfpgan": @@ -1174,7 +1206,8 @@ class InvokeAIWebServer: all_parameters["facetool_type"] = facetool_parameters["type"] progress.set_current_status("common:statusSavingImage") - self.socketio.emit("progressUpdate", progress.to_formatted_dict()) + self.socketio.emit( + "progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) # restore the stashed URLS and discard the paths, we are about to send the result to client @@ -1185,12 +1218,14 @@ class InvokeAIWebServer: ) if "init_mask" in all_parameters: - all_parameters["init_mask"] = "" # TODO: store the mask in metadata + # TODO: store the mask in metadata + all_parameters["init_mask"] = "" if generation_parameters["generation_mode"] == "unifiedCanvas": all_parameters["bounding_box"] = original_bounding_box - metadata = self.parameters_to_generated_image_metadata(all_parameters) + metadata = self.parameters_to_generated_image_metadata( + all_parameters) command = parameters_to_command(all_parameters) @@ -1220,15 +1255,18 @@ class InvokeAIWebServer: if progress.total_iterations > progress.current_iteration: progress.set_current_step(1) - progress.set_current_status("common:statusIterationComplete") + progress.set_current_status( + "common:statusIterationComplete") progress.set_current_status_has_steps(False) else: progress.mark_complete() - self.socketio.emit("progressUpdate", progress.to_formatted_dict()) + self.socketio.emit( + "progressUpdate", progress.to_formatted_dict()) eventlet.sleep(0) - parsed_prompt, _ = get_prompt_structure(generation_parameters["prompt"]) + parsed_prompt, _ = get_prompt_structure( + generation_parameters["prompt"]) tokens = None if type(parsed_prompt) is Blend else \ get_tokens_for_prompt(self.generate.model, parsed_prompt) attention_maps_image_base64_url = None if attention_maps_image is None \ @@ -1402,7 +1440,8 @@ class InvokeAIWebServer: self, parameters, original_image_path ): try: - current_metadata = retrieve_metadata(original_image_path)["sd-metadata"] + current_metadata = retrieve_metadata( + original_image_path)["sd-metadata"] postprocessing_metadata = {} """ @@ -1442,7 +1481,8 @@ class InvokeAIWebServer: postprocessing_metadata ) else: - current_metadata["image"]["postprocessing"] = [postprocessing_metadata] + current_metadata["image"]["postprocessing"] = [ + postprocessing_metadata] return current_metadata @@ -1554,7 +1594,8 @@ class InvokeAIWebServer: ) elif "thumbnails" in url: return os.path.abspath( - os.path.join(self.thumbnail_image_path, os.path.basename(url)) + os.path.join(self.thumbnail_image_path, + os.path.basename(url)) ) else: return os.path.abspath( @@ -1723,10 +1764,12 @@ def dataURL_to_image(dataURL: str) -> ImageType: ) return image + """ Converts an image into a base64 image dataURL. """ + def image_to_dataURL(image: ImageType) -> str: buffered = io.BytesIO() image.save(buffered, format="PNG") @@ -1736,7 +1779,6 @@ def image_to_dataURL(image: ImageType) -> str: return image_base64 - """ Converts a base64 image dataURL into bytes. The dataURL is split on the first commma. diff --git a/invokeai/frontend/public/locales/modelmanager/en.json b/invokeai/frontend/public/locales/modelmanager/en.json index 71c69f2fbe..399acb0b48 100644 --- a/invokeai/frontend/public/locales/modelmanager/en.json +++ b/invokeai/frontend/public/locales/modelmanager/en.json @@ -74,5 +74,6 @@ "convertToDiffusersHelpText6": "Do you wish to convert this model?", "inpaintingModel": "Inpainting Model", "customConfig": "Custom Config", - "pathToCustomConfig": "Path To Custom Config" + "pathToCustomConfig": "Path To Custom Config", + "statusConverting": "Converting" } diff --git a/invokeai/frontend/src/app/invokeai.d.ts b/invokeai/frontend/src/app/invokeai.d.ts index 652c651bd5..aedb3c6b0f 100644 --- a/invokeai/frontend/src/app/invokeai.d.ts +++ b/invokeai/frontend/src/app/invokeai.d.ts @@ -222,6 +222,7 @@ export declare type InvokeDiffusersModelConfigProps = { export declare type InvokeModelConversionProps = { name: string; is_inpainting: boolean; + custom_config: string | null; }; /** diff --git a/invokeai/frontend/src/app/socketio/emitters.ts b/invokeai/frontend/src/app/socketio/emitters.ts index 501450deb2..5070d572d4 100644 --- a/invokeai/frontend/src/app/socketio/emitters.ts +++ b/invokeai/frontend/src/app/socketio/emitters.ts @@ -178,8 +178,10 @@ const makeSocketIOEmitters = ( emitDeleteModel: (modelName: string) => { socketio.emit('deleteModel', modelName); }, - emitConvertToDiffusers: (modelName: string) => { - socketio.emit('convertToDiffusers', modelName); + emitConvertToDiffusers: ( + modelToConvert: InvokeAI.InvokeModelConversionProps + ) => { + socketio.emit('convertToDiffusers', modelToConvert); }, emitRequestModelChange: (modelName: string) => { dispatch(modelChangeRequested()); diff --git a/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx b/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx index 0bed4dc468..060abc1379 100644 --- a/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx +++ b/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx @@ -25,6 +25,7 @@ export default function ModelConvert(props: ModelConvertProps) { const [isInpainting, setIsInpainting] = useState(false); const [customConfig, setIsCustomConfig] = useState(false); + const [pathToConfig, setPathToConfig] = useState(''); const dispatch = useAppDispatch(); const { t } = useTranslation(); @@ -37,20 +38,40 @@ export default function ModelConvert(props: ModelConvertProps) { (state: RootState) => state.system.isConnected ); - useEffect(() => { + // Need to manually handle local state reset because the component does not re-render. + const stateReset = () => { setIsInpainting(false); setIsCustomConfig(false); + setPathToConfig(''); + }; + + // Reset local state when model changes + useEffect(() => { + stateReset(); }, [model]); + // Handle local state reset when user cancels input + const modelConvertCancelHandler = () => { + stateReset(); + }; + const modelConvertHandler = () => { + const modelConvertData = { + name: model, + is_inpainting: isInpainting, + custom_config: customConfig && pathToConfig !== '' ? pathToConfig : null, + }; + dispatch(setIsProcessing(true)); - dispatch(convertToDiffusers({ name: model, is_inpainting: isInpainting })); + dispatch(convertToDiffusers(modelConvertData)); + stateReset(); // Edge case: Cancel local state when model convert fails }; return ( {t('modelmanager:pathToCustomConfig')} - + { + if (e.target.value !== '') setPathToConfig(e.target.value); + }} + width="25rem" + /> )} From 7f695fed397b6ceb27b9393ab0705437616f1f51 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 12 Feb 2023 00:03:42 +1300 Subject: [PATCH 06/39] Ignore safetensor or ckpt files inside diffusers model folders. Basically skips the path if the path has the word diffusers anywhere inside it. --- ldm/invoke/model_manager.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ldm/invoke/model_manager.py b/ldm/invoke/model_manager.py index 3135931eea..920e2873c6 100644 --- a/ldm/invoke/model_manager.py +++ b/ldm/invoke/model_manager.py @@ -799,15 +799,17 @@ class ModelManager(object): models_folder_safetensors = Path(search_folder).glob("**/*.safetensors") ckpt_files = [x for x in models_folder_ckpt if x.is_file()] - safetensor_files = [x for x in models_folder_safetensors if x.is_file] + safetensor_files = [x for x in models_folder_safetensors if x.is_file()] files = ckpt_files + safetensor_files found_models = [] for file in files: - found_models.append( - {"name": file.stem, "location": str(file.resolve()).replace("\\", "/")} - ) + location = str(file.resolve()).replace("\\", "/") + if 'diffusers' not in location: + found_models.append( + {"name": file.stem, "location": location} + ) return search_folder, found_models From 11e422cf297c4e30a880afab5ed770e7dd81d1b8 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 12 Feb 2023 00:13:22 +1300 Subject: [PATCH 07/39] Ignore two files names instead of the entire folder rather than bypassing any path with diffusers in it, im specifically bypassing model.safetensors and diffusion_pytorch_model.safetensors both of which should be diffusers files in most cases. --- ldm/invoke/model_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldm/invoke/model_manager.py b/ldm/invoke/model_manager.py index 920e2873c6..0e7a0747ab 100644 --- a/ldm/invoke/model_manager.py +++ b/ldm/invoke/model_manager.py @@ -806,7 +806,7 @@ class ModelManager(object): found_models = [] for file in files: location = str(file.resolve()).replace("\\", "/") - if 'diffusers' not in location: + if 'model.safetensors' not in location and 'diffusion_pytorch_model.safetensors' not in location: found_models.append( {"name": file.stem, "location": location} ) From 96926d66482f2ccf261bc7b24a003f85c1201190 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 12 Feb 2023 05:00:29 +1300 Subject: [PATCH 08/39] v2 Conversion Support & Radio Picker Converted the picker options to a Radio Group and also updated the backend to use the appropriate config if it is a v2 model that needs to be converted. --- invokeai/backend/invoke_ai_web_server.py | 13 ++- .../public/locales/modelmanager/en.json | 6 +- invokeai/frontend/src/app/invokeai.d.ts | 2 +- .../components/ModelManager/ModelConvert.tsx | 85 +++++++++---------- 4 files changed, 56 insertions(+), 50 deletions(-) diff --git a/invokeai/backend/invoke_ai_web_server.py b/invokeai/backend/invoke_ai_web_server.py index d7e0a4d11a..dda6ee2df2 100644 --- a/invokeai/backend/invoke_ai_web_server.py +++ b/invokeai/backend/invoke_ai_web_server.py @@ -422,14 +422,21 @@ class InvokeAIWebServer: original_config_file = Path( Globals.root, original_config_file) - if model_to_convert['is_inpainting']: + if model_to_convert['model_type'] == 'inpainting': original_config_file = Path( 'configs', 'stable-diffusion', - 'v1-inpainting-inference.yaml' if model_to_convert['is_inpainting'] else 'v1-inference.yaml' + 'v1-inpainting-inference.yaml' ) - if model_to_convert['custom_config'] is not None: + if model_to_convert['model_type'] == '2': + original_config_file = Path( + 'configs', + 'stable-diffusion', + 'v2-inference-v.yaml' + ) + + if model_to_convert['model_type'] == 'custom' and model_to_convert['custom_config'] is not None: original_config_file = Path( model_to_convert['custom_config']) diff --git a/invokeai/frontend/public/locales/modelmanager/en.json b/invokeai/frontend/public/locales/modelmanager/en.json index 399acb0b48..967e11f061 100644 --- a/invokeai/frontend/public/locales/modelmanager/en.json +++ b/invokeai/frontend/public/locales/modelmanager/en.json @@ -72,8 +72,10 @@ "convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.", "convertToDiffusersHelpText5": "This process will create a Diffusers version of this model in the same directory as your checkpoint. Please make sure you have enough disk space.", "convertToDiffusersHelpText6": "Do you wish to convert this model?", - "inpaintingModel": "Inpainting Model", - "customConfig": "Custom Config", + "v1": "v1", + "v2": "v2", + "inpainting": "v1 Inpainting", + "custom": "Custom", "pathToCustomConfig": "Path To Custom Config", "statusConverting": "Converting" } diff --git a/invokeai/frontend/src/app/invokeai.d.ts b/invokeai/frontend/src/app/invokeai.d.ts index aedb3c6b0f..e67a3e4951 100644 --- a/invokeai/frontend/src/app/invokeai.d.ts +++ b/invokeai/frontend/src/app/invokeai.d.ts @@ -221,7 +221,7 @@ export declare type InvokeDiffusersModelConfigProps = { export declare type InvokeModelConversionProps = { name: string; - is_inpainting: boolean; + model_type: string; custom_config: string | null; }; diff --git a/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx b/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx index 060abc1379..89061e7bd8 100644 --- a/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx +++ b/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx @@ -1,10 +1,16 @@ -import { Flex, ListItem, Text, UnorderedList } from '@chakra-ui/react'; +import { + Flex, + ListItem, + Radio, + RadioGroup, + Text, + UnorderedList, +} from '@chakra-ui/react'; import { convertToDiffusers } from 'app/socketio/actions'; import { RootState } from 'app/store'; import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIAlertDialog from 'common/components/IAIAlertDialog'; import IAIButton from 'common/components/IAIButton'; -import IAICheckbox from 'common/components/IAICheckbox'; import IAIInput from 'common/components/IAIInput'; import { setIsProcessing } from 'features/system/store/systemSlice'; import { useState, useEffect } from 'react'; @@ -23,9 +29,8 @@ export default function ModelConvert(props: ModelConvertProps) { const retrievedModel = model_list[model]; - const [isInpainting, setIsInpainting] = useState(false); - const [customConfig, setIsCustomConfig] = useState(false); const [pathToConfig, setPathToConfig] = useState(''); + const [modelType, setModelType] = useState('1'); const dispatch = useAppDispatch(); const { t } = useTranslation(); @@ -40,8 +45,7 @@ export default function ModelConvert(props: ModelConvertProps) { // Need to manually handle local state reset because the component does not re-render. const stateReset = () => { - setIsInpainting(false); - setIsCustomConfig(false); + setModelType('1'); setPathToConfig(''); }; @@ -58,8 +62,9 @@ export default function ModelConvert(props: ModelConvertProps) { const modelConvertHandler = () => { const modelConvertData = { name: model, - is_inpainting: isInpainting, - custom_config: customConfig && pathToConfig !== '' ? pathToConfig : null, + model_type: modelType, + custom_config: + modelType === 'custom' && pathToConfig !== '' ? pathToConfig : null, }; dispatch(setIsProcessing(true)); @@ -86,6 +91,7 @@ export default function ModelConvert(props: ModelConvertProps) { 🧨 {t('modelmanager:convertToDiffusers')} } + motionPreset="slideInBottom" > {t('modelmanager:convertToDiffusersHelpText1')} @@ -96,46 +102,37 @@ export default function ModelConvert(props: ModelConvertProps) { {t('modelmanager:convertToDiffusersHelpText5')} {t('modelmanager:convertToDiffusersHelpText6')} - + setModelType(v)} + defaultValue="1" + name="model_type" + > - { - setIsInpainting(!isInpainting); - setIsCustomConfig(false); + {t('modelmanager:v1')} + {t('modelmanager:v2')} + {t('modelmanager:inpainting')} + {t('modelmanager:custom')} + + + {modelType === 'custom' && ( + + + {t('modelmanager:pathToCustomConfig')} + + { + if (e.target.value !== '') setPathToConfig(e.target.value); }} - label={t('modelmanager:inpaintingModel')} - isDisabled={customConfig} - /> - { - setIsCustomConfig(!customConfig); - setIsInpainting(false); - }} - label={t('modelmanager:customConfig')} - isDisabled={isInpainting} + width="25rem" /> - {customConfig && ( - - - {t('modelmanager:pathToCustomConfig')} - - { - if (e.target.value !== '') setPathToConfig(e.target.value); - }} - width="25rem" - /> - - )} - + )} ); From 8a3b5ac21de480935b3c87c001ce643b63c061d4 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sat, 11 Feb 2023 14:58:49 -0500 Subject: [PATCH 09/39] rebuild frontend --- .../frontend/dist/assets/index-a78f4d86.js | 638 ++++++++++++++++++ .../frontend/dist/assets/index-ad762ffd.js | 638 ------------------ invokeai/frontend/dist/index.html | 2 +- .../dist/locales/modelmanager/en.json | 16 +- invokeai/frontend/stats.html | 2 +- 5 files changed, 655 insertions(+), 641 deletions(-) create mode 100644 invokeai/frontend/dist/assets/index-a78f4d86.js delete mode 100644 invokeai/frontend/dist/assets/index-ad762ffd.js diff --git a/invokeai/frontend/dist/assets/index-a78f4d86.js b/invokeai/frontend/dist/assets/index-a78f4d86.js new file mode 100644 index 0000000000..a2254b8262 --- /dev/null +++ b/invokeai/frontend/dist/assets/index-a78f4d86.js @@ -0,0 +1,638 @@ +var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var sn=(e,t,n)=>(Cee(e,typeof t!="symbol"?t+"":t,n),n);function cj(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var _o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function v_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var y={},_ee={get exports(){return y},set exports(e){y=e}},bS={},w={},kee={get exports(){return w},set exports(e){w=e}},tn={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var py=Symbol.for("react.element"),Eee=Symbol.for("react.portal"),Pee=Symbol.for("react.fragment"),Tee=Symbol.for("react.strict_mode"),Lee=Symbol.for("react.profiler"),Aee=Symbol.for("react.provider"),Oee=Symbol.for("react.context"),Mee=Symbol.for("react.forward_ref"),Iee=Symbol.for("react.suspense"),Ree=Symbol.for("react.memo"),Dee=Symbol.for("react.lazy"),gL=Symbol.iterator;function Nee(e){return e===null||typeof e!="object"?null:(e=gL&&e[gL]||e["@@iterator"],typeof e=="function"?e:null)}var dj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fj=Object.assign,hj={};function p0(e,t,n){this.props=e,this.context=t,this.refs=hj,this.updater=n||dj}p0.prototype.isReactComponent={};p0.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};p0.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function pj(){}pj.prototype=p0.prototype;function y_(e,t,n){this.props=e,this.context=t,this.refs=hj,this.updater=n||dj}var b_=y_.prototype=new pj;b_.constructor=y_;fj(b_,p0.prototype);b_.isPureReactComponent=!0;var mL=Array.isArray,gj=Object.prototype.hasOwnProperty,S_={current:null},mj={key:!0,ref:!0,__self:!0,__source:!0};function vj(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)gj.call(t,r)&&!mj.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?z3.dark:z3.light),document.body.classList.remove(r?z3.light:z3.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){return n.query().matches??r==="dark"?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var Yee="chakra-ui-color-mode";function Kee(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var Xee=Kee(Yee),yL=()=>{};function bL(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function bj(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=Xee}=e,s=i==="dark"?"dark":"light",[l,u]=w.useState(()=>bL(a,s)),[d,h]=w.useState(()=>bL(a)),{getSystemTheme:m,setClassName:v,setDataset:b,addListener:S}=w.useMemo(()=>qee({preventTransition:o}),[o]),_=i==="system"&&!l?d:l,E=w.useCallback(A=>{const M=A==="system"?m():A;u(M),v(M==="dark"),b(M),a.set(M)},[a,m,v,b]);Gs(()=>{i==="system"&&h(m())},[]),w.useEffect(()=>{const A=a.get();if(A){E(A);return}if(i==="system"){E("system");return}E(s)},[a,s,i,E]);const k=w.useCallback(()=>{E(_==="dark"?"light":"dark")},[_,E]);w.useEffect(()=>{if(r)return S(E)},[r,S,E]);const T=w.useMemo(()=>({colorMode:t??_,toggleColorMode:t?yL:k,setColorMode:t?yL:E,forced:t!==void 0}),[_,k,E,t]);return N.createElement(w_.Provider,{value:T},n)}bj.displayName="ColorModeProvider";var U4={},Zee={get exports(){return U4},set exports(e){U4=e}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",m="[object Error]",v="[object Function]",b="[object GeneratorFunction]",S="[object Map]",_="[object Number]",E="[object Null]",k="[object Object]",T="[object Proxy]",A="[object RegExp]",M="[object Set]",R="[object String]",D="[object Undefined]",j="[object WeakMap]",z="[object ArrayBuffer]",H="[object DataView]",K="[object Float32Array]",te="[object Float64Array]",G="[object Int8Array]",$="[object Int16Array]",W="[object Int32Array]",X="[object Uint8Array]",Z="[object Uint8ClampedArray]",U="[object Uint16Array]",Q="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Ee=/^(?:0|[1-9]\d*)$/,be={};be[K]=be[te]=be[G]=be[$]=be[W]=be[X]=be[Z]=be[U]=be[Q]=!0,be[s]=be[l]=be[z]=be[d]=be[H]=be[h]=be[m]=be[v]=be[S]=be[_]=be[k]=be[A]=be[M]=be[R]=be[j]=!1;var ye=typeof _o=="object"&&_o&&_o.Object===Object&&_o,Fe=typeof self=="object"&&self&&self.Object===Object&&self,Me=ye||Fe||Function("return this")(),rt=t&&!t.nodeType&&t,Ve=rt&&!0&&e&&!e.nodeType&&e,je=Ve&&Ve.exports===rt,wt=je&&ye.process,Be=function(){try{var Y=Ve&&Ve.require&&Ve.require("util").types;return Y||wt&&wt.binding&&wt.binding("util")}catch{}}(),at=Be&&Be.isTypedArray;function bt(Y,ie,ge){switch(ge.length){case 0:return Y.call(ie);case 1:return Y.call(ie,ge[0]);case 2:return Y.call(ie,ge[0],ge[1]);case 3:return Y.call(ie,ge[0],ge[1],ge[2])}return Y.apply(ie,ge)}function Le(Y,ie){for(var ge=-1,st=Array(Y);++ge-1}function B0(Y,ie){var ge=this.__data__,st=ys(ge,Y);return st<0?(++this.size,ge.push([Y,ie])):ge[st][1]=ie,this}oa.prototype.clear=bf,oa.prototype.delete=j0,oa.prototype.get=xc,oa.prototype.has=Sf,oa.prototype.set=B0;function al(Y){var ie=-1,ge=Y==null?0:Y.length;for(this.clear();++ie1?ge[Wt-1]:void 0,kt=Wt>2?ge[2]:void 0;for(xn=Y.length>3&&typeof xn=="function"?(Wt--,xn):void 0,kt&&Ip(ge[0],ge[1],kt)&&(xn=Wt<3?void 0:xn,Wt=1),ie=Object(ie);++st-1&&Y%1==0&&Y0){if(++ie>=i)return arguments[0]}else ie=0;return Y.apply(void 0,arguments)}}function Ec(Y){if(Y!=null){try{return Ke.call(Y)}catch{}try{return Y+""}catch{}}return""}function Fa(Y,ie){return Y===ie||Y!==Y&&ie!==ie}var kf=xu(function(){return arguments}())?xu:function(Y){return Kn(Y)&&Xe.call(Y,"callee")&&!Ze.call(Y,"callee")},_u=Array.isArray;function Yt(Y){return Y!=null&&Dp(Y.length)&&!Tc(Y)}function Rp(Y){return Kn(Y)&&Yt(Y)}var Pc=rn||Z0;function Tc(Y){if(!ua(Y))return!1;var ie=ll(Y);return ie==v||ie==b||ie==u||ie==T}function Dp(Y){return typeof Y=="number"&&Y>-1&&Y%1==0&&Y<=a}function ua(Y){var ie=typeof Y;return Y!=null&&(ie=="object"||ie=="function")}function Kn(Y){return Y!=null&&typeof Y=="object"}function Ef(Y){if(!Kn(Y)||ll(Y)!=k)return!1;var ie=nn(Y);if(ie===null)return!0;var ge=Xe.call(ie,"constructor")&&ie.constructor;return typeof ge=="function"&&ge instanceof ge&&Ke.call(ge)==Ct}var Np=at?ut(at):Cc;function Pf(Y){return ui(Y,jp(Y))}function jp(Y){return Yt(Y)?Y0(Y,!0):ul(Y)}var gn=bs(function(Y,ie,ge,st){aa(Y,ie,ge,st)});function Kt(Y){return function(){return Y}}function Bp(Y){return Y}function Z0(){return!1}e.exports=gn})(Zee,U4);const Gl=U4;function qs(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Ch(e,...t){return Qee(e)?e(...t):e}var Qee=e=>typeof e=="function",Jee=e=>/!(important)?$/.test(e),SL=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,r7=(e,t)=>n=>{const r=String(t),i=Jee(r),o=SL(r),a=e?`${e}.${o}`:o;let s=qs(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=SL(s),i?`${s} !important`:s};function y2(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{const s=r7(t,o)(a);let l=(n==null?void 0:n(s,a))??s;return r&&(l=r(l,a)),l}}var H3=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Ms(e,t){return n=>{const r={property:n,scale:e};return r.transform=y2({scale:e,transform:t}),r}}var ete=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function tte(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:ete(t),transform:n?y2({scale:n,compose:r}):r}}var Sj=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function nte(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Sj].join(" ")}function rte(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Sj].join(" ")}var ite={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},ote={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function ate(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var ste={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},xj="& > :not(style) ~ :not(style)",lte={[xj]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},ute={[xj]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},i7={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},cte=new Set(Object.values(i7)),wj=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),dte=e=>e.trim();function fte(e,t){var n;if(e==null||wj.has(e))return e;const r=/(?^[a-z-A-Z]+)\((?(.*))\)/g,{type:i,values:o}=((n=r.exec(e))==null?void 0:n.groups)??{};if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(dte).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in i7?i7[s]:s;l.unshift(u);const d=l.map(h=>{if(cte.has(h))return h;const m=h.indexOf(" "),[v,b]=m!==-1?[h.substr(0,m),h.substr(m+1)]:[h],S=Cj(b)?b:b&&b.split(" "),_=`colors.${v}`,E=_ in t.__cssMap?t.__cssMap[_].varRef:v;return S?[E,...Array.isArray(S)?S:[S]].join(" "):E});return`${a}(${d.join(", ")})`}var Cj=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),hte=(e,t)=>fte(e,t??{});function pte(e){return/^var\(--.+\)$/.test(e)}var gte=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Al=e=>t=>`${e}(${t})`,hn={filter(e){return e!=="auto"?e:ite},backdropFilter(e){return e!=="auto"?e:ote},ring(e){return ate(hn.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?nte():e==="auto-gpu"?rte():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=gte(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(pte(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:hte,blur:Al("blur"),opacity:Al("opacity"),brightness:Al("brightness"),contrast:Al("contrast"),dropShadow:Al("drop-shadow"),grayscale:Al("grayscale"),hueRotate:Al("hue-rotate"),invert:Al("invert"),saturate:Al("saturate"),sepia:Al("sepia"),bgImage(e){return e==null||Cj(e)||wj.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=ste[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},se={borderWidths:Ms("borderWidths"),borderStyles:Ms("borderStyles"),colors:Ms("colors"),borders:Ms("borders"),radii:Ms("radii",hn.px),space:Ms("space",H3(hn.vh,hn.px)),spaceT:Ms("space",H3(hn.vh,hn.px)),degreeT(e){return{property:e,transform:hn.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:y2({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Ms("sizes",H3(hn.vh,hn.px)),sizesT:Ms("sizes",H3(hn.vh,hn.fraction)),shadows:Ms("shadows"),logical:tte,blur:Ms("blur",hn.blur)},a4={background:se.colors("background"),backgroundColor:se.colors("backgroundColor"),backgroundImage:se.propT("backgroundImage",hn.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:hn.bgClip},bgSize:se.prop("backgroundSize"),bgPosition:se.prop("backgroundPosition"),bg:se.colors("background"),bgColor:se.colors("backgroundColor"),bgPos:se.prop("backgroundPosition"),bgRepeat:se.prop("backgroundRepeat"),bgAttachment:se.prop("backgroundAttachment"),bgGradient:se.propT("backgroundImage",hn.gradient),bgClip:{transform:hn.bgClip}};Object.assign(a4,{bgImage:a4.backgroundImage,bgImg:a4.backgroundImage});var Cn={border:se.borders("border"),borderWidth:se.borderWidths("borderWidth"),borderStyle:se.borderStyles("borderStyle"),borderColor:se.colors("borderColor"),borderRadius:se.radii("borderRadius"),borderTop:se.borders("borderTop"),borderBlockStart:se.borders("borderBlockStart"),borderTopLeftRadius:se.radii("borderTopLeftRadius"),borderStartStartRadius:se.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:se.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:se.radii("borderTopRightRadius"),borderStartEndRadius:se.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:se.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:se.borders("borderRight"),borderInlineEnd:se.borders("borderInlineEnd"),borderBottom:se.borders("borderBottom"),borderBlockEnd:se.borders("borderBlockEnd"),borderBottomLeftRadius:se.radii("borderBottomLeftRadius"),borderBottomRightRadius:se.radii("borderBottomRightRadius"),borderLeft:se.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:se.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:se.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:se.borders(["borderLeft","borderRight"]),borderInline:se.borders("borderInline"),borderY:se.borders(["borderTop","borderBottom"]),borderBlock:se.borders("borderBlock"),borderTopWidth:se.borderWidths("borderTopWidth"),borderBlockStartWidth:se.borderWidths("borderBlockStartWidth"),borderTopColor:se.colors("borderTopColor"),borderBlockStartColor:se.colors("borderBlockStartColor"),borderTopStyle:se.borderStyles("borderTopStyle"),borderBlockStartStyle:se.borderStyles("borderBlockStartStyle"),borderBottomWidth:se.borderWidths("borderBottomWidth"),borderBlockEndWidth:se.borderWidths("borderBlockEndWidth"),borderBottomColor:se.colors("borderBottomColor"),borderBlockEndColor:se.colors("borderBlockEndColor"),borderBottomStyle:se.borderStyles("borderBottomStyle"),borderBlockEndStyle:se.borderStyles("borderBlockEndStyle"),borderLeftWidth:se.borderWidths("borderLeftWidth"),borderInlineStartWidth:se.borderWidths("borderInlineStartWidth"),borderLeftColor:se.colors("borderLeftColor"),borderInlineStartColor:se.colors("borderInlineStartColor"),borderLeftStyle:se.borderStyles("borderLeftStyle"),borderInlineStartStyle:se.borderStyles("borderInlineStartStyle"),borderRightWidth:se.borderWidths("borderRightWidth"),borderInlineEndWidth:se.borderWidths("borderInlineEndWidth"),borderRightColor:se.colors("borderRightColor"),borderInlineEndColor:se.colors("borderInlineEndColor"),borderRightStyle:se.borderStyles("borderRightStyle"),borderInlineEndStyle:se.borderStyles("borderInlineEndStyle"),borderTopRadius:se.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:se.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:se.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:se.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Cn,{rounded:Cn.borderRadius,roundedTop:Cn.borderTopRadius,roundedTopLeft:Cn.borderTopLeftRadius,roundedTopRight:Cn.borderTopRightRadius,roundedTopStart:Cn.borderStartStartRadius,roundedTopEnd:Cn.borderStartEndRadius,roundedBottom:Cn.borderBottomRadius,roundedBottomLeft:Cn.borderBottomLeftRadius,roundedBottomRight:Cn.borderBottomRightRadius,roundedBottomStart:Cn.borderEndStartRadius,roundedBottomEnd:Cn.borderEndEndRadius,roundedLeft:Cn.borderLeftRadius,roundedRight:Cn.borderRightRadius,roundedStart:Cn.borderInlineStartRadius,roundedEnd:Cn.borderInlineEndRadius,borderStart:Cn.borderInlineStart,borderEnd:Cn.borderInlineEnd,borderTopStartRadius:Cn.borderStartStartRadius,borderTopEndRadius:Cn.borderStartEndRadius,borderBottomStartRadius:Cn.borderEndStartRadius,borderBottomEndRadius:Cn.borderEndEndRadius,borderStartRadius:Cn.borderInlineStartRadius,borderEndRadius:Cn.borderInlineEndRadius,borderStartWidth:Cn.borderInlineStartWidth,borderEndWidth:Cn.borderInlineEndWidth,borderStartColor:Cn.borderInlineStartColor,borderEndColor:Cn.borderInlineEndColor,borderStartStyle:Cn.borderInlineStartStyle,borderEndStyle:Cn.borderInlineEndStyle});var mte={color:se.colors("color"),textColor:se.colors("color"),fill:se.colors("fill"),stroke:se.colors("stroke")},o7={boxShadow:se.shadows("boxShadow"),mixBlendMode:!0,blendMode:se.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:se.prop("backgroundBlendMode"),opacity:!0};Object.assign(o7,{shadow:o7.boxShadow});var vte={filter:{transform:hn.filter},blur:se.blur("--chakra-blur"),brightness:se.propT("--chakra-brightness",hn.brightness),contrast:se.propT("--chakra-contrast",hn.contrast),hueRotate:se.degreeT("--chakra-hue-rotate"),invert:se.propT("--chakra-invert",hn.invert),saturate:se.propT("--chakra-saturate",hn.saturate),dropShadow:se.propT("--chakra-drop-shadow",hn.dropShadow),backdropFilter:{transform:hn.backdropFilter},backdropBlur:se.blur("--chakra-backdrop-blur"),backdropBrightness:se.propT("--chakra-backdrop-brightness",hn.brightness),backdropContrast:se.propT("--chakra-backdrop-contrast",hn.contrast),backdropHueRotate:se.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:se.propT("--chakra-backdrop-invert",hn.invert),backdropSaturate:se.propT("--chakra-backdrop-saturate",hn.saturate)},G4={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:hn.flexDirection},experimental_spaceX:{static:lte,transform:y2({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:ute,transform:y2({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:se.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:se.space("gap"),rowGap:se.space("rowGap"),columnGap:se.space("columnGap")};Object.assign(G4,{flexDir:G4.flexDirection});var _j={gridGap:se.space("gridGap"),gridColumnGap:se.space("gridColumnGap"),gridRowGap:se.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},yte={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:hn.outline},outlineOffset:!0,outlineColor:se.colors("outlineColor")},Za={width:se.sizesT("width"),inlineSize:se.sizesT("inlineSize"),height:se.sizes("height"),blockSize:se.sizes("blockSize"),boxSize:se.sizes(["width","height"]),minWidth:se.sizes("minWidth"),minInlineSize:se.sizes("minInlineSize"),minHeight:se.sizes("minHeight"),minBlockSize:se.sizes("minBlockSize"),maxWidth:se.sizes("maxWidth"),maxInlineSize:se.sizes("maxInlineSize"),maxHeight:se.sizes("maxHeight"),maxBlockSize:se.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:se.propT("float",hn.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Za,{w:Za.width,h:Za.height,minW:Za.minWidth,maxW:Za.maxWidth,minH:Za.minHeight,maxH:Za.maxHeight,overscroll:Za.overscrollBehavior,overscrollX:Za.overscrollBehaviorX,overscrollY:Za.overscrollBehaviorY});var bte={listStyleType:!0,listStylePosition:!0,listStylePos:se.prop("listStylePosition"),listStyleImage:!0,listStyleImg:se.prop("listStyleImage")};function Ste(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},wte=xte(Ste),Cte={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},_te={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Xw=(e,t,n)=>{const r={},i=wte(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},kte={srOnly:{transform(e){return e===!0?Cte:e==="focusable"?_te:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Xw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Xw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Xw(t,e,n)}},Bv={position:!0,pos:se.prop("position"),zIndex:se.prop("zIndex","zIndices"),inset:se.spaceT("inset"),insetX:se.spaceT(["left","right"]),insetInline:se.spaceT("insetInline"),insetY:se.spaceT(["top","bottom"]),insetBlock:se.spaceT("insetBlock"),top:se.spaceT("top"),insetBlockStart:se.spaceT("insetBlockStart"),bottom:se.spaceT("bottom"),insetBlockEnd:se.spaceT("insetBlockEnd"),left:se.spaceT("left"),insetInlineStart:se.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:se.spaceT("right"),insetInlineEnd:se.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Bv,{insetStart:Bv.insetInlineStart,insetEnd:Bv.insetInlineEnd});var Ete={ring:{transform:hn.ring},ringColor:se.colors("--chakra-ring-color"),ringOffset:se.prop("--chakra-ring-offset-width"),ringOffsetColor:se.colors("--chakra-ring-offset-color"),ringInset:se.prop("--chakra-ring-inset")},sr={margin:se.spaceT("margin"),marginTop:se.spaceT("marginTop"),marginBlockStart:se.spaceT("marginBlockStart"),marginRight:se.spaceT("marginRight"),marginInlineEnd:se.spaceT("marginInlineEnd"),marginBottom:se.spaceT("marginBottom"),marginBlockEnd:se.spaceT("marginBlockEnd"),marginLeft:se.spaceT("marginLeft"),marginInlineStart:se.spaceT("marginInlineStart"),marginX:se.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:se.spaceT("marginInline"),marginY:se.spaceT(["marginTop","marginBottom"]),marginBlock:se.spaceT("marginBlock"),padding:se.space("padding"),paddingTop:se.space("paddingTop"),paddingBlockStart:se.space("paddingBlockStart"),paddingRight:se.space("paddingRight"),paddingBottom:se.space("paddingBottom"),paddingBlockEnd:se.space("paddingBlockEnd"),paddingLeft:se.space("paddingLeft"),paddingInlineStart:se.space("paddingInlineStart"),paddingInlineEnd:se.space("paddingInlineEnd"),paddingX:se.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:se.space("paddingInline"),paddingY:se.space(["paddingTop","paddingBottom"]),paddingBlock:se.space("paddingBlock")};Object.assign(sr,{m:sr.margin,mt:sr.marginTop,mr:sr.marginRight,me:sr.marginInlineEnd,marginEnd:sr.marginInlineEnd,mb:sr.marginBottom,ml:sr.marginLeft,ms:sr.marginInlineStart,marginStart:sr.marginInlineStart,mx:sr.marginX,my:sr.marginY,p:sr.padding,pt:sr.paddingTop,py:sr.paddingY,px:sr.paddingX,pb:sr.paddingBottom,pl:sr.paddingLeft,ps:sr.paddingInlineStart,paddingStart:sr.paddingInlineStart,pr:sr.paddingRight,pe:sr.paddingInlineEnd,paddingEnd:sr.paddingInlineEnd});var Pte={textDecorationColor:se.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:se.shadows("textShadow")},Tte={clipPath:!0,transform:se.propT("transform",hn.transform),transformOrigin:!0,translateX:se.spaceT("--chakra-translate-x"),translateY:se.spaceT("--chakra-translate-y"),skewX:se.degreeT("--chakra-skew-x"),skewY:se.degreeT("--chakra-skew-y"),scaleX:se.prop("--chakra-scale-x"),scaleY:se.prop("--chakra-scale-y"),scale:se.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:se.degreeT("--chakra-rotate")},Lte={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:se.prop("transitionDuration","transition.duration"),transitionProperty:se.prop("transitionProperty","transition.property"),transitionTimingFunction:se.prop("transitionTimingFunction","transition.easing")},Ate={fontFamily:se.prop("fontFamily","fonts"),fontSize:se.prop("fontSize","fontSizes",hn.px),fontWeight:se.prop("fontWeight","fontWeights"),lineHeight:se.prop("lineHeight","lineHeights"),letterSpacing:se.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},Ote={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:se.spaceT("scrollMargin"),scrollMarginTop:se.spaceT("scrollMarginTop"),scrollMarginBottom:se.spaceT("scrollMarginBottom"),scrollMarginLeft:se.spaceT("scrollMarginLeft"),scrollMarginRight:se.spaceT("scrollMarginRight"),scrollMarginX:se.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:se.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:se.spaceT("scrollPadding"),scrollPaddingTop:se.spaceT("scrollPaddingTop"),scrollPaddingBottom:se.spaceT("scrollPaddingBottom"),scrollPaddingLeft:se.spaceT("scrollPaddingLeft"),scrollPaddingRight:se.spaceT("scrollPaddingRight"),scrollPaddingX:se.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:se.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function kj(e){return qs(e)&&e.reference?e.reference:String(e)}var SS=(e,...t)=>t.map(kj).join(` ${e} `).replace(/calc/g,""),xL=(...e)=>`calc(${SS("+",...e)})`,wL=(...e)=>`calc(${SS("-",...e)})`,a7=(...e)=>`calc(${SS("*",...e)})`,CL=(...e)=>`calc(${SS("/",...e)})`,_L=e=>{const t=kj(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:a7(t,-1)},Sh=Object.assign(e=>({add:(...t)=>Sh(xL(e,...t)),subtract:(...t)=>Sh(wL(e,...t)),multiply:(...t)=>Sh(a7(e,...t)),divide:(...t)=>Sh(CL(e,...t)),negate:()=>Sh(_L(e)),toString:()=>e.toString()}),{add:xL,subtract:wL,multiply:a7,divide:CL,negate:_L});function Mte(e,t="-"){return e.replace(/\s+/g,t)}function Ite(e){const t=Mte(e.toString());return Dte(Rte(t))}function Rte(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function Dte(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function Nte(e,t=""){return[t,e].filter(Boolean).join("-")}function jte(e,t){return`var(${e}${t?`, ${t}`:""})`}function Bte(e,t=""){return Ite(`--${Nte(e,t)}`)}function Vn(e,t,n){const r=Bte(e,n);return{variable:r,reference:jte(r,t)}}function $te(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function Fte(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function s7(e){if(e==null)return e;const{unitless:t}=Fte(e);return t||typeof e=="number"?`${e}px`:e}var Ej=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,C_=e=>Object.fromEntries(Object.entries(e).sort(Ej));function kL(e){const t=C_(e);return Object.assign(Object.values(t),t)}function zte(e){const t=Object.keys(C_(e));return new Set(t)}function EL(e){if(!e)return e;e=s7(e)??e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function yv(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${s7(e)})`),t&&n.push("and",`(max-width: ${s7(t)})`),n.join(" ")}function Hte(e){if(!e)return null;e.base=e.base??"0px";const t=kL(e),n=Object.entries(e).sort(Ej).map(([o,a],s,l)=>{let[,u]=l[s+1]??[];return u=parseFloat(u)>0?EL(u):void 0,{_minW:EL(a),breakpoint:o,minW:a,maxW:u,maxWQuery:yv(null,u),minWQuery:yv(a),minMaxQuery:yv(a,u)}}),r=zte(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(o){const a=Object.keys(o);return a.length>0&&a.every(s=>r.has(s))},asObject:C_(e),asArray:kL(e),details:n,media:[null,...t.map(o=>yv(o)).slice(1)],toArrayValue(o){if(!qs(o))throw new Error("toArrayValue: value must be an object");const a=i.map(s=>o[s]??null);for(;$te(a)===null;)a.pop();return a},toObjectValue(o){if(!Array.isArray(o))throw new Error("toObjectValue: value must be an array");return o.reduce((a,s,l)=>{const u=i[l];return u!=null&&s!=null&&(a[u]=s),a},{})}}}var zi={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},ad=e=>Pj(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Bu=e=>Pj(t=>e(t,"~ &"),"[data-peer]",".peer"),Pj=(e,...t)=>t.map(e).join(", "),xS={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:ad(zi.hover),_peerHover:Bu(zi.hover),_groupFocus:ad(zi.focus),_peerFocus:Bu(zi.focus),_groupFocusVisible:ad(zi.focusVisible),_peerFocusVisible:Bu(zi.focusVisible),_groupActive:ad(zi.active),_peerActive:Bu(zi.active),_groupDisabled:ad(zi.disabled),_peerDisabled:Bu(zi.disabled),_groupInvalid:ad(zi.invalid),_peerInvalid:Bu(zi.invalid),_groupChecked:ad(zi.checked),_peerChecked:Bu(zi.checked),_groupFocusWithin:ad(zi.focusWithin),_peerFocusWithin:Bu(zi.focusWithin),_peerPlaceholderShown:Bu(zi.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},Vte=Object.keys(xS);function PL(e,t){return Vn(String(e).replace(/\./g,"-"),void 0,t)}function Wte(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=PL(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[v,...b]=m,S=`${v}.-${b.join(".")}`,_=Sh.negate(s),E=Sh.negate(u);r[S]={value:_,var:l,varRef:E}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const d=m=>{const b=[String(i).split(".")[0],m].join(".");if(!e[b])return m;const{reference:_}=PL(b,t==null?void 0:t.cssVarPrefix);return _},h=qs(s)?s:{default:s};n=Gl(n,Object.entries(h).reduce((m,[v,b])=>{var S;const _=d(b);if(v==="default")return m[l]=_,m;const E=((S=xS)==null?void 0:S[v])??v;return m[E]={[l]:_},m},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function Ute(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Gte(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var qte=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function Yte(e){return Gte(e,qte)}function Kte(e){return e.semanticTokens}function Xte(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function Zte({tokens:e,semanticTokens:t}){const n=Object.entries(l7(e)??{}).map(([i,o])=>[i,{isSemantic:!1,value:o}]),r=Object.entries(l7(t,1)??{}).map(([i,o])=>[i,{isSemantic:!0,value:o}]);return Object.fromEntries([...n,...r])}function l7(e,t=1/0){return!qs(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(qs(i)||Array.isArray(i)?Object.entries(l7(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function Qte(e){var t;const n=Xte(e),r=Yte(n),i=Kte(n),o=Zte({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=Wte(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:Hte(n.breakpoints)}),n}var __=Gl({},a4,Cn,mte,G4,Za,vte,Ete,yte,_j,kte,Bv,o7,sr,Ote,Ate,Pte,Tte,bte,Lte),Jte=Object.assign({},sr,Za,G4,_j,Bv),Tj=Object.keys(Jte),ene=[...Object.keys(__),...Vte],tne={...__,...xS},nne=e=>e in tne,rne=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=Ch(e[a],t);if(s==null)continue;if(s=qs(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!one(t),sne=(e,t)=>{if(t==null)return t;const n=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.varRef},r=a=>n(a)??a,[i,o]=ine(t);return t=n(i)??r(o)??r(t),t};function lne(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s;const l=Ch(o,r),u=rne(l)(r);let d={};for(let h in u){const m=u[h];let v=Ch(m,r);h in n&&(h=n[h]),ane(h,v)&&(v=sne(r,v));let b=t[h];if(b===!0&&(b={property:h}),qs(v)){d[h]=d[h]??{},d[h]=Gl({},d[h],i(v,!0));continue}let S=((s=b==null?void 0:b.transform)==null?void 0:s.call(b,v,r,l))??v;S=b!=null&&b.processResult?i(S,!0):S;const _=Ch(b==null?void 0:b.property,r);if(!a&&(b!=null&&b.static)){const E=Ch(b.static,r);d=Gl({},d,E)}if(_&&Array.isArray(_)){for(const E of _)d[E]=S;continue}if(_){_==="&"&&qs(S)?d=Gl({},d,S):d[_]=S;continue}if(qs(S)){d=Gl({},d,S);continue}d[h]=S}return d};return i}var Lj=e=>t=>lne({theme:t,pseudos:xS,configs:__})(e);function hr(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function une(e,t){if(Array.isArray(e))return e;if(qs(e))return t(e);if(e!=null)return[e]}function cne(e,t){for(let n=t+1;n{Gl(u,{[T]:m?k[T]:{[E]:k[T]}})});continue}if(!v){m?Gl(u,k):u[E]=k;continue}u[E]=k}}return u}}function fne(e){return t=>{const{variant:n,size:r,theme:i}=t,o=dne(i);return Gl({},Ch(e.baseStyle??{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function hne(e,t,n){var r,i;return((i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)??n}function Sn(e){return Ute(e,["styleConfig","size","variant","colorScheme"])}function pne(e){if(e.sheet)return e.sheet;for(var t=0;t0?Ui(g0,--ra):0,Wm--,ii===10&&(Wm=1,CS--),ii}function Ta(){return ii=ra2||S2(ii)>3?"":" "}function Ene(e,t){for(;--t&&Ta()&&!(ii<48||ii>102||ii>57&&ii<65||ii>70&&ii<97););return my(e,s4()+(t<6&&Xl()==32&&Ta()==32))}function c7(e){for(;Ta();)switch(ii){case e:return ra;case 34:case 39:e!==34&&e!==39&&c7(ii);break;case 40:e===41&&c7(e);break;case 92:Ta();break}return ra}function Pne(e,t){for(;Ta()&&e+ii!==47+10;)if(e+ii===42+42&&Xl()===47)break;return"/*"+my(t,ra-1)+"*"+wS(e===47?e:Ta())}function Tne(e){for(;!S2(Xl());)Ta();return my(e,ra)}function Lne(e){return Dj(u4("",null,null,null,[""],e=Rj(e),0,[0],e))}function u4(e,t,n,r,i,o,a,s,l){for(var u=0,d=0,h=a,m=0,v=0,b=0,S=1,_=1,E=1,k=0,T="",A=i,M=o,R=r,D=T;_;)switch(b=k,k=Ta()){case 40:if(b!=108&&Ui(D,h-1)==58){u7(D+=On(l4(k),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:D+=l4(k);break;case 9:case 10:case 13:case 32:D+=kne(b);break;case 92:D+=Ene(s4()-1,7);continue;case 47:switch(Xl()){case 42:case 47:V3(Ane(Pne(Ta(),s4()),t,n),l);break;default:D+="/"}break;case 123*S:s[u++]=Fl(D)*E;case 125*S:case 59:case 0:switch(k){case 0:case 125:_=0;case 59+d:v>0&&Fl(D)-h&&V3(v>32?LL(D+";",r,n,h-1):LL(On(D," ","")+";",r,n,h-2),l);break;case 59:D+=";";default:if(V3(R=TL(D,t,n,u,d,i,s,T,A=[],M=[],h),o),k===123)if(d===0)u4(D,t,R,R,A,o,h,s,M);else switch(m===99&&Ui(D,3)===110?100:m){case 100:case 109:case 115:u4(e,R,R,r&&V3(TL(e,R,R,0,0,i,s,T,i,A=[],h),M),i,M,h,s,r?A:M);break;default:u4(D,R,R,R,[""],M,0,s,M)}}u=d=v=0,S=E=1,T=D="",h=a;break;case 58:h=1+Fl(D),v=b;default:if(S<1){if(k==123)--S;else if(k==125&&S++==0&&_ne()==125)continue}switch(D+=wS(k),k*S){case 38:E=d>0?1:(D+="\f",-1);break;case 44:s[u++]=(Fl(D)-1)*E,E=1;break;case 64:Xl()===45&&(D+=l4(Ta())),m=Xl(),d=h=Fl(T=D+=Tne(s4())),k++;break;case 45:b===45&&Fl(D)==2&&(S=0)}}return o}function TL(e,t,n,r,i,o,a,s,l,u,d){for(var h=i-1,m=i===0?o:[""],v=P_(m),b=0,S=0,_=0;b0?m[E]+" "+k:On(k,/&\f/g,m[E])))&&(l[_++]=T);return _S(e,t,n,i===0?k_:s,l,u,d)}function Ane(e,t,n){return _S(e,t,n,Aj,wS(Cne()),b2(e,2,-2),0)}function LL(e,t,n,r){return _S(e,t,n,E_,b2(e,0,r),b2(e,r+1,-1),r)}function mm(e,t){for(var n="",r=P_(e),i=0;i6)switch(Ui(e,t+1)){case 109:if(Ui(e,t+4)!==45)break;case 102:return On(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+q4+(Ui(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~u7(e,"stretch")?jj(On(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ui(e,t+1)!==115)break;case 6444:switch(Ui(e,Fl(e)-3-(~u7(e,"!important")&&10))){case 107:return On(e,":",":"+_n)+e;case 101:return On(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Ui(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+eo+"$2box$3")+e}break;case 5936:switch(Ui(e,t+11)){case 114:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+eo+e+e}return e}var $ne=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case E_:t.return=jj(t.value,t.length);break;case Oj:return mm([H1(t,{value:On(t.value,"@","@"+_n)})],i);case k_:if(t.length)return wne(t.props,function(o){switch(xne(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return mm([H1(t,{props:[On(o,/:(read-\w+)/,":"+q4+"$1")]})],i);case"::placeholder":return mm([H1(t,{props:[On(o,/:(plac\w+)/,":"+_n+"input-$1")]}),H1(t,{props:[On(o,/:(plac\w+)/,":"+q4+"$1")]}),H1(t,{props:[On(o,/:(plac\w+)/,eo+"input-$1")]})],i)}return""})}},Fne=[$ne],Bj=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(S){var _=S.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(S),S.setAttribute("data-s",""))})}var i=t.stylisPlugins||Fne,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(S){for(var _=S.getAttribute("data-emotion").split(" "),E=1;E<_.length;E++)o[_[E]]=!0;s.push(S)});var l,u=[jne,Bne];{var d,h=[One,Ine(function(S){d.insert(S)})],m=Mne(u.concat(i,h)),v=function(_){return mm(Lne(_),m)};l=function(_,E,k,T){d=k,v(_?_+"{"+E.styles+"}":E.styles),T&&(b.inserted[E.name]=!0)}}var b={key:n,sheet:new mne({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return b.sheet.hydrate(s),b};function bn(){return bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Qne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Jne=/[A-Z]|^ms/g,ere=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Wj=function(t){return t.charCodeAt(1)===45},ML=function(t){return t!=null&&typeof t!="boolean"},Zw=Nj(function(e){return Wj(e)?e:e.replace(Jne,"-$&").toLowerCase()}),IL=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(ere,function(r,i,o){return zl={name:i,styles:o,next:zl},i})}return Qne[t]!==1&&!Wj(t)&&typeof n=="number"&&n!==0?n+"px":n};function x2(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return zl={name:n.name,styles:n.styles,next:zl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)zl={name:r.name,styles:r.styles,next:zl},r=r.next;var i=n.styles+";";return i}return tre(e,t,n)}case"function":{if(e!==void 0){var o=zl,a=n(e);return zl=o,x2(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function tre(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{t.includes(r)||(n[r]=e[r])}),n}function yre(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},Zj=bre(yre);function Qj(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var Jj=e=>Qj(e,t=>t!=null);function Sre(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var xre=Sre();function eB(e,...t){return mre(e)?e(...t):e}function wre(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Cre(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=w.createContext(void 0);i.displayName=r;function o(){var a;const s=w.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}var _re=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,kre=Nj(function(e){return _re.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Ere=kre,Pre=function(t){return t!=="theme"},jL=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Ere:Pre},BL=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},Tre=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Hj(n,r,i),rre(function(){return Vj(n,r,i)}),null},Lre=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=BL(t,n,r),l=s||jL(i),u=!l("as");return function(){var d=arguments,h=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)h.push.apply(h,d);else{h.push(d[0][0]);for(var m=d.length,v=1;v[h,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([h,m])=>[h,m.className]))}function l(d){const v=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:v,selector:`.${v}`,toString:()=>d}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var Ore=Mn("accordion").parts("root","container","button","panel").extend("icon"),Mre=Mn("alert").parts("title","description","container").extend("icon","spinner"),Ire=Mn("avatar").parts("label","badge","container").extend("excessLabel","group"),Rre=Mn("breadcrumb").parts("link","item","container").extend("separator");Mn("button").parts();var Dre=Mn("checkbox").parts("control","icon","container").extend("label");Mn("progress").parts("track","filledTrack").extend("label");var Nre=Mn("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),jre=Mn("editable").parts("preview","input","textarea"),Bre=Mn("form").parts("container","requiredIndicator","helperText"),$re=Mn("formError").parts("text","icon"),Fre=Mn("input").parts("addon","field","element"),zre=Mn("list").parts("container","item","icon"),Hre=Mn("menu").parts("button","list","item").extend("groupTitle","command","divider"),Vre=Mn("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Wre=Mn("numberinput").parts("root","field","stepperGroup","stepper");Mn("pininput").parts("field");var Ure=Mn("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Gre=Mn("progress").parts("label","filledTrack","track"),qre=Mn("radio").parts("container","control","label"),Yre=Mn("select").parts("field","icon"),Kre=Mn("slider").parts("container","track","thumb","filledTrack","mark"),Xre=Mn("stat").parts("container","label","helpText","number","icon"),Zre=Mn("switch").parts("container","track","thumb"),Qre=Mn("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),Jre=Mn("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),eie=Mn("tag").parts("container","label","closeButton"),tie=Mn("card").parts("container","header","body","footer");function Gi(e,t){nie(e)&&(e="100%");var n=rie(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function W3(e){return Math.min(1,Math.max(0,e))}function nie(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function rie(e){return typeof e=="string"&&e.indexOf("%")!==-1}function tB(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function U3(e){return e<=1?"".concat(Number(e)*100,"%"):e}function _h(e){return e.length===1?"0"+e:String(e)}function iie(e,t,n){return{r:Gi(e,255)*255,g:Gi(t,255)*255,b:Gi(n,255)*255}}function $L(e,t,n){e=Gi(e,255),t=Gi(t,255),n=Gi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=0,s=(r+i)/2;if(r===i)a=0,o=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function oie(e,t,n){var r,i,o;if(e=Gi(e,360),t=Gi(t,100),n=Gi(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Qw(s,a,e+1/3),i=Qw(s,a,e),o=Qw(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function FL(e,t,n){e=Gi(e,255),t=Gi(t,255),n=Gi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var g7={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function cie(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=hie(e)),typeof e=="object"&&($u(e.r)&&$u(e.g)&&$u(e.b)?(t=iie(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):$u(e.h)&&$u(e.s)&&$u(e.v)?(r=U3(e.s),i=U3(e.v),t=aie(e.h,r,i),a=!0,s="hsv"):$u(e.h)&&$u(e.s)&&$u(e.l)&&(r=U3(e.s),o=U3(e.l),t=oie(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=tB(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var die="[-\\+]?\\d+%?",fie="[-\\+]?\\d*\\.\\d+%?",Cd="(?:".concat(fie,")|(?:").concat(die,")"),Jw="[\\s|\\(]+(".concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")\\s*\\)?"),e6="[\\s|\\(]+(".concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")\\s*\\)?"),Bs={CSS_UNIT:new RegExp(Cd),rgb:new RegExp("rgb"+Jw),rgba:new RegExp("rgba"+e6),hsl:new RegExp("hsl"+Jw),hsla:new RegExp("hsla"+e6),hsv:new RegExp("hsv"+Jw),hsva:new RegExp("hsva"+e6),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function hie(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(g7[e])e=g7[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Bs.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Bs.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Bs.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Bs.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Bs.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Bs.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Bs.hex8.exec(e),n?{r:_a(n[1]),g:_a(n[2]),b:_a(n[3]),a:HL(n[4]),format:t?"name":"hex8"}:(n=Bs.hex6.exec(e),n?{r:_a(n[1]),g:_a(n[2]),b:_a(n[3]),format:t?"name":"hex"}:(n=Bs.hex4.exec(e),n?{r:_a(n[1]+n[1]),g:_a(n[2]+n[2]),b:_a(n[3]+n[3]),a:HL(n[4]+n[4]),format:t?"name":"hex8"}:(n=Bs.hex3.exec(e),n?{r:_a(n[1]+n[1]),g:_a(n[2]+n[2]),b:_a(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function $u(e){return Boolean(Bs.CSS_UNIT.exec(String(e)))}var vy=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=uie(t)),this.originalInput=t;var i=cie(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,a=t.g/255,s=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=tB(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=FL(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=FL(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=$L(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=$L(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),zL(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),sie(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(Gi(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(Gi(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+zL(this.r,this.g,this.b,!1),n=0,r=Object.entries(g7);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=W3(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=W3(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=W3(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=W3(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:i,v:o})),o=(o+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(nB(e));return e.count=t,n}var r=pie(e.hue,e.seed),i=gie(r,e),o=mie(r,i,e),a={h:r,s:i,v:o};return e.alpha!==void 0&&(a.a=e.alpha),new vy(a)}function pie(e,t){var n=yie(e),r=Y4(n,t);return r<0&&(r=360+r),r}function gie(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return Y4([0,100],t.seed);var n=rB(e).saturationRange,r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55;break}return Y4([r,i],t.seed)}function mie(e,t,n){var r=vie(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100;break}return Y4([r,i],n.seed)}function vie(e,t){for(var n=rB(e).lowerBounds,r=0;r=i&&t<=a){var l=(s-o)/(a-i),u=o-l*i;return l*t+u}}return 0}function yie(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=oB.find(function(a){return a.name===e});if(n){var r=iB(n);if(r.hueRange)return r.hueRange}var i=new vy(e);if(i.isValid){var o=i.toHsv().h;return[o,o]}}return[0,360]}function rB(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=oB;t=i.hueRange[0]&&e<=i.hueRange[1])return i}throw Error("Color not found")}function Y4(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var i=t/233280;return Math.floor(r+i*(n-r))}function iB(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],i=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,i]}}var oB=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function bie(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,ko=(e,t,n)=>{const r=bie(e,`colors.${t}`,t),{isValid:i}=new vy(r);return i?r:n},xie=e=>t=>{const n=ko(t,e);return new vy(n).isDark()?"dark":"light"},wie=e=>t=>xie(e)(t)==="dark",Um=(e,t)=>n=>{const r=ko(n,e);return new vy(r).setAlpha(t).toRgbString()};function VL(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + 45deg, + ${t} 25%, + transparent 25%, + transparent 50%, + ${t} 50%, + ${t} 75%, + transparent 75%, + transparent + )`,backgroundSize:`${e} ${e}`}}function Cie(e){const t=nB().toHexString();return!e||Sie(e)?t:e.string&&e.colors?kie(e.string,e.colors):e.string&&!e.colors?_ie(e.string):e.colors&&!e.string?Eie(e.colors):t}function _ie(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function kie(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function I_(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function Pie(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function aB(e){return Pie(e)&&e.reference?e.reference:String(e)}var jS=(e,...t)=>t.map(aB).join(` ${e} `).replace(/calc/g,""),WL=(...e)=>`calc(${jS("+",...e)})`,UL=(...e)=>`calc(${jS("-",...e)})`,m7=(...e)=>`calc(${jS("*",...e)})`,GL=(...e)=>`calc(${jS("/",...e)})`,qL=e=>{const t=aB(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:m7(t,-1)},Uu=Object.assign(e=>({add:(...t)=>Uu(WL(e,...t)),subtract:(...t)=>Uu(UL(e,...t)),multiply:(...t)=>Uu(m7(e,...t)),divide:(...t)=>Uu(GL(e,...t)),negate:()=>Uu(qL(e)),toString:()=>e.toString()}),{add:WL,subtract:UL,multiply:m7,divide:GL,negate:qL});function Tie(e){return!Number.isInteger(parseFloat(e.toString()))}function Lie(e,t="-"){return e.replace(/\s+/g,t)}function sB(e){const t=Lie(e.toString());return t.includes("\\.")?e:Tie(e)?t.replace(".","\\."):e}function Aie(e,t=""){return[t,sB(e)].filter(Boolean).join("-")}function Oie(e,t){return`var(${sB(e)}${t?`, ${t}`:""})`}function Mie(e,t=""){return`--${Aie(e,t)}`}function yi(e,t){const n=Mie(e,t==null?void 0:t.prefix);return{variable:n,reference:Oie(n,Iie(t==null?void 0:t.fallback))}}function Iie(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{definePartsStyle:Rie,defineMultiStyleConfig:Die}=hr(Ore.keys),Nie={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},jie={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Bie={pt:"2",px:"4",pb:"5"},$ie={fontSize:"1.25em"},Fie=Rie({container:Nie,button:jie,panel:Bie,icon:$ie}),zie=Die({baseStyle:Fie}),{definePartsStyle:yy,defineMultiStyleConfig:Hie}=hr(Mre.keys),La=Vn("alert-fg"),ec=Vn("alert-bg"),Vie=yy({container:{bg:ec.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:La.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:La.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function R_(e){const{theme:t,colorScheme:n}=e,r=Um(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Wie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark}}}}),Uie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:La.reference}}}),Gie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:La.reference}}}),qie=yy(e=>{const{colorScheme:t}=e;return{container:{[La.variable]:"colors.white",[ec.variable]:`colors.${t}.500`,_dark:{[La.variable]:"colors.gray.900",[ec.variable]:`colors.${t}.200`},color:La.reference}}}),Yie={subtle:Wie,"left-accent":Uie,"top-accent":Gie,solid:qie},Kie=Hie({baseStyle:Vie,variants:Yie,defaultProps:{variant:"subtle",colorScheme:"blue"}}),lB={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Xie={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},Zie={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},Qie={...lB,...Xie,container:Zie},uB=Qie,Jie=e=>typeof e=="function";function To(e,...t){return Jie(e)?e(...t):e}var{definePartsStyle:cB,defineMultiStyleConfig:eoe}=hr(Ire.keys),vm=Vn("avatar-border-color"),t6=Vn("avatar-bg"),toe={borderRadius:"full",border:"0.2em solid",[vm.variable]:"white",_dark:{[vm.variable]:"colors.gray.800"},borderColor:vm.reference},noe={[t6.variable]:"colors.gray.200",_dark:{[t6.variable]:"colors.whiteAlpha.400"},bgColor:t6.reference},YL=Vn("avatar-background"),roe=e=>{const{name:t,theme:n}=e,r=t?Cie({string:t}):"colors.gray.400",i=wie(r)(n);let o="white";return i||(o="gray.800"),{bg:YL.reference,"&:not([data-loaded])":{[YL.variable]:r},color:o,[vm.variable]:"colors.white",_dark:{[vm.variable]:"colors.gray.800"},borderColor:vm.reference,verticalAlign:"top"}},ioe=cB(e=>({badge:To(toe,e),excessLabel:To(noe,e),container:To(roe,e)}));function sd(e){const t=e!=="100%"?uB[e]:void 0;return cB({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var ooe={"2xs":sd(4),xs:sd(6),sm:sd(8),md:sd(12),lg:sd(16),xl:sd(24),"2xl":sd(32),full:sd("100%")},aoe=eoe({baseStyle:ioe,sizes:ooe,defaultProps:{size:"md"}}),soe={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},ym=Vn("badge-bg"),ql=Vn("badge-color"),loe=e=>{const{colorScheme:t,theme:n}=e,r=Um(`${t}.500`,.6)(n);return{[ym.variable]:`colors.${t}.500`,[ql.variable]:"colors.white",_dark:{[ym.variable]:r,[ql.variable]:"colors.whiteAlpha.800"},bg:ym.reference,color:ql.reference}},uoe=e=>{const{colorScheme:t,theme:n}=e,r=Um(`${t}.200`,.16)(n);return{[ym.variable]:`colors.${t}.100`,[ql.variable]:`colors.${t}.800`,_dark:{[ym.variable]:r,[ql.variable]:`colors.${t}.200`},bg:ym.reference,color:ql.reference}},coe=e=>{const{colorScheme:t,theme:n}=e,r=Um(`${t}.200`,.8)(n);return{[ql.variable]:`colors.${t}.500`,_dark:{[ql.variable]:r},color:ql.reference,boxShadow:`inset 0 0 0px 1px ${ql.reference}`}},doe={solid:loe,subtle:uoe,outline:coe},Fv={baseStyle:soe,variants:doe,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:foe,definePartsStyle:hoe}=hr(Rre.keys),poe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},goe=hoe({link:poe}),moe=foe({baseStyle:goe}),voe={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},dB=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Et("inherit","whiteAlpha.900")(e),_hover:{bg:Et("gray.100","whiteAlpha.200")(e)},_active:{bg:Et("gray.200","whiteAlpha.300")(e)}};const r=Um(`${t}.200`,.12)(n),i=Um(`${t}.200`,.24)(n);return{color:Et(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Et(`${t}.50`,r)(e)},_active:{bg:Et(`${t}.100`,i)(e)}}},yoe=e=>{const{colorScheme:t}=e,n=Et("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...To(dB,e)}},boe={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Soe=e=>{const{colorScheme:t}=e;if(t==="gray"){const s=Et("gray.100","whiteAlpha.200")(e);return{bg:s,_hover:{bg:Et("gray.200","whiteAlpha.300")(e),_disabled:{bg:s}},_active:{bg:Et("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=boe[t]??{},a=Et(n,`${t}.200`)(e);return{bg:a,color:Et(r,"gray.800")(e),_hover:{bg:Et(i,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:Et(o,`${t}.400`)(e)}}},xoe=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Et(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Et(`${t}.700`,`${t}.500`)(e)}}},woe={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},Coe={ghost:dB,outline:yoe,solid:Soe,link:xoe,unstyled:woe},_oe={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},koe={baseStyle:voe,variants:Coe,sizes:_oe,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Mh,defineMultiStyleConfig:Eoe}=hr(tie.keys),K4=Vn("card-bg"),bm=Vn("card-padding"),Poe=Mh({container:{[K4.variable]:"chakra-body-bg",backgroundColor:K4.reference,color:"chakra-body-text"},body:{padding:bm.reference,flex:"1 1 0%"},header:{padding:bm.reference},footer:{padding:bm.reference}}),Toe={sm:Mh({container:{borderRadius:"base",[bm.variable]:"space.3"}}),md:Mh({container:{borderRadius:"md",[bm.variable]:"space.5"}}),lg:Mh({container:{borderRadius:"xl",[bm.variable]:"space.7"}})},Loe={elevated:Mh({container:{boxShadow:"base",_dark:{[K4.variable]:"colors.gray.700"}}}),outline:Mh({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:Mh({container:{[K4.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},Aoe=Eoe({baseStyle:Poe,variants:Loe,sizes:Toe,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:c4,defineMultiStyleConfig:Ooe}=hr(Dre.keys),zv=Vn("checkbox-size"),Moe=e=>{const{colorScheme:t}=e;return{w:zv.reference,h:zv.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e),_hover:{bg:Et(`${t}.600`,`${t}.300`)(e),borderColor:Et(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Et("gray.200","transparent")(e),bg:Et("gray.200","whiteAlpha.300")(e),color:Et("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e)},_disabled:{bg:Et("gray.100","whiteAlpha.100")(e),borderColor:Et("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Et("red.500","red.300")(e)}}},Ioe={_disabled:{cursor:"not-allowed"}},Roe={userSelect:"none",_disabled:{opacity:.4}},Doe={transitionProperty:"transform",transitionDuration:"normal"},Noe=c4(e=>({icon:Doe,container:Ioe,control:To(Moe,e),label:Roe})),joe={sm:c4({control:{[zv.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:c4({control:{[zv.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:c4({control:{[zv.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},X4=Ooe({baseStyle:Noe,sizes:joe,defaultProps:{size:"md",colorScheme:"blue"}}),Hv=yi("close-button-size"),V1=yi("close-button-bg"),Boe={w:[Hv.reference],h:[Hv.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[V1.variable]:"colors.blackAlpha.100",_dark:{[V1.variable]:"colors.whiteAlpha.100"}},_active:{[V1.variable]:"colors.blackAlpha.200",_dark:{[V1.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:V1.reference},$oe={lg:{[Hv.variable]:"sizes.10",fontSize:"md"},md:{[Hv.variable]:"sizes.8",fontSize:"xs"},sm:{[Hv.variable]:"sizes.6",fontSize:"2xs"}},Foe={baseStyle:Boe,sizes:$oe,defaultProps:{size:"md"}},{variants:zoe,defaultProps:Hoe}=Fv,Voe={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Woe={baseStyle:Voe,variants:zoe,defaultProps:Hoe},Uoe={w:"100%",mx:"auto",maxW:"prose",px:"4"},Goe={baseStyle:Uoe},qoe={opacity:.6,borderColor:"inherit"},Yoe={borderStyle:"solid"},Koe={borderStyle:"dashed"},Xoe={solid:Yoe,dashed:Koe},Zoe={baseStyle:qoe,variants:Xoe,defaultProps:{variant:"solid"}},{definePartsStyle:v7,defineMultiStyleConfig:Qoe}=hr(Nre.keys),n6=Vn("drawer-bg"),r6=Vn("drawer-box-shadow");function _g(e){return v7(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Joe={bg:"blackAlpha.600",zIndex:"overlay"},eae={display:"flex",zIndex:"modal",justifyContent:"center"},tae=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[n6.variable]:"colors.white",[r6.variable]:"shadows.lg",_dark:{[n6.variable]:"colors.gray.700",[r6.variable]:"shadows.dark-lg"},bg:n6.reference,boxShadow:r6.reference}},nae={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},rae={position:"absolute",top:"2",insetEnd:"3"},iae={px:"6",py:"2",flex:"1",overflow:"auto"},oae={px:"6",py:"4"},aae=v7(e=>({overlay:Joe,dialogContainer:eae,dialog:To(tae,e),header:nae,closeButton:rae,body:iae,footer:oae})),sae={xs:_g("xs"),sm:_g("md"),md:_g("lg"),lg:_g("2xl"),xl:_g("4xl"),full:_g("full")},lae=Qoe({baseStyle:aae,sizes:sae,defaultProps:{size:"xs"}}),{definePartsStyle:uae,defineMultiStyleConfig:cae}=hr(jre.keys),dae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},fae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},hae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},pae=uae({preview:dae,input:fae,textarea:hae}),gae=cae({baseStyle:pae}),{definePartsStyle:mae,defineMultiStyleConfig:vae}=hr(Bre.keys),Sm=Vn("form-control-color"),yae={marginStart:"1",[Sm.variable]:"colors.red.500",_dark:{[Sm.variable]:"colors.red.300"},color:Sm.reference},bae={mt:"2",[Sm.variable]:"colors.gray.600",_dark:{[Sm.variable]:"colors.whiteAlpha.600"},color:Sm.reference,lineHeight:"normal",fontSize:"sm"},Sae=mae({container:{width:"100%",position:"relative"},requiredIndicator:yae,helperText:bae}),xae=vae({baseStyle:Sae}),{definePartsStyle:wae,defineMultiStyleConfig:Cae}=hr($re.keys),xm=Vn("form-error-color"),_ae={[xm.variable]:"colors.red.500",_dark:{[xm.variable]:"colors.red.300"},color:xm.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},kae={marginEnd:"0.5em",[xm.variable]:"colors.red.500",_dark:{[xm.variable]:"colors.red.300"},color:xm.reference},Eae=wae({text:_ae,icon:kae}),Pae=Cae({baseStyle:Eae}),Tae={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Lae={baseStyle:Tae},Aae={fontFamily:"heading",fontWeight:"bold"},Oae={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},Mae={baseStyle:Aae,sizes:Oae,defaultProps:{size:"xl"}},{definePartsStyle:Gu,defineMultiStyleConfig:Iae}=hr(Fre.keys),Rae=Gu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),ld={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},Dae={lg:Gu({field:ld.lg,addon:ld.lg}),md:Gu({field:ld.md,addon:ld.md}),sm:Gu({field:ld.sm,addon:ld.sm}),xs:Gu({field:ld.xs,addon:ld.xs})};function D_(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Et("blue.500","blue.300")(e),errorBorderColor:n||Et("red.500","red.300")(e)}}var Nae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Et("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r),boxShadow:`0 0 0 1px ${ko(t,r)}`},_focusVisible:{zIndex:1,borderColor:ko(t,n),boxShadow:`0 0 0 1px ${ko(t,n)}`}},addon:{border:"1px solid",borderColor:Et("inherit","whiteAlpha.50")(e),bg:Et("gray.100","whiteAlpha.300")(e)}}}),jae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e),_hover:{bg:Et("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r)},_focusVisible:{bg:"transparent",borderColor:ko(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e)}}}),Bae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r),boxShadow:`0px 1px 0px 0px ${ko(t,r)}`},_focusVisible:{borderColor:ko(t,n),boxShadow:`0px 1px 0px 0px ${ko(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),$ae=Gu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),Fae={outline:Nae,filled:jae,flushed:Bae,unstyled:$ae},kn=Iae({baseStyle:Rae,sizes:Dae,variants:Fae,defaultProps:{size:"md",variant:"outline"}}),i6=Vn("kbd-bg"),zae={[i6.variable]:"colors.gray.100",_dark:{[i6.variable]:"colors.whiteAlpha.100"},bg:i6.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Hae={baseStyle:zae},Vae={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Wae={baseStyle:Vae},{defineMultiStyleConfig:Uae,definePartsStyle:Gae}=hr(zre.keys),qae={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Yae=Gae({icon:qae}),Kae=Uae({baseStyle:Yae}),{defineMultiStyleConfig:Xae,definePartsStyle:Zae}=hr(Hre.keys),$l=Vn("menu-bg"),o6=Vn("menu-shadow"),Qae={[$l.variable]:"#fff",[o6.variable]:"shadows.sm",_dark:{[$l.variable]:"colors.gray.700",[o6.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:$l.reference,boxShadow:o6.reference},Jae={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[$l.variable]:"colors.gray.100",_dark:{[$l.variable]:"colors.whiteAlpha.100"}},_active:{[$l.variable]:"colors.gray.200",_dark:{[$l.variable]:"colors.whiteAlpha.200"}},_expanded:{[$l.variable]:"colors.gray.100",_dark:{[$l.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:$l.reference},ese={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},tse={opacity:.6},nse={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},rse={transitionProperty:"common",transitionDuration:"normal"},ise=Zae({button:rse,list:Qae,item:Jae,groupTitle:ese,command:tse,divider:nse}),ose=Xae({baseStyle:ise}),{defineMultiStyleConfig:ase,definePartsStyle:y7}=hr(Vre.keys),sse={bg:"blackAlpha.600",zIndex:"modal"},lse=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},use=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:Et("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:Et("lg","dark-lg")(e)}},cse={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},dse={position:"absolute",top:"2",insetEnd:"3"},fse=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},hse={px:"6",py:"4"},pse=y7(e=>({overlay:sse,dialogContainer:To(lse,e),dialog:To(use,e),header:cse,closeButton:dse,body:To(fse,e),footer:hse}));function Is(e){return y7(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var gse={xs:Is("xs"),sm:Is("sm"),md:Is("md"),lg:Is("lg"),xl:Is("xl"),"2xl":Is("2xl"),"3xl":Is("3xl"),"4xl":Is("4xl"),"5xl":Is("5xl"),"6xl":Is("6xl"),full:Is("full")},mse=ase({baseStyle:pse,sizes:gse,defaultProps:{size:"md"}}),vse={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},fB=vse,{defineMultiStyleConfig:yse,definePartsStyle:hB}=hr(Wre.keys),N_=yi("number-input-stepper-width"),pB=yi("number-input-input-padding"),bse=Uu(N_).add("0.5rem").toString(),a6=yi("number-input-bg"),s6=yi("number-input-color"),l6=yi("number-input-border-color"),Sse={[N_.variable]:"sizes.6",[pB.variable]:bse},xse=e=>{var t;return((t=To(kn.baseStyle,e))==null?void 0:t.field)??{}},wse={width:N_.reference},Cse={borderStart:"1px solid",borderStartColor:l6.reference,color:s6.reference,bg:a6.reference,[s6.variable]:"colors.chakra-body-text",[l6.variable]:"colors.chakra-border-color",_dark:{[s6.variable]:"colors.whiteAlpha.800",[l6.variable]:"colors.whiteAlpha.300"},_active:{[a6.variable]:"colors.gray.200",_dark:{[a6.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},_se=hB(e=>({root:Sse,field:To(xse,e)??{},stepperGroup:wse,stepper:Cse}));function G3(e){var t,n;const r=(t=kn.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},o=((n=r.field)==null?void 0:n.fontSize)??"md",a=fB.fontSizes[o];return hB({field:{...r.field,paddingInlineEnd:pB.reference,verticalAlign:"top"},stepper:{fontSize:Uu(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var kse={xs:G3("xs"),sm:G3("sm"),md:G3("md"),lg:G3("lg")},Ese=yse({baseStyle:_se,sizes:kse,variants:kn.variants,defaultProps:kn.defaultProps}),KL,Pse={...(KL=kn.baseStyle)==null?void 0:KL.field,textAlign:"center"},Tse={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},XL,Lse={outline:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((XL=kn.variants)==null?void 0:XL.unstyled.field)??{}},Ase={baseStyle:Pse,sizes:Tse,variants:Lse,defaultProps:kn.defaultProps},{defineMultiStyleConfig:Ose,definePartsStyle:Mse}=hr(Ure.keys),q3=yi("popper-bg"),Ise=yi("popper-arrow-bg"),ZL=yi("popper-arrow-shadow-color"),Rse={zIndex:10},Dse={[q3.variable]:"colors.white",bg:q3.reference,[Ise.variable]:q3.reference,[ZL.variable]:"colors.gray.200",_dark:{[q3.variable]:"colors.gray.700",[ZL.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},Nse={px:3,py:2,borderBottomWidth:"1px"},jse={px:3,py:2},Bse={px:3,py:2,borderTopWidth:"1px"},$se={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},Fse=Mse({popper:Rse,content:Dse,header:Nse,body:jse,footer:Bse,closeButton:$se}),zse=Ose({baseStyle:Fse}),{defineMultiStyleConfig:Hse,definePartsStyle:bv}=hr(Gre.keys),Vse=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=Et(VL(),VL("1rem","rgba(0,0,0,0.1)"))(e),a=Et(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( + to right, + transparent 0%, + ${ko(n,a)} 50%, + transparent 100% + )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},Wse={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Use=e=>({bg:Et("gray.100","whiteAlpha.300")(e)}),Gse=e=>({transitionProperty:"common",transitionDuration:"slow",...Vse(e)}),qse=bv(e=>({label:Wse,filledTrack:Gse(e),track:Use(e)})),Yse={xs:bv({track:{h:"1"}}),sm:bv({track:{h:"2"}}),md:bv({track:{h:"3"}}),lg:bv({track:{h:"4"}})},Kse=Hse({sizes:Yse,baseStyle:qse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Xse,definePartsStyle:d4}=hr(qre.keys),Zse=e=>{var t;const n=(t=To(X4.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Qse=d4(e=>{var t,n,r,i;return{label:(n=(t=X4).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=X4).baseStyle)==null?void 0:i.call(r,e).container,control:Zse(e)}}),Jse={md:d4({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:d4({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:d4({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},ele=Xse({baseStyle:Qse,sizes:Jse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:tle,definePartsStyle:nle}=hr(Yre.keys),Y3=Vn("select-bg"),QL,rle={...(QL=kn.baseStyle)==null?void 0:QL.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Y3.reference,[Y3.variable]:"colors.white",_dark:{[Y3.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Y3.reference}},ile={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},ole=nle({field:rle,icon:ile}),K3={paddingInlineEnd:"8"},JL,eA,tA,nA,rA,iA,oA,aA,ale={lg:{...(JL=kn.sizes)==null?void 0:JL.lg,field:{...(eA=kn.sizes)==null?void 0:eA.lg.field,...K3}},md:{...(tA=kn.sizes)==null?void 0:tA.md,field:{...(nA=kn.sizes)==null?void 0:nA.md.field,...K3}},sm:{...(rA=kn.sizes)==null?void 0:rA.sm,field:{...(iA=kn.sizes)==null?void 0:iA.sm.field,...K3}},xs:{...(oA=kn.sizes)==null?void 0:oA.xs,field:{...(aA=kn.sizes)==null?void 0:aA.xs.field,...K3},icon:{insetEnd:"1"}}},sle=tle({baseStyle:ole,sizes:ale,variants:kn.variants,defaultProps:kn.defaultProps}),u6=Vn("skeleton-start-color"),c6=Vn("skeleton-end-color"),lle={[u6.variable]:"colors.gray.100",[c6.variable]:"colors.gray.400",_dark:{[u6.variable]:"colors.gray.800",[c6.variable]:"colors.gray.600"},background:u6.reference,borderColor:c6.reference,opacity:.7,borderRadius:"sm"},ule={baseStyle:lle},d6=Vn("skip-link-bg"),cle={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[d6.variable]:"colors.white",_dark:{[d6.variable]:"colors.gray.700"},bg:d6.reference}},dle={baseStyle:cle},{defineMultiStyleConfig:fle,definePartsStyle:BS}=hr(Kre.keys),_2=Vn("slider-thumb-size"),k2=Vn("slider-track-size"),bd=Vn("slider-bg"),hle=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...I_({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},ple=e=>({...I_({orientation:e.orientation,horizontal:{h:k2.reference},vertical:{w:k2.reference}}),overflow:"hidden",borderRadius:"sm",[bd.variable]:"colors.gray.200",_dark:{[bd.variable]:"colors.whiteAlpha.200"},_disabled:{[bd.variable]:"colors.gray.300",_dark:{[bd.variable]:"colors.whiteAlpha.300"}},bg:bd.reference}),gle=e=>{const{orientation:t}=e;return{...I_({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:_2.reference,h:_2.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},mle=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[bd.variable]:`colors.${t}.500`,_dark:{[bd.variable]:`colors.${t}.200`},bg:bd.reference}},vle=BS(e=>({container:hle(e),track:ple(e),thumb:gle(e),filledTrack:mle(e)})),yle=BS({container:{[_2.variable]:"sizes.4",[k2.variable]:"sizes.1"}}),ble=BS({container:{[_2.variable]:"sizes.3.5",[k2.variable]:"sizes.1"}}),Sle=BS({container:{[_2.variable]:"sizes.2.5",[k2.variable]:"sizes.0.5"}}),xle={lg:yle,md:ble,sm:Sle},wle=fle({baseStyle:vle,sizes:xle,defaultProps:{size:"md",colorScheme:"blue"}}),xh=yi("spinner-size"),Cle={width:[xh.reference],height:[xh.reference]},_le={xs:{[xh.variable]:"sizes.3"},sm:{[xh.variable]:"sizes.4"},md:{[xh.variable]:"sizes.6"},lg:{[xh.variable]:"sizes.8"},xl:{[xh.variable]:"sizes.12"}},kle={baseStyle:Cle,sizes:_le,defaultProps:{size:"md"}},{defineMultiStyleConfig:Ele,definePartsStyle:gB}=hr(Xre.keys),Ple={fontWeight:"medium"},Tle={opacity:.8,marginBottom:"2"},Lle={verticalAlign:"baseline",fontWeight:"semibold"},Ale={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},Ole=gB({container:{},label:Ple,helpText:Tle,number:Lle,icon:Ale}),Mle={md:gB({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},Ile=Ele({baseStyle:Ole,sizes:Mle,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Rle,definePartsStyle:f4}=hr(Zre.keys),Vv=yi("switch-track-width"),Ih=yi("switch-track-height"),f6=yi("switch-track-diff"),Dle=Uu.subtract(Vv,Ih),b7=yi("switch-thumb-x"),W1=yi("switch-bg"),Nle=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Vv.reference],height:[Ih.reference],transitionProperty:"common",transitionDuration:"fast",[W1.variable]:"colors.gray.300",_dark:{[W1.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[W1.variable]:`colors.${t}.500`,_dark:{[W1.variable]:`colors.${t}.200`}},bg:W1.reference}},jle={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Ih.reference],height:[Ih.reference],_checked:{transform:`translateX(${b7.reference})`}},Ble=f4(e=>({container:{[f6.variable]:Dle,[b7.variable]:f6.reference,_rtl:{[b7.variable]:Uu(f6).negate().toString()}},track:Nle(e),thumb:jle})),$le={sm:f4({container:{[Vv.variable]:"1.375rem",[Ih.variable]:"sizes.3"}}),md:f4({container:{[Vv.variable]:"1.875rem",[Ih.variable]:"sizes.4"}}),lg:f4({container:{[Vv.variable]:"2.875rem",[Ih.variable]:"sizes.6"}})},Fle=Rle({baseStyle:Ble,sizes:$le,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:zle,definePartsStyle:wm}=hr(Qre.keys),Hle=wm({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Z4={"&[data-is-numeric=true]":{textAlign:"end"}},Vle=wm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},caption:{color:Et("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Wle=wm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},caption:{color:Et("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e)},td:{background:Et(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Ule={simple:Vle,striped:Wle,unstyled:{}},Gle={sm:wm({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:wm({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:wm({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},qle=zle({baseStyle:Hle,variants:Ule,sizes:Gle,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Xo=Vn("tabs-color"),Vs=Vn("tabs-bg"),X3=Vn("tabs-border-color"),{defineMultiStyleConfig:Yle,definePartsStyle:Zl}=hr(Jre.keys),Kle=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},Xle=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Zle=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},Qle={p:4},Jle=Zl(e=>({root:Kle(e),tab:Xle(e),tablist:Zle(e),tabpanel:Qle})),eue={sm:Zl({tab:{py:1,px:4,fontSize:"sm"}}),md:Zl({tab:{fontSize:"md",py:2,px:4}}),lg:Zl({tab:{fontSize:"lg",py:3,px:4}})},tue=Zl(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Xo.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Vs.variable]:"colors.gray.200",_dark:{[Vs.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Xo.reference,bg:Vs.reference}}}),nue=Zl(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[X3.reference]:"transparent",_selected:{[Xo.variable]:`colors.${t}.600`,[X3.variable]:"colors.white",_dark:{[Xo.variable]:`colors.${t}.300`,[X3.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:X3.reference},color:Xo.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),rue=Zl(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Vs.variable]:"colors.gray.50",_dark:{[Vs.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Vs.variable]:"colors.white",[Xo.variable]:`colors.${t}.600`,_dark:{[Vs.variable]:"colors.gray.800",[Xo.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Xo.reference,bg:Vs.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),iue=Zl(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ko(n,`${t}.700`),bg:ko(n,`${t}.100`)}}}}),oue=Zl(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Xo.variable]:"colors.gray.600",_dark:{[Xo.variable]:"inherit"},_selected:{[Xo.variable]:"colors.white",[Vs.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:"colors.gray.800",[Vs.variable]:`colors.${t}.300`}},color:Xo.reference,bg:Vs.reference}}}),aue=Zl({}),sue={line:tue,enclosed:nue,"enclosed-colored":rue,"soft-rounded":iue,"solid-rounded":oue,unstyled:aue},lue=Yle({baseStyle:Jle,sizes:eue,variants:sue,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:uue,definePartsStyle:Rh}=hr(eie.keys),cue={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},due={lineHeight:1.2,overflow:"visible"},fue={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},hue=Rh({container:cue,label:due,closeButton:fue}),pue={sm:Rh({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Rh({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Rh({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},gue={subtle:Rh(e=>{var t;return{container:(t=Fv.variants)==null?void 0:t.subtle(e)}}),solid:Rh(e=>{var t;return{container:(t=Fv.variants)==null?void 0:t.solid(e)}}),outline:Rh(e=>{var t;return{container:(t=Fv.variants)==null?void 0:t.outline(e)}})},mue=uue({variants:gue,baseStyle:hue,sizes:pue,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),sA,vue={...(sA=kn.baseStyle)==null?void 0:sA.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},lA,yue={outline:e=>{var t;return((t=kn.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=kn.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=kn.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((lA=kn.variants)==null?void 0:lA.unstyled.field)??{}},uA,cA,dA,fA,bue={xs:((uA=kn.sizes)==null?void 0:uA.xs.field)??{},sm:((cA=kn.sizes)==null?void 0:cA.sm.field)??{},md:((dA=kn.sizes)==null?void 0:dA.md.field)??{},lg:((fA=kn.sizes)==null?void 0:fA.lg.field)??{}},Sue={baseStyle:vue,sizes:bue,variants:yue,defaultProps:{size:"md",variant:"outline"}},Z3=yi("tooltip-bg"),h6=yi("tooltip-fg"),xue=yi("popper-arrow-bg"),wue={bg:Z3.reference,color:h6.reference,[Z3.variable]:"colors.gray.700",[h6.variable]:"colors.whiteAlpha.900",_dark:{[Z3.variable]:"colors.gray.300",[h6.variable]:"colors.gray.900"},[xue.variable]:Z3.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},Cue={baseStyle:wue},_ue={Accordion:zie,Alert:Kie,Avatar:aoe,Badge:Fv,Breadcrumb:moe,Button:koe,Checkbox:X4,CloseButton:Foe,Code:Woe,Container:Goe,Divider:Zoe,Drawer:lae,Editable:gae,Form:xae,FormError:Pae,FormLabel:Lae,Heading:Mae,Input:kn,Kbd:Hae,Link:Wae,List:Kae,Menu:ose,Modal:mse,NumberInput:Ese,PinInput:Ase,Popover:zse,Progress:Kse,Radio:ele,Select:sle,Skeleton:ule,SkipLink:dle,Slider:wle,Spinner:kle,Stat:Ile,Switch:Fle,Table:qle,Tabs:lue,Tag:mue,Textarea:Sue,Tooltip:Cue,Card:Aoe},kue={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Eue=kue,Pue={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Tue=Pue,Lue={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},Aue=Lue,Oue={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Mue=Oue,Iue={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},Rue=Iue,Due={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Nue={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},jue={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Bue={property:Due,easing:Nue,duration:jue},$ue=Bue,Fue={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},zue=Fue,Hue={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Vue=Hue,Wue={breakpoints:Tue,zIndices:zue,radii:Mue,blur:Vue,colors:Aue,...fB,sizes:uB,shadows:Rue,space:lB,borders:Eue,transition:$ue},Uue={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},Gue={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},que="ltr",Yue={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},Kue={semanticTokens:Uue,direction:que,...Wue,components:_ue,styles:Gue,config:Yue},Xue=typeof Element<"u",Zue=typeof Map=="function",Que=typeof Set=="function",Jue=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function h4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!h4(e[r],t[r]))return!1;return!0}var o;if(Zue&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!h4(r.value[1],t.get(r.value[0])))return!1;return!0}if(Que&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Jue&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(Xue&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!h4(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var ece=function(t,n){try{return h4(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function m0(){const e=w.useContext(w2);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function mB(){const e=gy(),t=m0();return{...e,theme:t}}function tce(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__breakpoints)==null?void 0:o.asArray)==null?void 0:a[i]};return r(t)??r(n)??n}function nce(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__cssMap)==null?void 0:o[i])==null?void 0:a.value};return r(t)??r(n)??n}function rce(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{if(e==="breakpoints")return tce(o,l,a[u]??l);const d=`${e}.${l}`;return nce(o,d,a[u]??l)});return Array.isArray(t)?s:s[0]}}function ice(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=w.useMemo(()=>Qte(n),[n]);return N.createElement(sre,{theme:i},N.createElement(oce,{root:t}),r)}function oce({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return N.createElement(DS,{styles:n=>({[t]:n.__cssVars})})}Cre({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function ace(){const{colorMode:e}=gy();return N.createElement(DS,{styles:t=>{const n=Zj(t,"styles.global"),r=eB(n,{theme:t,colorMode:e});return r?Lj(r)(t):void 0}})}var sce=new Set([...ene,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),lce=new Set(["htmlWidth","htmlHeight","htmlSize"]);function uce(e){return lce.has(e)||!sce.has(e)}var cce=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=Qj(a,(h,m)=>nne(m)),l=eB(e,t),u=Object.assign({},i,l,Jj(s),o),d=Lj(u)(t.theme);return r?[d,r]:d};function p6(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=uce);const i=cce({baseStyle:n}),o=p7(e,r)(i);return N.forwardRef(function(l,u){const{colorMode:d,forced:h}=gy();return N.createElement(o,{ref:u,"data-theme":h?d:void 0,...l})})}function Ae(e){return w.forwardRef(e)}function vB(e,t={}){const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=mB(),a=e?Zj(i,`components.${e}`):void 0,s=n||a,l=Gl({theme:i,colorMode:o},(s==null?void 0:s.defaultProps)??{},Jj(vre(r,["children"]))),u=w.useRef({});if(s){const h=fne(s)(l);ece(u.current,h)||(u.current=h)}return u.current}function Oo(e,t={}){return vB(e,t)}function Oi(e,t={}){return vB(e,t)}function dce(){const e=new Map;return new Proxy(p6,{apply(t,n,r){return p6(...r)},get(t,n){return e.has(n)||e.set(n,p6(n)),e.get(n)}})}var Ce=dce();function fce(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Pn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o}=e,a=w.createContext(void 0);a.displayName=t;function s(){var l;const u=w.useContext(a);if(!u&&n){const d=new Error(o??fce(r,i));throw d.name="ContextError",(l=Error.captureStackTrace)==null||l.call(Error,d,s),d}return u}return[a.Provider,s,a]}function hce(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Hn(...e){return t=>{e.forEach(n=>{hce(n,t)})}}function pce(...e){return w.useMemo(()=>Hn(...e),e)}function hA(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var gce=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function pA(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function gA(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var S7=typeof window<"u"?w.useLayoutEffect:w.useEffect,Q4=e=>e,mce=class{constructor(){sn(this,"descendants",new Map);sn(this,"register",e=>{if(e!=null)return gce(e)?this.registerNode(e):t=>{this.registerNode(t,e)}});sn(this,"unregister",e=>{this.descendants.delete(e);const t=hA(Array.from(this.descendants.keys()));this.assignIndex(t)});sn(this,"destroy",()=>{this.descendants.clear()});sn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})});sn(this,"count",()=>this.descendants.size);sn(this,"enabledCount",()=>this.enabledValues().length);sn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index));sn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled));sn(this,"item",e=>{if(this.count()!==0)return this.values()[e]});sn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]});sn(this,"first",()=>this.item(0));sn(this,"firstEnabled",()=>this.enabledItem(0));sn(this,"last",()=>this.item(this.descendants.size-1));sn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)});sn(this,"indexOf",e=>{var t;return e?((t=this.descendants.get(e))==null?void 0:t.index)??-1:-1});sn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e)));sn(this,"next",(e,t=!0)=>{const n=pA(e,this.count(),t);return this.item(n)});sn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=pA(r,this.enabledCount(),t);return this.enabledItem(i)});sn(this,"prev",(e,t=!0)=>{const n=gA(e,this.count()-1,t);return this.item(n)});sn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=gA(r,this.enabledCount()-1,t);return this.enabledItem(i)});sn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=hA(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function vce(){const e=w.useRef(new mce);return S7(()=>()=>e.current.destroy()),e.current}var[yce,yB]=Pn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function bce(e){const t=yB(),[n,r]=w.useState(-1),i=w.useRef(null);S7(()=>()=>{i.current&&t.unregister(i.current)},[]),S7(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=Q4(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:Hn(o,i)}}function bB(){return[Q4(yce),()=>Q4(yB()),()=>vce(),i=>bce(i)]}var Qr=(...e)=>e.filter(Boolean).join(" "),mA={path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})),viewBox:"0 0 24 24"},Na=Ae((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,d=Qr("chakra-icon",s),h={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},m={ref:t,focusable:o,className:d,__css:h},v=r??mA.viewBox;if(n&&typeof n!="string")return N.createElement(Ce.svg,{as:n,...m,...u});const b=a??mA.path;return N.createElement(Ce.svg,{verticalAlign:"middle",viewBox:v,...m,...u},b)});Na.displayName="Icon";function yt(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=w.Children.toArray(e.path),a=Ae((s,l)=>N.createElement(Na,{ref:l,viewBox:t,...i,...s},o.length?o:N.createElement("path",{fill:"currentColor",d:n})));return a.displayName=r,a}function Er(e,t=[]){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function $S(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,v)=>m!==v}=e,o=Er(r),a=Er(i),[s,l]=w.useState(n),u=t!==void 0,d=u?t:s,h=Er(m=>{const b=typeof m=="function"?m(d):m;a(d,b)&&(u||l(b),o(b))},[u,o,d,a]);return[d,h]}const j_=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),FS=w.createContext({});function Sce(){return w.useContext(FS).visualElement}const v0=w.createContext(null),ip=typeof document<"u",J4=ip?w.useLayoutEffect:w.useEffect,SB=w.createContext({strict:!1});function xce(e,t,n,r){const i=Sce(),o=w.useContext(SB),a=w.useContext(v0),s=w.useContext(j_).reducedMotion,l=w.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return J4(()=>{u&&u.render()}),w.useEffect(()=>{u&&u.animationState&&u.animationState.animateChanges()}),J4(()=>()=>u&&u.notify("Unmount"),[]),u}function Ug(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wce(e,t,n){return w.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ug(n)&&(n.current=r))},[t])}function E2(e){return typeof e=="string"||Array.isArray(e)}function zS(e){return typeof e=="object"&&typeof e.start=="function"}const Cce=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function HS(e){return zS(e.animate)||Cce.some(t=>E2(e[t]))}function xB(e){return Boolean(HS(e)||e.variants)}function _ce(e,t){if(HS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||E2(n)?n:void 0,animate:E2(r)?r:void 0}}return e.inherit!==!1?t:{}}function kce(e){const{initial:t,animate:n}=_ce(e,w.useContext(FS));return w.useMemo(()=>({initial:t,animate:n}),[vA(t),vA(n)])}function vA(e){return Array.isArray(e)?e.join(" "):e}const Fu=e=>({isEnabled:t=>e.some(n=>!!t[n])}),P2={measureLayout:Fu(["layout","layoutId","drag"]),animation:Fu(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:Fu(["exit"]),drag:Fu(["drag","dragControls"]),focus:Fu(["whileFocus"]),hover:Fu(["whileHover","onHoverStart","onHoverEnd"]),tap:Fu(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Fu(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:Fu(["whileInView","onViewportEnter","onViewportLeave"])};function Ece(e){for(const t in e)t==="projectionNodeConstructor"?P2.projectionNodeConstructor=e[t]:P2[t].Component=e[t]}function VS(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Wv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Pce=1;function Tce(){return VS(()=>{if(Wv.hasEverUpdated)return Pce++})}const B_=w.createContext({});class Lce extends N.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const wB=w.createContext({}),Ace=Symbol.for("motionComponentSymbol");function Oce({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&Ece(e);function a(l,u){const d={...w.useContext(j_),...l,layoutId:Mce(l)},{isStatic:h}=d;let m=null;const v=kce(l),b=h?void 0:Tce(),S=i(l,h);if(!h&&ip){v.visualElement=xce(o,S,d,t);const _=w.useContext(SB).strict,E=w.useContext(wB);v.visualElement&&(m=v.visualElement.loadFeatures(d,_,e,b,n||P2.projectionNodeConstructor,E))}return w.createElement(Lce,{visualElement:v.visualElement,props:d},m,w.createElement(FS.Provider,{value:v},r(o,l,b,wce(S,v.visualElement,u),S,h,v.visualElement)))}const s=w.forwardRef(a);return s[Ace]=o,s}function Mce({layoutId:e}){const t=w.useContext(B_).id;return t&&e!==void 0?t+"-"+e:e}function Ice(e){function t(r,i={}){return Oce(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const Rce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function $_(e){return typeof e!="string"||e.includes("-")?!1:!!(Rce.indexOf(e)>-1||/[A-Z]/.test(e))}const e5={};function Dce(e){Object.assign(e5,e)}const t5=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],y0=new Set(t5);function CB(e,{layout:t,layoutId:n}){return y0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!e5[e]||e==="opacity")}const su=e=>!!(e!=null&&e.getVelocity),Nce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jce=(e,t)=>t5.indexOf(e)-t5.indexOf(t);function Bce({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";t.sort(jce);for(const s of t)a+=`${Nce[s]||s}(${e[s]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}function _B(e){return e.startsWith("--")}const $ce=(e,t)=>t&&typeof e=="number"?t.transform(e):e,kB=(e,t)=>n=>Math.max(Math.min(n,t),e),Uv=e=>e%1?Number(e.toFixed(5)):e,T2=/(-)?([\d]*\.?[\d])+/g,x7=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Fce=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function by(e){return typeof e=="string"}const op={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Gv=Object.assign(Object.assign({},op),{transform:kB(0,1)}),Q3=Object.assign(Object.assign({},op),{default:1}),Sy=e=>({test:t=>by(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),fd=Sy("deg"),Ql=Sy("%"),Lt=Sy("px"),zce=Sy("vh"),Hce=Sy("vw"),yA=Object.assign(Object.assign({},Ql),{parse:e=>Ql.parse(e)/100,transform:e=>Ql.transform(e*100)}),F_=(e,t)=>n=>Boolean(by(n)&&Fce.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),EB=(e,t,n)=>r=>{if(!by(r))return r;const[i,o,a,s]=r.match(T2);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},kh={test:F_("hsl","hue"),parse:EB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ql.transform(Uv(t))+", "+Ql.transform(Uv(n))+", "+Uv(Gv.transform(r))+")"},Vce=kB(0,255),g6=Object.assign(Object.assign({},op),{transform:e=>Math.round(Vce(e))}),_d={test:F_("rgb","red"),parse:EB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+g6.transform(e)+", "+g6.transform(t)+", "+g6.transform(n)+", "+Uv(Gv.transform(r))+")"};function Wce(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const w7={test:F_("#"),parse:Wce,transform:_d.transform},wo={test:e=>_d.test(e)||w7.test(e)||kh.test(e),parse:e=>_d.test(e)?_d.parse(e):kh.test(e)?kh.parse(e):w7.parse(e),transform:e=>by(e)?e:e.hasOwnProperty("red")?_d.transform(e):kh.transform(e)},PB="${c}",TB="${n}";function Uce(e){var t,n,r,i;return isNaN(e)&&by(e)&&((n=(t=e.match(T2))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((i=(r=e.match(x7))===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0}function LB(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(x7);r&&(n=r.length,e=e.replace(x7,PB),t.push(...r.map(wo.parse)));const i=e.match(T2);return i&&(e=e.replace(T2,TB),t.push(...i.map(op.parse))),{values:t,numColors:n,tokenised:e}}function AB(e){return LB(e).values}function OB(e){const{values:t,numColors:n,tokenised:r}=LB(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function qce(e){const t=AB(e);return OB(e)(t.map(Gce))}const tc={test:Uce,parse:AB,createTransformer:OB,getAnimatableNone:qce},Yce=new Set(["brightness","contrast","saturate","opacity"]);function Kce(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(T2)||[];if(!r)return e;const i=n.replace(r,"");let o=Yce.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const Xce=/([a-z-]*)\(.*?\)/g,C7=Object.assign(Object.assign({},tc),{getAnimatableNone:e=>{const t=e.match(Xce);return t?t.map(Kce).join(" "):e}}),bA={...op,transform:Math.round},MB={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,size:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,rotate:fd,rotateX:fd,rotateY:fd,rotateZ:fd,scale:Q3,scaleX:Q3,scaleY:Q3,scaleZ:Q3,skew:fd,skewX:fd,skewY:fd,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:Gv,originX:yA,originY:yA,originZ:Lt,zIndex:bA,fillOpacity:Gv,strokeOpacity:Gv,numOctaves:bA};function z_(e,t,n,r){const{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let u=!1,d=!1,h=!0;for(const m in t){const v=t[m];if(_B(m)){o[m]=v;continue}const b=MB[m],S=$ce(v,b);if(y0.has(m)){if(u=!0,a[m]=S,s.push(m),!h)continue;v!==(b.default||0)&&(h=!1)}else m.startsWith("origin")?(d=!0,l[m]=S):i[m]=S}if(t.transform||(u||r?i.transform=Bce(e,n,h,r):i.transform&&(i.transform="none")),d){const{originX:m="50%",originY:v="50%",originZ:b=0}=l;i.transformOrigin=`${m} ${v} ${b}`}}const H_=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function IB(e,t,n){for(const r in t)!su(t[r])&&!CB(r,n)&&(e[r]=t[r])}function Zce({transformTemplate:e},t,n){return w.useMemo(()=>{const r=H_();return z_(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function Qce(e,t,n){const r=e.style||{},i={};return IB(i,r,e),Object.assign(i,Zce(e,t,n)),e.transformValues?e.transformValues(i):i}function Jce(e,t,n){const r={},i=Qce(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),r.style=i,r}const ede=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],tde=["whileTap","onTap","onTapStart","onTapCancel"],nde=["onPan","onPanStart","onPanSessionStart","onPanEnd"],rde=["whileInView","onViewportEnter","onViewportLeave","viewport"],ide=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...rde,...tde,...ede,...nde]);function n5(e){return ide.has(e)}let RB=e=>!n5(e);function ode(e){e&&(RB=t=>t.startsWith("on")?!n5(t):e(t))}try{ode(require("@emotion/is-prop-valid").default)}catch{}function ade(e,t,n){const r={};for(const i in e)(RB(i)||n===!0&&n5(i)||!t&&!n5(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function SA(e,t,n){return typeof e=="string"?e:Lt.transform(t+n*e)}function sde(e,t,n){const r=SA(t,e.x,e.width),i=SA(n,e.y,e.height);return`${r} ${i}`}const lde={offset:"stroke-dashoffset",array:"stroke-dasharray"},ude={offset:"strokeDashoffset",array:"strokeDasharray"};function cde(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?lde:ude;e[o.offset]=Lt.transform(-r);const a=Lt.transform(t),s=Lt.transform(n);e[o.array]=`${a} ${s}`}function V_(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,d){z_(e,l,u,d),e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=sde(v,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),o!==void 0&&cde(h,o,a,s,!1)}const DB=()=>({...H_(),attrs:{}});function dde(e,t){const n=w.useMemo(()=>{const r=DB();return V_(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};IB(r,e.style,e),n.style={...r,...n.style}}return n}function fde(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=($_(n)?dde:Jce)(r,a,s),h={...ade(r,typeof n=="string",e),...u,ref:o};return i&&(h["data-projection-id"]=i),w.createElement(n,h)}}const NB=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function jB(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const BB=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function $B(e,t,n,r){jB(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(BB.has(i)?i:NB(i),t.attrs[i])}function W_(e){const{style:t}=e,n={};for(const r in t)(su(t[r])||CB(r,e))&&(n[r]=t[r]);return n}function FB(e){const t=W_(e);for(const n in e)if(su(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function U_(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const L2=e=>Array.isArray(e),hde=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),zB=e=>L2(e)?e[e.length-1]||0:e;function p4(e){const t=su(e)?e.get():e;return hde(t)?t.toValue():t}function pde({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:gde(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const HB=e=>(t,n)=>{const r=w.useContext(FS),i=w.useContext(v0),o=()=>pde(e,t,r,i);return n?o():VS(o)};function gde(e,t,n,r){const i={},o=r(e);for(const m in o)i[m]=p4(o[m]);let{initial:a,animate:s}=e;const l=HS(e),u=xB(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?s:a;return h&&typeof h!="boolean"&&!zS(h)&&(Array.isArray(h)?h:[h]).forEach(v=>{const b=U_(e,v);if(!b)return;const{transitionEnd:S,transition:_,...E}=b;for(const k in E){let T=E[k];if(Array.isArray(T)){const A=d?T.length-1:0;T=T[A]}T!==null&&(i[k]=T)}for(const k in S)i[k]=S[k]}),i}const mde={useVisualState:HB({scrapeMotionValuesFromProps:FB,createRenderState:DB,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}V_(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),$B(t,n)}})},vde={useVisualState:HB({scrapeMotionValuesFromProps:W_,createRenderState:H_})};function yde(e,{forwardMotionProps:t=!1},n,r,i){return{...$_(e)?mde:vde,preloadedFeatures:n,useRender:fde(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}}var tr;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(tr||(tr={}));function WS(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function _7(e,t,n,r){w.useEffect(()=>{const i=e.current;if(n&&i)return WS(i,t,n,r)},[e,t,n,r])}function bde({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(tr.Focus,!0)},i=()=>{n&&n.setActive(tr.Focus,!1)};_7(t,"focus",e?r:void 0),_7(t,"blur",e?i:void 0)}function VB(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function WB(e){return!!e.touches}function Sde(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const xde={pageX:0,pageY:0};function wde(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||xde;return{x:r[t+"X"],y:r[t+"Y"]}}function Cde(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function G_(e,t="page"){return{point:WB(e)?wde(e,t):Cde(e,t)}}const UB=(e,t=!1)=>{const n=r=>e(r,G_(r));return t?Sde(n):n},_de=()=>ip&&window.onpointerdown===null,kde=()=>ip&&window.ontouchstart===null,Ede=()=>ip&&window.onmousedown===null,Pde={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Tde={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function GB(e){return _de()?e:kde()?Tde[e]:Ede()?Pde[e]:e}function Cm(e,t,n,r){return WS(e,GB(t),UB(n,t==="pointerdown"),r)}function r5(e,t,n,r){return _7(e,GB(t),n&&UB(n,t==="pointerdown"),r)}function qB(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const xA=qB("dragHorizontal"),wA=qB("dragVertical");function YB(e){let t=!1;if(e==="y")t=wA();else if(e==="x")t=xA();else{const n=xA(),r=wA();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function KB(){const e=YB(!0);return e?(e(),!1):!0}function CA(e,t,n){return(r,i)=>{!VB(r)||KB()||(e.animationState&&e.animationState.setActive(tr.Hover,t),n&&n(r,i))}}function Lde({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){r5(r,"pointerenter",e||n?CA(r,!0,e):void 0,{passive:!e}),r5(r,"pointerleave",t||n?CA(r,!1,t):void 0,{passive:!t})}const XB=(e,t)=>t?e===t?!0:XB(e,t.parentElement):!1;function q_(e){return w.useEffect(()=>()=>e(),[])}function ZB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),m6=.001,Ode=.01,_A=10,Mde=.05,Ide=1;function Rde({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;Ade(e<=_A*1e3);let a=1-t;a=o5(Mde,Ide,a),e=o5(Ode,_A,e/1e3),a<1?(i=u=>{const d=u*a,h=d*e,m=d-n,v=k7(u,a),b=Math.exp(-h);return m6-m/v*b},o=u=>{const h=u*a*e,m=h*n+n,v=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-h),S=k7(Math.pow(u,2),a);return(-i(u)+m6>0?-1:1)*((m-v)*b)/S}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-m6+d*h},o=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const s=5/e,l=Nde(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const Dde=12;function Nde(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function $de(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!kA(e,Bde)&&kA(e,jde)){const n=Rde(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function Y_(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=ZB(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:s,damping:l,mass:u,velocity:d,duration:h,isResolvedFromDuration:m}=$de(o),v=EA,b=EA;function S(){const _=d?-(d/1e3):0,E=n-t,k=l/(2*Math.sqrt(s*u)),T=Math.sqrt(s/u)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),k<1){const A=k7(T,k);v=M=>{const R=Math.exp(-k*T*M);return n-R*((_+k*T*E)/A*Math.sin(A*M)+E*Math.cos(A*M))},b=M=>{const R=Math.exp(-k*T*M);return k*T*R*(Math.sin(A*M)*(_+k*T*E)/A+E*Math.cos(A*M))-R*(Math.cos(A*M)*(_+k*T*E)-A*E*Math.sin(A*M))}}else if(k===1)v=A=>n-Math.exp(-T*A)*(E+(_+T*E)*A);else{const A=T*Math.sqrt(k*k-1);v=M=>{const R=Math.exp(-k*T*M),D=Math.min(A*M,300);return n-R*((_+k*T*E)*Math.sinh(D)+A*E*Math.cosh(D))/A}}}return S(),{next:_=>{const E=v(_);if(m)a.done=_>=h;else{const k=b(_)*1e3,T=Math.abs(k)<=r,A=Math.abs(n-E)<=i;a.done=T&&A}return a.value=a.done?n:E,a},flipTarget:()=>{d=-d,[t,n]=[n,t],S()}}}Y_.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const EA=e=>0,A2=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},zr=(e,t,n)=>-n*e+n*t+e;function v6(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function PA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=v6(l,s,e+1/3),o=v6(l,s,e),a=v6(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const Fde=(e,t,n)=>{const r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},zde=[w7,_d,kh],TA=e=>zde.find(t=>t.test(e)),QB=(e,t)=>{let n=TA(e),r=TA(t),i=n.parse(e),o=r.parse(t);n===kh&&(i=PA(i),n=_d),r===kh&&(o=PA(o),r=_d);const a=Object.assign({},i);return s=>{for(const l in a)l!=="alpha"&&(a[l]=Fde(i[l],o[l],s));return a.alpha=zr(i.alpha,o.alpha,s),n.transform(a)}},E7=e=>typeof e=="number",Hde=(e,t)=>n=>t(e(n)),US=(...e)=>e.reduce(Hde);function JB(e,t){return E7(e)?n=>zr(e,t,n):wo.test(e)?QB(e,t):t$(e,t)}const e$=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>JB(o,t[a]));return o=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=JB(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}};function LA(e){const t=tc.parse(e),n=t.length;let r=0,i=0,o=0;for(let a=0;a{const n=tc.createTransformer(t),r=LA(e),i=LA(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?US(e$(r.parsed,i.parsed),n):a=>`${a>0?t:e}`},Wde=(e,t)=>n=>zr(e,t,n);function Ude(e){if(typeof e=="number")return Wde;if(typeof e=="string")return wo.test(e)?QB:t$;if(Array.isArray(e))return e$;if(typeof e=="object")return Vde}function Gde(e,t,n){const r=[],i=n||Ude(e[0]),o=e.length-1;for(let a=0;an(A2(e,t,r))}function Yde(e,t){const n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let l=1;for(;li||l===r);l++);o=l-1}const s=A2(e[o],e[o+1],i);return t[o](s)}}function n$(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;i5(o===t.length),i5(!r||!Array.isArray(r)||r.length===o-1),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=Gde(t,r,i),s=o===2?qde(e,a):Yde(e,a);return n?l=>s(o5(e[0],e[o-1],l)):s}const GS=e=>t=>1-e(1-t),K_=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Kde=e=>t=>Math.pow(t,e),r$=e=>t=>t*t*((e+1)*t-e),Xde=e=>{const t=r$(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},i$=1.525,Zde=4/11,Qde=8/11,Jde=9/10,X_=e=>e,Z_=Kde(2),efe=GS(Z_),o$=K_(Z_),a$=e=>1-Math.sin(Math.acos(e)),Q_=GS(a$),tfe=K_(Q_),J_=r$(i$),nfe=GS(J_),rfe=K_(J_),ife=Xde(i$),ofe=4356/361,afe=35442/1805,sfe=16061/1805,a5=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-a5(1-e*2)):.5*a5(e*2-1)+.5;function cfe(e,t){return e.map(()=>t||o$).splice(0,e.length-1)}function dfe(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function ffe(e,t){return e.map(n=>n*t)}function g4({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){const o={done:!1,value:e},a=Array.isArray(t)?t:[e,t],s=ffe(r&&r.length===a.length?r:dfe(a),i);function l(){return n$(s,a,{ease:Array.isArray(n)?n:cfe(a,n)})}let u=l();return{next:d=>(o.value=u(d),o.done=d>=i,o),flipTarget:()=>{a.reverse(),u=l()}}}function hfe({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a={done:!1,value:t};let s=n*e;const l=t+s,u=o===void 0?l:o(l);return u!==l&&(s=u-t),{next:d=>{const h=-s*Math.exp(-d/r);return a.done=!(h>i||h<-i),a.value=a.done?u:u+h,a},flipTarget:()=>{}}}const AA={keyframes:g4,spring:Y_,decay:hfe};function pfe(e){if(Array.isArray(e.to))return g4;if(AA[e.type])return AA[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?g4:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Y_:g4}const s$=1/60*1e3,gfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),l$=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(gfe()),s$);function mfe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=mfe(()=>O2=!0),e),{}),yfe=xy.reduce((e,t)=>{const n=qS[t];return e[t]=(r,i=!1,o=!1)=>(O2||xfe(),n.schedule(r,i,o)),e},{}),bfe=xy.reduce((e,t)=>(e[t]=qS[t].cancel,e),{});xy.reduce((e,t)=>(e[t]=()=>qS[t].process(_m),e),{});const Sfe=e=>qS[e].process(_m),u$=e=>{O2=!1,_m.delta=P7?s$:Math.max(Math.min(e-_m.timestamp,vfe),1),_m.timestamp=e,T7=!0,xy.forEach(Sfe),T7=!1,O2&&(P7=!1,l$(u$))},xfe=()=>{O2=!0,P7=!0,T7||l$(u$)},wfe=()=>_m;function c$(e,t,n=0){return e-t-n}function Cfe(e,t,n=0,r=!0){return r?c$(t+-e,t,n):t-(e-t)+n}function _fe(e,t,n,r){return r?e>=t+n:e<=-n}const kfe=e=>{const t=({delta:n})=>e(n);return{start:()=>yfe.update(t,!0),stop:()=>bfe.update(t)}};function d$(e){var t,n,{from:r,autoplay:i=!0,driver:o=kfe,elapsed:a=0,repeat:s=0,repeatType:l="loop",repeatDelay:u=0,onPlay:d,onStop:h,onComplete:m,onRepeat:v,onUpdate:b}=e,S=ZB(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:_}=S,E,k=0,T=S.duration,A,M=!1,R=!0,D;const j=pfe(S);!((n=(t=j).needsInterpolation)===null||n===void 0)&&n.call(t,r,_)&&(D=n$([0,100],[r,_],{clamp:!1}),r=0,_=100);const z=j(Object.assign(Object.assign({},S),{from:r,to:_}));function H(){k++,l==="reverse"?(R=k%2===0,a=Cfe(a,T,u,R)):(a=c$(a,T,u),l==="mirror"&&z.flipTarget()),M=!1,v&&v()}function K(){E.stop(),m&&m()}function te($){if(R||($=-$),a+=$,!M){const W=z.next(Math.max(0,a));A=W.value,D&&(A=D(A)),M=R?W.done:a<=0}b==null||b(A),M&&(k===0&&(T??(T=a)),k{h==null||h(),E.stop()}}}function f$(e,t){return t?e*(1e3/t):0}function Efe({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:d,onUpdate:h,onComplete:m,onStop:v}){let b;function S(T){return n!==void 0&&Tr}function _(T){return n===void 0?r:r===void 0||Math.abs(n-T){var M;h==null||h(A),(M=T.onUpdate)===null||M===void 0||M.call(T,A)},onComplete:m,onStop:v}))}function k(T){E(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},T))}if(S(e))k({from:e,velocity:t,to:_(e)});else{let T=i*t+e;typeof u<"u"&&(T=u(T));const A=_(T),M=A===n?-1:1;let R,D;const j=z=>{R=D,D=z,t=f$(z-R,wfe().delta),(M===1&&z>A||M===-1&&zb==null?void 0:b.stop()}}const L7=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),OA=e=>L7(e)&&e.hasOwnProperty("z"),J3=(e,t)=>Math.abs(e-t);function ek(e,t){if(E7(e)&&E7(t))return J3(e,t);if(L7(e)&&L7(t)){const n=J3(e.x,t.x),r=J3(e.y,t.y),i=OA(e)&&OA(t)?J3(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}const h$=(e,t)=>1-3*t+3*e,p$=(e,t)=>3*t-6*e,g$=e=>3*e,s5=(e,t,n)=>((h$(t,n)*e+p$(t,n))*e+g$(t))*e,m$=(e,t,n)=>3*h$(t,n)*e*e+2*p$(t,n)*e+g$(t),Pfe=1e-7,Tfe=10;function Lfe(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=s5(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>Pfe&&++s=Ofe?Mfe(a,h,e,n):m===0?h:Lfe(a,s,s+eb,e,n)}return a=>a===0||a===1?a:s5(o(a),t,r)}function Rfe({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(!1),s=w.useRef(null),l={passive:!(t||e||n||v)};function u(){s.current&&s.current(),s.current=null}function d(){return u(),a.current=!1,i.animationState&&i.animationState.setActive(tr.Tap,!1),!KB()}function h(b,S){d()&&(XB(i.current,b.target)?e&&e(b,S):n&&n(b,S))}function m(b,S){d()&&n&&n(b,S)}function v(b,S){u(),!a.current&&(a.current=!0,s.current=US(Cm(window,"pointerup",h,l),Cm(window,"pointercancel",m,l)),i.animationState&&i.animationState.setActive(tr.Tap,!0),t&&t(b,S))}r5(i,"pointerdown",o?v:void 0,l),q_(u)}const Dfe="production",v$=typeof process>"u"||process.env===void 0?Dfe:"production",MA=new Set;function y$(e,t,n){e||MA.has(t)||(console.warn(t),n&&console.warn(n),MA.add(t))}const A7=new WeakMap,y6=new WeakMap,Nfe=e=>{const t=A7.get(e.target);t&&t(e)},jfe=e=>{e.forEach(Nfe)};function Bfe({root:e,...t}){const n=e||document;y6.has(n)||y6.set(n,{});const r=y6.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(jfe,{root:e,...t})),r[i]}function $fe(e,t,n){const r=Bfe(t);return A7.set(e,n),r.observe(e),()=>{A7.delete(e),r.unobserve(e)}}function Ffe({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){const o=w.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?Vfe:Hfe)(a,o.current,e,i)}const zfe={some:0,all:1};function Hfe(e,t,n,{root:r,margin:i,amount:o="some",once:a}){w.useEffect(()=>{if(!e||!n.current)return;const s={root:r==null?void 0:r.current,rootMargin:i,threshold:typeof o=="number"?o:zfe[o]},l=u=>{const{isIntersecting:d}=u;if(t.isInView===d||(t.isInView=d,a&&!d&&t.hasEnteredView))return;d&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(tr.InView,d);const h=n.getProps(),m=d?h.onViewportEnter:h.onViewportLeave;m&&m(u)};return $fe(n.current,s,l)},[e,r,i,o])}function Vfe(e,t,n,{fallback:r=!0}){w.useEffect(()=>{!e||!r||(v$!=="production"&&y$(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:i}=n.getProps();i&&i(null),n.animationState&&n.animationState.setActive(tr.InView,!0)}))},[e])}const kd=e=>t=>(e(t),null),Wfe={inView:kd(Ffe),tap:kd(Rfe),focus:kd(bde),hover:kd(Lde)};function tk(){const e=w.useContext(v0);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=w.useId();return w.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function Ufe(){return Gfe(w.useContext(v0))}function Gfe(e){return e===null?!0:e.isPresent}function b$(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,qfe={linear:X_,easeIn:Z_,easeInOut:o$,easeOut:efe,circIn:a$,circInOut:tfe,circOut:Q_,backIn:J_,backInOut:rfe,backOut:nfe,anticipate:ife,bounceIn:lfe,bounceInOut:ufe,bounceOut:a5},IA=e=>{if(Array.isArray(e)){i5(e.length===4);const[t,n,r,i]=e;return Ife(t,n,r,i)}else if(typeof e=="string")return qfe[e];return e},Yfe=e=>Array.isArray(e)&&typeof e[0]!="number",RA=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&tc.test(t)&&!t.startsWith("url(")),oh=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),tb=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),b6=()=>({type:"keyframes",ease:"linear",duration:.3}),Kfe=e=>({type:"keyframes",duration:.8,values:e}),DA={x:oh,y:oh,z:oh,rotate:oh,rotateX:oh,rotateY:oh,rotateZ:oh,scaleX:tb,scaleY:tb,scale:tb,opacity:b6,backgroundColor:b6,color:b6,default:tb},Xfe=(e,t)=>{let n;return L2(t)?n=Kfe:n=DA[e]||DA.default,{to:t,...n(t)}},Zfe={...MB,color:wo,backgroundColor:wo,outlineColor:wo,fill:wo,stroke:wo,borderColor:wo,borderTopColor:wo,borderRightColor:wo,borderBottomColor:wo,borderLeftColor:wo,filter:C7,WebkitFilter:C7},nk=e=>Zfe[e];function rk(e,t){var n;let r=nk(e);return r!==C7&&(r=tc),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const Qfe={current:!1},S$=1/60*1e3,Jfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),x$=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Jfe()),S$);function ehe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=ehe(()=>M2=!0),e),{}),Ys=wy.reduce((e,t)=>{const n=YS[t];return e[t]=(r,i=!1,o=!1)=>(M2||rhe(),n.schedule(r,i,o)),e},{}),Uh=wy.reduce((e,t)=>(e[t]=YS[t].cancel,e),{}),S6=wy.reduce((e,t)=>(e[t]=()=>YS[t].process(km),e),{}),nhe=e=>YS[e].process(km),w$=e=>{M2=!1,km.delta=O7?S$:Math.max(Math.min(e-km.timestamp,the),1),km.timestamp=e,M7=!0,wy.forEach(nhe),M7=!1,M2&&(O7=!1,x$(w$))},rhe=()=>{M2=!0,O7=!0,M7||x$(w$)},I7=()=>km;function C$(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Uh.read(r),e(o-t))};return Ys.read(r,!0),()=>Uh.read(r)}function ihe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...u}){return!!Object.keys(u).length}function ohe({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){const a={...o};return t&&(a.offset=t),o.duration&&(a.duration=l5(o.duration)),o.repeatDelay&&(a.repeatDelay=l5(o.repeatDelay)),e&&(a.ease=Yfe(e)?e.map(IA):IA(e)),o.type==="tween"&&(a.type="keyframes"),(n||i||r)&&(n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),o.type!=="spring"&&(a.type="keyframes"),a}function ahe(e,t){var n,r;return(r=(n=(ik(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function she(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function lhe(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),she(t),ihe(e)||(e={...e,...Xfe(n,t.to)}),{...t,...ohe(e)}}function uhe(e,t,n,r,i){const o=ik(r,e)||{};let a=o.from!==void 0?o.from:t.get();const s=RA(e,n);a==="none"&&s&&typeof n=="string"?a=rk(e,n):NA(a)&&typeof n=="string"?a=jA(n):!Array.isArray(n)&&NA(n)&&typeof a=="string"&&(n=jA(a));const l=RA(e,a);function u(){const h={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:m=>t.set(m)};return o.type==="inertia"||o.type==="decay"?Efe({...h,...o}):d$({...lhe(o,h,e),onUpdate:m=>{h.onUpdate(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{h.onComplete(),o.onComplete&&o.onComplete()}})}function d(){const h=zB(n);return t.set(h),i(),o.onUpdate&&o.onUpdate(h),o.onComplete&&o.onComplete(),{stop:()=>{}}}return!l||!s||o.type===!1?d:u}function NA(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function jA(e){return typeof e=="number"?0:rk("",e)}function ik(e,t){return e[t]||e.default||e}function ok(e,t,n,r={}){return Qfe.current&&(r={type:!1}),t.start(i=>{let o;const a=uhe(e,t,n,r,i),s=ahe(r,e),l=()=>o=a();let u;return s?u=C$(l,l5(s)):l(),()=>{u&&u(),o&&o.stop()}})}const che=e=>/^\-?\d*\.?\d+$/.test(e),dhe=e=>/^0[^.\s]+$/.test(e);function ak(e,t){e.indexOf(t)===-1&&e.push(t)}function sk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class qv{constructor(){this.subscriptions=[]}add(t){return ak(this.subscriptions,t),()=>sk(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class hhe{constructor(t){this.version="7.6.9",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new qv,this.velocityUpdateSubscribers=new qv,this.renderSubscribers=new qv,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=I7();this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,Ys.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Ys.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=fhe(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?f$(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Gm(e){return new hhe(e)}const _$=e=>t=>t.test(e),phe={test:e=>e==="auto",parse:e=>e},k$=[op,Lt,Ql,fd,Hce,zce,phe],U1=e=>k$.find(_$(e)),ghe=[...k$,wo,tc],mhe=e=>ghe.find(_$(e));function vhe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function yhe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function KS(e,t,n){const r=e.getProps();return U_(r,t,n!==void 0?n:r.custom,vhe(e),yhe(e))}function bhe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Gm(n))}function She(e,t){const n=KS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=zB(o[a]);bhe(e,a,s)}}function xhe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;sR7(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=R7(e,t,n);else{const i=typeof t=="function"?KS(e,t,n.custom):t;r=E$(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function R7(e,t,n={}){var r;const i=KS(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const a=i?()=>E$(e,i,n):()=>Promise.resolve(),s=!((r=e.variantChildren)===null||r===void 0)&&r.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=o;return khe(e,t,d+u,h,m,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[a,s]:[s,a];return u().then(d)}else return Promise.all([a(),s(n.delay)])}function E$(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const u=e.getValue("willChange");r&&(a=r);const d=[],h=i&&((o=e.animationState)===null||o===void 0?void 0:o.getState()[i]);for(const m in l){const v=e.getValue(m),b=l[m];if(!v||b===void 0||h&&Phe(h,m))continue;let S={delay:n,...a};e.shouldReduceMotion&&y0.has(m)&&(S={...S,type:!1,delay:0});let _=ok(m,v,b,S);u5(u)&&(u.add(m),_=_.then(()=>u.remove(m))),d.push(_)}return Promise.all(d).then(()=>{s&&She(e,s)})}function khe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(Ehe).forEach((u,d)=>{a.push(R7(u,t,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function Ehe(e,t){return e.sortNodePosition(t)}function Phe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const lk=[tr.Animate,tr.InView,tr.Focus,tr.Hover,tr.Tap,tr.Drag,tr.Exit],The=[...lk].reverse(),Lhe=lk.length;function Ahe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>_he(e,n,r)))}function Ohe(e){let t=Ahe(e);const n=Ihe();let r=!0;const i=(l,u)=>{const d=KS(e,u);if(d){const{transition:h,transitionEnd:m,...v}=d;l={...l,...v,...m}}return l};function o(l){t=l(e)}function a(l,u){var d;const h=e.getProps(),m=e.getVariantContext(!0)||{},v=[],b=new Set;let S={},_=1/0;for(let k=0;k_&&R;const K=Array.isArray(M)?M:[M];let te=K.reduce(i,{});D===!1&&(te={});const{prevResolvedValues:G={}}=A,$={...G,...te},W=X=>{H=!0,b.delete(X),A.needsAnimating[X]=!0};for(const X in $){const Z=te[X],U=G[X];S.hasOwnProperty(X)||(Z!==U?L2(Z)&&L2(U)?!b$(Z,U)||z?W(X):A.protectedKeys[X]=!0:Z!==void 0?W(X):b.add(X):Z!==void 0&&b.has(X)?W(X):A.protectedKeys[X]=!0)}A.prevProp=M,A.prevResolvedValues=te,A.isActive&&(S={...S,...te}),r&&e.blockInitialAnimation&&(H=!1),H&&!j&&v.push(...K.map(X=>({animation:X,options:{type:T,...l}})))}if(b.size){const k={};b.forEach(T=>{const A=e.getBaseTarget(T);A!==void 0&&(k[T]=A)}),v.push({animation:k})}let E=Boolean(v.length);return r&&h.initial===!1&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,E?t(v):Promise.resolve()}function s(l,u,d){var h;if(n[l].isActive===u)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(v=>{var b;return(b=v.animationState)===null||b===void 0?void 0:b.setActive(l,u)}),n[l].isActive=u;const m=a(d,l);for(const v in n)n[v].protectedKeys={};return m}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function Mhe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!b$(t,e):!1}function ah(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ihe(){return{[tr.Animate]:ah(!0),[tr.InView]:ah(),[tr.Hover]:ah(),[tr.Tap]:ah(),[tr.Drag]:ah(),[tr.Focus]:ah(),[tr.Exit]:ah()}}const Rhe={animation:kd(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=Ohe(e)),zS(t)&&w.useEffect(()=>t.subscribe(e),[t])}),exit:kd(e=>{const{custom:t,visualElement:n}=e,[r,i]=tk(),o=w.useContext(v0);w.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(tr.Exit,!r,{custom:o&&o.custom||t});a&&!r&&a.then(i)},[r])})};class P${constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=w6(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=ek(u.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:m}=u,{timestamp:v}=I7();this.history.push({...m,timestamp:v});const{onStart:b,onMove:S}=this.handlers;d||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{if(this.lastMoveEvent=u,this.lastMoveEventInfo=x6(d,this.transformPagePoint),VB(u)&&u.buttons===0){this.handlePointerUp(u,d);return}Ys.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{this.end();const{onEnd:h,onSessionEnd:m}=this.handlers,v=w6(x6(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,v),m&&m(u,v)},WB(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const i=G_(t),o=x6(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=I7();this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,w6(o,this.history)),this.removeListeners=US(Cm(window,"pointermove",this.handlePointerMove),Cm(window,"pointerup",this.handlePointerUp),Cm(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Uh.update(this.updatePoint)}}function x6(e,t){return t?{point:t(e.point)}:e}function BA(e,t){return{x:e.x-t.x,y:e.y-t.y}}function w6({point:e},t){return{point:e,delta:BA(e,T$(t)),offset:BA(e,Dhe(t)),velocity:Nhe(t,.1)}}function Dhe(e){return e[0]}function T$(e){return e[e.length-1]}function Nhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=T$(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>l5(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Ma(e){return e.max-e.min}function $A(e,t=0,n=.01){return ek(e,t)n&&(e=r?zr(n,e,r.max):Math.min(e,n)),e}function VA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function $he(e,{top:t,left:n,bottom:r,right:i}){return{x:VA(e.x,n,i),y:VA(e.y,t,r)}}function WA(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=A2(t.min,t.max-r,e.min):r>i&&(n=A2(e.min,e.max-i,t.min)),o5(0,1,n)}function Hhe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const D7=.35;function Vhe(e=D7){return e===!1?e=0:e===!0&&(e=D7),{x:UA(e,"left","right"),y:UA(e,"top","bottom")}}function UA(e,t,n){return{min:GA(e,t),max:GA(e,n)}}function GA(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const qA=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xv=()=>({x:qA(),y:qA()}),YA=()=>({min:0,max:0}),pi=()=>({x:YA(),y:YA()});function Nl(e){return[e("x"),e("y")]}function L$({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Whe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Uhe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function C6(e){return e===void 0||e===1}function N7({scale:e,scaleX:t,scaleY:n}){return!C6(e)||!C6(t)||!C6(n)}function fh(e){return N7(e)||A$(e)||e.z||e.rotate||e.rotateX||e.rotateY}function A$(e){return KA(e.x)||KA(e.y)}function KA(e){return e&&e!=="0%"}function c5(e,t,n){const r=e-n,i=t*r;return n+i}function XA(e,t,n,r,i){return i!==void 0&&(e=c5(e,i,r)),c5(e,n,r)+t}function j7(e,t=0,n=1,r,i){e.min=XA(e.min,t,n,r,i),e.max=XA(e.max,t,n,r,i)}function O$(e,{x:t,y:n}){j7(e.x,t.translate,t.scale,t.originPoint),j7(e.y,n.translate,n.scale,n.originPoint)}function Ghe(e,t,n,r=!1){var i,o;const a=n.length;if(!a)return;t.x=t.y=1;let s,l;for(let u=0;u{this.stopAnimation(),n&&this.snapToCursor(G_(s,"page").point)},i=(s,l)=>{var u;const{drag:d,dragPropagation:h,onDragStart:m}=this.getProps();d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=YB(d),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nl(v=>{var b,S;let _=this.getAxisMotionValue(v).get()||0;if(Ql.test(_)){const E=(S=(b=this.visualElement.projection)===null||b===void 0?void 0:b.layout)===null||S===void 0?void 0:S.layoutBox[v];E&&(_=Ma(E)*(parseFloat(_)/100))}this.originPoint[v]=_}),m==null||m(s,l),(u=this.visualElement.animationState)===null||u===void 0||u.setActive(tr.Drag,!0))},o=(s,l)=>{const{dragPropagation:u,dragDirectionLock:d,onDirectionLock:h,onDrag:m}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:v}=l;if(d&&this.currentDirection===null){this.currentDirection=Qhe(v),this.currentDirection!==null&&(h==null||h(this.currentDirection));return}this.updateAxis("x",l.point,v),this.updateAxis("y",l.point,v),this.visualElement.render(),m==null||m(s,l)},a=(s,l)=>this.stop(s,l);this.panSession=new P$(t,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o==null||o(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(tr.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!nb(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Bhe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Ug(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=$he(r.layoutBox,t):this.constraints=!1,this.elastic=Vhe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Nl(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Hhe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ug(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Khe(r,i.root,this.visualElement.getTransformPagePoint());let a=Fhe(i.layout.layoutBox,o);if(n){const s=n(Whe(a));this.hasMutatedConstraints=!!s,s&&(a=L$(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Nl(d=>{var h;if(!nb(d,n,this.currentDirection))return;let m=(h=l==null?void 0:l[d])!==null&&h!==void 0?h:{};a&&(m={min:0,max:0});const v=i?200:1e6,b=i?40:1e7,S={type:"inertia",velocity:r?t[d]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(d,S)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ok(t,r,0,n)}stopAnimation(){Nl(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){Nl(n=>{const{drag:r}=this.getProps();if(!nb(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-zr(a,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!Ug(r)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Nl(s=>{const l=this.getAxisMotionValue(s);if(l){const u=l.get();o[s]=zhe({min:u,max:u},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",(t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Nl(s=>{if(!nb(s,n,null))return;const l=this.getAxisMotionValue(s),{min:u,max:d}=this.constraints[s];l.set(zr(u,d,o[s]))})}addListeners(){var t;if(!this.visualElement.current)return;Xhe.set(this.visualElement,this);const n=this.visualElement.current,r=Cm(n,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps();d&&h&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();Ug(u)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",i);o&&!o.layout&&((t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout()),i();const s=WS(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Nl(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=u[h].translate,m.set(m.get()+u[h].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),l==null||l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=D7,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function nb(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Qhe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function Jhe(e){const{dragControls:t,visualElement:n}=e,r=VS(()=>new Zhe(n));w.useEffect(()=>t&&t.subscribe(r),[r,t]),w.useEffect(()=>r.addListeners(),[r])}function epe({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(null),{transformPagePoint:s}=w.useContext(j_),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(d,h)=>{a.current=null,n&&n(d,h)}};w.useEffect(()=>{a.current!==null&&a.current.updateHandlers(l)});function u(d){a.current=new P$(d,l,{transformPagePoint:s})}r5(i,"pointerdown",o&&u),q_(()=>a.current&&a.current.end())}const tpe={pan:kd(epe),drag:kd(Jhe)};function B7(e){return typeof e=="string"&&e.startsWith("var(--")}const I$=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function npe(e){const t=I$.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function $7(e,t,n=1){const[r,i]=npe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():B7(i)?$7(i,t,n+1):i}function rpe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!B7(o))return;const a=$7(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!B7(o))continue;const a=$7(o,r);a&&(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const ipe=new Set(["width","height","top","left","right","bottom","x","y"]),R$=e=>ipe.has(e),ope=e=>Object.keys(e).some(R$),D$=(e,t)=>{e.set(t,!1),e.set(t)},QA=e=>e===op||e===Lt;var JA;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(JA||(JA={}));const eO=(e,t)=>parseFloat(e.split(", ")[t]),tO=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return eO(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?eO(o[1],e):0}},ape=new Set(["x","y","z"]),spe=t5.filter(e=>!ape.has(e));function lpe(e){const t=[];return spe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const nO={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:tO(4,13),y:tO(5,14)},upe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=nO[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const d=t.getValue(u);D$(d,s[u]),e[u]=nO[u](l,o)}),e},cpe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(R$);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],h=U1(d);const m=t[l];let v;if(L2(m)){const b=m.length,S=m[0]===null?1:0;d=m[S],h=U1(d);for(let _=S;_=0?window.pageYOffset:null,u=upe(t,e,s);return o.length&&o.forEach(([d,h])=>{e.getValue(d).set(h)}),e.render(),ip&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function dpe(e,t,n,r){return ope(t)?cpe(e,t,n,r):{target:t,transitionEnd:r}}const fpe=(e,t,n,r)=>{const i=rpe(e,t,r);return t=i.target,r=i.transitionEnd,dpe(e,t,n,r)},F7={current:null},N$={current:!1};function hpe(){if(N$.current=!0,!!ip)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>F7.current=e.matches;e.addListener(t),t()}else F7.current=!1}function ppe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(su(o))e.addValue(i,o),u5(r)&&r.add(i);else if(su(a))e.addValue(i,Gm(o)),u5(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,Gm(s!==void 0?s:o))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const j$=Object.keys(P2),gpe=j$.length,rO=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class mpe{constructor({parent:t,props:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Ys.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=s,this.parent=t,this.props=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=HS(n),this.isVariantNode=xB(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n);for(const d in u){const h=u[d];a[d]!==void 0&&su(h)&&(h.set(a[d],!1),u5(l)&&l.add(d))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var n;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(n=this.parent)===null||n===void 0?void 0:n.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),N$.current||hpe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:F7.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,n,r;(t=this.projection)===null||t===void 0||t.unmount(),Uh.update(this.notifyUpdate),Uh.render(this.render),this.valueSubscriptions.forEach(i=>i()),(n=this.removeFromVariantTree)===null||n===void 0||n.call(this),(r=this.parent)===null||r===void 0||r.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(t,n){const r=y0.has(t),i=n.onChange(a=>{this.latestValues[t]=a,this.props.onUpdate&&Ys.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isProjectionDirty=!0)}),o=n.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures(t,n,r,i,o,a){const s=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:m})}return s}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let n=0;nr.variantChildren.delete(t)}addValue(t,n){this.hasValue(t)&&this.removeValue(t),this.values.set(t,n),this.latestValues[t]=n.get(),this.bindToMotionValue(t,n)}removeValue(t){var n;this.values.delete(t),(n=this.valueSubscriptions.get(t))===null||n===void 0||n(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Gm(n),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=U_(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!su(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new qv),this.events[t].add(n)}notify(t,...n){var r;(r=this.events[t])===null||r===void 0||r.notify(...n)}}const B$=["initial",...lk],vpe=B$.length;class $$ extends mpe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){var r;return(r=t.style)===null||r===void 0?void 0:r[n]}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=Che(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){xhe(this,r,a);const s=fpe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function ype(e){return window.getComputedStyle(e)}class bpe extends $${readValueFromInstance(t,n){if(y0.has(n)){const r=nk(n);return r&&r.default||0}else{const r=ype(t),i=(_B(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return M$(t,n)}build(t,n,r,i){z_(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t){return W_(t)}renderInstance(t,n,r,i){jB(t,n,r,i)}}class Spe extends $${getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){var r;return y0.has(n)?((r=nk(n))===null||r===void 0?void 0:r.default)||0:(n=BB.has(n)?n:NB(n),t.getAttribute(n))}measureInstanceViewportBox(){return pi()}scrapeMotionValuesFromProps(t){return FB(t)}build(t,n,r,i){V_(t,n,r,i.transformTemplate)}renderInstance(t,n,r,i){$B(t,n,r,i)}}const xpe=(e,t)=>$_(e)?new Spe(t,{enableHardwareAcceleration:!1}):new bpe(t,{enableHardwareAcceleration:!0});function iO(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const G1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Lt.test(e))e=parseFloat(e);else return e;const n=iO(e,t.target.x),r=iO(e,t.target.y);return`${n}% ${r}%`}},oO="_$css",wpe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(I$,v=>(o.push(v),oO)));const a=tc.parse(e);if(a.length>5)return r;const s=tc.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=d;const h=zr(u,d,.5);typeof a[2+l]=="number"&&(a[2+l]/=h),typeof a[3+l]=="number"&&(a[3+l]/=h);let m=s(a);if(i){let v=0;m=m.replace(oO,()=>{const b=o[v];return v++,b})}return m}};class Cpe extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;Dce(kpe),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Wv.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Ys.postRender(()=>{var s;!((s=a.getStack())===null||s===void 0)&&s.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(i),r!=null&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t==null||t()}render(){return null}}function _pe(e){const[t,n]=tk(),r=w.useContext(B_);return N.createElement(Cpe,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(wB),isPresent:t,safeToRemove:n})}const kpe={borderRadius:{...G1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:G1,borderTopRightRadius:G1,borderBottomLeftRadius:G1,borderBottomRightRadius:G1,boxShadow:wpe},Epe={measureLayout:_pe};function Ppe(e,t,n={}){const r=su(e)?e:Gm(e);return ok("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const F$=["TopLeft","TopRight","BottomLeft","BottomRight"],Tpe=F$.length,aO=e=>typeof e=="string"?parseFloat(e):e,sO=e=>typeof e=="number"||Lt.test(e);function Lpe(e,t,n,r,i,o){var a,s,l,u;i?(e.opacity=zr(0,(a=n.opacity)!==null&&a!==void 0?a:1,Ape(r)),e.opacityExit=zr((s=t.opacity)!==null&&s!==void 0?s:1,0,Ope(r))):o&&(e.opacity=zr((l=t.opacity)!==null&&l!==void 0?l:1,(u=n.opacity)!==null&&u!==void 0?u:1,r));for(let d=0;drt?1:n(A2(e,t,r))}function uO(e,t){e.min=t.min,e.max=t.max}function Rs(e,t){uO(e.x,t.x),uO(e.y,t.y)}function cO(e,t,n,r,i){return e-=t,e=c5(e,1/n,r),i!==void 0&&(e=c5(e,1/i,r)),e}function Mpe(e,t=0,n=1,r=.5,i,o=e,a=e){if(Ql.test(t)&&(t=parseFloat(t),t=zr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=zr(o.min,o.max,r);e===o&&(s-=t),e.min=cO(e.min,t,n,s,i),e.max=cO(e.max,t,n,s,i)}function dO(e,t,[n,r,i],o,a){Mpe(e,t[n],t[r],t[i],t.scale,o,a)}const Ipe=["x","scaleX","originX"],Rpe=["y","scaleY","originY"];function fO(e,t,n,r){dO(e.x,t,Ipe,n==null?void 0:n.x,r==null?void 0:r.x),dO(e.y,t,Rpe,n==null?void 0:n.y,r==null?void 0:r.y)}function hO(e){return e.translate===0&&e.scale===1}function H$(e){return hO(e.x)&&hO(e.y)}function V$(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function pO(e){return Ma(e.x)/Ma(e.y)}function Dpe(e,t,n=.1){return ek(e,t)<=n}class Npe{constructor(){this.members=[]}add(t){ak(this.members,t),t.scheduleRender()}remove(t){if(sk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){var r;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(i=t.resumingFrom)===null||i===void 0?void 0:(o=i.options).onExitComplete)===null||a===void 0||a.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gO(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),d&&(r+=`rotateY(${d}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const jpe=(e,t)=>e.depth-t.depth;class Bpe{constructor(){this.children=[],this.isDirty=!1}add(t){ak(this.children,t),this.isDirty=!0}remove(t){sk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jpe),this.isDirty=!1,this.children.forEach(t)}}const mO=["","X","Y","Z"],vO=1e3;let $pe=0;function W$({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=$pe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Wpe),this.nodes.forEach(Upe)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=C$(v,250),Wv.hasAnimatedSinceResize&&(Wv.hasAnimatedSinceResize=!1,this.nodes.forEach(bO))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&h&&(u||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:v,hasRelativeTargetChanged:b,layout:S})=>{var _,E,k,T,A;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const M=(E=(_=this.options.transition)!==null&&_!==void 0?_:h.getDefaultTransition())!==null&&E!==void 0?E:Xpe,{onLayoutAnimationStart:R,onLayoutAnimationComplete:D}=h.getProps(),j=!this.targetLayout||!V$(this.targetLayout,S)||b,z=!v&&b;if(!((k=this.resumeFrom)===null||k===void 0)&&k.instance||z||v&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,z);const H={...ik(M,"layout"),onPlay:R,onComplete:D};h.shouldReduceMotion&&(H.delay=0,H.type=!1),this.startAnimation(H)}else!v&&this.animationProgress===0&&bO(this),this.isLead()&&((A=(T=this.options).onExitComplete)===null||A===void 0||A.call(T));this.targetLayout=S})}unmount(){var a,s;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(s=this.parent)===null||s===void 0||s.children.delete(this),this.instance=void 0,Uh.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(Gpe),this.animationId++)}willUpdate(a=!0){var s,l,u;if(this.root.isUpdateBlocked()){(l=(s=this.options).onExitComplete)===null||l===void 0||l.call(s);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var T;const A=k/1e3;SO(v.x,a.x,A),SO(v.y,a.y,A),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((T=this.relativeParent)===null||T===void 0)&&T.layout)&&(Kv(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ype(this.relativeTarget,this.relativeTargetOrigin,b,A)),S&&(this.animationValues=m,Lpe(m,h,this.latestValues,A,E,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(0)}startAnimation(a){var s,l;this.notifyListeners("animationStart"),(s=this.currentAnimation)===null||s===void 0||s.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(Uh.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ys.update(()=>{Wv.hasAnimatedSinceResize=!0,this.currentAnimation=Ppe(0,vO,{...a,onUpdate:u=>{var d;this.mixTargetDelta(u),(d=a.onUpdate)===null||d===void 0||d.call(a,u)},onComplete:()=>{var u;(u=a.onComplete)===null||u===void 0||u.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,vO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:d}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&U$(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||pi();const h=Ma(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+h;const m=Ma(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}Rs(s,l),Gg(s,d),Yv(this.projectionDeltaWithTransform,this.layoutCorrected,s,d)}}registerSharedNode(a,s){var l,u,d;this.sharedNodes.has(a)||this.sharedNodes.set(a,new Npe),this.sharedNodes.get(a).add(s),s.promote({transition:(l=s.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(d=(u=s.options.initialPromotionConfig)===null||u===void 0?void 0:u.shouldPreserveFollowOpacity)===null||d===void 0?void 0:d.call(u,s)})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(yO),this.root.sharedNodes.clear()}}}function Fpe(e){e.updateLayout()}function zpe(e){var t,n,r;const i=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:a}=e.layout,{animationType:s}=e.options,l=i.source!==e.layout.source;s==="size"?Nl(v=>{const b=l?i.measuredBox[v]:i.layoutBox[v],S=Ma(b);b.min=o[v].min,b.max=b.min+S}):U$(s,i.layoutBox,o)&&Nl(v=>{const b=l?i.measuredBox[v]:i.layoutBox[v],S=Ma(o[v]);b.max=b.min+S});const u=Xv();Yv(u,o,i.layoutBox);const d=Xv();l?Yv(d,e.applyTransform(a,!0),i.measuredBox):Yv(d,o,i.layoutBox);const h=!H$(u);let m=!1;if(!e.resumeFrom){const v=e.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:b,layout:S}=v;if(b&&S){const _=pi();Kv(_,i.layoutBox,b.layoutBox);const E=pi();Kv(E,o,S.layoutBox),V$(_,E)||(m=!0)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:d,layoutDelta:u,hasLayoutChanged:h,hasRelativeTargetChanged:m})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function Hpe(e){e.clearSnapshot()}function yO(e){e.clearMeasurements()}function Vpe(e){const{visualElement:t}=e.options;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function bO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Wpe(e){e.resolveTargetDelta()}function Upe(e){e.calcProjection()}function Gpe(e){e.resetRotation()}function qpe(e){e.removeLeadSnapshot()}function SO(e,t,n){e.translate=zr(t.translate,0,n),e.scale=zr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xO(e,t,n,r){e.min=zr(t.min,n.min,r),e.max=zr(t.max,n.max,r)}function Ype(e,t,n,r){xO(e.x,t.x,n.x,r),xO(e.y,t.y,n.y,r)}function Kpe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Xpe={duration:.45,ease:[.4,0,.1,1]};function Zpe(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function wO(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function Qpe(e){wO(e.x),wO(e.y)}function U$(e,t,n){return e==="position"||e==="preserve-aspect"&&!Dpe(pO(t),pO(n),.2)}const Jpe=W$({attachResizeListener:(e,t)=>WS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_6={current:void 0},ege=W$({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_6.current){const e=new Jpe(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),_6.current=e}return _6.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),tge={...Rhe,...Wfe,...tpe,...Epe},hu=Ice((e,t)=>yde(e,t,tge,xpe,ege));function G$(){const e=w.useRef(!1);return J4(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function nge(){const e=G$(),[t,n]=w.useState(0),r=w.useCallback(()=>{e.current&&n(t+1)},[t]);return[w.useCallback(()=>Ys.postRender(r),[r]),t]}class rge extends w.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ige({children:e,isPresent:t}){const n=w.useId(),r=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0});return w.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` + [data-motion-pop-id="${n}"] { + position: absolute !important; + width: ${o}px !important; + height: ${a}px !important; + top: ${s}px !important; + left: ${l}px !important; + } + `),()=>{document.head.removeChild(u)}},[t]),w.createElement(rge,{isPresent:t,childRef:r,sizeRef:i},w.cloneElement(e,{ref:r}))}const k6=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=VS(oge),l=w.useId(),u=w.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:d=>{s.set(d,!0);for(const h of s.values())if(!h)return;r&&r()},register:d=>(s.set(d,!1),()=>s.delete(d))}),o?void 0:[n]);return w.useMemo(()=>{s.forEach((d,h)=>s.set(h,!1))},[n]),w.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=w.createElement(ige,{isPresent:n},e)),w.createElement(v0.Provider,{value:u},e)};function oge(){return new Map}const zg=e=>e.key||"";function age(e,t){e.forEach(n=>{const r=zg(n);t.set(r,n)})}function sge(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const of=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",y$(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=nge();const l=w.useContext(B_).forceRender;l&&(s=l);const u=G$(),d=sge(e);let h=d;const m=new Set,v=w.useRef(h),b=w.useRef(new Map).current,S=w.useRef(!0);if(J4(()=>{S.current=!1,age(d,b),v.current=h}),q_(()=>{S.current=!0,b.clear(),m.clear()}),S.current)return w.createElement(w.Fragment,null,h.map(T=>w.createElement(k6,{key:zg(T),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},T)));h=[...h];const _=v.current.map(zg),E=d.map(zg),k=_.length;for(let T=0;T{if(E.indexOf(T)!==-1)return;const A=b.get(T);if(!A)return;const M=_.indexOf(T),R=()=>{b.delete(T),m.delete(T);const D=v.current.findIndex(j=>j.key===T);if(v.current.splice(D,1),!m.size){if(v.current=d,u.current===!1)return;s(),r&&r()}};h.splice(M,0,w.createElement(k6,{key:zg(A),isPresent:!1,onExitComplete:R,custom:t,presenceAffectsLayout:o,mode:a},A))}),h=h.map(T=>{const A=T.key;return m.has(A)?T:w.createElement(k6,{key:zg(T),isPresent:!0,presenceAffectsLayout:o,mode:a},T)}),v$!=="production"&&a==="wait"&&h.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),w.createElement(w.Fragment,null,m.size?h:h.map(T=>w.cloneElement(T)))};var Hl=function(){return Hl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function z7(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function lge(){return!1}var uge=e=>{const{condition:t,message:n}=e;t&&lge()&&console.warn(n)},Eh={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},q1={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function H7(e){switch((e==null?void 0:e.direction)??"right"){case"right":return q1.slideRight;case"left":return q1.slideLeft;case"bottom":return q1.slideDown;case"top":return q1.slideUp;default:return q1.slideRight}}var Dh={enter:{duration:.2,ease:Eh.easeOut},exit:{duration:.1,ease:Eh.easeIn}},Ks={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},cge=e=>e!=null&&parseInt(e.toString(),10)>0,_O={exit:{height:{duration:.2,ease:Eh.ease},opacity:{duration:.3,ease:Eh.ease}},enter:{height:{duration:.3,ease:Eh.ease},opacity:{duration:.4,ease:Eh.ease}}},dge={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:cge(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(n==null?void 0:n.exit)??Ks.exit(_O.exit,i)}),enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(n==null?void 0:n.enter)??Ks.enter(_O.enter,i)})},Y$=w.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:d,...h}=e,[m,v]=w.useState(!1);w.useEffect(()=>{const k=setTimeout(()=>{v(!0)});return()=>clearTimeout(k)},[]),uge({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,S={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:d==null?void 0:d.enter,exit:r?d==null?void 0:d.exit:{...d==null?void 0:d.exit,display:b?"block":"none"}}},_=r?n:!0,E=n||r?"enter":"exit";return N.createElement(of,{initial:!1,custom:S},_&&N.createElement(hu.div,{ref:t,...h,className:Cy("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:S,variants:dge,initial:r?"exit":!1,animate:E,exit:"exit"}))});Y$.displayName="Collapse";var fge={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??Ks.enter(Dh.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??Ks.exit(Dh.exit,n),transitionEnd:t==null?void 0:t.exit})},K$={initial:"exit",animate:"enter",exit:"exit",variants:fge},hge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,d=i||r?"enter":"exit",h=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return N.createElement(of,{custom:m},h&&N.createElement(hu.div,{ref:n,className:Cy("chakra-fade",o),custom:m,...K$,animate:d,...u}))});hge.displayName="Fade";var pge={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(n==null?void 0:n.exit)??Ks.exit(Dh.exit,i)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??Ks.enter(Dh.enter,n),transitionEnd:e==null?void 0:e.enter})},X$={initial:"exit",animate:"enter",exit:"exit",variants:pge},gge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:d,...h}=t,m=r?i&&r:!0,v=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:d};return N.createElement(of,{custom:b},m&&N.createElement(hu.div,{ref:n,className:Cy("chakra-offset-slide",s),...X$,animate:v,custom:b,...h}))});gge.displayName="ScaleFade";var kO={exit:{duration:.15,ease:Eh.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},mge={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{const{exit:i}=H7({direction:e});return{...i,transition:(t==null?void 0:t.exit)??Ks.exit(kO.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{const{enter:i}=H7({direction:e});return{...i,transition:(n==null?void 0:n.enter)??Ks.enter(kO.enter,r),transitionEnd:t==null?void 0:t.enter}}},Z$=w.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:d,motionProps:h,...m}=t,v=H7({direction:r}),b=Object.assign({position:"fixed"},v.position,i),S=o?a&&o:!0,_=a||o?"enter":"exit",E={transitionEnd:u,transition:l,direction:r,delay:d};return N.createElement(of,{custom:E},S&&N.createElement(hu.div,{...m,ref:n,initial:"exit",className:Cy("chakra-slide",s),animate:_,exit:"exit",custom:E,variants:mge,style:b,...h}))});Z$.displayName="Slide";var vge={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,x:e,y:t,transition:(n==null?void 0:n.exit)??Ks.exit(Dh.exit,i),transitionEnd:r==null?void 0:r.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??Ks.enter(Dh.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{const a={x:t,y:e};return{opacity:0,transition:(n==null?void 0:n.exit)??Ks.exit(Dh.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},V7={initial:"initial",animate:"enter",exit:"exit",variants:vge},yge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:d,delay:h,...m}=t,v=r?i&&r:!0,b=i||r?"enter":"exit",S={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:d,delay:h};return N.createElement(of,{custom:S},v&&N.createElement(hu.div,{ref:n,className:Cy("chakra-offset-slide",a),custom:S,...V7,animate:b,...m}))});yge.displayName="SlideFade";var _y=(...e)=>e.filter(Boolean).join(" ");function bge(){return!1}var XS=e=>{const{condition:t,message:n}=e;t&&bge()&&console.warn(n)};function E6(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Sge,ZS]=Pn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[xge,uk]=Pn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[wge,pze,Cge,_ge]=bB(),qg=Ae(function(t,n){const{getButtonProps:r}=uk(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...ZS().button};return N.createElement(Ce.button,{...i,className:_y("chakra-accordion__button",t.className),__css:a})});qg.displayName="AccordionButton";function kge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Tge(e),Lge(e);const s=Cge(),[l,u]=w.useState(-1);w.useEffect(()=>()=>{u(-1)},[]);const[d,h]=$S({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:d,setIndex:h,htmlProps:a,getAccordionItemProps:v=>{let b=!1;return v!==null&&(b=Array.isArray(d)?d.includes(v):d===v),{isOpen:b,onChange:_=>{if(v!==null)if(i&&Array.isArray(d)){const E=_?d.concat(v):d.filter(k=>k!==v);h(E)}else _?h(v):o&&h(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[Ege,ck]=Pn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Pge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=ck(),s=w.useRef(null),l=w.useId(),u=r??l,d=`accordion-button-${u}`,h=`accordion-panel-${u}`;Age(e);const{register:m,index:v,descendants:b}=_ge({disabled:t&&!n}),{isOpen:S,onChange:_}=o(v===-1?null:v);Oge({isOpen:S,isDisabled:t});const E=()=>{_==null||_(!0)},k=()=>{_==null||_(!1)},T=w.useCallback(()=>{_==null||_(!S),a(v)},[v,a,S,_]),A=w.useCallback(j=>{const H={ArrowDown:()=>{const K=b.nextEnabled(v);K==null||K.node.focus()},ArrowUp:()=>{const K=b.prevEnabled(v);K==null||K.node.focus()},Home:()=>{const K=b.firstEnabled();K==null||K.node.focus()},End:()=>{const K=b.lastEnabled();K==null||K.node.focus()}}[j.key];H&&(j.preventDefault(),H(j))},[b,v]),M=w.useCallback(()=>{a(v)},[a,v]),R=w.useCallback(function(z={},H=null){return{...z,type:"button",ref:Hn(m,s,H),id:d,disabled:!!t,"aria-expanded":!!S,"aria-controls":h,onClick:E6(z.onClick,T),onFocus:E6(z.onFocus,M),onKeyDown:E6(z.onKeyDown,A)}},[d,t,S,T,M,A,h,m]),D=w.useCallback(function(z={},H=null){return{...z,ref:H,role:"region",id:h,"aria-labelledby":d,hidden:!S}},[d,S,h]);return{isOpen:S,isDisabled:t,isFocusable:n,onOpen:E,onClose:k,getButtonProps:R,getPanelProps:D,htmlProps:i}}function Tge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;XS({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function Lge(e){XS({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function Age(e){XS({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. + `})}function Oge(e){XS({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Yg(e){const{isOpen:t,isDisabled:n}=uk(),{reduceMotion:r}=ck(),i=_y("chakra-accordion__icon",e.className),o=ZS(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return N.createElement(Na,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))}Yg.displayName="AccordionIcon";var Kg=Ae(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Pge(t),l={...ZS().container,overflowAnchor:"none"},u=w.useMemo(()=>a,[a]);return N.createElement(xge,{value:u},N.createElement(Ce.div,{ref:n,...o,className:_y("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});Kg.displayName="AccordionItem";var Xg=Ae(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=ck(),{getPanelProps:s,isOpen:l}=uk(),u=s(o,n),d=_y("chakra-accordion__panel",r),h=ZS();a||delete u.hidden;const m=N.createElement(Ce.div,{...u,__css:h.panel,className:d});return a?m:N.createElement(Y$,{in:l,...i},m)});Xg.displayName="AccordionPanel";var dk=Ae(function({children:t,reduceMotion:n,...r},i){const o=Oi("Accordion",r),a=Sn(r),{htmlProps:s,descendants:l,...u}=kge(a),d=w.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return N.createElement(wge,{value:l},N.createElement(Ege,{value:d},N.createElement(Sge,{value:o},N.createElement(Ce.div,{ref:i,...s,className:_y("chakra-accordion",r.className),__css:o.root},t))))});dk.displayName="Accordion";var Mge=(...e)=>e.filter(Boolean).join(" "),Ige=rf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),ky=Ae((e,t)=>{const n=Oo("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=Sn(e),u=Mge("chakra-spinner",s),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${Ige} ${o} linear infinite`,...n};return N.createElement(Ce.div,{ref:t,__css:d,className:u,...l},r&&N.createElement(Ce.span,{srOnly:!0},r))});ky.displayName="Spinner";var QS=(...e)=>e.filter(Boolean).join(" ");function Rge(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}))}function Dge(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}))}function EO(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))}var[Nge,jge]=Pn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[Bge,fk]=Pn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),Q$={info:{icon:Dge,colorScheme:"blue"},warning:{icon:EO,colorScheme:"orange"},success:{icon:Rge,colorScheme:"green"},error:{icon:EO,colorScheme:"red"},loading:{icon:ky,colorScheme:"blue"}};function $ge(e){return Q$[e].colorScheme}function Fge(e){return Q$[e].icon}var J$=Ae(function(t,n){const{status:r="info",addRole:i=!0,...o}=Sn(t),a=t.colorScheme??$ge(r),s=Oi("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return N.createElement(Nge,{value:{status:r}},N.createElement(Bge,{value:s},N.createElement(Ce.div,{role:i?"alert":void 0,ref:n,...o,className:QS("chakra-alert",t.className),__css:l})))});J$.displayName="Alert";var eF=Ae(function(t,n){const i={display:"inline",...fk().description};return N.createElement(Ce.div,{ref:n,...t,className:QS("chakra-alert__desc",t.className),__css:i})});eF.displayName="AlertDescription";function tF(e){const{status:t}=jge(),n=Fge(t),r=fk(),i=t==="loading"?r.spinner:r.icon;return N.createElement(Ce.span,{display:"inherit",...e,className:QS("chakra-alert__icon",e.className),__css:i},e.children||N.createElement(n,{h:"100%",w:"100%"}))}tF.displayName="AlertIcon";var nF=Ae(function(t,n){const r=fk();return N.createElement(Ce.div,{ref:n,...t,className:QS("chakra-alert__title",t.className),__css:r.title})});nF.displayName="AlertTitle";function zge(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Hge(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,d]=w.useState("pending");w.useEffect(()=>{d(n?"loading":"pending")},[n]);const h=w.useRef(),m=w.useCallback(()=>{if(!n)return;v();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=S=>{v(),d("loaded"),i==null||i(S)},b.onerror=S=>{v(),d("failed"),o==null||o(S)},h.current=b},[n,a,r,s,i,o,t]),v=()=>{h.current&&(h.current.onload=null,h.current.onerror=null,h.current=null)};return Gs(()=>{if(!l)return u==="loading"&&m(),()=>{v()}},[u,m,l]),l?"loaded":u}var Vge=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",d5=Ae(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return N.createElement("img",{width:r,height:i,ref:n,alt:o,...a})});d5.displayName="NativeImage";var JS=Ae(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:d,crossOrigin:h,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:v,...b}=t,S=r!==void 0||i!==void 0,_=u!=null||d||!S,E=Hge({...t,ignoreFallback:_}),k=Vge(E,m),T={ref:n,objectFit:l,objectPosition:s,..._?b:zge(b,["onError","onLoad"])};return k?i||N.createElement(Ce.img,{as:d5,className:"chakra-image__placeholder",src:r,...T}):N.createElement(Ce.img,{as:d5,src:o,srcSet:a,crossOrigin:h,loading:u,referrerPolicy:v,className:"chakra-image",...T})});JS.displayName="Image";Ae((e,t)=>N.createElement(Ce.img,{ref:t,as:d5,className:"chakra-image",...e}));function ex(e){return w.Children.toArray(e).filter(t=>w.isValidElement(t))}var tx=(...e)=>e.filter(Boolean).join(" "),PO=e=>e?"":void 0,[Wge,Uge]=Pn({strict:!1,name:"ButtonGroupContext"});function W7(e){const{children:t,className:n,...r}=e,i=w.isValidElement(t)?w.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=tx("chakra-button__icon",n);return N.createElement(Ce.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}W7.displayName="ButtonIcon";function U7(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=N.createElement(ky,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=tx("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",d=w.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return N.createElement(Ce.div,{className:l,...s,__css:d},i)}U7.displayName="ButtonSpinner";function Gge(e){const[t,n]=w.useState(!e);return{ref:w.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var ls=Ae((e,t)=>{const n=Uge(),r=Oo("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:d,iconSpacing:h="0.5rem",type:m,spinner:v,spinnerPlacement:b="start",className:S,as:_,...E}=Sn(e),k=w.useMemo(()=>{const R={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:R}}},[r,n]),{ref:T,type:A}=Gge(_),M={rightIcon:u,leftIcon:l,iconSpacing:h,children:s};return N.createElement(Ce.button,{disabled:i||o,ref:pce(t,T),as:_,type:m??A,"data-active":PO(a),"data-loading":PO(o),__css:k,className:tx("chakra-button",S),...E},o&&b==="start"&&N.createElement(U7,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:h},v),o?d||N.createElement(Ce.span,{opacity:0},N.createElement(TO,{...M})):N.createElement(TO,{...M}),o&&b==="end"&&N.createElement(U7,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:h},v))});ls.displayName="Button";function TO(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return N.createElement(N.Fragment,null,t&&N.createElement(W7,{marginEnd:i},t),r,n&&N.createElement(W7,{marginStart:i},n))}var oo=Ae(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...d}=t,h=tx("chakra-button__group",a),m=w.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let v={display:"inline-flex"};return l?v={...v,"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}}:v={...v,"& > *:not(style) ~ *:not(style)":{marginStart:s}},N.createElement(Wge,{value:m},N.createElement(Ce.div,{ref:n,role:"group",__css:v,className:h,"data-attached":l?"":void 0,...d}))});oo.displayName="ButtonGroup";var us=Ae((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=w.isValidElement(s)?w.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return N.createElement(ls,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a},l)});us.displayName="IconButton";var x0=(...e)=>e.filter(Boolean).join(" "),rb=e=>e?"":void 0,P6=e=>e?!0:void 0;function LO(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[qge,rF]=Pn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Yge,ap]=Pn({strict:!1,name:"FormControlContext"});function Kge(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=w.useId(),l=t||`field-${s}`,u=`${l}-label`,d=`${l}-feedback`,h=`${l}-helptext`,[m,v]=w.useState(!1),[b,S]=w.useState(!1),[_,E]=w.useState(!1),k=w.useCallback((D={},j=null)=>({id:h,...D,ref:Hn(j,z=>{z&&S(!0)})}),[h]),T=w.useCallback((D={},j=null)=>({...D,ref:j,"data-focus":rb(_),"data-disabled":rb(i),"data-invalid":rb(r),"data-readonly":rb(o),id:D.id??u,htmlFor:D.htmlFor??l}),[l,i,_,r,o,u]),A=w.useCallback((D={},j=null)=>({id:d,...D,ref:Hn(j,z=>{z&&v(!0)}),"aria-live":"polite"}),[d]),M=w.useCallback((D={},j=null)=>({...D,...a,ref:j,role:"group"}),[a]),R=w.useCallback((D={},j=null)=>({...D,ref:j,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!_,onFocus:()=>E(!0),onBlur:()=>E(!1),hasFeedbackText:m,setHasFeedbackText:v,hasHelpText:b,setHasHelpText:S,id:l,labelId:u,feedbackId:d,helpTextId:h,htmlProps:a,getHelpTextProps:k,getErrorMessageProps:A,getRootProps:M,getLabelProps:T,getRequiredIndicatorProps:R}}var fn=Ae(function(t,n){const r=Oi("Form",t),i=Sn(t),{getRootProps:o,htmlProps:a,...s}=Kge(i),l=x0("chakra-form-control",t.className);return N.createElement(Yge,{value:s},N.createElement(qge,{value:r},N.createElement(Ce.div,{...o({},n),className:l,__css:r.container})))});fn.displayName="FormControl";var ur=Ae(function(t,n){const r=ap(),i=rF(),o=x0("chakra-form__helper-text",t.className);return N.createElement(Ce.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});ur.displayName="FormHelperText";function hk(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=pk(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":P6(n),"aria-required":P6(i),"aria-readonly":P6(r)}}function pk(e){const t=ap(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:d,onBlur:h,...m}=e,v=e["aria-describedby"]?[e["aria-describedby"]]:[];return t!=null&&t.hasFeedbackText&&(t!=null&&t.isInvalid)&&v.push(t.feedbackId),t!=null&&t.hasHelpText&&v.push(t.helpTextId),{...m,"aria-describedby":v.join(" ")||void 0,id:n??(t==null?void 0:t.id),isDisabled:r??u??(t==null?void 0:t.isDisabled),isReadOnly:i??l??(t==null?void 0:t.isReadOnly),isRequired:o??a??(t==null?void 0:t.isRequired),isInvalid:s??(t==null?void 0:t.isInvalid),onFocus:LO(t==null?void 0:t.onFocus,d),onBlur:LO(t==null?void 0:t.onBlur,h)}}var[Xge,Zge]=Pn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),cr=Ae((e,t)=>{const n=Oi("FormError",e),r=Sn(e),i=ap();return i!=null&&i.isInvalid?N.createElement(Xge,{value:n},N.createElement(Ce.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:x0("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});cr.displayName="FormErrorMessage";var Qge=Ae((e,t)=>{const n=Zge(),r=ap();if(!(r!=null&&r.isInvalid))return null;const i=x0("chakra-form__error-icon",e.className);return N.createElement(Na,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))});Qge.displayName="FormErrorIcon";var En=Ae(function(t,n){const r=Oo("FormLabel",t),i=Sn(t),{className:o,children:a,requiredIndicator:s=N.createElement(iF,null),optionalIndicator:l=null,...u}=i,d=ap(),h=(d==null?void 0:d.getLabelProps(u,n))??{ref:n,...u};return N.createElement(Ce.label,{...h,className:x0("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,d!=null&&d.isRequired?s:l)});En.displayName="FormLabel";var iF=Ae(function(t,n){const r=ap(),i=rF();if(!(r!=null&&r.isRequired))return null;const o=x0("chakra-form__required-indicator",t.className);return N.createElement(Ce.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});iF.displayName="RequiredIndicator";function Ud(e,t){const n=w.useRef(!1),r=w.useRef(!1);w.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var gk={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},Jge=Ce("span",{baseStyle:gk});Jge.displayName="VisuallyHidden";var eme=Ce("input",{baseStyle:gk});eme.displayName="VisuallyHiddenInput";var AO=!1,nx=null,qm=!1,G7=new Set,tme=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function nme(e){return!(e.metaKey||!tme&&e.altKey||e.ctrlKey)}function mk(e,t){G7.forEach(n=>n(e,t))}function OO(e){qm=!0,nme(e)&&(nx="keyboard",mk("keyboard",e))}function kg(e){nx="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(qm=!0,mk("pointer",e))}function rme(e){e.target===window||e.target===document||(qm||(nx="keyboard",mk("keyboard",e)),qm=!1)}function ime(){qm=!1}function MO(){return nx!=="pointer"}function ome(){if(typeof window>"u"||AO)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){qm=!0,e.apply(this,n)},document.addEventListener("keydown",OO,!0),document.addEventListener("keyup",OO,!0),window.addEventListener("focus",rme,!0),window.addEventListener("blur",ime,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",kg,!0),document.addEventListener("pointermove",kg,!0),document.addEventListener("pointerup",kg,!0)):(document.addEventListener("mousedown",kg,!0),document.addEventListener("mousemove",kg,!0),document.addEventListener("mouseup",kg,!0)),AO=!0}function oF(e){ome(),e(MO());const t=()=>e(MO());return G7.add(t),()=>{G7.delete(t)}}var[gze,ame]=Pn({name:"CheckboxGroupContext",strict:!1}),sme=(...e)=>e.filter(Boolean).join(" "),bo=e=>e?"":void 0;function Ka(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function lme(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function ume(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},N.createElement("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function cme(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},N.createElement("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function dme(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?cme:ume;return n||t?N.createElement(Ce.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},N.createElement(i,{...r})):null}function fme(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function aF(e={}){const t=pk(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:d,isChecked:h,isFocusable:m,onChange:v,isIndeterminate:b,name:S,value:_,tabIndex:E=void 0,"aria-label":k,"aria-labelledby":T,"aria-invalid":A,...M}=e,R=fme(M,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=Er(v),j=Er(s),z=Er(l),[H,K]=w.useState(!1),[te,G]=w.useState(!1),[$,W]=w.useState(!1),[X,Z]=w.useState(!1);w.useEffect(()=>oF(K),[]);const U=w.useRef(null),[Q,re]=w.useState(!0),[fe,Ee]=w.useState(!!d),be=h!==void 0,ye=be?h:fe,Fe=w.useCallback(Le=>{if(r||n){Le.preventDefault();return}be||Ee(ye?Le.target.checked:b?!0:Le.target.checked),D==null||D(Le)},[r,n,ye,be,b,D]);Gs(()=>{U.current&&(U.current.indeterminate=Boolean(b))},[b]),Ud(()=>{n&&G(!1)},[n,G]),Gs(()=>{const Le=U.current;Le!=null&&Le.form&&(Le.form.onreset=()=>{Ee(!!d)})},[]);const Me=n&&!m,rt=w.useCallback(Le=>{Le.key===" "&&Z(!0)},[Z]),Ve=w.useCallback(Le=>{Le.key===" "&&Z(!1)},[Z]);Gs(()=>{if(!U.current)return;U.current.checked!==ye&&Ee(U.current.checked)},[U.current]);const je=w.useCallback((Le={},ut=null)=>{const Mt=ct=>{te&&ct.preventDefault(),Z(!0)};return{...Le,ref:ut,"data-active":bo(X),"data-hover":bo($),"data-checked":bo(ye),"data-focus":bo(te),"data-focus-visible":bo(te&&H),"data-indeterminate":bo(b),"data-disabled":bo(n),"data-invalid":bo(o),"data-readonly":bo(r),"aria-hidden":!0,onMouseDown:Ka(Le.onMouseDown,Mt),onMouseUp:Ka(Le.onMouseUp,()=>Z(!1)),onMouseEnter:Ka(Le.onMouseEnter,()=>W(!0)),onMouseLeave:Ka(Le.onMouseLeave,()=>W(!1))}},[X,ye,n,te,H,$,b,o,r]),wt=w.useCallback((Le={},ut=null)=>({...R,...Le,ref:Hn(ut,Mt=>{Mt&&re(Mt.tagName==="LABEL")}),onClick:Ka(Le.onClick,()=>{var Mt;Q||((Mt=U.current)==null||Mt.click(),requestAnimationFrame(()=>{var ct;(ct=U.current)==null||ct.focus()}))}),"data-disabled":bo(n),"data-checked":bo(ye),"data-invalid":bo(o)}),[R,n,ye,o,Q]),Be=w.useCallback((Le={},ut=null)=>({...Le,ref:Hn(U,ut),type:"checkbox",name:S,value:_,id:a,tabIndex:E,onChange:Ka(Le.onChange,Fe),onBlur:Ka(Le.onBlur,j,()=>G(!1)),onFocus:Ka(Le.onFocus,z,()=>G(!0)),onKeyDown:Ka(Le.onKeyDown,rt),onKeyUp:Ka(Le.onKeyUp,Ve),required:i,checked:ye,disabled:Me,readOnly:r,"aria-label":k,"aria-labelledby":T,"aria-invalid":A?Boolean(A):o,"aria-describedby":u,"aria-disabled":n,style:gk}),[S,_,a,Fe,j,z,rt,Ve,i,ye,Me,r,k,T,A,o,u,n,E]),at=w.useCallback((Le={},ut=null)=>({...Le,ref:ut,onMouseDown:Ka(Le.onMouseDown,IO),onTouchStart:Ka(Le.onTouchStart,IO),"data-disabled":bo(n),"data-checked":bo(ye),"data-invalid":bo(o)}),[ye,n,o]);return{state:{isInvalid:o,isFocused:te,isChecked:ye,isActive:X,isHovered:$,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:wt,getCheckboxProps:je,getInputProps:Be,getLabelProps:at,htmlProps:R}}function IO(e){e.preventDefault(),e.stopPropagation()}var hme={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},pme={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},gme=rf({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),mme=rf({from:{opacity:0},to:{opacity:1}}),vme=rf({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),sF=Ae(function(t,n){const r=ame(),i={...r,...t},o=Oi("Checkbox",i),a=Sn(t),{spacing:s="0.5rem",className:l,children:u,iconColor:d,iconSize:h,icon:m=N.createElement(dme,null),isChecked:v,isDisabled:b=r==null?void 0:r.isDisabled,onChange:S,inputProps:_,...E}=a;let k=v;r!=null&&r.value&&a.value&&(k=r.value.includes(a.value));let T=S;r!=null&&r.onChange&&a.value&&(T=lme(r.onChange,S));const{state:A,getInputProps:M,getCheckboxProps:R,getLabelProps:D,getRootProps:j}=aF({...E,isDisabled:b,isChecked:k,onChange:T}),z=w.useMemo(()=>({animation:A.isIndeterminate?`${mme} 20ms linear, ${vme} 200ms linear`:`${gme} 200ms linear`,fontSize:h,color:d,...o.icon}),[d,h,,A.isIndeterminate,o.icon]),H=w.cloneElement(m,{__css:z,isIndeterminate:A.isIndeterminate,isChecked:A.isChecked});return N.createElement(Ce.label,{__css:{...pme,...o.container},className:sme("chakra-checkbox",l),...j()},N.createElement("input",{className:"chakra-checkbox__input",...M(_,n)}),N.createElement(Ce.span,{__css:{...hme,...o.control},className:"chakra-checkbox__control",...R()},H),u&&N.createElement(Ce.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:s,...o.label}},u))});sF.displayName="Checkbox";function yme(e){return N.createElement(Na,{focusable:"false","aria-hidden":!0,...e},N.createElement("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}))}var rx=Ae(function(t,n){const r=Oo("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=Sn(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return N.createElement(Ce.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||N.createElement(yme,{width:"1em",height:"1em"}))});rx.displayName="CloseButton";function bme(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function vk(e,t){let n=bme(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function q7(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function f5(e,t,n){return(e-t)*100/(n-t)}function lF(e,t,n){return(n-t)*e+t}function Y7(e,t,n){const r=Math.round((e-t)/n)*n+t,i=q7(n);return vk(r,i)}function Em(e,t,n){return e==null?e:(nr==null?"":T6(r,o,n)??""),m=typeof i<"u",v=m?i:d,b=uF(hd(v),o),S=n??b,_=w.useCallback(H=>{H!==v&&(m||h(H.toString()),u==null||u(H.toString(),hd(H)))},[u,m,v]),E=w.useCallback(H=>{let K=H;return l&&(K=Em(K,a,s)),vk(K,S)},[S,l,s,a]),k=w.useCallback((H=o)=>{let K;v===""?K=hd(H):K=hd(v)+H,K=E(K),_(K)},[E,o,_,v]),T=w.useCallback((H=o)=>{let K;v===""?K=hd(-H):K=hd(v)-H,K=E(K),_(K)},[E,o,_,v]),A=w.useCallback(()=>{let H;r==null?H="":H=T6(r,o,n)??a,_(H)},[r,n,o,_,a]),M=w.useCallback(H=>{const K=T6(H,o,S)??a;_(K)},[S,o,_,a]),R=hd(v);return{isOutOfRange:R>s||RN.createElement(DS,{styles:cF}),wme=()=>N.createElement(DS,{styles:` + html { + line-height: 1.5; + -webkit-text-size-adjust: 100%; + font-family: system-ui, sans-serif; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + -moz-osx-font-smoothing: grayscale; + touch-action: manipulation; + } + + body { + position: relative; + min-height: 100%; + font-feature-settings: 'kern'; + } + + *, + *::before, + *::after { + border-width: 0; + border-style: solid; + box-sizing: border-box; + } + + main { + display: block; + } + + hr { + border-top-width: 1px; + box-sizing: content-box; + height: 0; + overflow: visible; + } + + pre, + code, + kbd, + samp { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-size: 1em; + } + + a { + background-color: transparent; + color: inherit; + text-decoration: inherit; + } + + abbr[title] { + border-bottom: none; + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + } + + b, + strong { + font-weight: bold; + } + + small { + font-size: 80%; + } + + sub, + sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + sub { + bottom: -0.25em; + } + + sup { + top: -0.5em; + } + + img { + border-style: none; + } + + button, + input, + optgroup, + select, + textarea { + font-family: inherit; + font-size: 100%; + line-height: 1.15; + margin: 0; + } + + button, + input { + overflow: visible; + } + + button, + select { + text-transform: none; + } + + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; + } + + fieldset { + padding: 0.35em 0.75em 0.625em; + } + + legend { + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal; + } + + progress { + vertical-align: baseline; + } + + textarea { + overflow: auto; + } + + [type="checkbox"], + [type="radio"] { + box-sizing: border-box; + padding: 0; + } + + [type="number"]::-webkit-inner-spin-button, + [type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none !important; + } + + input[type="number"] { + -moz-appearance: textfield; + } + + [type="search"] { + -webkit-appearance: textfield; + outline-offset: -2px; + } + + [type="search"]::-webkit-search-decoration { + -webkit-appearance: none !important; + } + + ::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit; + } + + details { + display: block; + } + + summary { + display: list-item; + } + + template { + display: none; + } + + [hidden] { + display: none !important; + } + + body, + blockquote, + dl, + dd, + h1, + h2, + h3, + h4, + h5, + h6, + hr, + figure, + p, + pre { + margin: 0; + } + + button { + background: transparent; + padding: 0; + } + + fieldset { + margin: 0; + padding: 0; + } + + ol, + ul { + margin: 0; + padding: 0; + } + + textarea { + resize: vertical; + } + + button, + [role="button"] { + cursor: pointer; + } + + button::-moz-focus-inner { + border: 0 !important; + } + + table { + border-collapse: collapse; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + font-size: inherit; + font-weight: inherit; + } + + button, + input, + optgroup, + select, + textarea { + padding: 0; + line-height: inherit; + color: inherit; + } + + img, + svg, + video, + canvas, + audio, + iframe, + embed, + object { + display: block; + } + + img, + video { + max-width: 100%; + height: auto; + } + + [data-js-focus-visible] :focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) { + outline: none; + box-shadow: none; + } + + select::-ms-expand { + display: none; + } + + ${cF} + `});function Nh(e,t,n,r){const i=Er(n);return w.useEffect(()=>{const o=typeof e=="function"?e():e??document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e??document;o==null||o.removeEventListener(t,i,r)}}function Cme(e){return"current"in e}var dF=()=>typeof window<"u";function _me(){const e=navigator.userAgentData;return(e==null?void 0:e.platform)??navigator.platform}var kme=e=>dF()&&e.test(navigator.vendor),Eme=e=>dF()&&e.test(_me()),Pme=()=>Eme(/mac|iphone|ipad|ipod/i),Tme=()=>Pme()&&kme(/apple/i);function Lme(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var o;return((o=t.current)==null?void 0:o.ownerDocument)??document};Nh(i,"pointerdown",o=>{if(!Tme()||!r)return;const a=o.target,l=(n??[t]).some(u=>{const d=Cme(u)?u.current:u;return(d==null?void 0:d.contains(a))||d===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}var Ame=xre?w.useLayoutEffect:w.useEffect;function RO(e,t=[]){const n=w.useRef(e);return Ame(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Ome(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Mme(e,t){const n=w.useId();return w.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Gh(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=RO(n),a=RO(t),[s,l]=w.useState(e.defaultIsOpen||!1),[u,d]=Ome(r,s),h=Mme(i,"disclosure"),m=w.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),v=w.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),b=w.useCallback(()=>{(d?m:v)()},[d,v,m]);return{isOpen:!!d,onOpen:v,onClose:m,onToggle:b,isControlled:u,getButtonProps:(S={})=>({...S,"aria-expanded":d,"aria-controls":h,onClick:wre(S.onClick,b)}),getDisclosureProps:(S={})=>({...S,hidden:!d,id:h})}}function yk(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var bk=Ae(function(t,n){const{htmlSize:r,...i}=t,o=Oi("Input",i),a=Sn(i),s=hk(a),l=Qr("chakra-input",t.className);return N.createElement(Ce.input,{size:r,...s,__css:o.field,ref:n,className:l})});bk.displayName="Input";bk.id="Input";var[Ime,fF]=Pn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Rme=Ae(function(t,n){const r=Oi("Input",t),{children:i,className:o,...a}=Sn(t),s=Qr("chakra-input__group",o),l={},u=ex(i),d=r.field;u.forEach(m=>{r&&(d&&m.type.id==="InputLeftElement"&&(l.paddingStart=d.height??d.h),d&&m.type.id==="InputRightElement"&&(l.paddingEnd=d.height??d.h),m.type.id==="InputRightAddon"&&(l.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const h=u.map(m=>{var v,b;const S=yk({size:((v=m.props)==null?void 0:v.size)||t.size,variant:((b=m.props)==null?void 0:b.variant)||t.variant});return m.type.id!=="Input"?w.cloneElement(m,S):w.cloneElement(m,Object.assign(S,l,m.props))});return N.createElement(Ce.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},N.createElement(Ime,{value:r},h))});Rme.displayName="InputGroup";var Dme={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},Nme=Ce("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),Sk=Ae(function(t,n){const{placement:r="left",...i}=t,o=Dme[r]??{},a=fF();return N.createElement(Nme,{ref:n,...i,__css:{...a.addon,...o}})});Sk.displayName="InputAddon";var hF=Ae(function(t,n){return N.createElement(Sk,{ref:n,placement:"left",...t,className:Qr("chakra-input__left-addon",t.className)})});hF.displayName="InputLeftAddon";hF.id="InputLeftAddon";var pF=Ae(function(t,n){return N.createElement(Sk,{ref:n,placement:"right",...t,className:Qr("chakra-input__right-addon",t.className)})});pF.displayName="InputRightAddon";pF.id="InputRightAddon";var jme=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),ix=Ae(function(t,n){const{placement:r="left",...i}=t,o=fF(),a=o.field,l={[r==="left"?"insetStart":"insetEnd"]:"0",width:(a==null?void 0:a.height)??(a==null?void 0:a.h),height:(a==null?void 0:a.height)??(a==null?void 0:a.h),fontSize:a==null?void 0:a.fontSize,...o.element};return N.createElement(jme,{ref:n,__css:l,...i})});ix.id="InputElement";ix.displayName="InputElement";var gF=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__left-element",r);return N.createElement(ix,{ref:n,placement:"left",className:o,...i})});gF.id="InputLeftElement";gF.displayName="InputLeftElement";var mF=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__right-element",r);return N.createElement(ix,{ref:n,placement:"right",className:o,...i})});mF.id="InputRightElement";mF.displayName="InputRightElement";function Bme(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Gd(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Bme(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var $me=Ae(function(e,t){const{ratio:n=4/3,children:r,className:i,...o}=e,a=w.Children.only(r),s=Qr("chakra-aspect-ratio",i);return N.createElement(Ce.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:Gd(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o},a)});$me.displayName="AspectRatio";var Fme=Ae(function(t,n){const r=Oo("Badge",t),{className:i,...o}=Sn(t);return N.createElement(Ce.span,{ref:n,className:Qr("chakra-badge",t.className),...o,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Fme.displayName="Badge";var Eo=Ce("div");Eo.displayName="Box";var vF=Ae(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return N.createElement(Eo,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});vF.displayName="Square";var zme=Ae(function(t,n){const{size:r,...i}=t;return N.createElement(vF,{size:r,ref:n,borderRadius:"9999px",...i})});zme.displayName="Circle";var yF=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});yF.displayName="Center";var Hme={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Ae(function(t,n){const{axis:r="both",...i}=t;return N.createElement(Ce.div,{ref:n,__css:Hme[r],...i,position:"absolute"})});var Vme=Ae(function(t,n){const r=Oo("Code",t),{className:i,...o}=Sn(t);return N.createElement(Ce.code,{ref:n,className:Qr("chakra-code",t.className),...o,__css:{display:"inline-block",...r}})});Vme.displayName="Code";var Wme=Ae(function(t,n){const{className:r,centerContent:i,...o}=Sn(t),a=Oo("Container",t);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-container",r),...o,__css:{...a,...i&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});Wme.displayName="Container";var Ume=Ae(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:o,borderRightWidth:a,borderWidth:s,borderStyle:l,borderColor:u,...d}=Oo("Divider",t),{className:h,orientation:m="horizontal",__css:v,...b}=Sn(t),S={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:i||o||s||"1px",width:"100%"}};return N.createElement(Ce.hr,{ref:n,"aria-orientation":m,...b,__css:{...d,border:"0",borderColor:u,borderStyle:l,...S[m],...v},className:Qr("chakra-divider",h)})});Ume.displayName="Divider";var Ge=Ae(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...d}=t,h={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return N.createElement(Ce.div,{ref:n,__css:h,...d})});Ge.displayName="Flex";var bF=Ae(function(t,n){const{templateAreas:r,gap:i,rowGap:o,columnGap:a,column:s,row:l,autoFlow:u,autoRows:d,templateRows:h,autoColumns:m,templateColumns:v,...b}=t,S={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:o,gridColumnGap:a,gridAutoColumns:m,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:d,gridTemplateRows:h,gridTemplateColumns:v};return N.createElement(Ce.div,{ref:n,__css:S,...b})});bF.displayName="Grid";function DO(e){return Gd(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Gme=Ae(function(t,n){const{area:r,colSpan:i,colStart:o,colEnd:a,rowEnd:s,rowSpan:l,rowStart:u,...d}=t,h=yk({gridArea:r,gridColumn:DO(i),gridRow:DO(l),gridColumnStart:o,gridColumnEnd:a,gridRowStart:u,gridRowEnd:s});return N.createElement(Ce.div,{ref:n,__css:h,...d})});Gme.displayName="GridItem";var jh=Ae(function(t,n){const r=Oo("Heading",t),{className:i,...o}=Sn(t);return N.createElement(Ce.h2,{ref:n,className:Qr("chakra-heading",t.className),...o,__css:r})});jh.displayName="Heading";Ae(function(t,n){const r=Oo("Mark",t),i=Sn(t);return N.createElement(Eo,{ref:n,...i,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var qme=Ae(function(t,n){const r=Oo("Kbd",t),{className:i,...o}=Sn(t);return N.createElement(Ce.kbd,{ref:n,className:Qr("chakra-kbd",i),...o,__css:{fontFamily:"mono",...r}})});qme.displayName="Kbd";var Bh=Ae(function(t,n){const r=Oo("Link",t),{className:i,isExternal:o,...a}=Sn(t);return N.createElement(Ce.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:Qr("chakra-link",i),...a,__css:r})});Bh.displayName="Link";Ae(function(t,n){const{isExternal:r,target:i,rel:o,className:a,...s}=t;return N.createElement(Ce.a,{...s,ref:n,className:Qr("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":o,target:r?"_blank":i,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});Ae(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.div,{ref:n,position:"relative",...i,className:Qr("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[Yme,SF]=Pn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),xk=Ae(function(t,n){const r=Oi("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=Sn(t),u=ex(i),h=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return N.createElement(Yme,{value:r},N.createElement(Ce.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...h},...l},u))});xk.displayName="List";var Kme=Ae((e,t)=>{const{as:n,...r}=e;return N.createElement(xk,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});Kme.displayName="OrderedList";var xF=Ae(function(t,n){const{as:r,...i}=t;return N.createElement(xk,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});xF.displayName="UnorderedList";var Sv=Ae(function(t,n){const r=SF();return N.createElement(Ce.li,{ref:n,...t,__css:r.item})});Sv.displayName="ListItem";var Xme=Ae(function(t,n){const r=SF();return N.createElement(Na,{ref:n,role:"presentation",...t,__css:r.icon})});Xme.displayName="ListIcon";var Zme=Ae(function(t,n){const{columns:r,spacingX:i,spacingY:o,spacing:a,minChildWidth:s,...l}=t,u=m0(),d=s?Jme(s,u):e0e(r);return N.createElement(bF,{ref:n,gap:a,columnGap:i,rowGap:o,templateColumns:d,...l})});Zme.displayName="SimpleGrid";function Qme(e){return typeof e=="number"?`${e}px`:e}function Jme(e,t){return Gd(e,n=>{const r=rce("sizes",n,Qme(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function e0e(e){return Gd(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var wF=Ce("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});wF.displayName="Spacer";var K7="& > *:not(style) ~ *:not(style)";function t0e(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[K7]:Gd(n,i=>r[i])}}function n0e(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":Gd(n,i=>r[i])}}var CF=e=>N.createElement(Ce.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});CF.displayName="StackItem";var wk=Ae((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:d,shouldWrapChildren:h,...m}=e,v=n?"row":r??"column",b=w.useMemo(()=>t0e({direction:v,spacing:a}),[v,a]),S=w.useMemo(()=>n0e({spacing:a,direction:v}),[a,v]),_=!!u,E=!h&&!_,k=w.useMemo(()=>{const A=ex(l);return E?A:A.map((M,R)=>{const D=typeof M.key<"u"?M.key:R,j=R+1===A.length,H=h?N.createElement(CF,{key:D},M):M;if(!_)return H;const K=w.cloneElement(u,{__css:S}),te=j?null:K;return N.createElement(w.Fragment,{key:D},H,te)})},[u,S,_,E,h,l]),T=Qr("chakra-stack",d);return N.createElement(Ce.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:b.flexDirection,flexWrap:s,className:T,__css:_?{}:{[K7]:b[K7]},...m},k)});wk.displayName="Stack";var Ey=Ae((e,t)=>N.createElement(wk,{align:"center",...e,direction:"row",ref:t}));Ey.displayName="HStack";var yn=Ae((e,t)=>N.createElement(wk,{align:"center",...e,direction:"column",ref:t}));yn.displayName="VStack";var Jt=Ae(function(t,n){const r=Oo("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=Sn(t),u=yk({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return N.createElement(Ce.p,{ref:n,className:Qr("chakra-text",t.className),...u,...l,__css:r})});Jt.displayName="Text";function NO(e){return typeof e=="number"?`${e}px`:e}var r0e=Ae(function(t,n){const{spacing:r="0.5rem",spacingX:i,spacingY:o,children:a,justify:s,direction:l,align:u,className:d,shouldWrapChildren:h,...m}=t,v=w.useMemo(()=>{const{spacingX:S=r,spacingY:_=r}={spacingX:i,spacingY:o};return{"--chakra-wrap-x-spacing":E=>Gd(S,k=>NO(r7("space",k)(E))),"--chakra-wrap-y-spacing":E=>Gd(_,k=>NO(r7("space",k)(E))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,i,o,s,u,l]),b=w.useMemo(()=>h?w.Children.map(a,(S,_)=>N.createElement(_F,{key:_},S)):a,[a,h]);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-wrap",d),overflow:"hidden",...m},N.createElement(Ce.ul,{className:"chakra-wrap__list",__css:v},b))});r0e.displayName="Wrap";var _F=Ae(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:Qr("chakra-wrap__listitem",r),...i})});_F.displayName="WrapItem";var i0e={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},kF=i0e,Eg=()=>{},o0e={document:kF,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:Eg,removeEventListener:Eg,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:Eg,removeListener:Eg}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:Eg,setInterval:()=>0,clearInterval:Eg},a0e=o0e,s0e={window:a0e,document:kF},EF=typeof window<"u"?{window,document}:s0e,PF=w.createContext(EF);PF.displayName="EnvironmentContext";function TF(e){const{children:t,environment:n}=e,[r,i]=w.useState(null),[o,a]=w.useState(!1);w.useEffect(()=>a(!0),[]);const s=w.useMemo(()=>{if(n)return n;const l=r==null?void 0:r.ownerDocument,u=r==null?void 0:r.ownerDocument.defaultView;return l?{document:l,window:u}:EF},[r,n]);return N.createElement(PF.Provider,{value:s},t,!n&&o&&N.createElement("span",{id:"__chakra_env",hidden:!0,ref:l=>{w.startTransition(()=>{l&&i(l)})}}))}TF.displayName="EnvironmentProvider";var l0e=e=>e?"":void 0;function u0e(){const e=w.useRef(new Map),t=e.current,n=w.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=w.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return w.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function L6(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function c0e(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:d,tabIndex:h,onMouseOver:m,onMouseLeave:v,...b}=e,[S,_]=w.useState(!0),[E,k]=w.useState(!1),T=u0e(),A=Z=>{Z&&Z.tagName!=="BUTTON"&&_(!1)},M=S?h:h||0,R=n&&!r,D=w.useCallback(Z=>{if(n){Z.stopPropagation(),Z.preventDefault();return}Z.currentTarget.focus(),l==null||l(Z)},[n,l]),j=w.useCallback(Z=>{E&&L6(Z)&&(Z.preventDefault(),Z.stopPropagation(),k(!1),T.remove(document,"keyup",j,!1))},[E,T]),z=w.useCallback(Z=>{if(u==null||u(Z),n||Z.defaultPrevented||Z.metaKey||!L6(Z.nativeEvent)||S)return;const U=i&&Z.key==="Enter";o&&Z.key===" "&&(Z.preventDefault(),k(!0)),U&&(Z.preventDefault(),Z.currentTarget.click()),T.add(document,"keyup",j,!1)},[n,S,u,i,o,T,j]),H=w.useCallback(Z=>{if(d==null||d(Z),n||Z.defaultPrevented||Z.metaKey||!L6(Z.nativeEvent)||S)return;o&&Z.key===" "&&(Z.preventDefault(),k(!1),Z.currentTarget.click())},[o,S,n,d]),K=w.useCallback(Z=>{Z.button===0&&(k(!1),T.remove(document,"mouseup",K,!1))},[T]),te=w.useCallback(Z=>{if(Z.button!==0)return;if(n){Z.stopPropagation(),Z.preventDefault();return}S||k(!0),Z.currentTarget.focus({preventScroll:!0}),T.add(document,"mouseup",K,!1),a==null||a(Z)},[n,S,a,T,K]),G=w.useCallback(Z=>{Z.button===0&&(S||k(!1),s==null||s(Z))},[s,S]),$=w.useCallback(Z=>{if(n){Z.preventDefault();return}m==null||m(Z)},[n,m]),W=w.useCallback(Z=>{E&&(Z.preventDefault(),k(!1)),v==null||v(Z)},[E,v]),X=Hn(t,A);return S?{...b,ref:X,type:"button","aria-disabled":R?void 0:n,disabled:R,onClick:D,onMouseDown:a,onMouseUp:s,onKeyUp:d,onKeyDown:u,onMouseOver:m,onMouseLeave:v}:{...b,ref:X,role:"button","data-active":l0e(E),"aria-disabled":n?"true":void 0,tabIndex:R?void 0:M,onClick:D,onMouseDown:te,onMouseUp:G,onKeyUp:H,onKeyDown:z,onMouseOver:$,onMouseLeave:W}}function LF(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function AF(e){if(!LF(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function d0e(e){var t;return((t=OF(e))==null?void 0:t.defaultView)??window}function OF(e){return LF(e)?e.ownerDocument:document}function f0e(e){return OF(e).activeElement}var MF=e=>e.hasAttribute("tabindex"),h0e=e=>MF(e)&&e.tabIndex===-1;function p0e(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function IF(e){return e.parentElement&&IF(e.parentElement)?!0:e.hidden}function g0e(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function RF(e){if(!AF(e)||IF(e)||p0e(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():g0e(e)?!0:MF(e)}function m0e(e){return e?AF(e)&&RF(e)&&!h0e(e):!1}var v0e=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],y0e=v0e.join(),b0e=e=>e.offsetWidth>0&&e.offsetHeight>0;function DF(e){const t=Array.from(e.querySelectorAll(y0e));return t.unshift(e),t.filter(n=>RF(n)&&b0e(n))}function S0e(e){const t=e.current;if(!t)return!1;const n=f0e(t);return!n||t.contains(n)?!1:!!m0e(n)}function x0e(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;Ud(()=>{if(!o||S0e(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var w0e={preventScroll:!0,shouldFocus:!1};function C0e(e,t=w0e){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=_0e(e)?e.current:e,s=i&&o,l=w.useRef(s),u=w.useRef(o);Gs(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const d=w.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=DF(a);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[o,r,a,n]);Ud(()=>{d()},[d]),Nh(a,"transitionend",d)}function _0e(e){return"current"in e}var Qo="top",cs="bottom",ds="right",Jo="left",Ck="auto",Py=[Qo,cs,ds,Jo],Ym="start",I2="end",k0e="clippingParents",NF="viewport",Y1="popper",E0e="reference",jO=Py.reduce(function(e,t){return e.concat([t+"-"+Ym,t+"-"+I2])},[]),jF=[].concat(Py,[Ck]).reduce(function(e,t){return e.concat([t,t+"-"+Ym,t+"-"+I2])},[]),P0e="beforeRead",T0e="read",L0e="afterRead",A0e="beforeMain",O0e="main",M0e="afterMain",I0e="beforeWrite",R0e="write",D0e="afterWrite",N0e=[P0e,T0e,L0e,A0e,O0e,M0e,I0e,R0e,D0e];function lu(e){return e?(e.nodeName||"").toLowerCase():null}function gs(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qh(e){var t=gs(e).Element;return e instanceof t||e instanceof Element}function as(e){var t=gs(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function _k(e){if(typeof ShadowRoot>"u")return!1;var t=gs(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function j0e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!as(o)||!lu(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function B0e(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!as(i)||!lu(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const $0e={name:"applyStyles",enabled:!0,phase:"write",fn:j0e,effect:B0e,requires:["computeStyles"]};function Jl(e){return e.split("-")[0]}var $h=Math.max,h5=Math.min,Km=Math.round;function X7(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function BF(){return!/^((?!chrome|android).)*safari/i.test(X7())}function Xm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&as(e)&&(i=e.offsetWidth>0&&Km(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Km(r.height)/e.offsetHeight||1);var a=qh(e)?gs(e):window,s=a.visualViewport,l=!BF()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,d=(r.top+(l&&s?s.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:d,right:u+h,bottom:d+m,left:u,x:u,y:d}}function kk(e){var t=Xm(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function $F(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_k(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function nc(e){return gs(e).getComputedStyle(e)}function F0e(e){return["table","td","th"].indexOf(lu(e))>=0}function af(e){return((qh(e)?e.ownerDocument:e.document)||window.document).documentElement}function ox(e){return lu(e)==="html"?e:e.assignedSlot||e.parentNode||(_k(e)?e.host:null)||af(e)}function BO(e){return!as(e)||nc(e).position==="fixed"?null:e.offsetParent}function z0e(e){var t=/firefox/i.test(X7()),n=/Trident/i.test(X7());if(n&&as(e)){var r=nc(e);if(r.position==="fixed")return null}var i=ox(e);for(_k(i)&&(i=i.host);as(i)&&["html","body"].indexOf(lu(i))<0;){var o=nc(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Ty(e){for(var t=gs(e),n=BO(e);n&&F0e(n)&&nc(n).position==="static";)n=BO(n);return n&&(lu(n)==="html"||lu(n)==="body"&&nc(n).position==="static")?t:n||z0e(e)||t}function Ek(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Zv(e,t,n){return $h(e,h5(t,n))}function H0e(e,t,n){var r=Zv(e,t,n);return r>n?n:r}function FF(){return{top:0,right:0,bottom:0,left:0}}function zF(e){return Object.assign({},FF(),e)}function HF(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var V0e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,zF(typeof t!="number"?t:HF(t,Py))};function W0e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Jl(n.placement),l=Ek(s),u=[Jo,ds].indexOf(s)>=0,d=u?"height":"width";if(!(!o||!a)){var h=V0e(i.padding,n),m=kk(o),v=l==="y"?Qo:Jo,b=l==="y"?cs:ds,S=n.rects.reference[d]+n.rects.reference[l]-a[l]-n.rects.popper[d],_=a[l]-n.rects.reference[l],E=Ty(o),k=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,T=S/2-_/2,A=h[v],M=k-m[d]-h[b],R=k/2-m[d]/2+T,D=Zv(A,R,M),j=l;n.modifiersData[r]=(t={},t[j]=D,t.centerOffset=D-R,t)}}function U0e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||$F(t.elements.popper,i)&&(t.elements.arrow=i))}const G0e={name:"arrow",enabled:!0,phase:"main",fn:W0e,effect:U0e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Zm(e){return e.split("-")[1]}var q0e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Y0e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Km(t*i)/i||0,y:Km(n*i)/i||0}}function $O(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,m=a.x,v=m===void 0?0:m,b=a.y,S=b===void 0?0:b,_=typeof d=="function"?d({x:v,y:S}):{x:v,y:S};v=_.x,S=_.y;var E=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),T=Jo,A=Qo,M=window;if(u){var R=Ty(n),D="clientHeight",j="clientWidth";if(R===gs(n)&&(R=af(n),nc(R).position!=="static"&&s==="absolute"&&(D="scrollHeight",j="scrollWidth")),R=R,i===Qo||(i===Jo||i===ds)&&o===I2){A=cs;var z=h&&R===M&&M.visualViewport?M.visualViewport.height:R[D];S-=z-r.height,S*=l?1:-1}if(i===Jo||(i===Qo||i===cs)&&o===I2){T=ds;var H=h&&R===M&&M.visualViewport?M.visualViewport.width:R[j];v-=H-r.width,v*=l?1:-1}}var K=Object.assign({position:s},u&&q0e),te=d===!0?Y0e({x:v,y:S}):{x:v,y:S};if(v=te.x,S=te.y,l){var G;return Object.assign({},K,(G={},G[A]=k?"0":"",G[T]=E?"0":"",G.transform=(M.devicePixelRatio||1)<=1?"translate("+v+"px, "+S+"px)":"translate3d("+v+"px, "+S+"px, 0)",G))}return Object.assign({},K,(t={},t[A]=k?S+"px":"",t[T]=E?v+"px":"",t.transform="",t))}function K0e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Jl(t.placement),variation:Zm(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,$O(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,$O(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const X0e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:K0e,data:{}};var ib={passive:!0};function Z0e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=gs(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,ib)}),s&&l.addEventListener("resize",n.update,ib),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,ib)}),s&&l.removeEventListener("resize",n.update,ib)}}const Q0e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Z0e,data:{}};var J0e={left:"right",right:"left",bottom:"top",top:"bottom"};function v4(e){return e.replace(/left|right|bottom|top/g,function(t){return J0e[t]})}var e1e={start:"end",end:"start"};function FO(e){return e.replace(/start|end/g,function(t){return e1e[t]})}function Pk(e){var t=gs(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Tk(e){return Xm(af(e)).left+Pk(e).scrollLeft}function t1e(e,t){var n=gs(e),r=af(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=BF();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+Tk(e),y:l}}function n1e(e){var t,n=af(e),r=Pk(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=$h(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=$h(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Tk(e),l=-r.scrollTop;return nc(i||n).direction==="rtl"&&(s+=$h(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function Lk(e){var t=nc(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function VF(e){return["html","body","#document"].indexOf(lu(e))>=0?e.ownerDocument.body:as(e)&&Lk(e)?e:VF(ox(e))}function Qv(e,t){var n;t===void 0&&(t=[]);var r=VF(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=gs(r),a=i?[o].concat(o.visualViewport||[],Lk(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Qv(ox(a)))}function Z7(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function r1e(e,t){var n=Xm(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function zO(e,t,n){return t===NF?Z7(t1e(e,n)):qh(t)?r1e(t,n):Z7(n1e(af(e)))}function i1e(e){var t=Qv(ox(e)),n=["absolute","fixed"].indexOf(nc(e).position)>=0,r=n&&as(e)?Ty(e):e;return qh(r)?t.filter(function(i){return qh(i)&&$F(i,r)&&lu(i)!=="body"}):[]}function o1e(e,t,n,r){var i=t==="clippingParents"?i1e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var d=zO(e,u,r);return l.top=$h(d.top,l.top),l.right=h5(d.right,l.right),l.bottom=h5(d.bottom,l.bottom),l.left=$h(d.left,l.left),l},zO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function WF(e){var t=e.reference,n=e.element,r=e.placement,i=r?Jl(r):null,o=r?Zm(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Qo:l={x:a,y:t.y-n.height};break;case cs:l={x:a,y:t.y+t.height};break;case ds:l={x:t.x+t.width,y:s};break;case Jo:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?Ek(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case Ym:l[u]=l[u]-(t[d]/2-n[d]/2);break;case I2:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function R2(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?k0e:s,u=n.rootBoundary,d=u===void 0?NF:u,h=n.elementContext,m=h===void 0?Y1:h,v=n.altBoundary,b=v===void 0?!1:v,S=n.padding,_=S===void 0?0:S,E=zF(typeof _!="number"?_:HF(_,Py)),k=m===Y1?E0e:Y1,T=e.rects.popper,A=e.elements[b?k:m],M=o1e(qh(A)?A:A.contextElement||af(e.elements.popper),l,d,a),R=Xm(e.elements.reference),D=WF({reference:R,element:T,strategy:"absolute",placement:i}),j=Z7(Object.assign({},T,D)),z=m===Y1?j:R,H={top:M.top-z.top+E.top,bottom:z.bottom-M.bottom+E.bottom,left:M.left-z.left+E.left,right:z.right-M.right+E.right},K=e.modifiersData.offset;if(m===Y1&&K){var te=K[i];Object.keys(H).forEach(function(G){var $=[ds,cs].indexOf(G)>=0?1:-1,W=[Qo,cs].indexOf(G)>=0?"y":"x";H[G]+=te[W]*$})}return H}function a1e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?jF:l,d=Zm(r),h=d?s?jO:jO.filter(function(b){return Zm(b)===d}):Py,m=h.filter(function(b){return u.indexOf(b)>=0});m.length===0&&(m=h);var v=m.reduce(function(b,S){return b[S]=R2(e,{placement:S,boundary:i,rootBoundary:o,padding:a})[Jl(S)],b},{});return Object.keys(v).sort(function(b,S){return v[b]-v[S]})}function s1e(e){if(Jl(e)===Ck)return[];var t=v4(e);return[FO(e),t,FO(t)]}function l1e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,v=n.flipVariations,b=v===void 0?!0:v,S=n.allowedAutoPlacements,_=t.options.placement,E=Jl(_),k=E===_,T=l||(k||!b?[v4(_)]:s1e(_)),A=[_].concat(T).reduce(function(ye,Fe){return ye.concat(Jl(Fe)===Ck?a1e(t,{placement:Fe,boundary:d,rootBoundary:h,padding:u,flipVariations:b,allowedAutoPlacements:S}):Fe)},[]),M=t.rects.reference,R=t.rects.popper,D=new Map,j=!0,z=A[0],H=0;H=0,W=$?"width":"height",X=R2(t,{placement:K,boundary:d,rootBoundary:h,altBoundary:m,padding:u}),Z=$?G?ds:Jo:G?cs:Qo;M[W]>R[W]&&(Z=v4(Z));var U=v4(Z),Q=[];if(o&&Q.push(X[te]<=0),s&&Q.push(X[Z]<=0,X[U]<=0),Q.every(function(ye){return ye})){z=K,j=!1;break}D.set(K,Q)}if(j)for(var re=b?3:1,fe=function(Fe){var Me=A.find(function(rt){var Ve=D.get(rt);if(Ve)return Ve.slice(0,Fe).every(function(je){return je})});if(Me)return z=Me,"break"},Ee=re;Ee>0;Ee--){var be=fe(Ee);if(be==="break")break}t.placement!==z&&(t.modifiersData[r]._skip=!0,t.placement=z,t.reset=!0)}}const u1e={name:"flip",enabled:!0,phase:"main",fn:l1e,requiresIfExists:["offset"],data:{_skip:!1}};function HO(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function VO(e){return[Qo,ds,cs,Jo].some(function(t){return e[t]>=0})}function c1e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=R2(t,{elementContext:"reference"}),s=R2(t,{altBoundary:!0}),l=HO(a,r),u=HO(s,i,o),d=VO(l),h=VO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const d1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:c1e};function f1e(e,t,n){var r=Jl(e),i=[Jo,Qo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Jo,ds].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function h1e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=jF.reduce(function(d,h){return d[h]=f1e(h,t.rects,o),d},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const p1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:h1e};function g1e(e){var t=e.state,n=e.name;t.modifiersData[n]=WF({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const m1e={name:"popperOffsets",enabled:!0,phase:"read",fn:g1e,data:{}};function v1e(e){return e==="x"?"y":"x"}function y1e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,m=n.tether,v=m===void 0?!0:m,b=n.tetherOffset,S=b===void 0?0:b,_=R2(t,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),E=Jl(t.placement),k=Zm(t.placement),T=!k,A=Ek(E),M=v1e(A),R=t.modifiersData.popperOffsets,D=t.rects.reference,j=t.rects.popper,z=typeof S=="function"?S(Object.assign({},t.rects,{placement:t.placement})):S,H=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,te={x:0,y:0};if(R){if(o){var G,$=A==="y"?Qo:Jo,W=A==="y"?cs:ds,X=A==="y"?"height":"width",Z=R[A],U=Z+_[$],Q=Z-_[W],re=v?-j[X]/2:0,fe=k===Ym?D[X]:j[X],Ee=k===Ym?-j[X]:-D[X],be=t.elements.arrow,ye=v&&be?kk(be):{width:0,height:0},Fe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:FF(),Me=Fe[$],rt=Fe[W],Ve=Zv(0,D[X],ye[X]),je=T?D[X]/2-re-Ve-Me-H.mainAxis:fe-Ve-Me-H.mainAxis,wt=T?-D[X]/2+re+Ve+rt+H.mainAxis:Ee+Ve+rt+H.mainAxis,Be=t.elements.arrow&&Ty(t.elements.arrow),at=Be?A==="y"?Be.clientTop||0:Be.clientLeft||0:0,bt=(G=K==null?void 0:K[A])!=null?G:0,Le=Z+je-bt-at,ut=Z+wt-bt,Mt=Zv(v?h5(U,Le):U,Z,v?$h(Q,ut):Q);R[A]=Mt,te[A]=Mt-Z}if(s){var ct,_t=A==="x"?Qo:Jo,un=A==="x"?cs:ds,ae=R[M],De=M==="y"?"height":"width",Ke=ae+_[_t],Xe=ae-_[un],xe=[Qo,Jo].indexOf(E)!==-1,Ne=(ct=K==null?void 0:K[M])!=null?ct:0,Ct=xe?Ke:ae-D[De]-j[De]-Ne+H.altAxis,Dt=xe?ae+D[De]+j[De]-Ne-H.altAxis:Xe,Te=v&&xe?H0e(Ct,ae,Dt):Zv(v?Ct:Ke,ae,v?Dt:Xe);R[M]=Te,te[M]=Te-ae}t.modifiersData[r]=te}}const b1e={name:"preventOverflow",enabled:!0,phase:"main",fn:y1e,requiresIfExists:["offset"]};function S1e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function x1e(e){return e===gs(e)||!as(e)?Pk(e):S1e(e)}function w1e(e){var t=e.getBoundingClientRect(),n=Km(t.width)/e.offsetWidth||1,r=Km(t.height)/e.offsetHeight||1;return n!==1||r!==1}function C1e(e,t,n){n===void 0&&(n=!1);var r=as(t),i=as(t)&&w1e(t),o=af(t),a=Xm(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((lu(t)!=="body"||Lk(o))&&(s=x1e(t)),as(t)?(l=Xm(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Tk(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function _1e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function k1e(e){var t=_1e(e);return N0e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function E1e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function P1e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var WO={placement:"bottom",modifiers:[],strategy:"absolute"};function UO(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),oi={arrowShadowColor:Pg("--popper-arrow-shadow-color"),arrowSize:Pg("--popper-arrow-size","8px"),arrowSizeHalf:Pg("--popper-arrow-size-half"),arrowBg:Pg("--popper-arrow-bg"),transformOrigin:Pg("--popper-transform-origin"),arrowOffset:Pg("--popper-arrow-offset")};function O1e(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var M1e={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},I1e=e=>M1e[e],GO={scroll:!0,resize:!0};function R1e(e){let t;return typeof e=="object"?t={enabled:!0,options:{...GO,...e}}:t={enabled:e,options:GO},t}var D1e={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},N1e={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{qO(e)},effect:({state:e})=>()=>{qO(e)}},qO=e=>{e.elements.popper.style.setProperty(oi.transformOrigin.var,I1e(e.placement))},j1e={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{B1e(e)}},B1e=e=>{var t;if(!e.placement)return;const n=$1e(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:oi.arrowSize.varRef,height:oi.arrowSize.varRef,zIndex:-1});const r={[oi.arrowSizeHalf.var]:`calc(${oi.arrowSize.varRef} / 2)`,[oi.arrowOffset.var]:`calc(${oi.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},$1e=e=>{if(e.startsWith("top"))return{property:"bottom",value:oi.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:oi.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:oi.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:oi.arrowOffset.varRef}},F1e={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{YO(e)},effect:({state:e})=>()=>{YO(e)}},YO=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");t&&Object.assign(t.style,{transform:"rotate(45deg)",background:oi.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:O1e(e.placement)})},z1e={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},H1e={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function V1e(e,t="ltr"){var n;const r=((n=z1e[e])==null?void 0:n[t])||e;return t==="ltr"?r:H1e[e]??r}function UF(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:s,gutter:l=8,flip:u=!0,boundary:d="clippingParents",preventOverflow:h=!0,matchWidth:m,direction:v="ltr"}=e,b=w.useRef(null),S=w.useRef(null),_=w.useRef(null),E=V1e(r,v),k=w.useRef(()=>{}),T=w.useCallback(()=>{var H;!t||!b.current||!S.current||((H=k.current)==null||H.call(k),_.current=A1e(b.current,S.current,{placement:E,modifiers:[F1e,j1e,N1e,{...D1e,enabled:!!m},{name:"eventListeners",...R1e(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:d}},...n??[]],strategy:i}),_.current.forceUpdate(),k.current=_.current.destroy)},[E,t,n,m,a,o,s,l,u,h,d,i]);w.useEffect(()=>()=>{var H;!b.current&&!S.current&&((H=_.current)==null||H.destroy(),_.current=null)},[]);const A=w.useCallback(H=>{b.current=H,T()},[T]),M=w.useCallback((H={},K=null)=>({...H,ref:Hn(A,K)}),[A]),R=w.useCallback(H=>{S.current=H,T()},[T]),D=w.useCallback((H={},K=null)=>({...H,ref:Hn(R,K),style:{...H.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,R,m]),j=w.useCallback((H={},K=null)=>{const{size:te,shadowColor:G,bg:$,style:W,...X}=H;return{...X,ref:K,"data-popper-arrow":"",style:W1e(H)}},[]),z=w.useCallback((H={},K=null)=>({...H,ref:K,"data-popper-arrow-inner":""}),[]);return{update(){var H;(H=_.current)==null||H.update()},forceUpdate(){var H;(H=_.current)==null||H.forceUpdate()},transformOrigin:oi.transformOrigin.varRef,referenceRef:A,popperRef:R,getPopperProps:D,getArrowProps:j,getArrowInnerProps:z,getReferenceProps:M}}function W1e(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function GF(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=Er(n),a=Er(t),[s,l]=w.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,d=r!==void 0,h=w.useId(),m=i??`disclosure-${h}`,v=w.useCallback(()=>{d||l(!1),a==null||a()},[d,a]),b=w.useCallback(()=>{d||l(!0),o==null||o()},[d,o]),S=w.useCallback(()=>{u?v():b()},[u,b,v]);function _(k={}){return{...k,"aria-expanded":u,"aria-controls":m,onClick(T){var A;(A=k.onClick)==null||A.call(k,T),S()}}}function E(k={}){return{...k,hidden:!u,id:m}}return{isOpen:u,onOpen:b,onClose:v,onToggle:S,isControlled:d,getButtonProps:_,getDisclosureProps:E}}function U1e(e){const{isOpen:t,ref:n}=e,[r,i]=w.useState(t),[o,a]=w.useState(!1);return w.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),Nh(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=d0e(n.current),d=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(d)}}}function qF(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var el={},G1e={get exports(){return el},set exports(e){el=e}},ja={},Fh={},q1e={get exports(){return Fh},set exports(e){Fh=e}},YF={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t(U,Q){var re=U.length;U.push(Q);e:for(;0>>1,Ee=U[fe];if(0>>1;fei(Fe,re))Mei(rt,Fe)?(U[fe]=rt,U[Me]=re,fe=Me):(U[fe]=Fe,U[ye]=re,fe=ye);else if(Mei(rt,re))U[fe]=rt,U[Me]=re,fe=Me;else break e}}return Q}function i(U,Q){var re=U.sortIndex-Q.sortIndex;return re!==0?re:U.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],d=1,h=null,m=3,v=!1,b=!1,S=!1,_=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(U){for(var Q=n(u);Q!==null;){if(Q.callback===null)r(u);else if(Q.startTime<=U)r(u),Q.sortIndex=Q.expirationTime,t(l,Q);else break;Q=n(u)}}function A(U){if(S=!1,T(U),!b)if(n(l)!==null)b=!0,X(M);else{var Q=n(u);Q!==null&&Z(A,Q.startTime-U)}}function M(U,Q){b=!1,S&&(S=!1,E(j),j=-1),v=!0;var re=m;try{for(T(Q),h=n(l);h!==null&&(!(h.expirationTime>Q)||U&&!K());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,m=h.priorityLevel;var Ee=fe(h.expirationTime<=Q);Q=e.unstable_now(),typeof Ee=="function"?h.callback=Ee:h===n(l)&&r(l),T(Q)}else r(l);h=n(l)}if(h!==null)var be=!0;else{var ye=n(u);ye!==null&&Z(A,ye.startTime-Q),be=!1}return be}finally{h=null,m=re,v=!1}}var R=!1,D=null,j=-1,z=5,H=-1;function K(){return!(e.unstable_now()-HU||125fe?(U.sortIndex=re,t(u,U),n(l)===null&&U===n(u)&&(S?(E(j),j=-1):S=!0,Z(A,re-fe))):(U.sortIndex=Ee,t(l,U),b||v||(b=!0,X(M))),U},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(U){var Q=m;return function(){var re=m;m=Q;try{return U.apply(this,arguments)}finally{m=re}}}})(YF);(function(e){e.exports=YF})(q1e);/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var KF=w,Ia=Fh;function He(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Q7=Object.prototype.hasOwnProperty,Y1e=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,KO={},XO={};function K1e(e){return Q7.call(XO,e)?!0:Q7.call(KO,e)?!1:Y1e.test(e)?XO[e]=!0:(KO[e]=!0,!1)}function X1e(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Z1e(e,t,n,r){if(t===null||typeof t>"u"||X1e(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mo(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Yi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Yi[e]=new Mo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Yi[t]=new Mo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Yi[e]=new Mo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Yi[e]=new Mo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Yi[e]=new Mo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Yi[e]=new Mo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Yi[e]=new Mo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Yi[e]=new Mo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Yi[e]=new Mo(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ak=/[\-:]([a-z])/g;function Ok(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Yi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!1,!1)});Yi.xlinkHref=new Mo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Yi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!0,!0)});function Mk(e,t,n,r){var i=Yi.hasOwnProperty(t)?Yi[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` +`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{O6=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?xv(e):""}function Q1e(e){switch(e.tag){case 5:return xv(e.type);case 16:return xv("Lazy");case 13:return xv("Suspense");case 19:return xv("SuspenseList");case 0:case 2:case 15:return e=M6(e.type,!1),e;case 11:return e=M6(e.type.render,!1),e;case 1:return e=M6(e.type,!0),e;default:return""}}function n9(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qg:return"Fragment";case Zg:return"Portal";case J7:return"Profiler";case Ik:return"StrictMode";case e9:return"Suspense";case t9:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case QF:return(e.displayName||"Context")+".Consumer";case ZF:return(e._context.displayName||"Context")+".Provider";case Rk:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dk:return t=e.displayName||null,t!==null?t:n9(e.type)||"Memo";case md:t=e._payload,e=e._init;try{return n9(e(t))}catch{}}return null}function J1e(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return n9(t);case 8:return t===Ik?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function qd(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ez(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function eve(e){var t=ez(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ab(e){e._valueTracker||(e._valueTracker=eve(e))}function tz(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ez(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function p5(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function r9(e,t){var n=t.checked;return Lr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function QO(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qd(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function nz(e,t){t=t.checked,t!=null&&Mk(e,"checked",t,!1)}function i9(e,t){nz(e,t);var n=qd(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?o9(e,t.type,n):t.hasOwnProperty("defaultValue")&&o9(e,t.type,qd(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function JO(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function o9(e,t,n){(t!=="number"||p5(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wv=Array.isArray;function Pm(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=sb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function N2(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jv={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tve=["Webkit","ms","Moz","O"];Object.keys(Jv).forEach(function(e){tve.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jv[t]=Jv[e]})});function az(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jv.hasOwnProperty(e)&&Jv[e]?(""+t).trim():t+"px"}function sz(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=az(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var nve=Lr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function l9(e,t){if(t){if(nve[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(He(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(He(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(He(61))}if(t.style!=null&&typeof t.style!="object")throw Error(He(62))}}function u9(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var c9=null;function Nk(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var d9=null,Tm=null,Lm=null;function nM(e){if(e=Oy(e)){if(typeof d9!="function")throw Error(He(280));var t=e.stateNode;t&&(t=cx(t),d9(e.stateNode,e.type,t))}}function lz(e){Tm?Lm?Lm.push(e):Lm=[e]:Tm=e}function uz(){if(Tm){var e=Tm,t=Lm;if(Lm=Tm=null,nM(e),t)for(e=0;e>>=0,e===0?32:31-(hve(e)/pve|0)|0}var lb=64,ub=4194304;function Cv(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function y5(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Cv(s):(o&=a,o!==0&&(r=Cv(o)))}else a=n&~i,a!==0?r=Cv(a):o!==0&&(r=Cv(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ly(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xs(t),e[t]=n}function yve(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=t2),dM=String.fromCharCode(32),fM=!1;function Lz(e,t){switch(e){case"keyup":return Gve.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Az(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jg=!1;function Yve(e,t){switch(e){case"compositionend":return Az(t);case"keypress":return t.which!==32?null:(fM=!0,dM);case"textInput":return e=t.data,e===dM&&fM?null:e;default:return null}}function Kve(e,t){if(Jg)return e==="compositionend"||!Wk&&Lz(e,t)?(e=Pz(),b4=zk=Ed=null,Jg=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=mM(n)}}function Rz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dz(){for(var e=window,t=p5();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=p5(e.document)}return t}function Uk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function i2e(e){var t=Dz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Rz(n.ownerDocument.documentElement,n)){if(r!==null&&Uk(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=vM(n,o);var a=vM(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,em=null,v9=null,r2=null,y9=!1;function yM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;y9||em==null||em!==p5(r)||(r=em,"selectionStart"in r&&Uk(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),r2&&H2(r2,r)||(r2=r,r=x5(v9,"onSelect"),0rm||(e.current=_9[rm],_9[rm]=null,rm--)}function rr(e,t){rm++,_9[rm]=e.current,e.current=t}var Yd={},lo=lf(Yd),ea=lf(!1),Yh=Yd;function Jm(e,t){var n=e.type.contextTypes;if(!n)return Yd;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ta(e){return e=e.childContextTypes,e!=null}function C5(){fr(ea),fr(lo)}function kM(e,t,n){if(lo.current!==Yd)throw Error(He(168));rr(lo,t),rr(ea,n)}function Wz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(He(108,J1e(e)||"Unknown",i));return Lr({},n,r)}function _5(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yd,Yh=lo.current,rr(lo,e),rr(ea,ea.current),!0}function EM(e,t,n){var r=e.stateNode;if(!r)throw Error(He(169));n?(e=Wz(e,t,Yh),r.__reactInternalMemoizedMergedChildContext=e,fr(ea),fr(lo),rr(lo,e)):fr(ea),rr(ea,n)}var Wu=null,dx=!1,G6=!1;function Uz(e){Wu===null?Wu=[e]:Wu.push(e)}function m2e(e){dx=!0,Uz(e)}function uf(){if(!G6&&Wu!==null){G6=!0;var e=0,t=Bn;try{var n=Wu;for(Bn=1;e>=a,i-=a,qu=1<<32-Xs(t)+i|n<j?(z=D,D=null):z=D.sibling;var H=m(E,D,T[j],A);if(H===null){D===null&&(D=z);break}e&&D&&H.alternate===null&&t(E,D),k=o(H,k,j),R===null?M=H:R.sibling=H,R=H,D=z}if(j===T.length)return n(E,D),yr&&hh(E,j),M;if(D===null){for(;jj?(z=D,D=null):z=D.sibling;var K=m(E,D,H.value,A);if(K===null){D===null&&(D=z);break}e&&D&&K.alternate===null&&t(E,D),k=o(K,k,j),R===null?M=K:R.sibling=K,R=K,D=z}if(H.done)return n(E,D),yr&&hh(E,j),M;if(D===null){for(;!H.done;j++,H=T.next())H=h(E,H.value,A),H!==null&&(k=o(H,k,j),R===null?M=H:R.sibling=H,R=H);return yr&&hh(E,j),M}for(D=r(E,D);!H.done;j++,H=T.next())H=v(D,E,j,H.value,A),H!==null&&(e&&H.alternate!==null&&D.delete(H.key===null?j:H.key),k=o(H,k,j),R===null?M=H:R.sibling=H,R=H);return e&&D.forEach(function(te){return t(E,te)}),yr&&hh(E,j),M}function _(E,k,T,A){if(typeof T=="object"&&T!==null&&T.type===Qg&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case ob:e:{for(var M=T.key,R=k;R!==null;){if(R.key===M){if(M=T.type,M===Qg){if(R.tag===7){n(E,R.sibling),k=i(R,T.props.children),k.return=E,E=k;break e}}else if(R.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===md&&IM(M)===R.type){n(E,R.sibling),k=i(R,T.props),k.ref=ev(E,R,T),k.return=E,E=k;break e}n(E,R);break}else t(E,R);R=R.sibling}T.type===Qg?(k=Hh(T.props.children,E.mode,A,T.key),k.return=E,E=k):(A=P4(T.type,T.key,T.props,null,E.mode,A),A.ref=ev(E,k,T),A.return=E,E=A)}return a(E);case Zg:e:{for(R=T.key;k!==null;){if(k.key===R)if(k.tag===4&&k.stateNode.containerInfo===T.containerInfo&&k.stateNode.implementation===T.implementation){n(E,k.sibling),k=i(k,T.children||[]),k.return=E,E=k;break e}else{n(E,k);break}else t(E,k);k=k.sibling}k=eC(T,E.mode,A),k.return=E,E=k}return a(E);case md:return R=T._init,_(E,k,R(T._payload),A)}if(wv(T))return b(E,k,T,A);if(K1(T))return S(E,k,T,A);mb(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,k!==null&&k.tag===6?(n(E,k.sibling),k=i(k,T),k.return=E,E=k):(n(E,k),k=J6(T,E.mode,A),k.return=E,E=k),a(E)):n(E,k)}return _}var t0=Jz(!0),eH=Jz(!1),My={},tu=lf(My),G2=lf(My),q2=lf(My);function Lh(e){if(e===My)throw Error(He(174));return e}function eE(e,t){switch(rr(q2,t),rr(G2,e),rr(tu,My),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:s9(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=s9(t,e)}fr(tu),rr(tu,t)}function n0(){fr(tu),fr(G2),fr(q2)}function tH(e){Lh(q2.current);var t=Lh(tu.current),n=s9(t,e.type);t!==n&&(rr(G2,e),rr(tu,n))}function tE(e){G2.current===e&&(fr(tu),fr(G2))}var kr=lf(0);function A5(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var q6=[];function nE(){for(var e=0;en?n:4,e(!0);var r=Y6.transition;Y6.transition={};try{e(!1),t()}finally{Bn=n,Y6.transition=r}}function vH(){return hs().memoizedState}function S2e(e,t,n){var r=jd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},yH(e))bH(t,n);else if(n=Kz(e,t,n,r),n!==null){var i=Lo();Zs(n,e,r,i),SH(n,t,r)}}function x2e(e,t,n){var r=jd(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(yH(e))bH(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,tl(s,a)){var l=t.interleaved;l===null?(i.next=i,Qk(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Kz(e,t,i,r),n!==null&&(i=Lo(),Zs(n,e,r,i),SH(n,t,r))}}function yH(e){var t=e.alternate;return e===Pr||t!==null&&t===Pr}function bH(e,t){i2=O5=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function SH(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bk(e,n)}}var M5={readContext:fs,useCallback:Qi,useContext:Qi,useEffect:Qi,useImperativeHandle:Qi,useInsertionEffect:Qi,useLayoutEffect:Qi,useMemo:Qi,useReducer:Qi,useRef:Qi,useState:Qi,useDebugValue:Qi,useDeferredValue:Qi,useTransition:Qi,useMutableSource:Qi,useSyncExternalStore:Qi,useId:Qi,unstable_isNewReconciler:!1},w2e={readContext:fs,useCallback:function(e,t){return jl().memoizedState=[e,t===void 0?null:t],e},useContext:fs,useEffect:DM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,C4(4194308,4,fH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return C4(4194308,4,e,t)},useInsertionEffect:function(e,t){return C4(4,2,e,t)},useMemo:function(e,t){var n=jl();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jl();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=S2e.bind(null,Pr,e),[r.memoizedState,e]},useRef:function(e){var t=jl();return e={current:e},t.memoizedState=e},useState:RM,useDebugValue:sE,useDeferredValue:function(e){return jl().memoizedState=e},useTransition:function(){var e=RM(!1),t=e[0];return e=b2e.bind(null,e[1]),jl().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pr,i=jl();if(yr){if(n===void 0)throw Error(He(407));n=n()}else{if(n=t(),Li===null)throw Error(He(349));Xh&30||iH(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,DM(aH.bind(null,r,o,e),[e]),r.flags|=2048,X2(9,oH.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=jl(),t=Li.identifierPrefix;if(yr){var n=Yu,r=qu;n=(r&~(1<<32-Xs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Y2++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Vl]=t,e[U2]=r,LH(e,t,!1,!1),t.stateNode=e;e:{switch(a=u9(n,r),n){case"dialog":ar("cancel",e),ar("close",e),i=r;break;case"iframe":case"object":case"embed":ar("load",e),i=r;break;case"video":case"audio":for(i=0;i<_v.length;i++)ar(_v[i],e);i=r;break;case"source":ar("error",e),i=r;break;case"img":case"image":case"link":ar("error",e),ar("load",e),i=r;break;case"details":ar("toggle",e),i=r;break;case"input":QO(e,r),i=r9(e,r),ar("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Lr({},r,{value:void 0}),ar("invalid",e);break;case"textarea":eM(e,r),i=a9(e,r),ar("invalid",e);break;default:i=r}l9(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?sz(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&oz(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&N2(e,l):typeof l=="number"&&N2(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(D2.hasOwnProperty(o)?l!=null&&o==="onScroll"&&ar("scroll",e):l!=null&&Mk(e,o,l,a))}switch(n){case"input":ab(e),JO(e,r,!1);break;case"textarea":ab(e),tM(e);break;case"option":r.value!=null&&e.setAttribute("value",""+qd(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Pm(e,!!r.multiple,o,!1):r.defaultValue!=null&&Pm(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=w5)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ji(t),null;case 6:if(e&&t.stateNode!=null)OH(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(He(166));if(n=Lh(q2.current),Lh(tu.current),gb(t)){if(r=t.stateNode,n=t.memoizedProps,r[Vl]=t,(o=r.nodeValue!==n)&&(e=Aa,e!==null))switch(e.tag){case 3:pb(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&pb(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Vl]=t,t.stateNode=r}return Ji(t),null;case 13:if(fr(kr),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(yr&&Pa!==null&&t.mode&1&&!(t.flags&128))Yz(),e0(),t.flags|=98560,o=!1;else if(o=gb(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(He(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(He(317));o[Vl]=t}else e0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ji(t),o=!1}else Hs!==null&&(V9(Hs),Hs=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||kr.current&1?mi===0&&(mi=3):pE())),t.updateQueue!==null&&(t.flags|=4),Ji(t),null);case 4:return n0(),D9(e,t),e===null&&V2(t.stateNode.containerInfo),Ji(t),null;case 10:return Zk(t.type._context),Ji(t),null;case 17:return ta(t.type)&&C5(),Ji(t),null;case 19:if(fr(kr),o=t.memoizedState,o===null)return Ji(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)tv(o,!1);else{if(mi!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=A5(e),a!==null){for(t.flags|=128,tv(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return rr(kr,kr.current&1|2),t.child}e=e.sibling}o.tail!==null&&Zr()>i0&&(t.flags|=128,r=!0,tv(o,!1),t.lanes=4194304)}else{if(!r)if(e=A5(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),tv(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!yr)return Ji(t),null}else 2*Zr()-o.renderingStartTime>i0&&n!==1073741824&&(t.flags|=128,r=!0,tv(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Zr(),t.sibling=null,n=kr.current,rr(kr,r?n&1|2:n&1),t):(Ji(t),null);case 22:case 23:return hE(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ka&1073741824&&(Ji(t),t.subtreeFlags&6&&(t.flags|=8192)):Ji(t),null;case 24:return null;case 25:return null}throw Error(He(156,t.tag))}function A2e(e,t){switch(qk(t),t.tag){case 1:return ta(t.type)&&C5(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return n0(),fr(ea),fr(lo),nE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tE(t),null;case 13:if(fr(kr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(He(340));e0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fr(kr),null;case 4:return n0(),null;case 10:return Zk(t.type._context),null;case 22:case 23:return hE(),null;case 24:return null;default:return null}}var yb=!1,io=!1,O2e=typeof WeakSet=="function"?WeakSet:Set,pt=null;function sm(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Fr(e,t,r)}else n.current=null}function N9(e,t,n){try{n()}catch(r){Fr(e,t,r)}}var WM=!1;function M2e(e,t){if(b9=b5,e=Dz(),Uk(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,d=0,h=e,m=null;t:for(;;){for(var v;h!==n||i!==0&&h.nodeType!==3||(s=a+i),h!==o||r!==0&&h.nodeType!==3||(l=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(v=h.firstChild)!==null;)m=h,h=v;for(;;){if(h===e)break t;if(m===n&&++u===i&&(s=a),m===o&&++d===r&&(l=a),(v=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=v}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(S9={focusedElem:e,selectionRange:n},b5=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){t=pt;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var S=b.memoizedProps,_=b.memoizedState,E=t.stateNode,k=E.getSnapshotBeforeUpdate(t.elementType===t.type?S:$s(t.type,S),_);E.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(He(163))}}catch(A){Fr(t,t.return,A)}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}return b=WM,WM=!1,b}function o2(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&N9(t,n,o)}i=i.next}while(i!==r)}}function px(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function j9(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function MH(e){var t=e.alternate;t!==null&&(e.alternate=null,MH(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vl],delete t[U2],delete t[C9],delete t[p2e],delete t[g2e])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function IH(e){return e.tag===5||e.tag===3||e.tag===4}function UM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||IH(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function B9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=w5));else if(r!==4&&(e=e.child,e!==null))for(B9(e,t,n),e=e.sibling;e!==null;)B9(e,t,n),e=e.sibling}function $9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for($9(e,t,n),e=e.sibling;e!==null;)$9(e,t,n),e=e.sibling}var Vi=null,Fs=!1;function ud(e,t,n){for(n=n.child;n!==null;)RH(e,t,n),n=n.sibling}function RH(e,t,n){if(eu&&typeof eu.onCommitFiberUnmount=="function")try{eu.onCommitFiberUnmount(ax,n)}catch{}switch(n.tag){case 5:io||sm(n,t);case 6:var r=Vi,i=Fs;Vi=null,ud(e,t,n),Vi=r,Fs=i,Vi!==null&&(Fs?(e=Vi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Vi.removeChild(n.stateNode));break;case 18:Vi!==null&&(Fs?(e=Vi,n=n.stateNode,e.nodeType===8?U6(e.parentNode,n):e.nodeType===1&&U6(e,n),F2(e)):U6(Vi,n.stateNode));break;case 4:r=Vi,i=Fs,Vi=n.stateNode.containerInfo,Fs=!0,ud(e,t,n),Vi=r,Fs=i;break;case 0:case 11:case 14:case 15:if(!io&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&N9(n,t,a),i=i.next}while(i!==r)}ud(e,t,n);break;case 1:if(!io&&(sm(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Fr(n,t,s)}ud(e,t,n);break;case 21:ud(e,t,n);break;case 22:n.mode&1?(io=(r=io)||n.memoizedState!==null,ud(e,t,n),io=r):ud(e,t,n);break;default:ud(e,t,n)}}function GM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new O2e),t.forEach(function(r){var i=z2e.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ds(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Zr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*R2e(r/1960))-r,10e?16:e,Pd===null)var r=!1;else{if(e=Pd,Pd=null,D5=0,pn&6)throw Error(He(331));var i=pn;for(pn|=4,pt=e.current;pt!==null;){var o=pt,a=o.child;if(pt.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lZr()-dE?zh(e,0):cE|=n),na(e,t)}function HH(e,t){t===0&&(e.mode&1?(t=ub,ub<<=1,!(ub&130023424)&&(ub=4194304)):t=1);var n=Lo();e=oc(e,t),e!==null&&(Ly(e,t,n),na(e,n))}function F2e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),HH(e,n)}function z2e(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(He(314))}r!==null&&r.delete(t),HH(e,n)}var VH;VH=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ea.current)Zo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Zo=!1,T2e(e,t,n);Zo=!!(e.flags&131072)}else Zo=!1,yr&&t.flags&1048576&&Gz(t,E5,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_4(e,t),e=t.pendingProps;var i=Jm(t,lo.current);Om(t,n),i=iE(null,t,r,e,i,n);var o=oE();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ta(r)?(o=!0,_5(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Jk(t),i.updater=fx,t.stateNode=i,i._reactInternals=t,L9(t,r,e,n),t=M9(null,t,r,!0,o,n)):(t.tag=0,yr&&o&&Gk(t),Co(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_4(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=V2e(r),e=$s(r,e),i){case 0:t=O9(null,t,r,e,n);break e;case 1:t=zM(null,t,r,e,n);break e;case 11:t=$M(null,t,r,e,n);break e;case 14:t=FM(null,t,r,$s(r.type,e),n);break e}throw Error(He(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),O9(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),zM(e,t,r,i,n);case 3:e:{if(EH(t),e===null)throw Error(He(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Xz(e,t),L5(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=r0(Error(He(423)),t),t=HM(e,t,r,n,i);break e}else if(r!==i){i=r0(Error(He(424)),t),t=HM(e,t,r,n,i);break e}else for(Pa=Rd(t.stateNode.containerInfo.firstChild),Aa=t,yr=!0,Hs=null,n=eH(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(e0(),r===i){t=ac(e,t,n);break e}Co(e,t,r,n)}t=t.child}return t;case 5:return tH(t),e===null&&E9(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,x9(r,i)?a=null:o!==null&&x9(r,o)&&(t.flags|=32),kH(e,t),Co(e,t,a,n),t.child;case 6:return e===null&&E9(t),null;case 13:return PH(e,t,n);case 4:return eE(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=t0(t,null,r,n):Co(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),$M(e,t,r,i,n);case 7:return Co(e,t,t.pendingProps,n),t.child;case 8:return Co(e,t,t.pendingProps.children,n),t.child;case 12:return Co(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,rr(P5,r._currentValue),r._currentValue=a,o!==null)if(tl(o.value,a)){if(o.children===i.children&&!ea.current){t=ac(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ku(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),P9(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(He(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),P9(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Co(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Om(t,n),i=fs(i),r=r(i),t.flags|=1,Co(e,t,r,n),t.child;case 14:return r=t.type,i=$s(r,t.pendingProps),i=$s(r.type,i),FM(e,t,r,i,n);case 15:return CH(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),_4(e,t),t.tag=1,ta(r)?(e=!0,_5(t)):e=!1,Om(t,n),Qz(t,r,i),L9(t,r,i,n),M9(null,t,r,!0,e,n);case 19:return TH(e,t,n);case 22:return _H(e,t,n)}throw Error(He(156,t.tag))};function WH(e,t){return mz(e,t)}function H2e(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function is(e,t,n,r){return new H2e(e,t,n,r)}function gE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function V2e(e){if(typeof e=="function")return gE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rk)return 11;if(e===Dk)return 14}return 2}function Bd(e,t){var n=e.alternate;return n===null?(n=is(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function P4(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")gE(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Qg:return Hh(n.children,i,o,t);case Ik:a=8,i|=8;break;case J7:return e=is(12,n,t,i|2),e.elementType=J7,e.lanes=o,e;case e9:return e=is(13,n,t,i),e.elementType=e9,e.lanes=o,e;case t9:return e=is(19,n,t,i),e.elementType=t9,e.lanes=o,e;case JF:return mx(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ZF:a=10;break e;case QF:a=9;break e;case Rk:a=11;break e;case Dk:a=14;break e;case md:a=16,r=null;break e}throw Error(He(130,e==null?e:typeof e,""))}return t=is(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Hh(e,t,n,r){return e=is(7,e,r,t),e.lanes=n,e}function mx(e,t,n,r){return e=is(22,e,r,t),e.elementType=JF,e.lanes=n,e.stateNode={isHidden:!1},e}function J6(e,t,n){return e=is(6,e,null,t),e.lanes=n,e}function eC(e,t,n){return t=is(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function W2e(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=R6(0),this.expirationTimes=R6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R6(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function mE(e,t,n,r,i,o,a,s,l){return e=new W2e(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=is(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jk(o),e}function U2e(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=ja})(G1e);const xb=v_(el);var[X2e,Z2e]=Pn({strict:!1,name:"PortalManagerContext"});function YH(e){const{children:t,zIndex:n}=e;return N.createElement(X2e,{value:{zIndex:n}},t)}YH.displayName="PortalManager";var[KH,Q2e]=Pn({strict:!1,name:"PortalContext"}),SE="chakra-portal",J2e=".chakra-portal",eye=e=>N.createElement("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0}},e.children),tye=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=w.useState(null),o=w.useRef(null),[,a]=w.useState({});w.useEffect(()=>a({}),[]);const s=Q2e(),l=Z2e();Gs(()=>{if(!r)return;const d=r.ownerDocument,h=t?s??d.body:d.body;if(!h)return;o.current=d.createElement("div"),o.current.className=SE,h.appendChild(o.current),a({});const m=o.current;return()=>{h.contains(m)&&h.removeChild(m)}},[r]);const u=l!=null&&l.zIndex?N.createElement(eye,{zIndex:l==null?void 0:l.zIndex},n):n;return o.current?el.createPortal(N.createElement(KH,{value:o.current},u),o.current):N.createElement("span",{ref:d=>{d&&i(d)}})},nye=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=w.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=SE),l},[i]),[,s]=w.useState({});return Gs(()=>s({}),[]),Gs(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?el.createPortal(N.createElement(KH,{value:r?a:null},t),a):null};function up(e){const{containerRef:t,...n}=e;return t?N.createElement(nye,{containerRef:t,...n}):N.createElement(tye,{...n})}up.defaultProps={appendToParentPortal:!0};up.className=SE;up.selector=J2e;up.displayName="Portal";var rye=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lg=new WeakMap,wb=new WeakMap,Cb={},tC=0,XH=function(e){return e&&(e.host||XH(e.parentNode))},iye=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=XH(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},oye=function(e,t,n,r){var i=iye(t,Array.isArray(e)?e:[e]);Cb[n]||(Cb[n]=new WeakMap);var o=Cb[n],a=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(s.has(m))d(m);else{var v=m.getAttribute(r),b=v!==null&&v!=="false",S=(Lg.get(m)||0)+1,_=(o.get(m)||0)+1;Lg.set(m,S),o.set(m,_),a.push(m),S===1&&b&&wb.set(m,!0),_===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}})};return d(t),s.clear(),tC++,function(){a.forEach(function(h){var m=Lg.get(h)-1,v=o.get(h)-1;Lg.set(h,m),o.set(h,v),m||(wb.has(h)||h.removeAttribute(r),wb.delete(h)),v||h.removeAttribute(n)}),tC--,tC||(Lg=new WeakMap,Lg=new WeakMap,wb=new WeakMap,Cb={})}},ZH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||rye(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),oye(r,i,n,"aria-hidden")):function(){return null}};function xE(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var jn={},aye={get exports(){return jn},set exports(e){jn=e}},sye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",lye=sye,uye=lye;function QH(){}function JH(){}JH.resetWarningCache=QH;var cye=function(){function e(r,i,o,a,s,l){if(l!==uye){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:JH,resetWarningCache:QH};return n.PropTypes=n,n};aye.exports=cye();var W9="data-focus-lock",eV="data-focus-lock-disabled",dye="data-no-focus-lock",fye="data-autofocus-inside",hye="data-no-autofocus";function pye(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gye(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function tV(e,t){return gye(t||null,function(n){return e.forEach(function(r){return pye(r,n)})})}var nC={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function nV(e){return e}function rV(e,t){t===void 0&&(t=nV);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function wE(e,t){return t===void 0&&(t=nV),rV(e,t)}function iV(e){e===void 0&&(e={});var t=rV(null);return t.options=Hl({async:!0,ssr:!1},e),t}var oV=function(e){var t=e.sideCar,n=q$(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Hl({},n))};oV.isSideCarExport=!0;function mye(e,t){return e.useMedium(t),oV}var aV=wE({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),sV=wE(),vye=wE(),yye=iV({async:!0}),bye=[],CE=w.forwardRef(function(t,n){var r,i=w.useState(),o=i[0],a=i[1],s=w.useRef(),l=w.useRef(!1),u=w.useRef(null),d=t.children,h=t.disabled,m=t.noFocusGuards,v=t.persistentFocus,b=t.crossFrame,S=t.autoFocus;t.allowTextSelection;var _=t.group,E=t.className,k=t.whiteList,T=t.hasPositiveIndices,A=t.shards,M=A===void 0?bye:A,R=t.as,D=R===void 0?"div":R,j=t.lockProps,z=j===void 0?{}:j,H=t.sideCar,K=t.returnFocus,te=t.focusOptions,G=t.onActivation,$=t.onDeactivation,W=w.useState({}),X=W[0],Z=w.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&G&&G(s.current),l.current=!0},[G]),U=w.useCallback(function(){l.current=!1,$&&$(s.current)},[$]);w.useEffect(function(){h||(u.current=null)},[]);var Q=w.useCallback(function(rt){var Ve=u.current;if(Ve&&Ve.focus){var je=typeof K=="function"?K(Ve):K;if(je){var wt=typeof je=="object"?je:void 0;u.current=null,rt?Promise.resolve().then(function(){return Ve.focus(wt)}):Ve.focus(wt)}}},[K]),re=w.useCallback(function(rt){l.current&&aV.useMedium(rt)},[]),fe=sV.useMedium,Ee=w.useCallback(function(rt){s.current!==rt&&(s.current=rt,a(rt))},[]),be=bn((r={},r[eV]=h&&"disabled",r[W9]=_,r),z),ye=m!==!0,Fe=ye&&m!=="tail",Me=tV([n,Ee]);return w.createElement(w.Fragment,null,ye&&[w.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:nC}),T?w.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:nC}):null],!h&&w.createElement(H,{id:X,sideCar:yye,observed:o,disabled:h,persistentFocus:v,crossFrame:b,autoFocus:S,whiteList:k,shards:M,onActivation:Z,onDeactivation:U,returnFocus:Q,focusOptions:te}),w.createElement(D,bn({ref:Me},be,{className:E,onBlur:fe,onFocus:re}),d),Fe&&w.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:nC}))});CE.propTypes={};CE.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const lV=CE;function U9(e,t){return U9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},U9(e,t)}function _E(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,U9(e,t)}function uV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sye(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){_E(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return a};var h=d.prototype;return h.componentDidMount=function(){o.push(this),s()},h.componentDidUpdate=function(){s()},h.componentWillUnmount=function(){var v=o.indexOf(this);o.splice(v,1),s()},h.render=function(){return N.createElement(i,this.props)},d}(w.PureComponent);return uV(l,"displayName","SideEffect("+n(i)+")"),l}}var pu=function(e){for(var t=Array(e.length),n=0;n=0}).sort(Tye)},Lye=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],EE=Lye.join(","),Aye="".concat(EE,", [data-focus-guard]"),yV=function(e,t){var n;return pu(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,i){return r.concat(i.matches(t?Aye:EE)?[i]:[],yV(i))},[])},PE=function(e,t){return e.reduce(function(n,r){return n.concat(yV(r,t),r.parentNode?pu(r.parentNode.querySelectorAll(EE)).filter(function(i){return i===r}):[])},[])},Oye=function(e){var t=e.querySelectorAll("[".concat(fye,"]"));return pu(t).map(function(n){return PE([n])}).reduce(function(n,r){return n.concat(r)},[])},TE=function(e,t){return pu(e).filter(function(n){return fV(t,n)}).filter(function(n){return kye(n)})},eI=function(e,t){return t===void 0&&(t=new Map),pu(e).filter(function(n){return hV(t,n)})},q9=function(e,t,n){return vV(TE(PE(e,n),t),!0,n)},tI=function(e,t){return vV(TE(PE(e),t),!1)},Mye=function(e,t){return TE(Oye(e),t)},Q2=function(e,t){return e.shadowRoot?Q2(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:pu(e.children).some(function(n){return Q2(n,t)})},Iye=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},bV=function(e){return e.parentNode?bV(e.parentNode):e},LE=function(e){var t=G9(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(W9);return n.push.apply(n,i?Iye(pu(bV(r).querySelectorAll("[".concat(W9,'="').concat(i,'"]:not([').concat(eV,'="disabled"])')))):[r]),n},[])},SV=function(e){return e.activeElement?e.activeElement.shadowRoot?SV(e.activeElement.shadowRoot):e.activeElement:void 0},AE=function(){return document.activeElement?document.activeElement.shadowRoot?SV(document.activeElement.shadowRoot):document.activeElement:void 0},Rye=function(e){return e===document.activeElement},Dye=function(e){return Boolean(pu(e.querySelectorAll("iframe")).some(function(t){return Rye(t)}))},xV=function(e){var t=document&&AE();return!t||t.dataset&&t.dataset.focusGuard?!1:LE(e).some(function(n){return Q2(n,t)||Dye(n)})},Nye=function(){var e=document&&AE();return e?pu(document.querySelectorAll("[".concat(dye,"]"))).some(function(t){return Q2(t,e)}):!1},jye=function(e,t){return t.filter(mV).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},OE=function(e,t){return mV(e)&&e.name?jye(e,t):e},Bye=function(e){var t=new Set;return e.forEach(function(n){return t.add(OE(n,e))}),e.filter(function(n){return t.has(n)})},nI=function(e){return e[0]&&e.length>1?OE(e[0],e):e[0]},rI=function(e,t){return e.length>1?e.indexOf(OE(e[t],e)):t},wV="NEW_FOCUS",$ye=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=kE(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,d=r?e.indexOf(r):-1,h=l-u,m=t.indexOf(o),v=t.indexOf(a),b=Bye(t),S=n!==void 0?b.indexOf(n):-1,_=S-(r?b.indexOf(r):l),E=rI(e,0),k=rI(e,i-1);if(l===-1||d===-1)return wV;if(!h&&d>=0)return d;if(l<=m&&s&&Math.abs(h)>1)return k;if(l>=v&&s&&Math.abs(h)>1)return E;if(h&&Math.abs(_)>1)return d;if(l<=m)return k;if(l>v)return E;if(h)return Math.abs(h)>1?d:(i+d+h)%i}},Fye=function(e){return function(t){var n,r=(n=pV(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},zye=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=eI(r.filter(Fye(n)));return i&&i.length?nI(i):nI(eI(t))},Y9=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Y9(e.parentNode.host||e.parentNode,t),t},rC=function(e,t){for(var n=Y9(e),r=Y9(t),i=0;i=0)return o}return!1},CV=function(e,t,n){var r=G9(e),i=G9(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=rC(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=rC(o,l);u&&(!a||Q2(u,a)?a=u:a=rC(u,a))})}),a},Hye=function(e,t){return e.reduce(function(n,r){return n.concat(Mye(r,t))},[])},Vye=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Pye)},Wye=function(e,t){var n=document&&AE(),r=LE(e).filter(B5),i=CV(n||e,e,r),o=new Map,a=tI(r,o),s=q9(r,o).filter(function(m){var v=m.node;return B5(v)});if(!(!s[0]&&(s=a,!s[0]))){var l=tI([i],o).map(function(m){var v=m.node;return v}),u=Vye(l,s),d=u.map(function(m){var v=m.node;return v}),h=$ye(d,l,n,t);return h===wV?{node:zye(a,d,Hye(r,o))}:h===void 0?h:u[h]}},Uye=function(e){var t=LE(e).filter(B5),n=CV(e,e,t),r=new Map,i=q9([n],r,!0),o=q9(t,r).filter(function(a){var s=a.node;return B5(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:kE(s)}})},Gye=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},iC=0,oC=!1,qye=function(e,t,n){n===void 0&&(n={});var r=Wye(e,t);if(!oC&&r){if(iC>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),oC=!0,setTimeout(function(){oC=!1},1);return}iC++,Gye(r.node,n.focusOptions),iC--}};const _V=qye;function kV(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var Yye=function(){return document&&document.activeElement===document.body},Kye=function(){return Yye()||Nye()},Im=null,um=null,Rm=null,J2=!1,Xye=function(){return!0},Zye=function(t){return(Im.whiteList||Xye)(t)},Qye=function(t,n){Rm={observerNode:t,portaledElement:n}},Jye=function(t){return Rm&&Rm.portaledElement===t};function iI(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var e3e=function(t){return t&&"current"in t?t.current:t},t3e=function(t){return t?Boolean(J2):J2==="meanwhile"},n3e=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},r3e=function(t,n){return n.some(function(r){return n3e(t,r,r)})},$5=function(){var t=!1;if(Im){var n=Im,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||Rm&&Rm.portaledElement,d=document&&document.activeElement;if(u){var h=[u].concat(a.map(e3e).filter(Boolean));if((!d||Zye(d))&&(i||t3e(s)||!Kye()||!um&&o)&&(u&&!(xV(h)||d&&r3e(d,h)||Jye(d))&&(document&&!um&&d&&!o?(d.blur&&d.blur(),document.body.focus()):(t=_V(h,um,{focusOptions:l}),Rm={})),J2=!1,um=document&&document.activeElement),document){var m=document&&document.activeElement,v=Uye(h),b=v.map(function(S){var _=S.node;return _}).indexOf(m);b>-1&&(v.filter(function(S){var _=S.guard,E=S.node;return _&&E.dataset.focusAutoGuard}).forEach(function(S){var _=S.node;return _.removeAttribute("tabIndex")}),iI(b,v.length,1,v),iI(b,-1,-1,v))}}}return t},EV=function(t){$5()&&t&&(t.stopPropagation(),t.preventDefault())},ME=function(){return kV($5)},i3e=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Qye(r,n)},o3e=function(){return null},PV=function(){J2="just",setTimeout(function(){J2="meanwhile"},0)},a3e=function(){document.addEventListener("focusin",EV),document.addEventListener("focusout",ME),window.addEventListener("blur",PV)},s3e=function(){document.removeEventListener("focusin",EV),document.removeEventListener("focusout",ME),window.removeEventListener("blur",PV)};function l3e(e){return e.filter(function(t){var n=t.disabled;return!n})}function u3e(e){var t=e.slice(-1)[0];t&&!Im&&a3e();var n=Im,r=n&&t&&t.id===n.id;Im=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(um=null,(!r||n.observed!==t.observed)&&t.onActivation(),$5(),kV($5)):(s3e(),um=null)}aV.assignSyncMedium(i3e);sV.assignMedium(ME);vye.assignMedium(function(e){return e({moveFocusInside:_V,focusInside:xV})});const c3e=Sye(l3e,u3e)(o3e);var TV=w.forwardRef(function(t,n){return w.createElement(lV,bn({sideCar:c3e,ref:n},t))}),LV=lV.propTypes||{};LV.sideCar;xE(LV,["sideCar"]);TV.propTypes={};const d3e=TV;var AV=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,d=w.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&DF(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),h=w.useCallback(()=>{var v;(v=n==null?void 0:n.current)==null||v.focus()},[n]),m=i&&!n;return N.createElement(d3e,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:d,onDeactivation:h,returnFocus:m},o)};AV.displayName="FocusLock";var T4="right-scroll-bar-position",L4="width-before-scroll-bar",f3e="with-scroll-bars-hidden",h3e="--removed-body-scroll-bar-size",OV=iV(),aC=function(){},xx=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:aC,onWheelCapture:aC,onTouchMoveCapture:aC}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,m=e.sideCar,v=e.noIsolation,b=e.inert,S=e.allowPinchZoom,_=e.as,E=_===void 0?"div":_,k=q$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),T=m,A=tV([n,t]),M=Hl(Hl({},k),i);return w.createElement(w.Fragment,null,d&&w.createElement(T,{sideCar:OV,removeScrollBar:u,shards:h,noIsolation:v,inert:b,setCallbacks:o,allowPinchZoom:!!S,lockRef:n}),a?w.cloneElement(w.Children.only(s),Hl(Hl({},M),{ref:A})):w.createElement(E,Hl({},M,{className:l,ref:A}),s))});xx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xx.classNames={fullWidth:L4,zeroRight:T4};var p3e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function g3e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=p3e();return t&&e.setAttribute("nonce",t),e}function m3e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function v3e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var y3e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=g3e())&&(m3e(t,n),v3e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b3e=function(){var e=y3e();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},MV=function(){var e=b3e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},S3e={left:0,top:0,right:0,gap:0},sC=function(e){return parseInt(e||"",10)||0},x3e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[sC(n),sC(r),sC(i)]},w3e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return S3e;var t=x3e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},C3e=MV(),_3e=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(f3e,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(a,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(T4,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(L4,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(T4," .").concat(T4,` { + right: 0 `).concat(r,`; + } + + .`).concat(L4," .").concat(L4,` { + margin-right: 0 `).concat(r,`; + } + + body { + `).concat(h3e,": ").concat(s,`px; + } +`)},k3e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=w.useMemo(function(){return w3e(i)},[i]);return w.createElement(C3e,{styles:_3e(o,!t,i,n?"":"!important")})},K9=!1;if(typeof window<"u")try{var _b=Object.defineProperty({},"passive",{get:function(){return K9=!0,!0}});window.addEventListener("test",_b,_b),window.removeEventListener("test",_b,_b)}catch{K9=!1}var Ag=K9?{passive:!1}:!1,E3e=function(e){return e.tagName==="TEXTAREA"},IV=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!E3e(e)&&n[t]==="visible")},P3e=function(e){return IV(e,"overflowY")},T3e=function(e){return IV(e,"overflowX")},oI=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=RV(e,n);if(r){var i=DV(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},L3e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},A3e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},RV=function(e,t){return e==="v"?P3e(t):T3e(t)},DV=function(e,t){return e==="v"?L3e(t):A3e(t)},O3e=function(e,t){return e==="h"&&t==="rtl"?-1:1},M3e=function(e,t,n,r,i){var o=O3e(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,d=a>0,h=0,m=0;do{var v=DV(e,s),b=v[0],S=v[1],_=v[2],E=S-_-o*b;(b||E)&&RV(e,s)&&(h+=E,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(i&&h===0||!i&&a>h)||!d&&(i&&m===0||!i&&-a>m))&&(u=!0),u},kb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},aI=function(e){return[e.deltaX,e.deltaY]},sI=function(e){return e&&"current"in e?e.current:e},I3e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},R3e=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},D3e=0,Og=[];function N3e(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(D3e++)[0],o=w.useState(function(){return MV()})[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=z7([e.lockRef.current],(e.shards||[]).map(sI),!0).filter(Boolean);return S.forEach(function(_){return _.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(S,_){if("touches"in S&&S.touches.length===2)return!a.current.allowPinchZoom;var E=kb(S),k=n.current,T="deltaX"in S?S.deltaX:k[0]-E[0],A="deltaY"in S?S.deltaY:k[1]-E[1],M,R=S.target,D=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in S&&D==="h"&&R.type==="range")return!1;var j=oI(D,R);if(!j)return!0;if(j?M=D:(M=D==="v"?"h":"v",j=oI(D,R)),!j)return!1;if(!r.current&&"changedTouches"in S&&(T||A)&&(r.current=M),!M)return!0;var z=r.current||M;return M3e(z,_,S,z==="h"?T:A,!0)},[]),l=w.useCallback(function(S){var _=S;if(!(!Og.length||Og[Og.length-1]!==o)){var E="deltaY"in _?aI(_):kb(_),k=t.current.filter(function(M){return M.name===_.type&&M.target===_.target&&I3e(M.delta,E)})[0];if(k&&k.should){_.cancelable&&_.preventDefault();return}if(!k){var T=(a.current.shards||[]).map(sI).filter(Boolean).filter(function(M){return M.contains(_.target)}),A=T.length>0?s(_,T[0]):!a.current.noIsolation;A&&_.cancelable&&_.preventDefault()}}},[]),u=w.useCallback(function(S,_,E,k){var T={name:S,delta:_,target:E,should:k};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(A){return A!==T})},1)},[]),d=w.useCallback(function(S){n.current=kb(S),r.current=void 0},[]),h=w.useCallback(function(S){u(S.type,aI(S),S.target,s(S,e.lockRef.current))},[]),m=w.useCallback(function(S){u(S.type,kb(S),S.target,s(S,e.lockRef.current))},[]);w.useEffect(function(){return Og.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Ag),document.addEventListener("touchmove",l,Ag),document.addEventListener("touchstart",d,Ag),function(){Og=Og.filter(function(S){return S!==o}),document.removeEventListener("wheel",l,Ag),document.removeEventListener("touchmove",l,Ag),document.removeEventListener("touchstart",d,Ag)}},[]);var v=e.removeScrollBar,b=e.inert;return w.createElement(w.Fragment,null,b?w.createElement(o,{styles:R3e(i)}):null,v?w.createElement(k3e,{gapMode:"margin"}):null)}const j3e=mye(OV,N3e);var NV=w.forwardRef(function(e,t){return w.createElement(xx,Hl({},e,{ref:t,sideCar:j3e}))});NV.classNames=xx.classNames;const jV=NV;var cp=(...e)=>e.filter(Boolean).join(" ");function kv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var B3e=class{constructor(){sn(this,"modals");this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},X9=new B3e;function $3e(e,t){w.useEffect(()=>(t&&X9.add(e),()=>{X9.remove(e)}),[t,e])}function F3e(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=w.useRef(null),d=w.useRef(null),[h,m,v]=H3e(r,"chakra-modal","chakra-modal--header","chakra-modal--body");z3e(u,t&&a),$3e(u,t);const b=w.useRef(null),S=w.useCallback(j=>{b.current=j.target},[]),_=w.useCallback(j=>{j.key==="Escape"&&(j.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[E,k]=w.useState(!1),[T,A]=w.useState(!1),M=w.useCallback((j={},z=null)=>({role:"dialog",...j,ref:Hn(z,u),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":E?m:void 0,"aria-describedby":T?v:void 0,onClick:kv(j.onClick,H=>H.stopPropagation())}),[v,T,h,m,E]),R=w.useCallback(j=>{j.stopPropagation(),b.current===j.target&&X9.isTopModal(u)&&(i&&(n==null||n()),s==null||s())},[n,i,s]),D=w.useCallback((j={},z=null)=>({...j,ref:Hn(z,d),onClick:kv(j.onClick,R),onKeyDown:kv(j.onKeyDown,_),onMouseDown:kv(j.onMouseDown,S)}),[_,S,R]);return{isOpen:t,onClose:n,headerId:m,bodyId:v,setBodyMounted:A,setHeaderMounted:k,dialogRef:u,overlayRef:d,getDialogProps:M,getDialogContainerProps:D}}function z3e(e,t){const n=e.current;w.useEffect(()=>{if(!(!e.current||!t))return ZH(e.current)},[t,e,n])}function H3e(e,...t){const n=w.useId(),r=e||n;return w.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[V3e,dp]=Pn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[W3e,Kd]=Pn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Xd=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m,onCloseComplete:v}=e,b=Oi("Modal",e),_={...F3e(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m};return N.createElement(W3e,{value:_},N.createElement(V3e,{value:b},N.createElement(of,{onExitComplete:v},_.isOpen&&N.createElement(up,{...t},n))))};Xd.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};Xd.displayName="Modal";var o0=Ae((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=Kd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=cp("chakra-modal__body",n),s=dp();return N.createElement(Ce.div,{ref:t,className:a,id:i,...r,__css:s.body})});o0.displayName="ModalBody";var Iy=Ae((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=Kd(),a=cp("chakra-modal__close-btn",r),s=dp();return N.createElement(rx,{ref:t,__css:s.closeButton,className:a,onClick:kv(n,l=>{l.stopPropagation(),o()}),...i})});Iy.displayName="ModalCloseButton";function BV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:d}=Kd(),[h,m]=tk();return w.useEffect(()=>{!h&&m&&setTimeout(m)},[h,m]),N.createElement(AV,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:d},N.createElement(jV,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0},e.children))}var U3e={slideInBottom:{...V7,custom:{offsetY:16,reverse:!0}},slideInRight:{...V7,custom:{offsetX:16,reverse:!0}},scale:{...X$,custom:{initialScale:.95,reverse:!0}},none:{}},G3e=Ce(hu.section),q3e=e=>U3e[e||"none"],$V=w.forwardRef((e,t)=>{const{preset:n,motionProps:r=q3e(n),...i}=e;return N.createElement(G3e,{ref:t,...r,...i})});$V.displayName="ModalTransition";var Jh=Ae((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Kd(),u=s(a,t),d=l(i),h=cp("chakra-modal__content",n),m=dp(),v={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:S}=Kd();return N.createElement(BV,null,N.createElement(Ce.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:b},N.createElement($V,{preset:S,motionProps:o,className:h,...u,__css:v},r)))});Jh.displayName="ModalContent";var wx=Ae((e,t)=>{const{className:n,...r}=e,i=cp("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...dp().footer};return N.createElement(Ce.footer,{ref:t,...r,__css:a,className:i})});wx.displayName="ModalFooter";var _0=Ae((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=Kd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=cp("chakra-modal__header",n),l={flex:0,...dp().header};return N.createElement(Ce.header,{ref:t,className:a,id:i,...r,__css:l})});_0.displayName="ModalHeader";var Y3e=Ce(hu.div),Zd=Ae((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=cp("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...dp().overlay},{motionPreset:u}=Kd(),h=i||(u==="none"?{}:K$);return N.createElement(Y3e,{...h,__css:l,ref:t,className:a,...o})});Zd.displayName="ModalOverlay";function FV(e){const{leastDestructiveRef:t,...n}=e;return N.createElement(Xd,{...n,initialFocusRef:t})}var zV=Ae((e,t)=>N.createElement(Jh,{ref:t,role:"alertdialog",...e})),[mze,K3e]=Pn(),X3e=Ce(Z$),Z3e=Ae((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=Kd(),d=s(a,t),h=l(o),m=cp("chakra-modal__content",n),v=dp(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},S={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{placement:_}=K3e();return N.createElement(BV,null,N.createElement(Ce.div,{...h,className:"chakra-modal__content-container",__css:S},N.createElement(X3e,{motionProps:i,direction:_,in:u,className:m,...d,__css:b},r)))});Z3e.displayName="DrawerContent";function Q3e(e,t){const n=Er(e);w.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var HV=(...e)=>e.filter(Boolean).join(" "),lC=e=>e?!0:void 0;function Ml(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var J3e=e=>N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})),ebe=e=>N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"}));function lI(e,t,n,r){w.useEffect(()=>{if(!e.current||!r)return;const i=e.current.ownerDocument.defaultView??window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(s=>{for(const l of s)l.type==="attributes"&&l.attributeName&&o.includes(l.attributeName)&&n(l)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var tbe=50,uI=300;function nbe(e,t){const[n,r]=w.useState(!1),[i,o]=w.useState(null),[a,s]=w.useState(!0),l=w.useRef(null),u=()=>clearTimeout(l.current);Q3e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?tbe:null);const d=w.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},uI)},[e,a]),h=w.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},uI)},[t,a]),m=w.useCallback(()=>{s(!0),r(!1),u()},[]);return w.useEffect(()=>()=>u(),[]),{up:d,down:h,stop:m,isSpinning:n}}var rbe=/^[Ee0-9+\-.]$/;function ibe(e){return rbe.test(e)}function obe(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function abe(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:d,pattern:h="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:v,id:b,onChange:S,precision:_,name:E,"aria-describedby":k,"aria-label":T,"aria-labelledby":A,onFocus:M,onBlur:R,onInvalid:D,getAriaValueText:j,isValidCharacter:z,format:H,parse:K,...te}=e,G=Er(M),$=Er(R),W=Er(D),X=Er(z??ibe),Z=Er(j),U=Sme(e),{update:Q,increment:re,decrement:fe}=U,[Ee,be]=w.useState(!1),ye=!(s||l),Fe=w.useRef(null),Me=w.useRef(null),rt=w.useRef(null),Ve=w.useRef(null),je=w.useCallback(Te=>Te.split("").filter(X).join(""),[X]),wt=w.useCallback(Te=>(K==null?void 0:K(Te))??Te,[K]),Be=w.useCallback(Te=>((H==null?void 0:H(Te))??Te).toString(),[H]);Ud(()=>{(U.valueAsNumber>o||U.valueAsNumber{if(!Fe.current)return;if(Fe.current.value!=U.value){const At=wt(Fe.current.value);U.setValue(je(At))}},[wt,je]);const at=w.useCallback((Te=a)=>{ye&&re(Te)},[re,ye,a]),bt=w.useCallback((Te=a)=>{ye&&fe(Te)},[fe,ye,a]),Le=nbe(at,bt);lI(rt,"disabled",Le.stop,Le.isSpinning),lI(Ve,"disabled",Le.stop,Le.isSpinning);const ut=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;const ze=wt(Te.currentTarget.value);Q(je(ze)),Me.current={start:Te.currentTarget.selectionStart,end:Te.currentTarget.selectionEnd}},[Q,je,wt]),Mt=w.useCallback(Te=>{var At;G==null||G(Te),Me.current&&(Te.target.selectionStart=Me.current.start??((At=Te.currentTarget.value)==null?void 0:At.length),Te.currentTarget.selectionEnd=Me.current.end??Te.currentTarget.selectionStart)},[G]),ct=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;obe(Te,X)||Te.preventDefault();const At=_t(Te)*a,ze=Te.key,nn={ArrowUp:()=>at(At),ArrowDown:()=>bt(At),Home:()=>Q(i),End:()=>Q(o)}[ze];nn&&(Te.preventDefault(),nn(Te))},[X,a,at,bt,Q,i,o]),_t=Te=>{let At=1;return(Te.metaKey||Te.ctrlKey)&&(At=.1),Te.shiftKey&&(At=10),At},un=w.useMemo(()=>{const Te=Z==null?void 0:Z(U.value);if(Te!=null)return Te;const At=U.value.toString();return At||void 0},[U.value,Z]),ae=w.useCallback(()=>{let Te=U.value;if(U.value==="")return;/^[eE]/.test(U.value.toString())?U.setValue(""):(U.valueAsNumbero&&(Te=o),U.cast(Te))},[U,o,i]),De=w.useCallback(()=>{be(!1),n&&ae()},[n,be,ae]),Ke=w.useCallback(()=>{t&&requestAnimationFrame(()=>{var Te;(Te=Fe.current)==null||Te.focus()})},[t]),Xe=w.useCallback(Te=>{Te.preventDefault(),Le.up(),Ke()},[Ke,Le]),xe=w.useCallback(Te=>{Te.preventDefault(),Le.down(),Ke()},[Ke,Le]);Nh(()=>Fe.current,"wheel",Te=>{var At;const vt=(((At=Fe.current)==null?void 0:At.ownerDocument)??document).activeElement===Fe.current;if(!v||!vt)return;Te.preventDefault();const nn=_t(Te)*a,Rn=Math.sign(Te.deltaY);Rn===-1?at(nn):Rn===1&&bt(nn)},{passive:!1});const Ne=w.useCallback((Te={},At=null)=>{const ze=l||r&&U.isAtMax;return{...Te,ref:Hn(At,rt),role:"button",tabIndex:-1,onPointerDown:Ml(Te.onPointerDown,vt=>{vt.button!==0||ze||Xe(vt)}),onPointerLeave:Ml(Te.onPointerLeave,Le.stop),onPointerUp:Ml(Te.onPointerUp,Le.stop),disabled:ze,"aria-disabled":lC(ze)}},[U.isAtMax,r,Xe,Le.stop,l]),Ct=w.useCallback((Te={},At=null)=>{const ze=l||r&&U.isAtMin;return{...Te,ref:Hn(At,Ve),role:"button",tabIndex:-1,onPointerDown:Ml(Te.onPointerDown,vt=>{vt.button!==0||ze||xe(vt)}),onPointerLeave:Ml(Te.onPointerLeave,Le.stop),onPointerUp:Ml(Te.onPointerUp,Le.stop),disabled:ze,"aria-disabled":lC(ze)}},[U.isAtMin,r,xe,Le.stop,l]),Dt=w.useCallback((Te={},At=null)=>({name:E,inputMode:m,type:"text",pattern:h,"aria-labelledby":A,"aria-label":T,"aria-describedby":k,id:b,disabled:l,...Te,readOnly:Te.readOnly??s,"aria-readonly":Te.readOnly??s,"aria-required":Te.required??u,required:Te.required??u,ref:Hn(Fe,At),value:Be(U.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(U.valueAsNumber)?void 0:U.valueAsNumber,"aria-invalid":lC(d??U.isOutOfRange),"aria-valuetext":un,autoComplete:"off",autoCorrect:"off",onChange:Ml(Te.onChange,ut),onKeyDown:Ml(Te.onKeyDown,ct),onFocus:Ml(Te.onFocus,Mt,()=>be(!0)),onBlur:Ml(Te.onBlur,$,De)}),[E,m,h,A,T,Be,k,b,l,u,s,d,U.value,U.valueAsNumber,U.isOutOfRange,i,o,un,ut,ct,Mt,$,De]);return{value:Be(U.value),valueAsNumber:U.valueAsNumber,isFocused:Ee,isDisabled:l,isReadOnly:s,getIncrementButtonProps:Ne,getDecrementButtonProps:Ct,getInputProps:Dt,htmlProps:te}}var[sbe,Cx]=Pn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[lbe,IE]=Pn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),RE=Ae(function(t,n){const r=Oi("NumberInput",t),i=Sn(t),o=pk(i),{htmlProps:a,...s}=abe(o),l=w.useMemo(()=>s,[s]);return N.createElement(lbe,{value:l},N.createElement(sbe,{value:r},N.createElement(Ce.div,{...a,ref:n,className:HV("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});RE.displayName="NumberInput";var VV=Ae(function(t,n){const r=Cx();return N.createElement(Ce.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});VV.displayName="NumberInputStepper";var DE=Ae(function(t,n){const{getInputProps:r}=IE(),i=r(t,n),o=Cx();return N.createElement(Ce.input,{...i,className:HV("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});DE.displayName="NumberInputField";var WV=Ce("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),NE=Ae(function(t,n){const r=Cx(),{getDecrementButtonProps:i}=IE(),o=i(t,n);return N.createElement(WV,{...o,__css:r.stepper},t.children??N.createElement(J3e,null))});NE.displayName="NumberDecrementStepper";var jE=Ae(function(t,n){const{getIncrementButtonProps:r}=IE(),i=r(t,n),o=Cx();return N.createElement(WV,{...i,__css:o.stepper},t.children??N.createElement(ebe,null))});jE.displayName="NumberIncrementStepper";var Ry=(...e)=>e.filter(Boolean).join(" ");function ube(e,...t){return cbe(e)?e(...t):e}var cbe=e=>typeof e=="function";function Il(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function dbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[fbe,fp]=Pn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[hbe,Dy]=Pn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Mg={click:"click",hover:"hover"};function pbe(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=Mg.click,openDelay:d=200,closeDelay:h=200,isLazy:m,lazyBehavior:v="unmount",computePositionOnMount:b,...S}=e,{isOpen:_,onClose:E,onOpen:k,onToggle:T}=GF(e),A=w.useRef(null),M=w.useRef(null),R=w.useRef(null),D=w.useRef(!1),j=w.useRef(!1);_&&(j.current=!0);const[z,H]=w.useState(!1),[K,te]=w.useState(!1),G=w.useId(),$=i??G,[W,X,Z,U]=["popover-trigger","popover-content","popover-header","popover-body"].map(ut=>`${ut}-${$}`),{referenceRef:Q,getArrowProps:re,getPopperProps:fe,getArrowInnerProps:Ee,forceUpdate:be}=UF({...S,enabled:_||!!b}),ye=U1e({isOpen:_,ref:R});Lme({enabled:_,ref:M}),x0e(R,{focusRef:M,visible:_,shouldFocus:o&&u===Mg.click}),C0e(R,{focusRef:r,visible:_,shouldFocus:a&&u===Mg.click});const Fe=qF({wasSelected:j.current,enabled:m,mode:v,isSelected:ye.present}),Me=w.useCallback((ut={},Mt=null)=>{const ct={...ut,style:{...ut.style,transformOrigin:oi.transformOrigin.varRef,[oi.arrowSize.var]:s?`${s}px`:void 0,[oi.arrowShadowColor.var]:l},ref:Hn(R,Mt),children:Fe?ut.children:null,id:X,tabIndex:-1,role:"dialog",onKeyDown:Il(ut.onKeyDown,_t=>{n&&_t.key==="Escape"&&E()}),onBlur:Il(ut.onBlur,_t=>{const un=cI(_t),ae=uC(R.current,un),De=uC(M.current,un);_&&t&&(!ae&&!De)&&E()}),"aria-labelledby":z?Z:void 0,"aria-describedby":K?U:void 0};return u===Mg.hover&&(ct.role="tooltip",ct.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0}),ct.onMouseLeave=Il(ut.onMouseLeave,_t=>{_t.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>E(),h))})),ct},[Fe,X,z,Z,K,U,u,n,E,_,t,h,l,s]),rt=w.useCallback((ut={},Mt=null)=>fe({...ut,style:{visibility:_?"visible":"hidden",...ut.style}},Mt),[_,fe]),Ve=w.useCallback((ut,Mt=null)=>({...ut,ref:Hn(Mt,A,Q)}),[A,Q]),je=w.useRef(),wt=w.useRef(),Be=w.useCallback(ut=>{A.current==null&&Q(ut)},[Q]),at=w.useCallback((ut={},Mt=null)=>{const ct={...ut,ref:Hn(M,Mt,Be),id:W,"aria-haspopup":"dialog","aria-expanded":_,"aria-controls":X};return u===Mg.click&&(ct.onClick=Il(ut.onClick,T)),u===Mg.hover&&(ct.onFocus=Il(ut.onFocus,()=>{je.current===void 0&&k()}),ct.onBlur=Il(ut.onBlur,_t=>{const un=cI(_t),ae=!uC(R.current,un);_&&t&&ae&&E()}),ct.onKeyDown=Il(ut.onKeyDown,_t=>{_t.key==="Escape"&&E()}),ct.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0,je.current=window.setTimeout(()=>k(),d)}),ct.onMouseLeave=Il(ut.onMouseLeave,()=>{D.current=!1,je.current&&(clearTimeout(je.current),je.current=void 0),wt.current=window.setTimeout(()=>{D.current===!1&&E()},h)})),ct},[W,_,X,u,Be,T,k,t,E,d,h]);w.useEffect(()=>()=>{je.current&&clearTimeout(je.current),wt.current&&clearTimeout(wt.current)},[]);const bt=w.useCallback((ut={},Mt=null)=>({...ut,id:Z,ref:Hn(Mt,ct=>{H(!!ct)})}),[Z]),Le=w.useCallback((ut={},Mt=null)=>({...ut,id:U,ref:Hn(Mt,ct=>{te(!!ct)})}),[U]);return{forceUpdate:be,isOpen:_,onAnimationComplete:ye.onComplete,onClose:E,getAnchorProps:Ve,getArrowProps:re,getArrowInnerProps:Ee,getPopoverPositionerProps:rt,getPopoverProps:Me,getTriggerProps:at,getHeaderProps:bt,getBodyProps:Le}}function uC(e,t){return e===t||(e==null?void 0:e.contains(t))}function cI(e){const t=e.currentTarget.ownerDocument.activeElement;return e.relatedTarget??t}function BE(e){const t=Oi("Popover",e),{children:n,...r}=Sn(e),i=m0(),o=pbe({...r,direction:i.direction});return N.createElement(fbe,{value:o},N.createElement(hbe,{value:t},ube(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})))}BE.displayName="Popover";function $E(e){const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=fp(),a=Dy(),s=t??n??r;return N.createElement(Ce.div,{...i(),className:"chakra-popover__arrow-positioner"},N.createElement(Ce.div,{className:Ry("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}$E.displayName="PopoverArrow";var gbe=Ae(function(t,n){const{getBodyProps:r}=fp(),i=Dy();return N.createElement(Ce.div,{...r(t,n),className:Ry("chakra-popover__body",t.className),__css:i.body})});gbe.displayName="PopoverBody";var mbe=Ae(function(t,n){const{onClose:r}=fp(),i=Dy();return N.createElement(rx,{size:"sm",onClick:r,className:Ry("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});mbe.displayName="PopoverCloseButton";function vbe(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var ybe={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},bbe=Ce(hu.section),UV=Ae(function(t,n){const{variants:r=ybe,...i}=t,{isOpen:o}=fp();return N.createElement(bbe,{ref:n,variants:vbe(r),initial:!1,animate:o?"enter":"exit",...i})});UV.displayName="PopoverTransition";var FE=Ae(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=fp(),u=Dy(),d={position:"relative",display:"flex",flexDirection:"column",...u.content};return N.createElement(Ce.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},N.createElement(UV,{...i,...a(o,n),onAnimationComplete:dbe(l,o.onAnimationComplete),className:Ry("chakra-popover__content",t.className),__css:d}))});FE.displayName="PopoverContent";var Sbe=Ae(function(t,n){const{getHeaderProps:r}=fp(),i=Dy();return N.createElement(Ce.header,{...r(t,n),className:Ry("chakra-popover__header",t.className),__css:i.header})});Sbe.displayName="PopoverHeader";function zE(e){const t=w.Children.only(e.children),{getTriggerProps:n}=fp();return w.cloneElement(t,n(t.props,t.ref))}zE.displayName="PopoverTrigger";function xbe(e,t,n){return(e-t)*100/(n-t)}var wbe=rf({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),Cbe=rf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),_be=rf({"0%":{left:"-40%"},"100%":{left:"100%"}}),kbe=rf({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function GV(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=xbe(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var qV=e=>{const{size:t,isIndeterminate:n,...r}=e;return N.createElement(Ce.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${Cbe} 2s linear infinite`:void 0},...r})};qV.displayName="Shape";var Z9=e=>N.createElement(Ce.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});Z9.displayName="Circle";var Ebe=Ae((e,t)=>{const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:d="10px",color:h="#0078d4",trackColor:m="#edebe9",isIndeterminate:v,...b}=e,S=GV({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:v}),_=v?void 0:(S.percent??0)*2.64,E=_==null?void 0:`${_} ${264-_}`,k=v?{css:{animation:`${wbe} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:E,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},T={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return N.createElement(Ce.div,{ref:t,className:"chakra-progress",...S.bind,...b,__css:T},N.createElement(qV,{size:n,isIndeterminate:v},N.createElement(Z9,{stroke:m,strokeWidth:d,className:"chakra-progress__track"}),N.createElement(Z9,{stroke:h,strokeWidth:d,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:S.value===0&&!v?0:void 0,...k})),u)});Ebe.displayName="CircularProgress";var[Pbe,Tbe]=Pn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Lbe=Ae((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=GV({value:i,min:n,max:r,isIndeterminate:o,role:a}),d={height:"100%",...Tbe().filledTrack};return N.createElement(Ce.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:d})}),YV=Ae((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:d,"aria-label":h,"aria-labelledby":m,title:v,role:b,...S}=Sn(e),_=Oi("Progress",e),E=u??((n=_.track)==null?void 0:n.borderRadius),k={animation:`${kbe} 1s linear infinite`},M={...!d&&a&&s&&k,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${_be} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",..._.track};return N.createElement(Ce.div,{ref:t,borderRadius:E,__css:R,...S},N.createElement(Pbe,{value:_},N.createElement(Lbe,{"aria-label":h,"aria-labelledby":m,min:i,max:o,value:r,isIndeterminate:d,css:M,borderRadius:E,title:v,role:b}),l))});YV.displayName="Progress";var Abe=Ce("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});Abe.displayName="CircularProgressLabel";var Obe=(...e)=>e.filter(Boolean).join(" ");function dI(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var So=e=>e?"":void 0,cC=e=>e?!0:void 0;function Ns(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Mbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function Ibe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}function Rbe(e){return e&&dI(e)&&dI(e.target)}function Dbe(e={}){const{onChange:t,value:n,defaultValue:r,name:i,isDisabled:o,isFocusable:a,isNative:s,...l}=e,[u,d]=w.useState(r||""),h=typeof n<"u",m=h?n:u,v=w.useRef(null),b=w.useCallback(()=>{const M=v.current;if(!M)return;let R="input:not(:disabled):checked";const D=M.querySelector(R);if(D){D.focus();return}R="input:not(:disabled)";const j=M.querySelector(R);j==null||j.focus()},[]),_=`radio-${w.useId()}`,E=i||_,k=w.useCallback(M=>{const R=Rbe(M)?M.target.value:M;h||d(R),t==null||t(String(R))},[t,h]),T=w.useCallback((M={},R=null)=>({...M,ref:Hn(R,v),role:"radiogroup"}),[]),A=w.useCallback((M={},R=null)=>({...M,ref:R,name:E,[s?"checked":"isChecked"]:m!=null?M.value===m:void 0,onChange(j){k(j)},"data-radiogroup":!0}),[s,E,k,m]);return{getRootProps:T,getRadioProps:A,name:E,ref:v,focus:b,setValue:d,value:m,onChange:k,isDisabled:o,isFocusable:a,htmlProps:l}}var[Nbe,KV]=Pn({name:"RadioGroupContext",strict:!1}),XV=Ae((e,t)=>{const{colorScheme:n,size:r,variant:i,children:o,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:d,onChange:h,getRootProps:m,name:v,htmlProps:b}=Dbe(u),S=w.useMemo(()=>({name:v,size:r,onChange:h,colorScheme:n,value:d,variant:i,isDisabled:s,isFocusable:l}),[v,r,h,n,d,i,s,l]);return N.createElement(Nbe,{value:S},N.createElement(Ce.div,{...m(b,t),className:Obe("chakra-radio-group",a)},o))});XV.displayName="RadioGroup";var jbe={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function Bbe(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:i,isReadOnly:o,isRequired:a,onChange:s,isInvalid:l,name:u,value:d,id:h,"data-radiogroup":m,"aria-describedby":v,...b}=e,S=`radio-${w.useId()}`,_=ap(),k=!!KV()||!!m;let A=!!_&&!k?_.id:S;A=h??A;const M=i??(_==null?void 0:_.isDisabled),R=o??(_==null?void 0:_.isReadOnly),D=a??(_==null?void 0:_.isRequired),j=l??(_==null?void 0:_.isInvalid),[z,H]=w.useState(!1),[K,te]=w.useState(!1),[G,$]=w.useState(!1),[W,X]=w.useState(!1),[Z,U]=w.useState(Boolean(t)),Q=typeof n<"u",re=Q?n:Z;w.useEffect(()=>oF(H),[]);const fe=w.useCallback(Be=>{if(R||M){Be.preventDefault();return}Q||U(Be.target.checked),s==null||s(Be)},[Q,M,R,s]),Ee=w.useCallback(Be=>{Be.key===" "&&X(!0)},[X]),be=w.useCallback(Be=>{Be.key===" "&&X(!1)},[X]),ye=w.useCallback((Be={},at=null)=>({...Be,ref:at,"data-active":So(W),"data-hover":So(G),"data-disabled":So(M),"data-invalid":So(j),"data-checked":So(re),"data-focus":So(K),"data-focus-visible":So(K&&z),"data-readonly":So(R),"aria-hidden":!0,onMouseDown:Ns(Be.onMouseDown,()=>X(!0)),onMouseUp:Ns(Be.onMouseUp,()=>X(!1)),onMouseEnter:Ns(Be.onMouseEnter,()=>$(!0)),onMouseLeave:Ns(Be.onMouseLeave,()=>$(!1))}),[W,G,M,j,re,K,R,z]),{onFocus:Fe,onBlur:Me}=_??{},rt=w.useCallback((Be={},at=null)=>{const bt=M&&!r;return{...Be,id:A,ref:at,type:"radio",name:u,value:d,onChange:Ns(Be.onChange,fe),onBlur:Ns(Me,Be.onBlur,()=>te(!1)),onFocus:Ns(Fe,Be.onFocus,()=>te(!0)),onKeyDown:Ns(Be.onKeyDown,Ee),onKeyUp:Ns(Be.onKeyUp,be),checked:re,disabled:bt,readOnly:R,required:D,"aria-invalid":cC(j),"aria-disabled":cC(bt),"aria-required":cC(D),"data-readonly":So(R),"aria-describedby":v,style:jbe}},[M,r,A,u,d,fe,Me,Fe,Ee,be,re,R,D,j,v]);return{state:{isInvalid:j,isFocused:K,isChecked:re,isActive:W,isHovered:G,isDisabled:M,isReadOnly:R,isRequired:D},getCheckboxProps:ye,getInputProps:rt,getLabelProps:(Be={},at=null)=>({...Be,ref:at,onMouseDown:Ns(Be.onMouseDown,fI),onTouchStart:Ns(Be.onTouchStart,fI),"data-disabled":So(M),"data-checked":So(re),"data-invalid":So(j)}),getRootProps:(Be,at=null)=>({...Be,ref:at,"data-disabled":So(M),"data-checked":So(re),"data-invalid":So(j)}),htmlProps:b}}function fI(e){e.preventDefault(),e.stopPropagation()}var Ev=Ae((e,t)=>{const n=KV(),{onChange:r,value:i}=e,o=Oi("Radio",{...n,...e}),a=Sn(e),{spacing:s="0.5rem",children:l,isDisabled:u=n==null?void 0:n.isDisabled,isFocusable:d=n==null?void 0:n.isFocusable,inputProps:h,...m}=a;let v=e.isChecked;(n==null?void 0:n.value)!=null&&i!=null&&(v=n.value===i);let b=r;n!=null&&n.onChange&&i!=null&&(b=Mbe(n.onChange,r));const S=(e==null?void 0:e.name)??(n==null?void 0:n.name),{getInputProps:_,getCheckboxProps:E,getLabelProps:k,getRootProps:T,htmlProps:A}=Bbe({...m,isChecked:v,isFocusable:d,isDisabled:u,onChange:b,name:S}),[M,R]=Ibe(A,Tj),D=E(R),j=_(h,t),z=k(),H=Object.assign({},M,T()),K={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...o.container},te={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...o.control},G={userSelect:"none",marginStart:s,...o.label};return N.createElement(Ce.label,{className:"chakra-radio",...H,__css:K},N.createElement("input",{className:"chakra-radio__input",...j}),N.createElement(Ce.span,{className:"chakra-radio__control",...D,__css:te}),l&&N.createElement(Ce.span,{className:"chakra-radio__label",...z,__css:G},l))});Ev.displayName="Radio";var $be=(...e)=>e.filter(Boolean).join(" "),Fbe=e=>e?"":void 0;function zbe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var ZV=Ae(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return N.createElement(Ce.select,{...a,ref:n,className:$be("chakra-select",o)},i&&N.createElement("option",{value:""},i),r)});ZV.displayName="SelectField";var QV=Ae((e,t)=>{var n;const r=Oi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:d,minHeight:h,iconColor:m,iconSize:v,...b}=Sn(e),[S,_]=zbe(b,Tj),E=hk(_),k={width:"100%",height:"fit-content",position:"relative",color:s},T={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return N.createElement(Ce.div,{className:"chakra-select__wrapper",__css:k,...S,...i},N.createElement(ZV,{ref:t,height:u??l,minH:d??h,placeholder:o,...E,__css:T},e.children),N.createElement(JV,{"data-disabled":Fbe(E.disabled),...(m||s)&&{color:m||s},__css:r.icon,...v&&{fontSize:v}},a))});QV.displayName="Select";var Hbe=e=>N.createElement("svg",{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Vbe=Ce("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),JV=e=>{const{children:t=N.createElement(Hbe,null),...n}=e,r=w.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return N.createElement(Vbe,{...n,className:"chakra-select__icon-wrapper"},w.isValidElement(t)?r:null)};JV.displayName="SelectIcon";function Wbe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ube(e){const t=qbe(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function eW(e){return!!e.touches}function Gbe(e){return eW(e)&&e.touches.length>1}function qbe(e){return e.view??window}function Ybe(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Kbe(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function tW(e,t="page"){return eW(e)?Ybe(e,t):Kbe(e,t)}function Xbe(e){return t=>{const n=Ube(t);(!n||n&&t.button===0)&&e(t)}}function Zbe(e,t=!1){function n(i){e(i,{point:tW(i)})}return t?Xbe(n):n}function A4(e,t,n,r){return Wbe(e,t,Zbe(n,t==="pointerdown"),r)}function nW(e){const t=w.useRef(null);return t.current=e,t}var Qbe=class{constructor(e,t,n){sn(this,"history",[]);sn(this,"startEvent",null);sn(this,"lastEvent",null);sn(this,"lastEventInfo",null);sn(this,"handlers",{});sn(this,"removeListeners",()=>{});sn(this,"threshold",3);sn(this,"win");sn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=dC(this.lastEventInfo,this.history),t=this.startEvent!==null,n=n4e(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=NL();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});sn(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,fre.update(this.updatePoint,!0)});sn(this,"onPointerUp",(e,t)=>{const n=dC(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});if(this.win=e.view??window,Gbe(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:tW(e)},{timestamp:i}=NL();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,dC(r,this.history)),this.removeListeners=t4e(A4(this.win,"pointermove",this.onPointerMove),A4(this.win,"pointerup",this.onPointerUp),A4(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),hre.update(this.updatePoint)}};function hI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dC(e,t){return{point:e.point,delta:hI(e.point,t[t.length-1]),offset:hI(e.point,t[0]),velocity:e4e(t,.1)}}var Jbe=e=>e*1e3;function e4e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Jbe(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function t4e(...e){return t=>e.reduce((n,r)=>r(n),t)}function fC(e,t){return Math.abs(e-t)}function pI(e){return"x"in e&&"y"in e}function n4e(e,t){if(typeof e=="number"&&typeof t=="number")return fC(e,t);if(pI(e)&&pI(t)){const n=fC(e.x,t.x),r=fC(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function rW(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=w.useRef(null),d=nW({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(h,m){u.current=null,i==null||i(h,m)}});w.useEffect(()=>{var h;(h=u.current)==null||h.updateHandlers(d.current)}),w.useEffect(()=>{const h=e.current;if(!h||!l)return;function m(v){u.current=new Qbe(v,d.current,s)}return A4(h,"pointerdown",m)},[e,l,d,s]),w.useEffect(()=>()=>{var h;(h=u.current)==null||h.end(),u.current=null},[])}function r4e(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const[o]=i;let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;t({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var i4e=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:w.useEffect;function o4e(e,t){var n;if(!e||!e.parentElement)return;const r=((n=e.ownerDocument)==null?void 0:n.defaultView)??window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function iW({getNodes:e,observeMutation:t=!0}){const[n,r]=w.useState([]),[i,o]=w.useState(0);return i4e(()=>{const a=e(),s=a.map((l,u)=>r4e(l,d=>{r(h=>[...h.slice(0,u),d,...h.slice(u+1)])}));if(t){const l=a[0];s.push(o4e(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function a4e(e){return typeof e=="object"&&e!==null&&"current"in e}function s4e(e){const[t]=iW({observeMutation:!1,getNodes(){return[a4e(e)?e.current:e]}});return t}var l4e=Object.getOwnPropertyNames,u4e=(e,t)=>function(){return e&&(t=(0,e[l4e(e)[0]])(e=0)),t},cf=u4e({"../../../react-shim.js"(){}});cf();cf();cf();var es=e=>e?"":void 0,Dm=e=>e?!0:void 0,df=(...e)=>e.filter(Boolean).join(" ");cf();function Nm(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}cf();cf();function c4e(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Pv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var O4={width:0,height:0},Eb=e=>e||O4;function oW(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=S=>{const _=r[S]??O4;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Pv({orientation:t,vertical:{bottom:`calc(${n[S]}% - ${_.height/2}px)`},horizontal:{left:`calc(${n[S]}% - ${_.width/2}px)`}})}},a=t==="vertical"?r.reduce((S,_)=>Eb(S).height>Eb(_).height?S:_,O4):r.reduce((S,_)=>Eb(S).width>Eb(_).width?S:_,O4),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Pv({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Pv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,d=[0,i?100-n[0]:n[0]],h=u?d:n;let m=h[0];!u&&i&&(m=100-m);const v=Math.abs(h[h.length-1]-h[0]),b={...l,...Pv({orientation:t,vertical:i?{height:`${v}%`,top:`${m}%`}:{height:`${v}%`,bottom:`${m}%`},horizontal:i?{width:`${v}%`,right:`${m}%`}:{width:`${v}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function aW(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function d4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:S,"aria-valuetext":_,"aria-label":E,"aria-labelledby":k,name:T,focusThumbOnChange:A=!0,minStepsBetweenThumbs:M=0,...R}=e,D=Er(m),j=Er(v),z=Er(S),H=aW({isReversed:a,direction:s,orientation:l}),[K,te]=$S({value:i,defaultValue:o??[25,75],onChange:r});if(!Array.isArray(K))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof K}\``);const[G,$]=w.useState(!1),[W,X]=w.useState(!1),[Z,U]=w.useState(-1),Q=!(d||h),re=w.useRef(K),fe=K.map(Ze=>Em(Ze,t,n)),Ee=M*b,be=f4e(fe,t,n,Ee),ye=w.useRef({eventSource:null,value:[],valueBounds:[]});ye.current.value=fe,ye.current.valueBounds=be;const Fe=fe.map(Ze=>n-Ze+t),rt=(H?Fe:fe).map(Ze=>f5(Ze,t,n)),Ve=l==="vertical",je=w.useRef(null),wt=w.useRef(null),Be=iW({getNodes(){const Ze=wt.current,xt=Ze==null?void 0:Ze.querySelectorAll("[role=slider]");return xt?Array.from(xt):[]}}),at=w.useId(),Le=c4e(u??at),ut=w.useCallback(Ze=>{var xt;if(!je.current)return;ye.current.eventSource="pointer";const ht=je.current.getBoundingClientRect(),{clientX:Ht,clientY:rn}=((xt=Ze.touches)==null?void 0:xt[0])??Ze,pr=Ve?ht.bottom-rn:Ht-ht.left,Io=Ve?ht.height:ht.width;let Mi=pr/Io;return H&&(Mi=1-Mi),lF(Mi,t,n)},[Ve,H,n,t]),Mt=(n-t)/10,ct=b||(n-t)/100,_t=w.useMemo(()=>({setValueAtIndex(Ze,xt){if(!Q)return;const ht=ye.current.valueBounds[Ze];xt=parseFloat(Y7(xt,ht.min,ct)),xt=Em(xt,ht.min,ht.max);const Ht=[...ye.current.value];Ht[Ze]=xt,te(Ht)},setActiveIndex:U,stepUp(Ze,xt=ct){const ht=ye.current.value[Ze],Ht=H?ht-xt:ht+xt;_t.setValueAtIndex(Ze,Ht)},stepDown(Ze,xt=ct){const ht=ye.current.value[Ze],Ht=H?ht+xt:ht-xt;_t.setValueAtIndex(Ze,Ht)},reset(){te(re.current)}}),[ct,H,te,Q]),un=w.useCallback(Ze=>{const xt=Ze.key,Ht={ArrowRight:()=>_t.stepUp(Z),ArrowUp:()=>_t.stepUp(Z),ArrowLeft:()=>_t.stepDown(Z),ArrowDown:()=>_t.stepDown(Z),PageUp:()=>_t.stepUp(Z,Mt),PageDown:()=>_t.stepDown(Z,Mt),Home:()=>{const{min:rn}=be[Z];_t.setValueAtIndex(Z,rn)},End:()=>{const{max:rn}=be[Z];_t.setValueAtIndex(Z,rn)}}[xt];Ht&&(Ze.preventDefault(),Ze.stopPropagation(),Ht(Ze),ye.current.eventSource="keyboard")},[_t,Z,Mt,be]),{getThumbStyle:ae,rootStyle:De,trackStyle:Ke,innerTrackStyle:Xe}=w.useMemo(()=>oW({isReversed:H,orientation:l,thumbRects:Be,thumbPercents:rt}),[H,l,rt,Be]),xe=w.useCallback(Ze=>{var xt;const ht=Ze??Z;if(ht!==-1&&A){const Ht=Le.getThumb(ht),rn=(xt=wt.current)==null?void 0:xt.ownerDocument.getElementById(Ht);rn&&setTimeout(()=>rn.focus())}},[A,Z,Le]);Ud(()=>{ye.current.eventSource==="keyboard"&&(j==null||j(ye.current.value))},[fe,j]);const Ne=Ze=>{const xt=ut(Ze)||0,ht=ye.current.value.map(Mi=>Math.abs(Mi-xt)),Ht=Math.min(...ht);let rn=ht.indexOf(Ht);const pr=ht.filter(Mi=>Mi===Ht);pr.length>1&&xt>ye.current.value[rn]&&(rn=rn+pr.length-1),U(rn),_t.setValueAtIndex(rn,xt),xe(rn)},Ct=Ze=>{if(Z==-1)return;const xt=ut(Ze)||0;U(Z),_t.setValueAtIndex(Z,xt),xe(Z)};rW(wt,{onPanSessionStart(Ze){Q&&($(!0),Ne(Ze),D==null||D(ye.current.value))},onPanSessionEnd(){Q&&($(!1),j==null||j(ye.current.value))},onPan(Ze){Q&&Ct(Ze)}});const Dt=w.useCallback((Ze={},xt=null)=>({...Ze,...R,id:Le.root,ref:Hn(xt,wt),tabIndex:-1,"aria-disabled":Dm(d),"data-focused":es(W),style:{...Ze.style,...De}}),[R,d,W,De,Le]),Te=w.useCallback((Ze={},xt=null)=>({...Ze,ref:Hn(xt,je),id:Le.track,"data-disabled":es(d),style:{...Ze.style,...Ke}}),[d,Ke,Le]),At=w.useCallback((Ze={},xt=null)=>({...Ze,ref:xt,id:Le.innerTrack,style:{...Ze.style,...Xe}}),[Xe,Le]),ze=w.useCallback((Ze,xt=null)=>{const{index:ht,...Ht}=Ze,rn=fe[ht];if(rn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ht}\`. The \`value\` or \`defaultValue\` length is : ${fe.length}`);const pr=be[ht];return{...Ht,ref:xt,role:"slider",tabIndex:Q?0:void 0,id:Le.getThumb(ht),"data-active":es(G&&Z===ht),"aria-valuetext":(z==null?void 0:z(rn))??(_==null?void 0:_[ht]),"aria-valuemin":pr.min,"aria-valuemax":pr.max,"aria-valuenow":rn,"aria-orientation":l,"aria-disabled":Dm(d),"aria-readonly":Dm(h),"aria-label":E==null?void 0:E[ht],"aria-labelledby":E!=null&&E[ht]||k==null?void 0:k[ht],style:{...Ze.style,...ae(ht)},onKeyDown:Nm(Ze.onKeyDown,un),onFocus:Nm(Ze.onFocus,()=>{X(!0),U(ht)}),onBlur:Nm(Ze.onBlur,()=>{X(!1),U(-1)})}},[Le,fe,be,Q,G,Z,z,_,l,d,h,E,k,ae,un,X]),vt=w.useCallback((Ze={},xt=null)=>({...Ze,ref:xt,id:Le.output,htmlFor:fe.map((ht,Ht)=>Le.getThumb(Ht)).join(" "),"aria-live":"off"}),[Le,fe]),nn=w.useCallback((Ze,xt=null)=>{const{value:ht,...Ht}=Ze,rn=!(htn),pr=ht>=fe[0]&&ht<=fe[fe.length-1];let Io=f5(ht,t,n);Io=H?100-Io:Io;const Mi={position:"absolute",pointerEvents:"none",...Pv({orientation:l,vertical:{bottom:`${Io}%`},horizontal:{left:`${Io}%`}})};return{...Ht,ref:xt,id:Le.getMarker(Ze.value),role:"presentation","aria-hidden":!0,"data-disabled":es(d),"data-invalid":es(!rn),"data-highlighted":es(pr),style:{...Ze.style,...Mi}}},[d,H,n,t,l,fe,Le]),Rn=w.useCallback((Ze,xt=null)=>{const{index:ht,...Ht}=Ze;return{...Ht,ref:xt,id:Le.getInput(ht),type:"hidden",value:fe[ht],name:Array.isArray(T)?T[ht]:`${T}-${ht}`}},[T,fe,Le]);return{state:{value:fe,isFocused:W,isDragging:G,getThumbPercent:Ze=>rt[Ze],getThumbMinValue:Ze=>be[Ze].min,getThumbMaxValue:Ze=>be[Ze].max},actions:_t,getRootProps:Dt,getTrackProps:Te,getInnerTrackProps:At,getThumbProps:ze,getMarkerProps:nn,getInputProps:Rn,getOutputProps:vt}}function f4e(e,t,n,r){return e.map((i,o)=>{const a=o===0?t:e[o-1]+r,s=o===e.length-1?n:e[o+1]-r;return{min:a,max:s}})}var[h4e,_x]=Pn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[p4e,HE]=Pn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),sW=Ae(function(t,n){const r=Oi("Slider",t),i=Sn(t),{direction:o}=m0();i.direction=o;const{getRootProps:a,...s}=d4e(i),l=w.useMemo(()=>({...s,name:t.name}),[s,t.name]);return N.createElement(h4e,{value:l},N.createElement(p4e,{value:r},N.createElement(Ce.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});sW.defaultProps={orientation:"horizontal"};sW.displayName="RangeSlider";var g4e=Ae(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=_x(),a=HE(),s=r(t,n);return N.createElement(Ce.div,{...s,className:df("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&N.createElement("input",{...i({index:t.index})}))});g4e.displayName="RangeSliderThumb";var m4e=Ae(function(t,n){const{getTrackProps:r}=_x(),i=HE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:df("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});m4e.displayName="RangeSliderTrack";var v4e=Ae(function(t,n){const{getInnerTrackProps:r}=_x(),i=HE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});v4e.displayName="RangeSliderFilledTrack";var y4e=Ae(function(t,n){const{getMarkerProps:r}=_x(),i=r(t,n);return N.createElement(Ce.div,{...i,className:df("chakra-slider__marker",t.className)})});y4e.displayName="RangeSliderMark";cf();cf();function b4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:S,"aria-valuetext":_,"aria-label":E,"aria-labelledby":k,name:T,focusThumbOnChange:A=!0,...M}=e,R=Er(m),D=Er(v),j=Er(S),z=aW({isReversed:a,direction:s,orientation:l}),[H,K]=$S({value:i,defaultValue:o??x4e(t,n),onChange:r}),[te,G]=w.useState(!1),[$,W]=w.useState(!1),X=!(d||h),Z=(n-t)/10,U=b||(n-t)/100,Q=Em(H,t,n),re=n-Q+t,Ee=f5(z?re:Q,t,n),be=l==="vertical",ye=nW({min:t,max:n,step:b,isDisabled:d,value:Q,isInteractive:X,isReversed:z,isVertical:be,eventSource:null,focusThumbOnChange:A,orientation:l}),Fe=w.useRef(null),Me=w.useRef(null),rt=w.useRef(null),Ve=w.useId(),je=u??Ve,[wt,Be]=[`slider-thumb-${je}`,`slider-track-${je}`],at=w.useCallback(ze=>{var vt;if(!Fe.current)return;const nn=ye.current;nn.eventSource="pointer";const Rn=Fe.current.getBoundingClientRect(),{clientX:Ze,clientY:xt}=((vt=ze.touches)==null?void 0:vt[0])??ze,ht=be?Rn.bottom-xt:Ze-Rn.left,Ht=be?Rn.height:Rn.width;let rn=ht/Ht;z&&(rn=1-rn);let pr=lF(rn,nn.min,nn.max);return nn.step&&(pr=parseFloat(Y7(pr,nn.min,nn.step))),pr=Em(pr,nn.min,nn.max),pr},[be,z,ye]),bt=w.useCallback(ze=>{const vt=ye.current;vt.isInteractive&&(ze=parseFloat(Y7(ze,vt.min,U)),ze=Em(ze,vt.min,vt.max),K(ze))},[U,K,ye]),Le=w.useMemo(()=>({stepUp(ze=U){const vt=z?Q-ze:Q+ze;bt(vt)},stepDown(ze=U){const vt=z?Q+ze:Q-ze;bt(vt)},reset(){bt(o||0)},stepTo(ze){bt(ze)}}),[bt,z,Q,U,o]),ut=w.useCallback(ze=>{const vt=ye.current,Rn={ArrowRight:()=>Le.stepUp(),ArrowUp:()=>Le.stepUp(),ArrowLeft:()=>Le.stepDown(),ArrowDown:()=>Le.stepDown(),PageUp:()=>Le.stepUp(Z),PageDown:()=>Le.stepDown(Z),Home:()=>bt(vt.min),End:()=>bt(vt.max)}[ze.key];Rn&&(ze.preventDefault(),ze.stopPropagation(),Rn(ze),vt.eventSource="keyboard")},[Le,bt,Z,ye]),Mt=(j==null?void 0:j(Q))??_,ct=s4e(Me),{getThumbStyle:_t,rootStyle:un,trackStyle:ae,innerTrackStyle:De}=w.useMemo(()=>{const ze=ye.current,vt=ct??{width:0,height:0};return oW({isReversed:z,orientation:ze.orientation,thumbRects:[vt],thumbPercents:[Ee]})},[z,ct,Ee,ye]),Ke=w.useCallback(()=>{ye.current.focusThumbOnChange&&setTimeout(()=>{var vt;return(vt=Me.current)==null?void 0:vt.focus()})},[ye]);Ud(()=>{const ze=ye.current;Ke(),ze.eventSource==="keyboard"&&(D==null||D(ze.value))},[Q,D]);function Xe(ze){const vt=at(ze);vt!=null&&vt!==ye.current.value&&K(vt)}rW(rt,{onPanSessionStart(ze){const vt=ye.current;vt.isInteractive&&(G(!0),Ke(),Xe(ze),R==null||R(vt.value))},onPanSessionEnd(){const ze=ye.current;ze.isInteractive&&(G(!1),D==null||D(ze.value))},onPan(ze){ye.current.isInteractive&&Xe(ze)}});const xe=w.useCallback((ze={},vt=null)=>({...ze,...M,ref:Hn(vt,rt),tabIndex:-1,"aria-disabled":Dm(d),"data-focused":es($),style:{...ze.style,...un}}),[M,d,$,un]),Ne=w.useCallback((ze={},vt=null)=>({...ze,ref:Hn(vt,Fe),id:Be,"data-disabled":es(d),style:{...ze.style,...ae}}),[d,Be,ae]),Ct=w.useCallback((ze={},vt=null)=>({...ze,ref:vt,style:{...ze.style,...De}}),[De]),Dt=w.useCallback((ze={},vt=null)=>({...ze,ref:Hn(vt,Me),role:"slider",tabIndex:X?0:void 0,id:wt,"data-active":es(te),"aria-valuetext":Mt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":Q,"aria-orientation":l,"aria-disabled":Dm(d),"aria-readonly":Dm(h),"aria-label":E,"aria-labelledby":E?void 0:k,style:{...ze.style,..._t(0)},onKeyDown:Nm(ze.onKeyDown,ut),onFocus:Nm(ze.onFocus,()=>W(!0)),onBlur:Nm(ze.onBlur,()=>W(!1))}),[X,wt,te,Mt,t,n,Q,l,d,h,E,k,_t,ut]),Te=w.useCallback((ze,vt=null)=>{const nn=!(ze.valuen),Rn=Q>=ze.value,Ze=f5(ze.value,t,n),xt={position:"absolute",pointerEvents:"none",...S4e({orientation:l,vertical:{bottom:z?`${100-Ze}%`:`${Ze}%`},horizontal:{left:z?`${100-Ze}%`:`${Ze}%`}})};return{...ze,ref:vt,role:"presentation","aria-hidden":!0,"data-disabled":es(d),"data-invalid":es(!nn),"data-highlighted":es(Rn),style:{...ze.style,...xt}}},[d,z,n,t,l,Q]),At=w.useCallback((ze={},vt=null)=>({...ze,ref:vt,type:"hidden",value:Q,name:T}),[T,Q]);return{state:{value:Q,isFocused:$,isDragging:te},actions:Le,getRootProps:xe,getTrackProps:Ne,getInnerTrackProps:Ct,getThumbProps:Dt,getMarkerProps:Te,getInputProps:At}}function S4e(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function x4e(e,t){return t"}),[C4e,Ex]=Pn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),VE=Ae((e,t)=>{const n=Oi("Slider",e),r=Sn(e),{direction:i}=m0();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=b4e(r),l=a(),u=o({},t);return N.createElement(w4e,{value:s},N.createElement(C4e,{value:n},N.createElement(Ce.div,{...l,className:df("chakra-slider",e.className),__css:n.container},e.children,N.createElement("input",{...u}))))});VE.defaultProps={orientation:"horizontal"};VE.displayName="Slider";var lW=Ae((e,t)=>{const{getThumbProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:df("chakra-slider__thumb",e.className),__css:r.thumb})});lW.displayName="SliderThumb";var uW=Ae((e,t)=>{const{getTrackProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:df("chakra-slider__track",e.className),__css:r.track})});uW.displayName="SliderTrack";var cW=Ae((e,t)=>{const{getInnerTrackProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:df("chakra-slider__filled-track",e.className),__css:r.filledTrack})});cW.displayName="SliderFilledTrack";var Q9=Ae((e,t)=>{const{getMarkerProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:df("chakra-slider__marker",e.className),__css:r.mark})});Q9.displayName="SliderMark";var _4e=(...e)=>e.filter(Boolean).join(" "),gI=e=>e?"":void 0,WE=Ae(function(t,n){const r=Oi("Switch",t),{spacing:i="0.5rem",children:o,...a}=Sn(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:d,getLabelProps:h}=aF(a),m=w.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),v=w.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=w.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return N.createElement(Ce.label,{...d(),className:_4e("chakra-switch",t.className),__css:m},N.createElement("input",{className:"chakra-switch__input",...l({},n)}),N.createElement(Ce.span,{...u(),className:"chakra-switch__track",__css:v},N.createElement(Ce.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":gI(s.isChecked),"data-hover":gI(s.isHovered)})),o&&N.createElement(Ce.span,{className:"chakra-switch__label",...h(),__css:b},o))});WE.displayName="Switch";var k0=(...e)=>e.filter(Boolean).join(" ");function J9(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[k4e,dW,E4e,P4e]=bB();function T4e(e){const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[d,h]=w.useState(t??0),[m,v]=$S({defaultValue:t??0,value:r,onChange:n});w.useEffect(()=>{r!=null&&h(r)},[r]);const b=E4e(),S=w.useId();return{id:`tabs-${e.id??S}`,selectedIndex:m,focusedIndex:d,setSelectedIndex:v,setFocusedIndex:h,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:b,direction:l,htmlProps:u}}var[L4e,Ny]=Pn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function A4e(e){const{focusedIndex:t,orientation:n,direction:r}=Ny(),i=dW(),o=w.useCallback(a=>{const s=()=>{var k;const T=i.nextEnabled(t);T&&((k=T.node)==null||k.focus())},l=()=>{var k;const T=i.prevEnabled(t);T&&((k=T.node)==null||k.focus())},u=()=>{var k;const T=i.firstEnabled();T&&((k=T.node)==null||k.focus())},d=()=>{var k;const T=i.lastEnabled();T&&((k=T.node)==null||k.focus())},h=n==="horizontal",m=n==="vertical",v=a.key,b=r==="ltr"?"ArrowLeft":"ArrowRight",S=r==="ltr"?"ArrowRight":"ArrowLeft",E={[b]:()=>h&&l(),[S]:()=>h&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:u,End:d}[v];E&&(a.preventDefault(),E(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:J9(e.onKeyDown,o)}}function O4e(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=Ny(),{index:u,register:d}=P4e({disabled:t&&!n}),h=u===l,m=()=>{i(u)},v=()=>{s(u),!o&&!(t&&n)&&i(u)},b=c0e({...r,ref:Hn(d,e.ref),isDisabled:t,isFocusable:n,onClick:J9(e.onClick,m)}),S="button";return{...b,id:fW(a,u),role:"tab",tabIndex:h?0:-1,type:S,"aria-selected":h,"aria-controls":hW(a,u),onFocus:t?void 0:J9(e.onFocus,v)}}var[M4e,I4e]=Pn({});function R4e(e){const t=Ny(),{id:n,selectedIndex:r}=t,o=ex(e.children).map((a,s)=>w.createElement(M4e,{key:s,value:{isSelected:s===r,id:hW(n,s),tabId:fW(n,s),selectedIndex:r}},a));return{...e,children:o}}function D4e(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=Ny(),{isSelected:o,id:a,tabId:s}=I4e(),l=w.useRef(!1);o&&(l.current=!0);const u=qF({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function N4e(){const e=Ny(),t=dW(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=w.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=w.useState(!1);return Gs(()=>{if(n==null)return;const d=t.item(n);if(d==null)return;i&&s({left:d.node.offsetLeft,width:d.node.offsetWidth}),o&&s({top:d.node.offsetTop,height:d.node.offsetHeight});const h=requestAnimationFrame(()=>{u(!0)});return()=>{h&&cancelAnimationFrame(h)}},[n,i,o,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:l?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function fW(e,t){return`${e}--tab-${t}`}function hW(e,t){return`${e}--tabpanel-${t}`}var[j4e,jy]=Pn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),pW=Ae(function(t,n){const r=Oi("Tabs",t),{children:i,className:o,...a}=Sn(t),{htmlProps:s,descendants:l,...u}=T4e(a),d=w.useMemo(()=>u,[u]),{isFitted:h,...m}=s;return N.createElement(k4e,{value:l},N.createElement(L4e,{value:d},N.createElement(j4e,{value:r},N.createElement(Ce.div,{className:k0("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});pW.displayName="Tabs";var B4e=Ae(function(t,n){const r=N4e(),i={...t.style,...r},o=jy();return N.createElement(Ce.div,{ref:n,...t,className:k0("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});B4e.displayName="TabIndicator";var $4e=Ae(function(t,n){const r=A4e({...t,ref:n}),o={display:"flex",...jy().tablist};return N.createElement(Ce.div,{...r,className:k0("chakra-tabs__tablist",t.className),__css:o})});$4e.displayName="TabList";var gW=Ae(function(t,n){const r=D4e({...t,ref:n}),i=jy();return N.createElement(Ce.div,{outline:"0",...r,className:k0("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});gW.displayName="TabPanel";var mW=Ae(function(t,n){const r=R4e(t),i=jy();return N.createElement(Ce.div,{...r,width:"100%",ref:n,className:k0("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});mW.displayName="TabPanels";var vW=Ae(function(t,n){const r=jy(),i=O4e({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return N.createElement(Ce.button,{...i,className:k0("chakra-tabs__tab",t.className),__css:o})});vW.displayName="Tab";var F4e=(...e)=>e.filter(Boolean).join(" ");function z4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var H4e=["h","minH","height","minHeight"],UE=Ae((e,t)=>{const n=Oo("Textarea",e),{className:r,rows:i,...o}=Sn(e),a=hk(o),s=i?z4e(n,H4e):n;return N.createElement(Ce.textarea,{ref:t,rows:i,...a,className:F4e("chakra-textarea",r),__css:s})});UE.displayName="Textarea";function V4e(e,t){const n=Er(e);w.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function e8(e,...t){return W4e(e)?e(...t):e}var W4e=e=>typeof e=="function";function U4e(e,t){const n=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(i==null?void 0:i[t])??n}var G4e=(e,t)=>e.find(n=>n.id===t);function mI(e,t){const n=yW(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function yW(e,t){for(const[n,r]of Object.entries(e))if(G4e(r,t))return n}function q4e(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Y4e(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}var K4e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Wl=X4e(K4e);function X4e(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=Z4e(i,o),{position:s,id:l}=a;return r(u=>{const h=s.includes("top")?[a,...u[s]??[]]:[...u[s]??[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=mI(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:bW(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(d=>({...d,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=yW(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(mI(Wl.getState(),i).position)}}var vI=0;function Z4e(e,t={}){vI+=1;const n=t.id??vI,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Wl.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var Q4e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return N.createElement(J$,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},N.createElement(tF,null,l),N.createElement(Ce.div,{flex:"1",maxWidth:"100%"},i&&N.createElement(nF,{id:u==null?void 0:u.title},i),s&&N.createElement(eF,{id:u==null?void 0:u.description,display:"block"},s)),o&&N.createElement(rx,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function bW(e={}){const{render:t,toastComponent:n=Q4e}=e;return i=>typeof t=="function"?t({...i,...e}):N.createElement(n,{...i,...e})}function J4e(e,t){const n=i=>({...t,...i,position:U4e((i==null?void 0:i.position)??(t==null?void 0:t.position),e)}),r=i=>{const o=n(i),a=bW(o);return Wl.notify(a,o)};return r.update=(i,o)=>{Wl.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...e8(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...e8(o.error,s)}))},r.closeAll=Wl.closeAll,r.close=Wl.close,r.isActive=Wl.isActive,r}function By(e){const{theme:t}=mB();return w.useMemo(()=>J4e(t.direction,e),[e,t.direction])}var e5e={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},SW=w.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=e5e,toastSpacing:d="0.5rem"}=e,[h,m]=w.useState(s),v=Ufe();Ud(()=>{v||r==null||r()},[v]),Ud(()=>{m(s)},[s]);const b=()=>m(null),S=()=>m(s),_=()=>{v&&i()};w.useEffect(()=>{v&&o&&i()},[v,o,i]),V4e(_,h);const E=w.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:d,...l}),[l,d]),k=w.useMemo(()=>q4e(a),[a]);return N.createElement(hu.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:S,custom:{position:a},style:k},N.createElement(Ce.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:E},e8(n,{id:t,onClose:_})))});SW.displayName="ToastComponent";var t5e=e=>{const t=w.useSyncExternalStore(Wl.subscribe,Wl.getState,Wl.getState),{children:n,motionVariants:r,component:i=SW,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return N.createElement("ul",{role:"region","aria-live":"polite",key:l,id:`chakra-toast-manager-${l}`,style:Y4e(l)},N.createElement(of,{initial:!1},u.map(d=>N.createElement(i,{key:d.id,motionVariants:r,...d}))))});return N.createElement(N.Fragment,null,n,N.createElement(up,{...o},s))};function n5e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function r5e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var i5e={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};function rv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var F5=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},t8=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function o5e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:d,id:h,isOpen:m,defaultIsOpen:v,arrowSize:b=10,arrowShadowColor:S,arrowPadding:_,modifiers:E,isDisabled:k,gutter:T,offset:A,direction:M,...R}=e,{isOpen:D,onOpen:j,onClose:z}=GF({isOpen:m,defaultIsOpen:v,onOpen:l,onClose:u}),{referenceRef:H,getPopperProps:K,getArrowInnerProps:te,getArrowProps:G}=UF({enabled:D,placement:d,arrowPadding:_,modifiers:E,gutter:T,offset:A,direction:M}),$=w.useId(),X=`tooltip-${h??$}`,Z=w.useRef(null),U=w.useRef(),Q=w.useCallback(()=>{U.current&&(clearTimeout(U.current),U.current=void 0)},[]),re=w.useRef(),fe=w.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=void 0)},[]),Ee=w.useCallback(()=>{fe(),z()},[z,fe]),be=a5e(Z,Ee),ye=w.useCallback(()=>{if(!k&&!U.current){be();const at=t8(Z);U.current=at.setTimeout(j,t)}},[be,k,j,t]),Fe=w.useCallback(()=>{Q();const at=t8(Z);re.current=at.setTimeout(Ee,n)},[n,Ee,Q]),Me=w.useCallback(()=>{D&&r&&Fe()},[r,Fe,D]),rt=w.useCallback(()=>{D&&a&&Fe()},[a,Fe,D]),Ve=w.useCallback(at=>{D&&at.key==="Escape"&&Fe()},[D,Fe]);Nh(()=>F5(Z),"keydown",s?Ve:void 0),Nh(()=>F5(Z),"scroll",()=>{D&&o&&Ee()}),w.useEffect(()=>{k&&(Q(),D&&z())},[k,D,z,Q]),w.useEffect(()=>()=>{Q(),fe()},[Q,fe]),Nh(()=>Z.current,"pointerleave",Fe);const je=w.useCallback((at={},bt=null)=>({...at,ref:Hn(Z,bt,H),onPointerEnter:rv(at.onPointerEnter,ut=>{ut.pointerType!=="touch"&&ye()}),onClick:rv(at.onClick,Me),onPointerDown:rv(at.onPointerDown,rt),onFocus:rv(at.onFocus,ye),onBlur:rv(at.onBlur,Fe),"aria-describedby":D?X:void 0}),[ye,Fe,rt,D,X,Me,H]),wt=w.useCallback((at={},bt=null)=>K({...at,style:{...at.style,[oi.arrowSize.var]:b?`${b}px`:void 0,[oi.arrowShadowColor.var]:S}},bt),[K,b,S]),Be=w.useCallback((at={},bt=null)=>{const Le={...at.style,position:"relative",transformOrigin:oi.transformOrigin.varRef};return{ref:bt,...R,...at,id:X,role:"tooltip",style:Le}},[R,X]);return{isOpen:D,show:ye,hide:Fe,getTriggerProps:je,getTooltipProps:Be,getTooltipPositionerProps:wt,getArrowProps:G,getArrowInnerProps:te}}var hC="chakra-ui:close-tooltip";function a5e(e,t){return w.useEffect(()=>{const n=F5(e);return n.addEventListener(hC,t),()=>n.removeEventListener(hC,t)},[t,e]),()=>{const n=F5(e),r=t8(e);n.dispatchEvent(new r.CustomEvent(hC))}}var s5e=Ce(hu.div),uo=Ae((e,t)=>{const n=Oo("Tooltip",e),r=Sn(e),i=m0(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:d,portalProps:h,background:m,backgroundColor:v,bgColor:b,motionProps:S,..._}=r,E=m??v??d??b;if(E){n.bg=E;const z=hne(i,"colors",E);n[oi.arrowBg.var]=z}const k=o5e({..._,direction:i.direction}),T=typeof o=="string"||s;let A;if(T)A=N.createElement(Ce.span,{display:"inline-block",tabIndex:0,...k.getTriggerProps()},o);else{const z=w.Children.only(o);A=w.cloneElement(z,k.getTriggerProps(z.props,z.ref))}const M=!!l,R=k.getTooltipProps({},t),D=M?n5e(R,["role","id"]):R,j=r5e(R,["role","id"]);return a?N.createElement(N.Fragment,null,A,N.createElement(of,null,k.isOpen&&N.createElement(up,{...h},N.createElement(Ce.div,{...k.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},N.createElement(s5e,{variants:i5e,initial:"exit",animate:"enter",exit:"exit",...S,...D,__css:n},a,M&&N.createElement(Ce.span,{srOnly:!0,...j},l),u&&N.createElement(Ce.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},N.createElement(Ce.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))))))):N.createElement(N.Fragment,null,o)});uo.displayName="Tooltip";var l5e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=N.createElement(TF,{environment:a},t);return N.createElement(ice,{theme:o,cssVarsRoot:s},N.createElement(bj,{colorModeManager:n,options:o.config},i?N.createElement(wme,null):N.createElement(xme,null),N.createElement(ace,null),r?N.createElement(YH,{zIndex:r},l):l))};function u5e({children:e,theme:t=Kue,toastOptions:n,...r}){return N.createElement(l5e,{theme:t,...r},e,N.createElement(t5e,{...n}))}var n8={},yI=el;n8.createRoot=yI.createRoot,n8.hydrateRoot=yI.hydrateRoot;var r8={},c5e={get exports(){return r8},set exports(e){r8=e}},xW={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var a0=w;function d5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var f5e=typeof Object.is=="function"?Object.is:d5e,h5e=a0.useState,p5e=a0.useEffect,g5e=a0.useLayoutEffect,m5e=a0.useDebugValue;function v5e(e,t){var n=t(),r=h5e({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return g5e(function(){i.value=n,i.getSnapshot=t,pC(i)&&o({inst:i})},[e,n,t]),p5e(function(){return pC(i)&&o({inst:i}),e(function(){pC(i)&&o({inst:i})})},[e]),m5e(n),n}function pC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!f5e(e,n)}catch{return!0}}function y5e(e,t){return t()}var b5e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y5e:v5e;xW.useSyncExternalStore=a0.useSyncExternalStore!==void 0?a0.useSyncExternalStore:b5e;(function(e){e.exports=xW})(c5e);var i8={},S5e={get exports(){return i8},set exports(e){i8=e}},wW={};/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Px=w,x5e=r8;function w5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var C5e=typeof Object.is=="function"?Object.is:w5e,_5e=x5e.useSyncExternalStore,k5e=Px.useRef,E5e=Px.useEffect,P5e=Px.useMemo,T5e=Px.useDebugValue;wW.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=k5e(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=P5e(function(){function l(v){if(!u){if(u=!0,d=v,v=r(v),i!==void 0&&a.hasValue){var b=a.value;if(i(b,v))return h=b}return h=v}if(b=h,C5e(d,v))return b;var S=r(v);return i!==void 0&&i(b,S)?b:(d=v,h=S)}var u=!1,d,h,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=_5e(e,o[0],o[1]);return E5e(function(){a.hasValue=!0,a.value=s},[s]),T5e(s),s};(function(e){e.exports=wW})(S5e);function L5e(e){e()}let CW=L5e;const A5e=e=>CW=e,O5e=()=>CW,Qd=w.createContext(null);function _W(){return w.useContext(Qd)}const M5e=()=>{throw new Error("uSES not initialized!")};let kW=M5e;const I5e=e=>{kW=e},R5e=(e,t)=>e===t;function D5e(e=Qd){const t=e===Qd?_W:()=>w.useContext(e);return function(r,i=R5e){const{store:o,subscription:a,getServerState:s}=t(),l=kW(a.addNestedSub,o.getState,s||o.getState,r,i);return w.useDebugValue(l),l}}const N5e=D5e();var bI={},j5e={get exports(){return bI},set exports(e){bI=e}},Fn={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var GE=Symbol.for("react.element"),qE=Symbol.for("react.portal"),Tx=Symbol.for("react.fragment"),Lx=Symbol.for("react.strict_mode"),Ax=Symbol.for("react.profiler"),Ox=Symbol.for("react.provider"),Mx=Symbol.for("react.context"),B5e=Symbol.for("react.server_context"),Ix=Symbol.for("react.forward_ref"),Rx=Symbol.for("react.suspense"),Dx=Symbol.for("react.suspense_list"),Nx=Symbol.for("react.memo"),jx=Symbol.for("react.lazy"),$5e=Symbol.for("react.offscreen"),EW;EW=Symbol.for("react.module.reference");function ms(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case GE:switch(e=e.type,e){case Tx:case Ax:case Lx:case Rx:case Dx:return e;default:switch(e=e&&e.$$typeof,e){case B5e:case Mx:case Ix:case jx:case Nx:case Ox:return e;default:return t}}case qE:return t}}}Fn.ContextConsumer=Mx;Fn.ContextProvider=Ox;Fn.Element=GE;Fn.ForwardRef=Ix;Fn.Fragment=Tx;Fn.Lazy=jx;Fn.Memo=Nx;Fn.Portal=qE;Fn.Profiler=Ax;Fn.StrictMode=Lx;Fn.Suspense=Rx;Fn.SuspenseList=Dx;Fn.isAsyncMode=function(){return!1};Fn.isConcurrentMode=function(){return!1};Fn.isContextConsumer=function(e){return ms(e)===Mx};Fn.isContextProvider=function(e){return ms(e)===Ox};Fn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===GE};Fn.isForwardRef=function(e){return ms(e)===Ix};Fn.isFragment=function(e){return ms(e)===Tx};Fn.isLazy=function(e){return ms(e)===jx};Fn.isMemo=function(e){return ms(e)===Nx};Fn.isPortal=function(e){return ms(e)===qE};Fn.isProfiler=function(e){return ms(e)===Ax};Fn.isStrictMode=function(e){return ms(e)===Lx};Fn.isSuspense=function(e){return ms(e)===Rx};Fn.isSuspenseList=function(e){return ms(e)===Dx};Fn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Tx||e===Ax||e===Lx||e===Rx||e===Dx||e===$5e||typeof e=="object"&&e!==null&&(e.$$typeof===jx||e.$$typeof===Nx||e.$$typeof===Ox||e.$$typeof===Mx||e.$$typeof===Ix||e.$$typeof===EW||e.getModuleId!==void 0)};Fn.typeOf=ms;(function(e){e.exports=Fn})(j5e);function F5e(){const e=O5e();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const SI={notify(){},get:()=>[]};function z5e(e,t){let n,r=SI;function i(h){return l(),r.subscribe(h)}function o(){r.notify()}function a(){d.onStateChange&&d.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=F5e())}function u(){n&&(n(),n=void 0,r.clear(),r=SI)}const d={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return d}const H5e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",V5e=H5e?w.useLayoutEffect:w.useEffect;function W5e({store:e,context:t,children:n,serverState:r}){const i=w.useMemo(()=>{const s=z5e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=w.useMemo(()=>e.getState(),[e]);V5e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]);const a=t||Qd;return N.createElement(a.Provider,{value:i},n)}function PW(e=Qd){const t=e===Qd?_W:()=>w.useContext(e);return function(){const{store:r}=t();return r}}const U5e=PW();function G5e(e=Qd){const t=e===Qd?U5e:PW(e);return function(){return t().dispatch}}const q5e=G5e();I5e(i8.useSyncExternalStoreWithSelector);A5e(el.unstable_batchedUpdates);function M4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?M4=function(n){return typeof n}:M4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},M4(e)}function Y5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:YE(e)?2:KE(e)?3:0}function jm(e,t){return E0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Q5e(e,t){return E0(e)===2?e.get(t):e[t]}function LW(e,t,n){var r=E0(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function AW(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function YE(e){return iSe&&e instanceof Map}function KE(e){return oSe&&e instanceof Set}function gh(e){return e.o||e.t}function XE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=MW(e);delete t[vr];for(var n=Bm(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=J5e),Object.freeze(e),t&&ep(e,function(n,r){return ZE(r,!0)},!0)),e}function J5e(){Ws(2)}function QE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function nu(e){var t=c8[e];return t||Ws(18,e),t}function eSe(e,t){c8[e]||(c8[e]=t)}function s8(){return ey}function gC(e,t){t&&(nu("Patches"),e.u=[],e.s=[],e.v=t)}function z5(e){l8(e),e.p.forEach(tSe),e.p=null}function l8(e){e===ey&&(ey=e.l)}function wI(e){return ey={p:[],l:ey,h:e,m:!0,_:0}}function tSe(e){var t=e[vr];t.i===0||t.i===1?t.j():t.O=!0}function mC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||nu("ES5").S(t,e,r),r?(n[vr].P&&(z5(t),Ws(4)),sc(e)&&(e=H5(t,e),t.l||V5(t,e)),t.u&&nu("Patches").M(n[vr].t,e,t.u,t.s)):e=H5(t,n,[]),z5(t),t.u&&t.v(t.u,t.s),e!==OW?e:void 0}function H5(e,t,n){if(QE(t))return t;var r=t[vr];if(!r)return ep(t,function(o,a){return CI(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return V5(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=XE(r.k):r.o;ep(r.i===3?new Set(i):i,function(o,a){return CI(e,r,i,o,a,n)}),V5(e,i,!1),n&&e.u&&nu("Patches").R(r,n,e.u,e.s)}return r.o}function CI(e,t,n,r,i,o){if(Jd(i)){var a=H5(e,i,o&&t&&t.i!==3&&!jm(t.D,r)?o.concat(r):void 0);if(LW(n,r,a),!Jd(a))return;e.m=!1}if(sc(i)&&!QE(i)){if(!e.h.F&&e._<1)return;H5(e,i),t&&t.A.l||V5(e,i)}}function V5(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&ZE(t,n)}function vC(e,t){var n=e[vr];return(n?gh(n):e)[t]}function _I(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function wd(e){e.P||(e.P=!0,e.l&&wd(e.l))}function yC(e){e.o||(e.o=XE(e.t))}function u8(e,t,n){var r=YE(t)?nu("MapSet").N(t,n):KE(t)?nu("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:s8(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=ty;a&&(l=[s],u=Tv);var d=Proxy.revocable(l,u),h=d.revoke,m=d.proxy;return s.k=m,s.j=h,m}(t,n):nu("ES5").J(t,n);return(n?n.A:s8()).p.push(r),r}function nSe(e){return Jd(e)||Ws(22,e),function t(n){if(!sc(n))return n;var r,i=n[vr],o=E0(n);if(i){if(!i.P&&(i.i<4||!nu("ES5").K(i)))return i.t;i.I=!0,r=kI(n,o),i.I=!1}else r=kI(n,o);return ep(r,function(a,s){i&&Q5e(i.t,a)===s||LW(r,a,t(s))}),o===3?new Set(r):r}(e)}function kI(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return XE(e)}function rSe(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[vr];return ty.get(l,o)},set:function(l){var u=this[vr];ty.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][vr];if(!s.P)switch(s.i){case 5:r(s)&&wd(s);break;case 4:n(s)&&wd(s)}}}function n(o){for(var a=o.t,s=o.k,l=Bm(s),u=l.length-1;u>=0;u--){var d=l[u];if(d!==vr){var h=a[d];if(h===void 0&&!jm(a,d))return!0;var m=s[d],v=m&&m[vr];if(v?v.t!==h:!AW(m,h))return!0}}var b=!!a[vr];return l.length!==Bm(a).length+(b?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?E-1:0),T=1;T1?d-1:0),m=1;m=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=nu("Patches").$;return Jd(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Ra=new sSe,IW=Ra.produce;Ra.produceWithPatches.bind(Ra);Ra.setAutoFreeze.bind(Ra);Ra.setUseProxies.bind(Ra);Ra.applyPatches.bind(Ra);Ra.createDraft.bind(Ra);Ra.finishDraft.bind(Ra);function LI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function AI(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ro(1));return n(eP)(e,t)}if(typeof e!="function")throw new Error(ro(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function d(){if(l)throw new Error(ro(3));return o}function h(S){if(typeof S!="function")throw new Error(ro(4));if(l)throw new Error(ro(5));var _=!0;return u(),s.push(S),function(){if(_){if(l)throw new Error(ro(6));_=!1,u();var k=s.indexOf(S);s.splice(k,1),a=null}}}function m(S){if(!lSe(S))throw new Error(ro(7));if(typeof S.type>"u")throw new Error(ro(8));if(l)throw new Error(ro(9));try{l=!0,o=i(o,S)}finally{l=!1}for(var _=a=s,E=0;E<_.length;E++){var k=_[E];k()}return S}function v(S){if(typeof S!="function")throw new Error(ro(10));i=S,m({type:W5.REPLACE})}function b(){var S,_=h;return S={subscribe:function(k){if(typeof k!="object"||k===null)throw new Error(ro(11));function T(){k.next&&k.next(d())}T();var A=_(T);return{unsubscribe:A}}},S[OI]=function(){return this},S}return m({type:W5.INIT}),r={dispatch:m,subscribe:h,getState:d,replaceReducer:v},r[OI]=b,r}function uSe(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:W5.INIT});if(typeof r>"u")throw new Error(ro(12));if(typeof n(void 0,{type:W5.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ro(13))})}function RW(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(ro(14));h[v]=_,d=d||_!==S}return d=d||o.length!==Object.keys(l).length,d?h:l}}function U5(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return G5}function i(s,l){r(s)===G5&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var hSe=function(t,n){return t===n};function pSe(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(R).forEach(function(D){T(D)&&d[D]!==R[D]&&m.indexOf(D)===-1&&m.push(D)}),Object.keys(d).forEach(function(D){R[D]===void 0&&T(D)&&m.indexOf(D)===-1&&d[D]!==void 0&&m.push(D)}),v===null&&(v=setInterval(E,i)),d=R},o)}function E(){if(m.length===0){v&&clearInterval(v),v=null;return}var R=m.shift(),D=r.reduce(function(j,z){return z.in(j,R,d)},d[R]);if(D!==void 0)try{h[R]=l(D)}catch(j){console.error("redux-persist/createPersistoid: error serializing state",j)}else delete h[R];m.length===0&&k()}function k(){Object.keys(h).forEach(function(R){d[R]===void 0&&delete h[R]}),b=s.setItem(a,l(h)).catch(A)}function T(R){return!(n&&n.indexOf(R)===-1&&R!=="_persist"||t&&t.indexOf(R)!==-1)}function A(R){u&&u(R)}var M=function(){for(;m.length!==0;)E();return b||Promise.resolve()};return{update:_,flush:M}}function YSe(e){return JSON.stringify(e)}function KSe(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:nP).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=XSe,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,d){return d.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function XSe(e){return JSON.parse(e)}function ZSe(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:nP).concat(e.key);return t.removeItem(n,QSe)}function QSe(e){}function BI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zu(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function txe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var nxe=5e3;function rxe(e,t){var n=e.version!==void 0?e.version:VSe;e.debug;var r=e.stateReconciler===void 0?GSe:e.stateReconciler,i=e.getStoredState||KSe,o=e.timeout!==void 0?e.timeout:nxe,a=null,s=!1,l=!0,u=function(h){return h._persist.rehydrated&&a&&!l&&a.update(h),h};return function(d,h){var m=d||{},v=m._persist,b=exe(m,["_persist"]),S=b;if(h.type===FW){var _=!1,E=function(j,z){_||(h.rehydrate(e.key,j,z),_=!0)};if(o&&setTimeout(function(){!_&&E(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=qSe(e)),v)return zu({},t(S,h),{_persist:v});if(typeof h.rehydrate!="function"||typeof h.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return h.register(e.key),i(e).then(function(D){var j=e.migrate||function(z,H){return Promise.resolve(z)};j(D,n).then(function(z){E(z)},function(z){E(void 0,z)})},function(D){E(void 0,D)}),zu({},t(S,h),{_persist:{version:n,rehydrated:!1}})}else{if(h.type===zW)return s=!0,h.result(ZSe(e)),zu({},t(S,h),{_persist:v});if(h.type===BW)return h.result(a&&a.flush()),zu({},t(S,h),{_persist:v});if(h.type===$W)l=!0;else if(h.type===rP){if(s)return zu({},S,{_persist:zu({},v,{rehydrated:!0})});if(h.key===e.key){var k=t(S,h),T=h.payload,A=r!==!1&&T!==void 0?r(T,d,k,e):k,M=zu({},A,{_persist:zu({},v,{rehydrated:!0})});return u(M)}}}if(!v)return t(d,h);var R=t(S,h);return R===S?d:u(zu({},R,{_persist:v}))}}function $I(e){return axe(e)||oxe(e)||ixe()}function ixe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function oxe(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function axe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:VW,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case HW:return f8({},t,{registry:[].concat($I(t.registry),[n.key])});case rP:var r=t.registry.indexOf(n.key),i=$I(t.registry);return i.splice(r,1),f8({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function uxe(e,t,n){var r=n||!1,i=eP(lxe,VW,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:HW,key:u})},a=function(u,d,h){var m={type:rP,payload:d,err:h,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=f8({},i,{purge:function(){var u=[];return e.dispatch({type:zW,result:function(h){u.push(h)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:BW,result:function(h){u.push(h)}}),Promise.all(u)},pause:function(){e.dispatch({type:$W})},persist:function(){e.dispatch({type:FW,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var iP={},oP={};oP.__esModule=!0;oP.default=fxe;function N4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?N4=function(n){return typeof n}:N4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},N4(e)}function wC(){}var cxe={getItem:wC,setItem:wC,removeItem:wC};function dxe(e){if((typeof self>"u"?"undefined":N4(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function fxe(e){var t="".concat(e,"Storage");return dxe(t)?self[t]:cxe}iP.__esModule=!0;iP.default=gxe;var hxe=pxe(oP);function pxe(e){return e&&e.__esModule?e:{default:e}}function gxe(e){var t=(0,hxe.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var WW=void 0,mxe=vxe(iP);function vxe(e){return e&&e.__esModule?e:{default:e}}var yxe=(0,mxe.default)("local");WW=yxe;var UW={},GW={},tp={};Object.defineProperty(tp,"__esModule",{value:!0});tp.PLACEHOLDER_UNDEFINED=tp.PACKAGE_NAME=void 0;tp.PACKAGE_NAME="redux-deep-persist";tp.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var aP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(aP);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=tp,n=aP,r=function(G){return typeof G=="object"&&G!==null};e.isObjectLike=r;const i=function(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(G){return(0,e.isLength)(G&&G.length)&&Object.prototype.toString.call(G)==="[object Array]"};const o=function(G){return!!G&&typeof G=="object"&&!(0,e.isArray)(G)};e.isPlainObject=o;const a=function(G){return String(~~G)===G&&Number(G)>=0};e.isIntegerString=a;const s=function(G){return Object.prototype.toString.call(G)==="[object String]"};e.isString=s;const l=function(G){return Object.prototype.toString.call(G)==="[object Date]"};e.isDate=l;const u=function(G){return Object.keys(G).length===0};e.isEmpty=u;const d=Object.prototype.hasOwnProperty,h=function(G,$,W){W||(W=new Set([G])),$||($="");for(const X in G){const Z=$?`${$}.${X}`:X,U=G[X];if((0,e.isObjectLike)(U))return W.has(U)?`${$}.${X}:`:(W.add(U),(0,e.getCircularPath)(U,Z,W))}return null};e.getCircularPath=h;const m=function(G){if(!(0,e.isObjectLike)(G))return G;if((0,e.isDate)(G))return new Date(+G);const $=(0,e.isArray)(G)?[]:{};for(const W in G){const X=G[W];$[W]=(0,e._cloneDeep)(X)}return $};e._cloneDeep=m;const v=function(G){const $=(0,e.getCircularPath)(G);if($)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${$}' of object you're trying to persist: ${G}`);return(0,e._cloneDeep)(G)};e.cloneDeep=v;const b=function(G,$){if(G===$)return{};if(!(0,e.isObjectLike)(G)||!(0,e.isObjectLike)($))return $;const W=(0,e.cloneDeep)(G),X=(0,e.cloneDeep)($),Z=Object.keys(W).reduce((Q,re)=>(d.call(X,re)||(Q[re]=void 0),Q),{});if((0,e.isDate)(W)||(0,e.isDate)(X))return W.valueOf()===X.valueOf()?{}:X;const U=Object.keys(X).reduce((Q,re)=>{if(!d.call(W,re))return Q[re]=X[re],Q;const fe=(0,e.difference)(W[re],X[re]);return(0,e.isObjectLike)(fe)&&(0,e.isEmpty)(fe)&&!(0,e.isDate)(fe)?(0,e.isArray)(W)&&!(0,e.isArray)(X)||!(0,e.isArray)(W)&&(0,e.isArray)(X)?X:Q:(Q[re]=fe,Q)},Z);return delete U._persist,U};e.difference=b;const S=function(G,$){return $.reduce((W,X)=>{if(W){const Z=parseInt(X,10),U=(0,e.isIntegerString)(X)&&Z<0?W.length+Z:X;return(0,e.isString)(W)?W.charAt(U):W[U]}},G)};e.path=S;const _=function(G,$){return[...G].reverse().reduce((Z,U,Q)=>{const re=(0,e.isIntegerString)(U)?[]:{};return re[U]=Q===0?$:Z,re},{})};e.assocPath=_;const E=function(G,$){const W=(0,e.cloneDeep)(G);return $.reduce((X,Z,U)=>(U===$.length-1&&X&&(0,e.isObjectLike)(X)&&delete X[Z],X&&X[Z]),W),W};e.dissocPath=E;const k=function(G,$,...W){if(!W||!W.length)return $;const X=W.shift(),{preservePlaceholder:Z,preserveUndefined:U}=G;if((0,e.isObjectLike)($)&&(0,e.isObjectLike)(X))for(const Q in X)if((0,e.isObjectLike)(X[Q])&&(0,e.isObjectLike)($[Q]))$[Q]||($[Q]={}),k(G,$[Q],X[Q]);else if((0,e.isArray)($)){let re=X[Q];const fe=Z?t.PLACEHOLDER_UNDEFINED:void 0;U||(re=typeof re<"u"?re:$[parseInt(Q,10)]),re=re!==t.PLACEHOLDER_UNDEFINED?re:fe,$[parseInt(Q,10)]=re}else{const re=X[Q]!==t.PLACEHOLDER_UNDEFINED?X[Q]:void 0;$[Q]=re}return k(G,$,...W)},T=function(G,$,W){return k({preservePlaceholder:W==null?void 0:W.preservePlaceholder,preserveUndefined:W==null?void 0:W.preserveUndefined},(0,e.cloneDeep)(G),(0,e.cloneDeep)($))};e.mergeDeep=T;const A=function(G,$=[],W,X,Z){if(!(0,e.isObjectLike)(G))return G;for(const U in G){const Q=G[U],re=(0,e.isArray)(G),fe=X?X+"."+U:U;Q===null&&(W===n.ConfigType.WHITELIST&&$.indexOf(fe)===-1||W===n.ConfigType.BLACKLIST&&$.indexOf(fe)!==-1)&&re&&(G[parseInt(U,10)]=void 0),Q===void 0&&Z&&W===n.ConfigType.BLACKLIST&&$.indexOf(fe)===-1&&re&&(G[parseInt(U,10)]=t.PLACEHOLDER_UNDEFINED),A(Q,$,W,fe,Z)}},M=function(G,$,W,X){const Z=(0,e.cloneDeep)(G);return A(Z,$,W,"",X),Z};e.preserveUndefined=M;const R=function(G,$,W){return W.indexOf(G)===$};e.unique=R;const D=function(G){return G.reduce(($,W)=>{const X=G.filter(Ee=>Ee===W),Z=G.filter(Ee=>(W+".").indexOf(Ee+".")===0),{duplicates:U,subsets:Q}=$,re=X.length>1&&U.indexOf(W)===-1,fe=Z.length>1;return{duplicates:[...U,...re?X:[]],subsets:[...Q,...fe?Z:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=D;const j=function(G,$,W){const X=W===n.ConfigType.WHITELIST?"whitelist":"blacklist",Z=`${t.PACKAGE_NAME}: incorrect ${X} configuration.`,U=`Check your create${W===n.ConfigType.WHITELIST?"White":"Black"}list arguments. + +`;if(!(0,e.isString)($)||$.length<1)throw new Error(`${Z} Name (key) of reducer is required. ${U}`);if(!G||!G.length)return;const{duplicates:Q,subsets:re}=(0,e.findDuplicatesAndSubsets)(G);if(Q.length>1)throw new Error(`${Z} Duplicated paths. + + ${JSON.stringify(Q)} + + ${U}`);if(re.length>1)throw new Error(`${Z} You are trying to persist an entire property and also some of its subset. + +${JSON.stringify(re)} + + ${U}`)};e.singleTransformValidator=j;const z=function(G){if(!(0,e.isArray)(G))return;const $=(G==null?void 0:G.map(W=>W.deepPersistKey).filter(W=>W))||[];if($.length){const W=$.filter((X,Z)=>$.indexOf(X)!==Z);if(W.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. + + Duplicates: ${JSON.stringify(W)}`)}};e.transformsValidator=z;const H=function({whitelist:G,blacklist:$}){if(G&&G.length&&$&&$.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(G){const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)(G);(0,e.throwError)({duplicates:W,subsets:X},"whitelist")}if($){const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)($);(0,e.throwError)({duplicates:W,subsets:X},"blacklist")}};e.configValidator=H;const K=function({duplicates:G,subsets:$},W){if(G.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${W}. + + ${JSON.stringify(G)}`);if($.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${W}. You must decide if you want to persist an entire path or its specific subset. + + ${JSON.stringify($)}`)};e.throwError=K;const te=function(G){return(0,e.isArray)(G)?G.filter(e.unique).reduce(($,W)=>{const X=W.split("."),Z=X[0],U=X.slice(1).join(".")||void 0,Q=$.filter(fe=>Object.keys(fe)[0]===Z)[0],re=Q?Object.values(Q)[0]:void 0;return Q||$.push({[Z]:U?[U]:void 0}),Q&&!re&&U&&(Q[Z]=[U]),Q&&re&&U&&re.push(U),$},[]):[]};e.getRootKeysGroup=te})(GW);(function(e){var t=_o&&_o.__rest||function(h,m){var v={};for(var b in h)Object.prototype.hasOwnProperty.call(h,b)&&m.indexOf(b)<0&&(v[b]=h[b]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var S=0,b=Object.getOwnPropertySymbols(h);S!_(k)&&h?h(E,k,T):E,out:(E,k,T)=>!_(k)&&m?m(E,k,T):E,deepPersistKey:b&&b[0]}},a=(h,m,v,{debug:b,whitelist:S,blacklist:_,transforms:E})=>{if(S||_)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(E);const k=(0,n.cloneDeep)(v);let T=h;if(T&&(0,n.isObjectLike)(T)){const A=(0,n.difference)(m,v);(0,n.isEmpty)(A)||(T=(0,n.mergeDeep)(h,A,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(A)}`)),Object.keys(T).forEach(M=>{if(M!=="_persist"){if((0,n.isObjectLike)(k[M])){k[M]=(0,n.mergeDeep)(k[M],T[M]);return}k[M]=T[M]}})}return b&&T&&(0,n.isObjectLike)(T)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(T)}`),k};e.autoMergeDeep=a;const s=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.WHITELIST),o(v=>{if(!m||!m.length)return v;let b=null,S;return m.forEach(_=>{const E=_.split(".");S=(0,n.path)(v,E),typeof S>"u"&&(0,n.isIntegerString)(E[E.length-1])&&(S=r.PLACEHOLDER_UNDEFINED);const k=(0,n.assocPath)(E,S),T=(0,n.isArray)(k)?[]:{};b=(0,n.mergeDeep)(b||T,k,{preservePlaceholder:!0})}),b||v},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.WHITELIST),{whitelist:[h]}));e.createWhitelist=s;const l=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.BLACKLIST),o(v=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST,!0);return m.map(_=>_.split(".")).reduce((_,E)=>(0,n.dissocPath)(_,E),b)},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST),{whitelist:[h]}));e.createBlacklist=l;const u=function(h,m){return m.map(v=>{const b=Object.keys(v)[0],S=v[b];return h===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,S):(0,e.createBlacklist)(b,S)})};e.getTransforms=u;const d=h=>{var{key:m,whitelist:v,blacklist:b,storage:S,transforms:_,rootReducer:E}=h,k=t(h,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:v,blacklist:b});const T=(0,n.getRootKeysGroup)(v),A=(0,n.getRootKeysGroup)(b),M=Object.keys(E(void 0,{type:""})),R=T.map(te=>Object.keys(te)[0]),D=A.map(te=>Object.keys(te)[0]),j=M.filter(te=>R.indexOf(te)===-1&&D.indexOf(te)===-1),z=(0,e.getTransforms)(i.ConfigType.WHITELIST,T),H=(0,e.getTransforms)(i.ConfigType.BLACKLIST,A),K=(0,n.isArray)(v)?j.map(te=>(0,e.createBlacklist)(te)):[];return Object.assign(Object.assign({},k),{key:m,storage:S,transforms:[...z,...H,...K,..._||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=d})(UW);const Td=(e,t)=>Math.floor(e/t)*t,Yl=(e,t)=>Math.round(e/t)*t;var ke={},bxe={get exports(){return ke},set exports(e){ke=e}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,m=2,v=4,b=1,S=2,_=1,E=2,k=4,T=8,A=16,M=32,R=64,D=128,j=256,z=512,H=30,K="...",te=800,G=16,$=1,W=2,X=3,Z=1/0,U=9007199254740991,Q=17976931348623157e292,re=0/0,fe=4294967295,Ee=fe-1,be=fe>>>1,ye=[["ary",D],["bind",_],["bindKey",E],["curry",T],["curryRight",A],["flip",z],["partial",M],["partialRight",R],["rearg",j]],Fe="[object Arguments]",Me="[object Array]",rt="[object AsyncFunction]",Ve="[object Boolean]",je="[object Date]",wt="[object DOMException]",Be="[object Error]",at="[object Function]",bt="[object GeneratorFunction]",Le="[object Map]",ut="[object Number]",Mt="[object Null]",ct="[object Object]",_t="[object Promise]",un="[object Proxy]",ae="[object RegExp]",De="[object Set]",Ke="[object String]",Xe="[object Symbol]",xe="[object Undefined]",Ne="[object WeakMap]",Ct="[object WeakSet]",Dt="[object ArrayBuffer]",Te="[object DataView]",At="[object Float32Array]",ze="[object Float64Array]",vt="[object Int8Array]",nn="[object Int16Array]",Rn="[object Int32Array]",Ze="[object Uint8Array]",xt="[object Uint8ClampedArray]",ht="[object Uint16Array]",Ht="[object Uint32Array]",rn=/\b__p \+= '';/g,pr=/\b(__p \+=) '' \+/g,Io=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Mi=/&(?:amp|lt|gt|quot|#39);/g,ol=/[&<>"']/g,D0=RegExp(Mi.source),$a=RegExp(ol.source),Tp=/<%-([\s\S]+?)%>/g,N0=/<%([\s\S]+?)%>/g,Sc=/<%=([\s\S]+?)%>/g,Lp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ap=/^\w*$/,oa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bf=/[\\^$.*+?()[\]{}|]/g,j0=RegExp(bf.source),xc=/^\s+/,Sf=/\s/,B0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,al=/\{\n\/\* \[wrapped with (.+)\] \*/,wc=/,? & /,$0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,F0=/[()=,{}\[\]\/\s]/,z0=/\\(\\)?/g,H0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vs=/\w*$/,V0=/^[-+]0x[0-9a-f]+$/i,W0=/^0b[01]+$/i,U0=/^\[object .+?Constructor\]$/,G0=/^0o[0-7]+$/i,q0=/^(?:0|[1-9]\d*)$/,Y0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sl=/($^)/,K0=/['\n\r\u2028\u2029\\]/g,ys="\\ud800-\\udfff",bu="\\u0300-\\u036f",Su="\\ufe20-\\ufe2f",ll="\\u20d0-\\u20ff",xu=bu+Su+ll,Op="\\u2700-\\u27bf",Cc="a-z\\xdf-\\xf6\\xf8-\\xff",ul="\\xac\\xb1\\xd7\\xf7",aa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dn="\\u2000-\\u206f",Tn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",sa="A-Z\\xc0-\\xd6\\xd8-\\xde",Hr="\\ufe0e\\ufe0f",li=ul+aa+Dn+Tn,la="['’]",cl="["+ys+"]",ui="["+li+"]",bs="["+xu+"]",xf="\\d+",wu="["+Op+"]",Ss="["+Cc+"]",wf="[^"+ys+li+xf+Op+Cc+sa+"]",Ii="\\ud83c[\\udffb-\\udfff]",Mp="(?:"+bs+"|"+Ii+")",Ip="[^"+ys+"]",Cf="(?:\\ud83c[\\udde6-\\uddff]){2}",dl="[\\ud800-\\udbff][\\udc00-\\udfff]",Ro="["+sa+"]",fl="\\u200d",Cu="(?:"+Ss+"|"+wf+")",X0="(?:"+Ro+"|"+wf+")",_c="(?:"+la+"(?:d|ll|m|re|s|t|ve))?",kc="(?:"+la+"(?:D|LL|M|RE|S|T|VE))?",_f=Mp+"?",Ec="["+Hr+"]?",Fa="(?:"+fl+"(?:"+[Ip,Cf,dl].join("|")+")"+Ec+_f+")*",kf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_u="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yt=Ec+_f+Fa,Rp="(?:"+[wu,Cf,dl].join("|")+")"+Yt,Pc="(?:"+[Ip+bs+"?",bs,Cf,dl,cl].join("|")+")",Tc=RegExp(la,"g"),Dp=RegExp(bs,"g"),ua=RegExp(Ii+"(?="+Ii+")|"+Pc+Yt,"g"),Kn=RegExp([Ro+"?"+Ss+"+"+_c+"(?="+[ui,Ro,"$"].join("|")+")",X0+"+"+kc+"(?="+[ui,Ro+Cu,"$"].join("|")+")",Ro+"?"+Cu+"+"+_c,Ro+"+"+kc,_u,kf,xf,Rp].join("|"),"g"),Ef=RegExp("["+fl+ys+xu+Hr+"]"),Np=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],jp=-1,gn={};gn[At]=gn[ze]=gn[vt]=gn[nn]=gn[Rn]=gn[Ze]=gn[xt]=gn[ht]=gn[Ht]=!0,gn[Fe]=gn[Me]=gn[Dt]=gn[Ve]=gn[Te]=gn[je]=gn[Be]=gn[at]=gn[Le]=gn[ut]=gn[ct]=gn[ae]=gn[De]=gn[Ke]=gn[Ne]=!1;var Kt={};Kt[Fe]=Kt[Me]=Kt[Dt]=Kt[Te]=Kt[Ve]=Kt[je]=Kt[At]=Kt[ze]=Kt[vt]=Kt[nn]=Kt[Rn]=Kt[Le]=Kt[ut]=Kt[ct]=Kt[ae]=Kt[De]=Kt[Ke]=Kt[Xe]=Kt[Ze]=Kt[xt]=Kt[ht]=Kt[Ht]=!0,Kt[Be]=Kt[at]=Kt[Ne]=!1;var Bp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Z0={"&":"&","<":"<",">":">",'"':""","'":"'"},Y={"&":"&","<":"<",">":">",""":'"',"'":"'"},ie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ge=parseFloat,st=parseInt,Wt=typeof _o=="object"&&_o&&_o.Object===Object&&_o,xn=typeof self=="object"&&self&&self.Object===Object&&self,kt=Wt||xn||Function("return this")(),Nt=t&&!t.nodeType&&t,Xt=Nt&&!0&&e&&!e.nodeType&&e,Jr=Xt&&Xt.exports===Nt,Rr=Jr&&Wt.process,wn=function(){try{var oe=Xt&&Xt.require&&Xt.require("util").types;return oe||Rr&&Rr.binding&&Rr.binding("util")}catch{}}(),ci=wn&&wn.isArrayBuffer,Do=wn&&wn.isDate,co=wn&&wn.isMap,za=wn&&wn.isRegExp,hl=wn&&wn.isSet,Q0=wn&&wn.isTypedArray;function Ri(oe,we,ve){switch(ve.length){case 0:return oe.call(we);case 1:return oe.call(we,ve[0]);case 2:return oe.call(we,ve[0],ve[1]);case 3:return oe.call(we,ve[0],ve[1],ve[2])}return oe.apply(we,ve)}function J0(oe,we,ve,it){for(var It=-1,on=oe==null?0:oe.length;++It-1}function $p(oe,we,ve){for(var it=-1,It=oe==null?0:oe.length;++it-1;);return ve}function xs(oe,we){for(var ve=oe.length;ve--&&Oc(we,oe[ve],0)>-1;);return ve}function t1(oe,we){for(var ve=oe.length,it=0;ve--;)oe[ve]===we&&++it;return it}var r3=Of(Bp),ws=Of(Z0);function gl(oe){return"\\"+ie[oe]}function zp(oe,we){return oe==null?n:oe[we]}function Eu(oe){return Ef.test(oe)}function Hp(oe){return Np.test(oe)}function i3(oe){for(var we,ve=[];!(we=oe.next()).done;)ve.push(we.value);return ve}function Vp(oe){var we=-1,ve=Array(oe.size);return oe.forEach(function(it,It){ve[++we]=[It,it]}),ve}function Wp(oe,we){return function(ve){return oe(we(ve))}}function fa(oe,we){for(var ve=-1,it=oe.length,It=0,on=[];++ve-1}function C3(c,g){var C=this.__data__,O=Wr(C,c);return O<0?(++this.size,C.push([c,g])):C[O][1]=g,this}ha.prototype.clear=x3,ha.prototype.delete=w3,ha.prototype.get=m1,ha.prototype.has=v1,ha.prototype.set=C3;function pa(c){var g=-1,C=c==null?0:c.length;for(this.clear();++g=g?c:g)),c}function wi(c,g,C,O,B,V){var J,ne=g&h,ce=g&m,_e=g&v;if(C&&(J=B?C(c,O,B,V):C(c)),J!==n)return J;if(!Cr(c))return c;var Pe=Ft(c);if(Pe){if(J=ZK(c),!ne)return Fi(c,J)}else{var Re=ki(c),nt=Re==at||Re==bt;if(od(c))return El(c,ne);if(Re==ct||Re==Fe||nt&&!B){if(J=ce||nt?{}:kT(c),!ne)return ce?D1(c,Kc(J,c)):Ho(c,dt(J,c))}else{if(!Kt[Re])return B?c:{};J=QK(c,Re,ne)}}V||(V=new Nr);var St=V.get(c);if(St)return St;V.set(c,J),eL(c)?c.forEach(function(Tt){J.add(wi(Tt,g,C,Tt,c,V))}):QT(c)&&c.forEach(function(Tt,Qt){J.set(Qt,wi(Tt,g,C,Qt,c,V))});var Pt=_e?ce?me:ba:ce?Wo:Ei,qt=Pe?n:Pt(c);return Xn(qt||c,function(Tt,Qt){qt&&(Qt=Tt,Tt=c[Qt]),yl(J,Qt,wi(Tt,g,C,Qt,c,V))}),J}function Qp(c){var g=Ei(c);return function(C){return Jp(C,c,g)}}function Jp(c,g,C){var O=C.length;if(c==null)return!O;for(c=mn(c);O--;){var B=C[O],V=g[B],J=c[B];if(J===n&&!(B in c)||!V(J))return!1}return!0}function x1(c,g,C){if(typeof c!="function")throw new Di(a);return F1(function(){c.apply(n,C)},g)}function Xc(c,g,C,O){var B=-1,V=Ki,J=!0,ne=c.length,ce=[],_e=g.length;if(!ne)return ce;C&&(g=Un(g,Vr(C))),O?(V=$p,J=!1):g.length>=i&&(V=Ic,J=!1,g=new Ua(g));e:for(;++BB?0:B+C),O=O===n||O>B?B:Vt(O),O<0&&(O+=B),O=C>O?0:nL(O);C0&&C(ne)?g>1?Ur(ne,g-1,C,O,B):Ha(B,ne):O||(B[B.length]=ne)}return B}var tg=Pl(),$o=Pl(!0);function ya(c,g){return c&&tg(c,g,Ei)}function Fo(c,g){return c&&$o(c,g,Ei)}function ng(c,g){return jo(g,function(C){return Du(c[C])})}function bl(c,g){g=kl(g,c);for(var C=0,O=g.length;c!=null&&Cg}function ig(c,g){return c!=null&&cn.call(c,g)}function og(c,g){return c!=null&&g in mn(c)}function ag(c,g,C){return c>=fi(g,C)&&c=120&&Pe.length>=120)?new Ua(J&&Pe):n}Pe=c[0];var Re=-1,nt=ne[0];e:for(;++Re-1;)ne!==c&&$f.call(ne,ce,1),$f.call(c,ce,1);return c}function Yf(c,g){for(var C=c?g.length:0,O=C-1;C--;){var B=g[C];if(C==O||B!==V){var V=B;Ru(B)?$f.call(c,B,1):mg(c,B)}}return c}function Kf(c,g){return c+Tu(c1()*(g-c+1))}function Cl(c,g,C,O){for(var B=-1,V=Dr(Hf((g-c)/(C||1)),0),J=ve(V);V--;)J[O?V:++B]=c,c+=C;return J}function nd(c,g){var C="";if(!c||g<1||g>U)return C;do g%2&&(C+=c),g=Tu(g/2),g&&(c+=c);while(g);return C}function Ot(c,g){return Iw(TT(c,g,Uo),c+"")}function dg(c){return Yc(Cg(c))}function Xf(c,g){var C=Cg(c);return O3(C,Au(g,0,C.length))}function Mu(c,g,C,O){if(!Cr(c))return c;g=kl(g,c);for(var B=-1,V=g.length,J=V-1,ne=c;ne!=null&&++BB?0:B+g),C=C>B?B:C,C<0&&(C+=B),B=g>C?0:C-g>>>0,g>>>=0;for(var V=ve(B);++O>>1,J=c[V];J!==null&&!Sa(J)&&(C?J<=g:J=i){var _e=g?null:q(c);if(_e)return Df(_e);J=!1,B=Ic,ce=new Ua}else ce=g?[]:ne;e:for(;++O=O?c:qr(c,g,C)}var O1=u3||function(c){return kt.clearTimeout(c)};function El(c,g){if(g)return c.slice();var C=c.length,O=Bc?Bc(C):new c.constructor(C);return c.copy(O),O}function M1(c){var g=new c.constructor(c.byteLength);return new Ni(g).set(new Ni(c)),g}function Iu(c,g){var C=g?M1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.byteLength)}function P3(c){var g=new c.constructor(c.source,vs.exec(c));return g.lastIndex=c.lastIndex,g}function Zn(c){return Wf?mn(Wf.call(c)):{}}function T3(c,g){var C=g?M1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.length)}function I1(c,g){if(c!==g){var C=c!==n,O=c===null,B=c===c,V=Sa(c),J=g!==n,ne=g===null,ce=g===g,_e=Sa(g);if(!ne&&!_e&&!V&&c>g||V&&J&&ce&&!ne&&!_e||O&&J&&ce||!C&&ce||!B)return 1;if(!O&&!V&&!_e&&c=ne)return ce;var _e=C[O];return ce*(_e=="desc"?-1:1)}}return c.index-g.index}function L3(c,g,C,O){for(var B=-1,V=c.length,J=C.length,ne=-1,ce=g.length,_e=Dr(V-J,0),Pe=ve(ce+_e),Re=!O;++ne1?C[B-1]:n,J=B>2?C[2]:n;for(V=c.length>3&&typeof V=="function"?(B--,V):n,J&&vo(C[0],C[1],J)&&(V=B<3?n:V,B=1),g=mn(g);++O-1?B[V?g[J]:J]:n}}function j1(c){return mr(function(g){var C=g.length,O=C,B=ho.prototype.thru;for(c&&g.reverse();O--;){var V=g[O];if(typeof V!="function")throw new Di(a);if(B&&!J&&Se(V)=="wrapper")var J=new ho([],!0)}for(O=J?O:C;++O1&&an.reverse(),Pe&&cene))return!1;var _e=V.get(c),Pe=V.get(g);if(_e&&Pe)return _e==g&&Pe==c;var Re=-1,nt=!0,St=C&S?new Ua:n;for(V.set(c,g),V.set(g,c);++Re1?"& ":"")+g[O],g=g.join(C>2?", ":" "),c.replace(B0,`{ +/* [wrapped with `+g+`] */ +`)}function eX(c){return Ft(c)||ih(c)||!!(l1&&c&&c[l1])}function Ru(c,g){var C=typeof c;return g=g??U,!!g&&(C=="number"||C!="symbol"&&q0.test(c))&&c>-1&&c%1==0&&c0){if(++g>=te)return arguments[0]}else g=0;return c.apply(n,arguments)}}function O3(c,g){var C=-1,O=c.length,B=O-1;for(g=g===n?O:g;++C1?c[g-1]:n;return C=typeof C=="function"?(c.pop(),C):n,FT(c,C)});function zT(c){var g=F(c);return g.__chain__=!0,g}function dZ(c,g){return g(c),c}function M3(c,g){return g(c)}var fZ=mr(function(c){var g=c.length,C=g?c[0]:0,O=this.__wrapped__,B=function(V){return Zp(V,c)};return g>1||this.__actions__.length||!(O instanceof Zt)||!Ru(C)?this.thru(B):(O=O.slice(C,+C+(g?1:0)),O.__actions__.push({func:M3,args:[B],thisArg:n}),new ho(O,this.__chain__).thru(function(V){return g&&!V.length&&V.push(n),V}))});function hZ(){return zT(this)}function pZ(){return new ho(this.value(),this.__chain__)}function gZ(){this.__values__===n&&(this.__values__=tL(this.value()));var c=this.__index__>=this.__values__.length,g=c?n:this.__values__[this.__index__++];return{done:c,value:g}}function mZ(){return this}function vZ(c){for(var g,C=this;C instanceof Uf;){var O=RT(C);O.__index__=0,O.__values__=n,g?B.__wrapped__=O:g=O;var B=O;C=C.__wrapped__}return B.__wrapped__=c,g}function yZ(){var c=this.__wrapped__;if(c instanceof Zt){var g=c;return this.__actions__.length&&(g=new Zt(this)),g=g.reverse(),g.__actions__.push({func:M3,args:[Rw],thisArg:n}),new ho(g,this.__chain__)}return this.thru(Rw)}function bZ(){return _l(this.__wrapped__,this.__actions__)}var SZ=yg(function(c,g,C){cn.call(c,C)?++c[C]:ga(c,C,1)});function xZ(c,g,C){var O=Ft(c)?Wn:w1;return C&&vo(c,g,C)&&(g=n),O(c,Ie(g,3))}function wZ(c,g){var C=Ft(c)?jo:va;return C(c,Ie(g,3))}var CZ=N1(DT),_Z=N1(NT);function kZ(c,g){return Ur(I3(c,g),1)}function EZ(c,g){return Ur(I3(c,g),Z)}function PZ(c,g,C){return C=C===n?1:Vt(C),Ur(I3(c,g),C)}function HT(c,g){var C=Ft(c)?Xn:ks;return C(c,Ie(g,3))}function VT(c,g){var C=Ft(c)?No:eg;return C(c,Ie(g,3))}var TZ=yg(function(c,g,C){cn.call(c,C)?c[C].push(g):ga(c,C,[g])});function LZ(c,g,C,O){c=Vo(c)?c:Cg(c),C=C&&!O?Vt(C):0;var B=c.length;return C<0&&(C=Dr(B+C,0)),B3(c)?C<=B&&c.indexOf(g,C)>-1:!!B&&Oc(c,g,C)>-1}var AZ=Ot(function(c,g,C){var O=-1,B=typeof g=="function",V=Vo(c)?ve(c.length):[];return ks(c,function(J){V[++O]=B?Ri(g,J,C):Es(J,g,C)}),V}),OZ=yg(function(c,g,C){ga(c,C,g)});function I3(c,g){var C=Ft(c)?Un:Br;return C(c,Ie(g,3))}function MZ(c,g,C,O){return c==null?[]:(Ft(g)||(g=g==null?[]:[g]),C=O?n:C,Ft(C)||(C=C==null?[]:[C]),Bi(c,g,C))}var IZ=yg(function(c,g,C){c[C?0:1].push(g)},function(){return[[],[]]});function RZ(c,g,C){var O=Ft(c)?Tf:Fp,B=arguments.length<3;return O(c,Ie(g,4),C,B,ks)}function DZ(c,g,C){var O=Ft(c)?Jy:Fp,B=arguments.length<3;return O(c,Ie(g,4),C,B,eg)}function NZ(c,g){var C=Ft(c)?jo:va;return C(c,N3(Ie(g,3)))}function jZ(c){var g=Ft(c)?Yc:dg;return g(c)}function BZ(c,g,C){(C?vo(c,g,C):g===n)?g=1:g=Vt(g);var O=Ft(c)?xi:Xf;return O(c,g)}function $Z(c){var g=Ft(c)?kw:_i;return g(c)}function FZ(c){if(c==null)return 0;if(Vo(c))return B3(c)?Va(c):c.length;var g=ki(c);return g==Le||g==De?c.size:Gr(c).length}function zZ(c,g,C){var O=Ft(c)?Lc:zo;return C&&vo(c,g,C)&&(g=n),O(c,Ie(g,3))}var HZ=Ot(function(c,g){if(c==null)return[];var C=g.length;return C>1&&vo(c,g[0],g[1])?g=[]:C>2&&vo(g[0],g[1],g[2])&&(g=[g[0]]),Bi(c,Ur(g,1),[])}),R3=c3||function(){return kt.Date.now()};function VZ(c,g){if(typeof g!="function")throw new Di(a);return c=Vt(c),function(){if(--c<1)return g.apply(this,arguments)}}function WT(c,g,C){return g=C?n:g,g=c&&g==null?c.length:g,pe(c,D,n,n,n,n,g)}function UT(c,g){var C;if(typeof g!="function")throw new Di(a);return c=Vt(c),function(){return--c>0&&(C=g.apply(this,arguments)),c<=1&&(g=n),C}}var Nw=Ot(function(c,g,C){var O=_;if(C.length){var B=fa(C,tt(Nw));O|=M}return pe(c,O,g,C,B)}),GT=Ot(function(c,g,C){var O=_|E;if(C.length){var B=fa(C,tt(GT));O|=M}return pe(g,O,c,C,B)});function qT(c,g,C){g=C?n:g;var O=pe(c,T,n,n,n,n,n,g);return O.placeholder=qT.placeholder,O}function YT(c,g,C){g=C?n:g;var O=pe(c,A,n,n,n,n,n,g);return O.placeholder=YT.placeholder,O}function KT(c,g,C){var O,B,V,J,ne,ce,_e=0,Pe=!1,Re=!1,nt=!0;if(typeof c!="function")throw new Di(a);g=Ya(g)||0,Cr(C)&&(Pe=!!C.leading,Re="maxWait"in C,V=Re?Dr(Ya(C.maxWait)||0,g):V,nt="trailing"in C?!!C.trailing:nt);function St(Kr){var Os=O,ju=B;return O=B=n,_e=Kr,J=c.apply(ju,Os),J}function Pt(Kr){return _e=Kr,ne=F1(Qt,g),Pe?St(Kr):J}function qt(Kr){var Os=Kr-ce,ju=Kr-_e,pL=g-Os;return Re?fi(pL,V-ju):pL}function Tt(Kr){var Os=Kr-ce,ju=Kr-_e;return ce===n||Os>=g||Os<0||Re&&ju>=V}function Qt(){var Kr=R3();if(Tt(Kr))return an(Kr);ne=F1(Qt,qt(Kr))}function an(Kr){return ne=n,nt&&O?St(Kr):(O=B=n,J)}function xa(){ne!==n&&O1(ne),_e=0,O=ce=B=ne=n}function yo(){return ne===n?J:an(R3())}function wa(){var Kr=R3(),Os=Tt(Kr);if(O=arguments,B=this,ce=Kr,Os){if(ne===n)return Pt(ce);if(Re)return O1(ne),ne=F1(Qt,g),St(ce)}return ne===n&&(ne=F1(Qt,g)),J}return wa.cancel=xa,wa.flush=yo,wa}var WZ=Ot(function(c,g){return x1(c,1,g)}),UZ=Ot(function(c,g,C){return x1(c,Ya(g)||0,C)});function GZ(c){return pe(c,z)}function D3(c,g){if(typeof c!="function"||g!=null&&typeof g!="function")throw new Di(a);var C=function(){var O=arguments,B=g?g.apply(this,O):O[0],V=C.cache;if(V.has(B))return V.get(B);var J=c.apply(this,O);return C.cache=V.set(B,J)||V,J};return C.cache=new(D3.Cache||pa),C}D3.Cache=pa;function N3(c){if(typeof c!="function")throw new Di(a);return function(){var g=arguments;switch(g.length){case 0:return!c.call(this);case 1:return!c.call(this,g[0]);case 2:return!c.call(this,g[0],g[1]);case 3:return!c.call(this,g[0],g[1],g[2])}return!c.apply(this,g)}}function qZ(c){return UT(2,c)}var YZ=Tw(function(c,g){g=g.length==1&&Ft(g[0])?Un(g[0],Vr(Ie())):Un(Ur(g,1),Vr(Ie()));var C=g.length;return Ot(function(O){for(var B=-1,V=fi(O.length,C);++B=g}),ih=lg(function(){return arguments}())?lg:function(c){return $r(c)&&cn.call(c,"callee")&&!s1.call(c,"callee")},Ft=ve.isArray,uQ=ci?Vr(ci):_1;function Vo(c){return c!=null&&j3(c.length)&&!Du(c)}function Yr(c){return $r(c)&&Vo(c)}function cQ(c){return c===!0||c===!1||$r(c)&&Ci(c)==Ve}var od=d3||Yw,dQ=Do?Vr(Do):k1;function fQ(c){return $r(c)&&c.nodeType===1&&!z1(c)}function hQ(c){if(c==null)return!0;if(Vo(c)&&(Ft(c)||typeof c=="string"||typeof c.splice=="function"||od(c)||wg(c)||ih(c)))return!c.length;var g=ki(c);if(g==Le||g==De)return!c.size;if($1(c))return!Gr(c).length;for(var C in c)if(cn.call(c,C))return!1;return!0}function pQ(c,g){return Qc(c,g)}function gQ(c,g,C){C=typeof C=="function"?C:n;var O=C?C(c,g):n;return O===n?Qc(c,g,n,C):!!O}function Bw(c){if(!$r(c))return!1;var g=Ci(c);return g==Be||g==wt||typeof c.message=="string"&&typeof c.name=="string"&&!z1(c)}function mQ(c){return typeof c=="number"&&qp(c)}function Du(c){if(!Cr(c))return!1;var g=Ci(c);return g==at||g==bt||g==rt||g==un}function ZT(c){return typeof c=="number"&&c==Vt(c)}function j3(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=U}function Cr(c){var g=typeof c;return c!=null&&(g=="object"||g=="function")}function $r(c){return c!=null&&typeof c=="object"}var QT=co?Vr(co):Pw;function vQ(c,g){return c===g||Jc(c,g,Rt(g))}function yQ(c,g,C){return C=typeof C=="function"?C:n,Jc(c,g,Rt(g),C)}function bQ(c){return JT(c)&&c!=+c}function SQ(c){if(rX(c))throw new It(o);return ug(c)}function xQ(c){return c===null}function wQ(c){return c==null}function JT(c){return typeof c=="number"||$r(c)&&Ci(c)==ut}function z1(c){if(!$r(c)||Ci(c)!=ct)return!1;var g=$c(c);if(g===null)return!0;var C=cn.call(g,"constructor")&&g.constructor;return typeof C=="function"&&C instanceof C&&Sr.call(C)==Si}var $w=za?Vr(za):xr;function CQ(c){return ZT(c)&&c>=-U&&c<=U}var eL=hl?Vr(hl):Ut;function B3(c){return typeof c=="string"||!Ft(c)&&$r(c)&&Ci(c)==Ke}function Sa(c){return typeof c=="symbol"||$r(c)&&Ci(c)==Xe}var wg=Q0?Vr(Q0):ei;function _Q(c){return c===n}function kQ(c){return $r(c)&&ki(c)==Ne}function EQ(c){return $r(c)&&Ci(c)==Ct}var PQ=P(Sl),TQ=P(function(c,g){return c<=g});function tL(c){if(!c)return[];if(Vo(c))return B3(c)?Xi(c):Fi(c);if(Fc&&c[Fc])return i3(c[Fc]());var g=ki(c),C=g==Le?Vp:g==De?Df:Cg;return C(c)}function Nu(c){if(!c)return c===0?c:0;if(c=Ya(c),c===Z||c===-Z){var g=c<0?-1:1;return g*Q}return c===c?c:0}function Vt(c){var g=Nu(c),C=g%1;return g===g?C?g-C:g:0}function nL(c){return c?Au(Vt(c),0,fe):0}function Ya(c){if(typeof c=="number")return c;if(Sa(c))return re;if(Cr(c)){var g=typeof c.valueOf=="function"?c.valueOf():c;c=Cr(g)?g+"":g}if(typeof c!="string")return c===0?c:+c;c=fo(c);var C=W0.test(c);return C||G0.test(c)?st(c.slice(2),C?2:8):V0.test(c)?re:+c}function rL(c){return Ga(c,Wo(c))}function LQ(c){return c?Au(Vt(c),-U,U):c===0?c:0}function An(c){return c==null?"":go(c)}var AQ=mo(function(c,g){if($1(g)||Vo(g)){Ga(g,Ei(g),c);return}for(var C in g)cn.call(g,C)&&yl(c,C,g[C])}),iL=mo(function(c,g){Ga(g,Wo(g),c)}),$3=mo(function(c,g,C,O){Ga(g,Wo(g),c,O)}),OQ=mo(function(c,g,C,O){Ga(g,Ei(g),c,O)}),MQ=mr(Zp);function IQ(c,g){var C=Lu(c);return g==null?C:dt(C,g)}var RQ=Ot(function(c,g){c=mn(c);var C=-1,O=g.length,B=O>2?g[2]:n;for(B&&vo(g[0],g[1],B)&&(O=1);++C1),V}),Ga(c,me(c),C),O&&(C=wi(C,h|m|v,jt));for(var B=g.length;B--;)mg(C,g[B]);return C});function QQ(c,g){return aL(c,N3(Ie(g)))}var JQ=mr(function(c,g){return c==null?{}:T1(c,g)});function aL(c,g){if(c==null)return{};var C=Un(me(c),function(O){return[O]});return g=Ie(g),cg(c,C,function(O,B){return g(O,B[0])})}function eJ(c,g,C){g=kl(g,c);var O=-1,B=g.length;for(B||(B=1,c=n);++Og){var O=c;c=g,g=O}if(C||c%1||g%1){var B=c1();return fi(c+B*(g-c+ge("1e-"+((B+"").length-1))),g)}return Kf(c,g)}var dJ=Tl(function(c,g,C){return g=g.toLowerCase(),c+(C?uL(g):g)});function uL(c){return Hw(An(c).toLowerCase())}function cL(c){return c=An(c),c&&c.replace(Y0,r3).replace(Dp,"")}function fJ(c,g,C){c=An(c),g=go(g);var O=c.length;C=C===n?O:Au(Vt(C),0,O);var B=C;return C-=g.length,C>=0&&c.slice(C,B)==g}function hJ(c){return c=An(c),c&&$a.test(c)?c.replace(ol,ws):c}function pJ(c){return c=An(c),c&&j0.test(c)?c.replace(bf,"\\$&"):c}var gJ=Tl(function(c,g,C){return c+(C?"-":"")+g.toLowerCase()}),mJ=Tl(function(c,g,C){return c+(C?" ":"")+g.toLowerCase()}),vJ=Sg("toLowerCase");function yJ(c,g,C){c=An(c),g=Vt(g);var O=g?Va(c):0;if(!g||O>=g)return c;var B=(g-O)/2;return f(Tu(B),C)+c+f(Hf(B),C)}function bJ(c,g,C){c=An(c),g=Vt(g);var O=g?Va(c):0;return g&&O>>0,C?(c=An(c),c&&(typeof g=="string"||g!=null&&!$w(g))&&(g=go(g),!g&&Eu(c))?Ts(Xi(c),0,C):c.split(g,C)):[]}var EJ=Tl(function(c,g,C){return c+(C?" ":"")+Hw(g)});function PJ(c,g,C){return c=An(c),C=C==null?0:Au(Vt(C),0,c.length),g=go(g),c.slice(C,C+g.length)==g}function TJ(c,g,C){var O=F.templateSettings;C&&vo(c,g,C)&&(g=n),c=An(c),g=$3({},g,O,We);var B=$3({},g.imports,O.imports,We),V=Ei(B),J=Rf(B,V),ne,ce,_e=0,Pe=g.interpolate||sl,Re="__p += '",nt=jf((g.escape||sl).source+"|"+Pe.source+"|"+(Pe===Sc?H0:sl).source+"|"+(g.evaluate||sl).source+"|$","g"),St="//# sourceURL="+(cn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jp+"]")+` +`;c.replace(nt,function(Tt,Qt,an,xa,yo,wa){return an||(an=xa),Re+=c.slice(_e,wa).replace(K0,gl),Qt&&(ne=!0,Re+=`' + +__e(`+Qt+`) + +'`),yo&&(ce=!0,Re+=`'; +`+yo+`; +__p += '`),an&&(Re+=`' + +((__t = (`+an+`)) == null ? '' : __t) + +'`),_e=wa+Tt.length,Tt}),Re+=`'; +`;var Pt=cn.call(g,"variable")&&g.variable;if(!Pt)Re=`with (obj) { +`+Re+` +} +`;else if(F0.test(Pt))throw new It(s);Re=(ce?Re.replace(rn,""):Re).replace(pr,"$1").replace(Io,"$1;"),Re="function("+(Pt||"obj")+`) { +`+(Pt?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(ne?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+Re+`return __p +}`;var qt=fL(function(){return on(V,St+"return "+Re).apply(n,J)});if(qt.source=Re,Bw(qt))throw qt;return qt}function LJ(c){return An(c).toLowerCase()}function AJ(c){return An(c).toUpperCase()}function OJ(c,g,C){if(c=An(c),c&&(C||g===n))return fo(c);if(!c||!(g=go(g)))return c;var O=Xi(c),B=Xi(g),V=da(O,B),J=xs(O,B)+1;return Ts(O,V,J).join("")}function MJ(c,g,C){if(c=An(c),c&&(C||g===n))return c.slice(0,r1(c)+1);if(!c||!(g=go(g)))return c;var O=Xi(c),B=xs(O,Xi(g))+1;return Ts(O,0,B).join("")}function IJ(c,g,C){if(c=An(c),c&&(C||g===n))return c.replace(xc,"");if(!c||!(g=go(g)))return c;var O=Xi(c),B=da(O,Xi(g));return Ts(O,B).join("")}function RJ(c,g){var C=H,O=K;if(Cr(g)){var B="separator"in g?g.separator:B;C="length"in g?Vt(g.length):C,O="omission"in g?go(g.omission):O}c=An(c);var V=c.length;if(Eu(c)){var J=Xi(c);V=J.length}if(C>=V)return c;var ne=C-Va(O);if(ne<1)return O;var ce=J?Ts(J,0,ne).join(""):c.slice(0,ne);if(B===n)return ce+O;if(J&&(ne+=ce.length-ne),$w(B)){if(c.slice(ne).search(B)){var _e,Pe=ce;for(B.global||(B=jf(B.source,An(vs.exec(B))+"g")),B.lastIndex=0;_e=B.exec(Pe);)var Re=_e.index;ce=ce.slice(0,Re===n?ne:Re)}}else if(c.indexOf(go(B),ne)!=ne){var nt=ce.lastIndexOf(B);nt>-1&&(ce=ce.slice(0,nt))}return ce+O}function DJ(c){return c=An(c),c&&D0.test(c)?c.replace(Mi,s3):c}var NJ=Tl(function(c,g,C){return c+(C?" ":"")+g.toUpperCase()}),Hw=Sg("toUpperCase");function dL(c,g,C){return c=An(c),g=C?n:g,g===n?Hp(c)?Nf(c):e1(c):c.match(g)||[]}var fL=Ot(function(c,g){try{return Ri(c,n,g)}catch(C){return Bw(C)?C:new It(C)}}),jJ=mr(function(c,g){return Xn(g,function(C){C=Ll(C),ga(c,C,Nw(c[C],c))}),c});function BJ(c){var g=c==null?0:c.length,C=Ie();return c=g?Un(c,function(O){if(typeof O[1]!="function")throw new Di(a);return[C(O[0]),O[1]]}):[],Ot(function(O){for(var B=-1;++BU)return[];var C=fe,O=fi(c,fe);g=Ie(g),c-=fe;for(var B=If(O,g);++C0||g<0)?new Zt(C):(c<0?C=C.takeRight(-c):c&&(C=C.drop(c)),g!==n&&(g=Vt(g),C=g<0?C.dropRight(-g):C.take(g-c)),C)},Zt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Zt.prototype.toArray=function(){return this.take(fe)},ya(Zt.prototype,function(c,g){var C=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),B=F[O?"take"+(g=="last"?"Right":""):g],V=O||/^find/.test(g);B&&(F.prototype[g]=function(){var J=this.__wrapped__,ne=O?[1]:arguments,ce=J instanceof Zt,_e=ne[0],Pe=ce||Ft(J),Re=function(Qt){var an=B.apply(F,Ha([Qt],ne));return O&&nt?an[0]:an};Pe&&C&&typeof _e=="function"&&_e.length!=1&&(ce=Pe=!1);var nt=this.__chain__,St=!!this.__actions__.length,Pt=V&&!nt,qt=ce&&!St;if(!V&&Pe){J=qt?J:new Zt(this);var Tt=c.apply(J,ne);return Tt.__actions__.push({func:M3,args:[Re],thisArg:n}),new ho(Tt,nt)}return Pt&&qt?c.apply(this,ne):(Tt=this.thru(Re),Pt?O?Tt.value()[0]:Tt.value():Tt)})}),Xn(["pop","push","shift","sort","splice","unshift"],function(c){var g=Dc[c],C=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",O=/^(?:pop|shift)$/.test(c);F.prototype[c]=function(){var B=arguments;if(O&&!this.__chain__){var V=this.value();return g.apply(Ft(V)?V:[],B)}return this[C](function(J){return g.apply(Ft(J)?J:[],B)})}}),ya(Zt.prototype,function(c,g){var C=F[g];if(C){var O=C.name+"";cn.call(Cs,O)||(Cs[O]=[]),Cs[O].push({name:g,func:C})}}),Cs[th(n,E).name]=[{name:"wrapper",func:n}],Zt.prototype.clone=Zi,Zt.prototype.reverse=ji,Zt.prototype.value=m3,F.prototype.at=fZ,F.prototype.chain=hZ,F.prototype.commit=pZ,F.prototype.next=gZ,F.prototype.plant=vZ,F.prototype.reverse=yZ,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=bZ,F.prototype.first=F.prototype.head,Fc&&(F.prototype[Fc]=mZ),F},Wa=Bo();Xt?((Xt.exports=Wa)._=Wa,Nt._=Wa):kt._=Wa}).call(_o)})(bxe,ke);const Ig=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Rg=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},Sxe=.999,xxe=.1,wxe=20,iv=.95,zI=30,h8=10,HI=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),sh=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Yl(s/o,64)):o<1&&(r.height=s,r.width=Yl(s*o,64)),a=r.width*r.height;return r},Cxe=e=>({width:Yl(e.width,64),height:Yl(e.height,64)}),qW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],_xe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],sP=e=>e.kind==="line"&&e.layer==="mask",kxe=e=>e.kind==="line"&&e.layer==="base",Y5=e=>e.kind==="image"&&e.layer==="base",Exe=e=>e.kind==="fillRect"&&e.layer==="base",Pxe=e=>e.kind==="eraseRect"&&e.layer==="base",Txe=e=>e.kind==="line",Lv={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},Lxe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:Lv,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},YW=hp({name:"canvas",initialState:Lxe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!sP(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Td(ke.clamp(n.width,64,512),64),height:Td(ke.clamp(n.height,64,512),64)},o={x:Yl(n.width/2-i.width/2,64),y:Yl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=sh(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState={...Lv,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Rg(r.width,r.height,n.width,n.height,iv),s=Ig(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=Cxe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=sh(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=HI(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...Lv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(Txe);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(ke.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState=Lv,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(Y5),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const d=Rg(i.width,i.height,512,512,iv),h=Ig(i.width,i.height,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=sh(m);e.scaledBoundingBoxDimensions=v}return}const{width:o,height:a}=r,l=Rg(t,n,o,a,.95),u=Ig(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=HI(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(Y5)){const i=Rg(r.width,r.height,512,512,iv),o=Ig(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=sh(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const d=r?1:Rg(i,o,l,u,iv),h=Ig(i,o,a,s,l,u,d);e.stageScale=d,e.stageCoordinates=h}else{const d=Rg(i,o,512,512,iv),h=Ig(i,o,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=sh(m);e.scaledBoundingBoxDimensions=v}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...Lv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Td(ke.clamp(o,64,512),64),height:Td(ke.clamp(a,64,512),64)},l={x:Yl(o/2-s.width/2,64),y:Yl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=sh(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=sh(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:KW,addFillRect:XW,addImageToStagingArea:Axe,addLine:Oxe,addPointToCurrentLine:ZW,clearCanvasHistory:QW,clearMask:lP,commitColorPickerColor:Mxe,commitStagingAreaImage:Ixe,discardStagedImages:Rxe,fitBoundingBoxToStage:vze,mouseLeftCanvas:Dxe,nextStagingAreaImage:Nxe,prevStagingAreaImage:jxe,redo:Bxe,resetCanvas:uP,resetCanvasInteractionState:$xe,resetCanvasView:JW,resizeAndScaleCanvas:Bx,resizeCanvas:Fxe,setBoundingBoxCoordinates:CC,setBoundingBoxDimensions:Av,setBoundingBoxPreviewFill:yze,setBoundingBoxScaleMethod:zxe,setBrushColor:$m,setBrushSize:Fm,setCanvasContainerDimensions:Hxe,setColorPickerColor:Vxe,setCursorPosition:Wxe,setDoesCanvasNeedScaling:vi,setInitialCanvasImage:$x,setIsDrawing:eU,setIsMaskEnabled:$y,setIsMouseOverBoundingBox:Pb,setIsMoveBoundingBoxKeyHeld:bze,setIsMoveStageKeyHeld:Sze,setIsMovingBoundingBox:_C,setIsMovingStage:K5,setIsTransformingBoundingBox:kC,setLayer:X5,setMaskColor:tU,setMergedCanvas:Uxe,setShouldAutoSave:nU,setShouldCropToBoundingBoxOnSave:rU,setShouldDarkenOutsideBoundingBox:iU,setShouldLockBoundingBox:xze,setShouldPreserveMaskedArea:oU,setShouldShowBoundingBox:Gxe,setShouldShowBrush:wze,setShouldShowBrushPreview:Cze,setShouldShowCanvasDebugInfo:aU,setShouldShowCheckboardTransparency:_ze,setShouldShowGrid:sU,setShouldShowIntermediates:lU,setShouldShowStagingImage:qxe,setShouldShowStagingOutline:VI,setShouldSnapToGrid:Z5,setStageCoordinates:uU,setStageScale:Yxe,setTool:ru,toggleShouldLockBoundingBox:kze,toggleTool:Eze,undo:Kxe,setScaledBoundingBoxDimensions:Tb,setShouldRestrictStrokesToBox:cU}=YW.actions,Xxe=YW.reducer,Zxe={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},dU=hp({name:"gallery",initialState:Zxe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=ke.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:cm,clearIntermediateImage:EC,removeImage:fU,setCurrentImage:WI,addGalleryImages:Qxe,setIntermediateImage:Jxe,selectNextImage:cP,selectPrevImage:dP,setShouldPinGallery:ewe,setShouldShowGallery:Fd,setGalleryScrollPosition:twe,setGalleryImageMinimumWidth:ov,setGalleryImageObjectFit:nwe,setShouldHoldGalleryOpen:hU,setShouldAutoSwitchToNewImages:rwe,setCurrentCategory:Lb,setGalleryWidth:iwe,setShouldUseSingleGalleryColumn:owe}=dU.actions,awe=dU.reducer,swe={isLightboxOpen:!1},lwe=swe,pU=hp({name:"lightbox",initialState:lwe,reducers:{setIsLightboxOpen:(e,t)=>{e.isLightboxOpen=t.payload}}}),{setIsLightboxOpen:zm}=pU.actions,uwe=pU.reducer,l2=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" ");function fP(e){let t=l2(e),n=null;const r=new RegExp(/\[([^\][]*)]/,"gi"),i=[...t.matchAll(r)].map(o=>o[1]);return i.length&&(n=i.join(" "),i.forEach(o=>{t=t.replace(`[${o}]`,"").replaceAll("[]","").trim()})),[t,n]}const cwe=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return hP(r)?r:!1},hP=e=>Boolean(typeof e=="string"?cwe(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),Q5=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),dwe=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),gU={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512},fwe=gU,mU=hp({name:"generation",initialState:fwe,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=l2(n)},setNegativePrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.negativePrompt=n:e.negativePrompt=l2(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:d,hires_fix:h,width:m,height:v}=t.payload.image;o&&o.length>0?(e.seedWeights=Q5(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=l2(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,typeof u>"u"?e.perlin=0:e.perlin=u,typeof d=="boolean"&&(e.seamless=d),m&&(e.width=m),v&&(e.height=v)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:d,seamless:h,hires_fix:m,width:v,height:b,strength:S,fit:_,init_image_path:E,mask_image_path:k}=t.payload.image;if(n==="img2img"&&(E&&(e.initialImage=E),k&&(e.maskPath=k),S&&(e.img2imgStrength=S),typeof _=="boolean"&&(e.shouldFitToWidthHeight=_)),a&&a.length>0?(e.seedWeights=Q5(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i){const[T,A]=fP(i);T&&(e.prompt=T),A?e.negativePrompt=A:e.negativePrompt=""}r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),typeof u>"u"?e.threshold=0:e.threshold=u,typeof d>"u"?e.perlin=0:e.perlin=d,typeof h=="boolean"&&(e.seamless=h),v&&(e.width=v),b&&(e.height=b)},resetParametersState:e=>({...e,...gU}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload}}}),{clearInitialImage:vU,resetParametersState:Pze,resetSeed:Tze,setAllImageToImageParameters:hwe,setAllParameters:yU,setAllTextToImageParameters:Lze,setCfgScale:bU,setHeight:SU,setImg2imgStrength:p8,setInfillMethod:xU,setInitialImage:P0,setIterations:pwe,setMaskPath:wU,setParameter:Aze,setPerlin:CU,setPrompt:Fx,setNegativePrompt:ny,setSampler:_U,setSeamBlur:UI,setSeamless:kU,setSeamSize:GI,setSeamSteps:qI,setSeamStrength:YI,setSeed:Fy,setSeedWeights:EU,setShouldFitToWidthHeight:PU,setShouldGenerateVariations:gwe,setShouldRandomizeSeed:mwe,setSteps:TU,setThreshold:LU,setTileSize:KI,setVariationAmount:vwe,setWidth:AU}=mU.actions,ywe=mU.reducer,OU={codeformerFidelity:.75,facetoolStrength:.8,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingDenoising:.75,upscalingStrength:.75},bwe=OU,MU=hp({name:"postprocessing",initialState:bwe,reducers:{setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingDenoising:(e,t)=>{e.upscalingDenoising=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setHiresStrength:(e,t)=>{e.hiresStrength=t.payload},resetPostprocessingState:e=>({...e,...OU}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload}}}),{resetPostprocessingState:Oze,setCodeformerFidelity:IU,setFacetoolStrength:g8,setFacetoolType:j4,setHiresFix:pP,setHiresStrength:XI,setShouldLoopback:Swe,setShouldRunESRGAN:xwe,setShouldRunFacetool:wwe,setUpscalingLevel:RU,setUpscalingDenoising:m8,setUpscalingStrength:v8}=MU.actions,Cwe=MU.reducer;function Qs(e){return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qs(e)}function gu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _we(e,t){if(Qs(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qs(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DU(e){var t=_we(e,"string");return Qs(t)==="symbol"?t:String(t)}function ZI(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};gu(this,e),this.init(t,n)}return mu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||Awe,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function nR(e,t,n){var r=gP(e,t,Object),i=r.obj,o=r.k;i[o]=n}function Iwe(e,t,n,r){var i=gP(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function J5(e,t){var n=gP(e,t),r=n.obj,i=n.k;if(r)return r[i]}function rR(e,t,n){var r=J5(e,n);return r!==void 0?r:J5(t,n)}function NU(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):NU(e[r],t[r],n):e[r]=t[r]);return e}function Dg(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Rwe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Dwe(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return Rwe[t]}):e}var Hx=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Nwe=[" ",",","?","!",";"];function jwe(e,t,n){t=t||"",n=n||"";var r=Nwe.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function iR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ab(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jU(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?jU(l,u,n):void 0}i=i[r[o]]}return i}}var Fwe=function(e){zx(n,e);var t=Bwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return gu(this,n),i=t.call(this),Hx&&ef.call(zd(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return mu(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[i,o];a&&typeof a!="string"&&(d=d.concat(a)),a&&typeof a=="string"&&(d=d.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(d=i.split("."));var h=J5(this.data,d);return h||!u||typeof a!="string"?h:jU(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var d=[i,o];a&&(d=d.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(d=i.split("."),s=o,o=d[1]),this.addNamespaces(o),nR(this.data,d,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[i,o];i.indexOf(".")>-1&&(d=i.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);var h=J5(this.data,d)||{};s?NU(h,a,l):h=Ab(Ab({},h),a),nR(this.data,d,h),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Ab(Ab({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(ef),BU={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function oR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var aR={},sR=function(e){zx(n,e);var t=zwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gu(this,n),i=t.call(this),Hx&&ef.call(zd(i)),Mwe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,zd(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Kl.create("translator"),i}return mu(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!jwe(i,a,s);if(u&&!d){var h=i.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:i,namespaces:l};var m=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),i=m.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(Qs(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,d=this.extractFromKey(i[i.length-1],o),h=d.key,m=d.namespaces,v=m[m.length-1],b=o.lng||this.language,S=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(S){var _=o.nsSeparator||this.options.nsSeparator;return l?(E.res="".concat(v).concat(_).concat(h),E):"".concat(v).concat(_).concat(h)}return l?(E.res=h,E):h}var E=this.resolve(i,o),k=E&&E.res,T=E&&E.usedKey||h,A=E&&E.exactUsedKey||h,M=Object.prototype.toString.apply(k),R=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,z=typeof k!="string"&&typeof k!="boolean"&&typeof k!="number";if(j&&k&&z&&R.indexOf(M)<0&&!(typeof D=="string"&&M==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var H=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,k,xo(xo({},o),{},{ns:m})):"key '".concat(h," (").concat(this.language,")' returned an object instead of string.");return l?(E.res=H,E):H}if(u){var K=M==="[object Array]",te=K?[]:{},G=K?A:T;for(var $ in k)if(Object.prototype.hasOwnProperty.call(k,$)){var W="".concat(G).concat(u).concat($);te[$]=this.translate(W,xo(xo({},o),{joinArrays:!1,ns:m})),te[$]===W&&(te[$]=k[$])}k=te}}else if(j&&typeof D=="string"&&M==="[object Array]")k=k.join(D),k&&(k=this.extendTranslation(k,i,o,a));else{var X=!1,Z=!1,U=o.count!==void 0&&typeof o.count!="string",Q=n.hasDefaultValue(o),re=U?this.pluralResolver.getSuffix(b,o.count,o):"",fe=o["defaultValue".concat(re)]||o.defaultValue;!this.isValidLookup(k)&&Q&&(X=!0,k=fe),this.isValidLookup(k)||(Z=!0,k=h);var Ee=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,be=Ee&&Z?void 0:k,ye=Q&&fe!==k&&this.options.updateMissing;if(Z||X||ye){if(this.logger.log(ye?"updateKey":"missingKey",b,v,h,ye?fe:k),u){var Fe=this.resolve(h,xo(xo({},o),{},{keySeparator:!1}));Fe&&Fe.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Me=[],rt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&rt&&rt[0])for(var Ve=0;Ve1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,d,h;return typeof i=="string"&&(i=[i]),i.forEach(function(m){if(!o.isValidLookup(s)){var v=o.extractFromKey(m,a),b=v.key;l=b;var S=v.namespaces;o.options.fallbackNS&&(S=S.concat(o.options.fallbackNS));var _=a.count!==void 0&&typeof a.count!="string",E=_&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),k=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);S.forEach(function(A){o.isValidLookup(s)||(h=A,!aR["".concat(T[0],"-").concat(A)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(h)&&(aR["".concat(T[0],"-").concat(A)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(T.join(", "),`" won't get resolved as namespace "`).concat(h,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(function(M){if(!o.isValidLookup(s)){d=M;var R=[b];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(R,b,M,A,a);else{var D;_&&(D=o.pluralResolver.getSuffix(M,a.count,a));var j="".concat(o.options.pluralSeparator,"zero");if(_&&(R.push(b+D),E&&R.push(b+j)),k){var z="".concat(b).concat(o.options.contextSeparator).concat(a.context);R.push(z),_&&(R.push(z+D),E&&R.push(z+j))}}for(var H;H=R.pop();)o.isValidLookup(s)||(u=H,s=o.getResource(M,A,H,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:d,usedNS:h}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(ef);function PC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var lR=function(){function e(t){gu(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kl.create("languageUtils")}return mu(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=PC(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=PC(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=PC(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){u&&(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),Vwe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Wwe={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Uwe=["v1","v2","v3"],uR={zero:0,one:1,two:2,few:3,many:4,other:5};function Gwe(){var e={};return Vwe.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Wwe[t.fc]}})}),e}var qwe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gu(this,e),this.languageUtils=t,this.options=n,this.logger=Kl.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Gwe()}return mu(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return uR[a]-uR[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!Uwe.includes(this.options.compatibilityJSON)}}]),e}();function cR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function js(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};gu(this,e),this.logger=Kl.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return mu(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:Dwe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Dg(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Dg(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Dg(r.nestingPrefix):r.nestingPrefixEscaped||Dg("$t("),this.nestingSuffix=r.nestingSuffix?Dg(r.nestingSuffix):r.nestingSuffixEscaped||Dg(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(_){return _.replace(/\$/g,"$$$$")}var m=function(E){if(E.indexOf(a.formatSeparator)<0){var k=rR(r,d,E);return a.alwaysFormat?a.format(k,void 0,i,js(js(js({},o),r),{},{interpolationkey:E})):k}var T=E.split(a.formatSeparator),A=T.shift().trim(),M=T.join(a.formatSeparator).trim();return a.format(rR(r,d,A),M,i,js(js(js({},o),r),{},{interpolationkey:A}))};this.resetRegExp();var v=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,S=[{regex:this.regexpUnescape,safeValue:function(E){return h(E)}},{regex:this.regexp,safeValue:function(E){return a.escapeValue?h(a.escape(E)):h(E)}}];return S.forEach(function(_){for(u=0;s=_.regex.exec(n);){var E=s[1].trim();if(l=m(E),l===void 0)if(typeof v=="function"){var k=v(n,s,o);l=typeof k=="string"?k:""}else if(o&&o.hasOwnProperty(E))l="";else if(b){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(E," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=tR(l));var T=_.safeValue(l);if(n=n.replace(s[0],T),b?(_.regex.lastIndex+=l.length,_.regex.lastIndex-=s[0].length):_.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(v,b){var S=this.nestingOptionsSeparator;if(v.indexOf(S)<0)return v;var _=v.split(new RegExp("".concat(S,"[ ]*{"))),E="{".concat(_[1]);v=_[0],E=this.interpolate(E,l);var k=E.match(/'/g),T=E.match(/"/g);(k&&k.length%2===0&&!T||T.length%2!==0)&&(E=E.replace(/'/g,'"'));try{l=JSON.parse(E),b&&(l=js(js({},b),l))}catch(A){return this.logger.warn("failed parsing options string in nesting for key ".concat(v),A),"".concat(v).concat(S).concat(E)}return delete l.defaultValue,v}for(;a=this.nestingRegexp.exec(n);){var d=[];l=js({},o),l.applyPostProcessor=!1,delete l.defaultValue;var h=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var m=a[1].split(this.formatSeparator).map(function(v){return v.trim()});a[1]=m.shift(),d=m,h=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=tR(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),h&&(s=d.reduce(function(v,b){return i.format(v,b,o.lng,js(js({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function dR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cd(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(a){var s=a.split(":"),l=Lwe(s),u=l[0],d=l.slice(1),h=d.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=h),h==="false"&&(n[u.trim()]=!1),h==="true"&&(n[u.trim()]=!0),isNaN(h)||(n[u.trim()]=parseInt(h,10))}})}}return{formatName:t,formatOptions:n}}function Ng(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var Xwe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gu(this,e),this.logger=Kl.create("formatter"),this.options=t,this.formats={number:Ng(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:Ng(function(n,r){var i=new Intl.NumberFormat(n,cd(cd({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:Ng(function(n,r){var i=new Intl.DateTimeFormat(n,cd({},r));return function(o){return i.format(o)}}),relativetime:Ng(function(n,r){var i=new Intl.RelativeTimeFormat(n,cd({},r));return function(o){return i.format(o,r.range||"day")}}),list:Ng(function(n,r){var i=new Intl.ListFormat(n,cd({},r));return function(o){return i.format(o)}})},this.init(t)}return mu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Ng(r)}},{key:"format",value:function(n,r,i,o){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,d){var h=Kwe(d),m=h.formatName,v=h.formatOptions;if(a.formats[m]){var b=u;try{var S=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},_=S.locale||S.lng||o.locale||o.lng||i;b=a.formats[m](u,_,cd(cd(cd({},v),o),S))}catch(E){a.logger.warn(E)}return b}else a.logger.warn("there was no format function for ".concat(m));return u},n);return l}}]),e}();function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hR(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jwe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var e6e=function(e){zx(n,e);var t=Zwe(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return gu(this,n),a=t.call(this),Hx&&ef.call(zd(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Kl.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return mu(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},d={},h={},m={};return i.forEach(function(v){var b=!0;o.forEach(function(S){var _="".concat(v,"|").concat(S);!a.reload&&l.store.hasResourceBundle(v,S)?l.state[_]=2:l.state[_]<0||(l.state[_]===1?d[_]===void 0&&(d[_]=!0):(l.state[_]=1,b=!1,d[_]===void 0&&(d[_]=!0),u[_]===void 0&&(u[_]=!0),m[S]===void 0&&(m[S]=!0)))}),b||(h[v]=!0)}),(Object.keys(u).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(d),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var d={};this.queue.forEach(function(h){Iwe(h.loaded,[l],u),Jwe(h,i),o&&h.errors.push(o),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(function(m){d[m]||(d[m]={});var v=h.loaded[m];v.length&&v.forEach(function(b){d[m][b]===void 0&&(d[m][b]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(h){return!h.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!i.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:d});return}this.readingCalls++;var h=function(S,_){if(s.readingCalls--,s.waitingReads.length>0){var E=s.waitingReads.shift();s.read(E.lng,E.ns,E.fcName,E.tried,E.wait,E.callback)}if(S&&_&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(d){a.loadOne(d)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(d,h){d&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),d),!d&&h&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),h),o.loaded(i,d,h)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var h=hR(hR({},u),{},{isUpdate:l}),m=this.backend.create.bind(this.backend);if(m.length<6)try{var v;m.length===5?v=m(i,o,a,s,h):v=m(i,o,a,s),v&&typeof v.then=="function"?v.then(function(b){return d(null,b)}).catch(d):d(null,v)}catch(b){d(b)}else m(i,o,a,s,d,h)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(ef);function pR(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Qs(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Qs(t[2])==="object"||Qs(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function gR(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function mR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rl(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ob(){}function r6e(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var eS=function(e){zx(n,e);var t=t6e(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(gu(this,n),r=t.call(this),Hx&&ef.call(zd(r)),r.options=gR(i),r.services={},r.logger=Kl,r.modules={external:[]},r6e(zd(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),zy(r,zd(r));setTimeout(function(){r.init(i,o)},0)}return r}return mu(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=pR();this.options=Rl(Rl(Rl({},s),this.options),gR(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Rl(Rl({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(E){return E?typeof E=="function"?new E:E:null}if(!this.options.isClone){this.modules.logger?Kl.init(l(this.modules.logger),this.options):Kl.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Xwe);var d=new lR(this.options);this.store=new Fwe(this.options.resources,this.options);var h=this.services;h.logger=Kl,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new qwe(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=l(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Ywe(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new e6e(l(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(E){for(var k=arguments.length,T=new Array(k>1?k-1:0),A=1;A1?k-1:0),A=1;A0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var v=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];v.forEach(function(E){i[E]=function(){var k;return(k=i.store)[E].apply(k,arguments)}});var b=["addResource","addResources","addResourceBundle","removeResourceBundle"];b.forEach(function(E){i[E]=function(){var k;return(k=i.store)[E].apply(k,arguments),i}});var S=av(),_=function(){var k=function(A,M){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),S.resolve(M),a(A,M)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return k(null,i.t.bind(i));i.changeLanguage(i.options.lng,k)};return this.options.resources||!this.options.initImmediate?_():setTimeout(_,0),S}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ob,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],d=function(v){if(v){var b=o.services.languageUtils.toResolveHierarchy(v);b.forEach(function(S){u.indexOf(S)<0&&u.push(S)})}};if(l)d(l);else{var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.forEach(function(m){return d(m)})}this.options.preload&&this.options.preload.forEach(function(m){return d(m)}),this.services.backendConnector.load(u,this.options.ns,function(m){!m&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=av();return i||(i=this.languages),o||(o=this.options.ns),a||(a=Ob),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&BU.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=av();this.emit("languageChanging",i);var l=function(m){a.language=m,a.languages=a.services.languageUtils.toResolveHierarchy(m),a.resolvedLanguage=void 0,a.setResolvedLanguage(m)},u=function(m,v){v?(l(v),a.translator.changeLanguage(v),a.isLanguageChangingTo=void 0,a.emit("languageChanged",v),a.logger.log("languageChanged",v)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(m,function(){return a.t.apply(a,arguments)})},d=function(m){!i&&!m&&a.services.languageDetector&&(m=[]);var v=typeof m=="string"?m:a.services.languageUtils.getBestMatchFromCodes(m);v&&(a.language||l(v),a.translator.language||a.translator.changeLanguage(v),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(v)),a.loadResources(v,function(b){u(b,v)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(d,h){var m;if(Qs(h)!=="object"){for(var v=arguments.length,b=new Array(v>2?v-2:0),S=2;S1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var d=function(v,b){var S=o.services.backendConnector.state["".concat(v,"|").concat(b)];return S===-1||S===2};if(a.precheck){var h=a.precheck(this,d);if(h!==void 0)return h}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,i)&&(!l||d(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=av();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=av();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new lR(pR());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ob,s=Rl(Rl(Rl({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(d){l[d]=i[d]}),l.services=Rl({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new sR(l.services,l.options),l.translator.on("*",function(d){for(var h=arguments.length,m=new Array(h>1?h-1:0),v=1;v0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new eS(e,t)});var zt=eS.createInstance();zt.createInstance=eS.createInstance;zt.createInstance;zt.dir;zt.init;zt.loadResources;zt.reloadResources;zt.use;zt.changeLanguage;zt.getFixedT;zt.t;zt.exists;zt.setDefaultNamespace;zt.hasLoadedNamespace;zt.loadNamespaces;zt.loadLanguages;function i6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ry(e){return ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ry(e)}function o6e(e,t){if(ry(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ry(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a6e(e){var t=o6e(e,"string");return ry(t)==="symbol"?t:String(t)}function vR(e,t){for(var n=0;n0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!yR.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!yR.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},bR={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=d6e(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},sv=null,SR=function(){if(sv!==null)return sv;try{sv=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{sv=!1}return sv},p6e={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&SR()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&SR()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},lv=null,xR=function(){if(lv!==null)return lv;try{lv=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{lv=!1}return lv},g6e={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&xR()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&xR()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},m6e={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},v6e={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},y6e={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},b6e={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function S6e(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var FU=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i6e(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return s6e(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=c6e(r,this.options||{},S6e()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(f6e),this.addDetector(h6e),this.addDetector(p6e),this.addDetector(g6e),this.addDetector(m6e),this.addDetector(v6e),this.addDetector(y6e),this.addDetector(b6e)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();FU.type="languageDetector";function b8(e){return b8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b8(e)}var zU=[],x6e=zU.forEach,w6e=zU.slice;function S8(e){return x6e.call(w6e.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function HU(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":b8(XMLHttpRequest))==="object"}function C6e(e){return!!e&&typeof e.then=="function"}function _6e(e){return C6e(e)?e:Promise.resolve(e)}function k6e(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var iy={},E6e={get exports(){return iy},set exports(e){iy=e}},u2={},P6e={get exports(){return u2},set exports(e){u2=e}},wR;function T6e(){return wR||(wR=1,function(e,t){var n=typeof self<"u"?self:_o,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l($){return $&&DataView.prototype.isPrototypeOf($)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function($){return $&&u.indexOf(Object.prototype.toString.call($))>-1};function h($){if(typeof $!="string"&&($=String($)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test($))throw new TypeError("Invalid character in header field name");return $.toLowerCase()}function m($){return typeof $!="string"&&($=String($)),$}function v($){var W={next:function(){var X=$.shift();return{done:X===void 0,value:X}}};return s.iterable&&(W[Symbol.iterator]=function(){return W}),W}function b($){this.map={},$ instanceof b?$.forEach(function(W,X){this.append(X,W)},this):Array.isArray($)?$.forEach(function(W){this.append(W[0],W[1])},this):$&&Object.getOwnPropertyNames($).forEach(function(W){this.append(W,$[W])},this)}b.prototype.append=function($,W){$=h($),W=m(W);var X=this.map[$];this.map[$]=X?X+", "+W:W},b.prototype.delete=function($){delete this.map[h($)]},b.prototype.get=function($){return $=h($),this.has($)?this.map[$]:null},b.prototype.has=function($){return this.map.hasOwnProperty(h($))},b.prototype.set=function($,W){this.map[h($)]=m(W)},b.prototype.forEach=function($,W){for(var X in this.map)this.map.hasOwnProperty(X)&&$.call(W,this.map[X],X,this)},b.prototype.keys=function(){var $=[];return this.forEach(function(W,X){$.push(X)}),v($)},b.prototype.values=function(){var $=[];return this.forEach(function(W){$.push(W)}),v($)},b.prototype.entries=function(){var $=[];return this.forEach(function(W,X){$.push([X,W])}),v($)},s.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function S($){if($.bodyUsed)return Promise.reject(new TypeError("Already read"));$.bodyUsed=!0}function _($){return new Promise(function(W,X){$.onload=function(){W($.result)},$.onerror=function(){X($.error)}})}function E($){var W=new FileReader,X=_(W);return W.readAsArrayBuffer($),X}function k($){var W=new FileReader,X=_(W);return W.readAsText($),X}function T($){for(var W=new Uint8Array($),X=new Array(W.length),Z=0;Z-1?W:$}function j($,W){W=W||{};var X=W.body;if($ instanceof j){if($.bodyUsed)throw new TypeError("Already read");this.url=$.url,this.credentials=$.credentials,W.headers||(this.headers=new b($.headers)),this.method=$.method,this.mode=$.mode,this.signal=$.signal,!X&&$._bodyInit!=null&&(X=$._bodyInit,$.bodyUsed=!0)}else this.url=String($);if(this.credentials=W.credentials||this.credentials||"same-origin",(W.headers||!this.headers)&&(this.headers=new b(W.headers)),this.method=D(W.method||this.method||"GET"),this.mode=W.mode||this.mode||null,this.signal=W.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function z($){var W=new FormData;return $.trim().split("&").forEach(function(X){if(X){var Z=X.split("="),U=Z.shift().replace(/\+/g," "),Q=Z.join("=").replace(/\+/g," ");W.append(decodeURIComponent(U),decodeURIComponent(Q))}}),W}function H($){var W=new b,X=$.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(Z){var U=Z.split(":"),Q=U.shift().trim();if(Q){var re=U.join(":").trim();W.append(Q,re)}}),W}M.call(j.prototype);function K($,W){W||(W={}),this.type="default",this.status=W.status===void 0?200:W.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in W?W.statusText:"OK",this.headers=new b(W.headers),this.url=W.url||"",this._initBody($)}M.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},K.error=function(){var $=new K(null,{status:0,statusText:""});return $.type="error",$};var te=[301,302,303,307,308];K.redirect=function($,W){if(te.indexOf(W)===-1)throw new RangeError("Invalid status code");return new K(null,{status:W,headers:{location:$}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(W,X){this.message=W,this.name=X;var Z=Error(W);this.stack=Z.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function G($,W){return new Promise(function(X,Z){var U=new j($,W);if(U.signal&&U.signal.aborted)return Z(new a.DOMException("Aborted","AbortError"));var Q=new XMLHttpRequest;function re(){Q.abort()}Q.onload=function(){var fe={status:Q.status,statusText:Q.statusText,headers:H(Q.getAllResponseHeaders()||"")};fe.url="responseURL"in Q?Q.responseURL:fe.headers.get("X-Request-URL");var Ee="response"in Q?Q.response:Q.responseText;X(new K(Ee,fe))},Q.onerror=function(){Z(new TypeError("Network request failed"))},Q.ontimeout=function(){Z(new TypeError("Network request failed"))},Q.onabort=function(){Z(new a.DOMException("Aborted","AbortError"))},Q.open(U.method,U.url,!0),U.credentials==="include"?Q.withCredentials=!0:U.credentials==="omit"&&(Q.withCredentials=!1),"responseType"in Q&&s.blob&&(Q.responseType="blob"),U.headers.forEach(function(fe,Ee){Q.setRequestHeader(Ee,fe)}),U.signal&&(U.signal.addEventListener("abort",re),Q.onreadystatechange=function(){Q.readyState===4&&U.signal.removeEventListener("abort",re)}),Q.send(typeof U._bodyInit>"u"?null:U._bodyInit)})}return G.polyfill=!0,o.fetch||(o.fetch=G,o.Headers=b,o.Request=j,o.Response=K),a.Headers=b,a.Request=j,a.Response=K,a.fetch=G,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(P6e,u2)),u2}(function(e,t){var n;if(typeof fetch=="function"&&(typeof _o<"u"&&_o.fetch?n=_o.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof k6e<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||T6e();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(E6e,iy);const VU=iy,CR=cj({__proto__:null,default:VU},[iy]);function tS(e){return tS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tS(e)}var Xu;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Xu=global.fetch:typeof window<"u"&&window.fetch?Xu=window.fetch:Xu=fetch);var oy;HU()&&(typeof global<"u"&&global.XMLHttpRequest?oy=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(oy=window.XMLHttpRequest));var nS;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?nS=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(nS=window.ActiveXObject));!Xu&&CR&&!oy&&!nS&&(Xu=VU||CR);typeof Xu!="function"&&(Xu=void 0);var x8=function(t,n){if(n&&tS(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},_R=function(t,n,r){Xu(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},kR=!1,L6e=function(t,n,r,i){t.queryStringParams&&(n=x8(n,t.queryStringParams));var o=S8({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=S8({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},kR?{}:a);try{_R(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),_R(n,s,i),kR=!0}catch(u){i(u)}}},A6e=function(t,n,r,i){r&&tS(r)==="object"&&(r=x8("",r).slice(1)),t.queryStringParams&&(n=x8(n,t.queryStringParams));try{var o;oy?o=new oy:o=new nS("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},O6e=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Xu&&n.indexOf("file:")!==0)return L6e(t,n,r,i);if(HU()||typeof ActiveXObject=="function")return A6e(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function ay(e){return ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ay(e)}function M6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ER(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};M6e(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return I6e(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=S8(i,this.options||{},N6e()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=_6e(l),l.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(d,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,d;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch{d="failed parsing "+n+" to json"}if(d)return r(d,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,d=[],h=[];n.forEach(function(m){var v=s.options.addPath;typeof s.options.addPath=="function"&&(v=s.options.addPath(m,r));var b=s.services.interpolator.interpolate(v,{lng:m,ns:r});s.options.request(s.options,b,l,function(S,_){u+=1,d.push(S),h.push(_),u===n.length&&a&&a(d,h)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(h){var m=o.toResolveHierarchy(h);m.forEach(function(v){l.indexOf(v)<0&&l.push(v)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),l.forEach(function(d){n.allOptions.ns.forEach(function(h){i.read(d,h,"read",null,null,function(m,v){m&&a.warn("loading namespace ".concat(h," for language ").concat(d," failed"),m),!m&&v&&a.log("loaded namespace ".concat(h," for language ").concat(d),v),i.loaded("".concat(d,"|").concat(h),m,v)})})})}}}]),e}();UU.type="backend";function sy(e){return sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sy(e)}function j6e(e,t){if(sy(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sy(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GU(e){var t=j6e(e,"string");return sy(t)==="symbol"?t:String(t)}function qU(e,t,n){return t=GU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B6e(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var d=t.services.backendConnector.state["".concat(l,"|").concat(u)];return d===-1||d===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function F6e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return w8("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):$6e(e,t,n)}var z6e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,H6e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},V6e=function(t){return H6e[t]},W6e=function(t){return t.replace(z6e,V6e)};function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function AR(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};C8=AR(AR({},C8),e)}function G6e(){return C8}var YU;function q6e(e){YU=e}function Y6e(){return YU}function K6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=w.useContext(Q6e)||{},i=r.i18n,o=r.defaultNS,a=n||i||Y6e();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new J6e),!a){w8("You will need to pass in an i18next instance by using initReactI18next");var s=function(z){return Array.isArray(z)?z[z.length-1]:z},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&w8("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=TC(TC(TC({},G6e()),a.options.react),t),d=u.useSuspense,h=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var v=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(j){return F6e(j,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],h)}var S=w.useState(b),_=iCe(S,2),E=_[0],k=_[1],T=m.join(),A=oCe(T),M=w.useRef(!0);w.useEffect(function(){var j=u.bindI18n,z=u.bindI18nStore;M.current=!0,!v&&!d&&TR(a,m,function(){M.current&&k(b)}),v&&A&&A!==T&&M.current&&k(b);function H(){M.current&&k(b)}return j&&a&&a.on(j,H),z&&a&&a.store.on(z,H),function(){M.current=!1,j&&a&&j.split(" ").forEach(function(K){return a.off(K,H)}),z&&a&&z.split(" ").forEach(function(K){return a.store.off(K,H)})}},[a,T]);var R=w.useRef(!0);w.useEffect(function(){M.current&&!R.current&&k(b),R.current=!1},[a,h]);var D=[E,a,v];if(D.t=E,D.i18n=a,D.ready=v,v||!v&&!d)return D;throw new Promise(function(j){TR(a,m,function(){j()})})}zt.use(UU).use(FU).use(Z6e).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","parameters","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const aCe={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:zt.isInitialized?zt.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},KU=hp({name:"system",initialState:aCe,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?zt.t("common:statusConnected"):zt.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=zt.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:sCe,setIsProcessing:ns,addLogEntry:to,setShouldShowLogViewer:LC,setIsConnected:RR,setSocketId:Mze,setShouldConfirmOnDelete:XU,setOpenAccordions:lCe,setSystemStatus:uCe,setCurrentStatus:B4,setSystemConfig:cCe,setShouldDisplayGuides:dCe,processingCanceled:fCe,errorOccurred:DR,errorSeen:ZU,setModelList:Mb,setIsCancelable:dm,modelChangeRequested:hCe,setSaveIntermediatesInterval:pCe,setEnableImageDebugging:gCe,generationRequested:mCe,addToast:Ah,clearToastQueue:vCe,setProcessingIndeterminateTask:yCe,setSearchFolder:QU,setFoundModels:JU,setOpenModel:NR}=KU.actions,bCe=KU.reducer,mP=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],SCe={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,addNewModelUIOption:null},xCe=SCe,eG=hp({name:"ui",initialState:xCe,reducers:{setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=mP.indexOf(t.payload)},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setParametersPanelScrollPosition:(e,t)=>{e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:(e,t)=>{e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:(e,t)=>{e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setAddNewModelUIOption:(e,t)=>{e.addNewModelUIOption=t.payload}}}),{setActiveTab:Yo,setCurrentTheme:wCe,setParametersPanelScrollPosition:CCe,setShouldHoldParametersPanelOpen:_Ce,setShouldPinParametersPanel:kCe,setShouldShowParametersPanel:Zu,setShouldShowDualDisplay:ECe,setShouldShowImageDetails:tG,setShouldUseCanvasBetaLayout:PCe,setShouldShowExistingModelsInSearch:TCe,setAddNewModelUIOption:Vh}=eG.actions,LCe=eG.reducer,cu=Object.create(null);cu.open="0";cu.close="1";cu.ping="2";cu.pong="3";cu.message="4";cu.upgrade="5";cu.noop="6";const $4=Object.create(null);Object.keys(cu).forEach(e=>{$4[cu[e]]=e});const ACe={type:"error",data:"parser error"},OCe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",MCe=typeof ArrayBuffer=="function",ICe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,nG=({type:e,data:t},n,r)=>OCe&&t instanceof Blob?n?r(t):jR(t,r):MCe&&(t instanceof ArrayBuffer||ICe(t))?n?r(t):jR(new Blob([t]),r):r(cu[e]+(t||"")),jR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},BR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ov=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(a&15)<<4|s>>2,d[i++]=(s&3)<<6|l&63;return u},DCe=typeof ArrayBuffer=="function",rG=(e,t)=>{if(typeof e!="string")return{type:"message",data:iG(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:NCe(e.substring(1),t)}:$4[n]?e.length>1?{type:$4[n],data:e.substring(1)}:{type:$4[n]}:ACe},NCe=(e,t)=>{if(DCe){const n=RCe(e);return iG(n,t)}else return{base64:!0,data:e}},iG=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},oG=String.fromCharCode(30),jCe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{nG(o,!1,s=>{r[a]=s,++i===n&&t(r.join(oG))})})},BCe=(e,t)=>{const n=e.split(oG),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function sG(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const FCe=setTimeout,zCe=clearTimeout;function Vx(e,t){t.useNativeTimers?(e.setTimeoutFn=FCe.bind(Ld),e.clearTimeoutFn=zCe.bind(Ld)):(e.setTimeoutFn=setTimeout.bind(Ld),e.clearTimeoutFn=clearTimeout.bind(Ld))}const HCe=1.33;function VCe(e){return typeof e=="string"?WCe(e):Math.ceil((e.byteLength||e.size)*HCe)}function WCe(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class UCe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class lG extends si{constructor(t){super(),this.writable=!1,Vx(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new UCe(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=rG(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const uG="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),_8=64,GCe={};let $R=0,Ib=0,FR;function zR(e){let t="";do t=uG[e%_8]+t,e=Math.floor(e/_8);while(e>0);return t}function cG(){const e=zR(+new Date);return e!==FR?($R=0,FR=e):e+"."+zR($R++)}for(;Ib<_8;Ib++)GCe[uG[Ib]]=Ib;function dG(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function qCe(e){let t={},n=e.split("&");for(let r=0,i=n.length;r{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};BCe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,jCe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=cG()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=dG(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new iu(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class iu extends si{constructor(t,n){super(),Vx(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=sG(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new hG(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=iu.requestsCount++,iu.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=KCe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete iu.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}iu.requestsCount=0;iu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",HR);else if(typeof addEventListener=="function"){const e="onpagehide"in Ld?"pagehide":"unload";addEventListener(e,HR,!1)}}function HR(){for(let e in iu.requests)iu.requests.hasOwnProperty(e)&&iu.requests[e].abort()}const pG=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Rb=Ld.WebSocket||Ld.MozWebSocket,VR=!0,QCe="arraybuffer",WR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class JCe extends lG{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=WR?{}:sG(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=VR&&!WR?n?new Rb(t,n):new Rb(t):new Rb(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||QCe,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{VR&&this.ws.send(o)}catch{}i&&pG(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=cG()),this.supportsBinary||(t.b64=1);const i=dG(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Rb}}const e7e={websocket:JCe,polling:ZCe},t7e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n7e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function k8(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=t7e.exec(e||""),o={},a=14;for(;a--;)o[n7e[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=r7e(o,o.path),o.queryKey=i7e(o,o.query),o}function r7e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function i7e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let gG=class Hg extends si{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=k8(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=k8(n.host).host),Vx(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=qCe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=aG,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new e7e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Hg.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Hg.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Hg.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=h=>{const m=new Error("probe error: "+h);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(h){n&&h.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Hg.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Hg.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,mG=Object.prototype.toString,l7e=typeof Blob=="function"||typeof Blob<"u"&&mG.call(Blob)==="[object BlobConstructor]",u7e=typeof File=="function"||typeof File<"u"&&mG.call(File)==="[object FileConstructor]";function vP(e){return a7e&&(e instanceof ArrayBuffer||s7e(e))||l7e&&e instanceof Blob||u7e&&e instanceof File}function F4(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case dn.ACK:case dn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class p7e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=d7e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const g7e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:yP,Encoder:h7e,get PacketType(){return dn},protocol:f7e},Symbol.toStringTag,{value:"Module"}));function zs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const m7e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class vG extends si{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[zs(t,"open",this.onopen.bind(this)),zs(t,"packet",this.onpacket.bind(this)),zs(t,"error",this.onerror.bind(this)),zs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(m7e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:dn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:dn.CONNECT,data:t})}):this.packet({type:dn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case dn.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case dn.EVENT:case dn.BINARY_EVENT:this.onevent(t);break;case dn.ACK:case dn.BINARY_ACK:this.onack(t);break;case dn.DISCONNECT:this.ondisconnect();break;case dn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:dn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:dn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}T0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};T0.prototype.reset=function(){this.attempts=0};T0.prototype.setMin=function(e){this.ms=e};T0.prototype.setMax=function(e){this.max=e};T0.prototype.setJitter=function(e){this.jitter=e};class T8 extends si{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Vx(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new T0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||g7e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new gG(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=zs(n,"open",function(){r.onopen(),t&&t()}),o=zs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(zs(t,"ping",this.onping.bind(this)),zs(t,"data",this.ondata.bind(this)),zs(t,"error",this.onerror.bind(this)),zs(t,"close",this.onclose.bind(this)),zs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){pG(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new vG(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const uv={};function z4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=o7e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=uv[i]&&o in uv[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new T8(r,t):(uv[i]||(uv[i]=new T8(r,t)),l=uv[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(z4,{Manager:T8,Socket:vG,io:z4,connect:z4});const v7e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],y7e=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],b7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],S7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],x7e=[{key:"2x",value:2},{key:"4x",value:4}],bP=0,SP=4294967295,w7e=["gfpgan","codeformer"],C7e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var _7e=Math.PI/180;function k7e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Hm=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},gt={_global:Hm,version:"8.3.14",isBrowser:k7e(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return gt.angleDeg?e*_7e:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return gt.DD.isDragging},isDragReady(){return!!gt.DD.node},releaseCanvasOnDestroy:!0,document:Hm.document,_injectGlobal(e){Hm.Konva=e}},Or=e=>{gt[e.prototype.getClassName()]=e};gt._injectGlobal(gt);class Ea{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new Ea(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var d=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/d):-Math.acos(r/d)),l.scaleX=s/d,l.scaleY=d,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=de._getRotation(l.rotation),l}}var E7e="[object Array]",P7e="[object Number]",T7e="[object String]",L7e="[object Boolean]",A7e=Math.PI/180,O7e=180/Math.PI,AC="#",M7e="",I7e="0",R7e="Konva warning: ",UR="Konva error: ",D7e="rgb(",OC={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},N7e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Db=[];const j7e=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},de={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===E7e},_isNumber(e){return Object.prototype.toString.call(e)===P7e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===T7e},_isBoolean(e){return Object.prototype.toString.call(e)===L7e},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){Db.push(e),Db.length===1&&j7e(function(){const t=Db;Db=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=de.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(AC,M7e);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=I7e+e;return AC+e},getRGB(e){var t;return e in OC?(t=OC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===AC?this._hexToRgb(e.substring(1)):e.substr(0,4)===D7e?(t=N7e.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",de._namedColorToRBA(e)||de._hex3ColorToRGBA(e)||de._hex6ColorToRGBA(e)||de._rgbColorToRGBA(e)||de._rgbaColorToRGBA(e)||de._hslColorToRGBA(e)},_namedColorToRBA(e){var t=OC[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,d=[0,0,0];for(let h=0;h<3;h++)s=r+1/3*-(h-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,d[h]=l*255;return{r:Math.round(d[0]),g:Math.round(d[1]),b:Math.round(d[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+d*(n-e),s=t+d*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=de.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=de._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],d=l[1],h=l[2];ht.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function hf(e){return de._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||de._isBoolean(e)?e:Object.prototype.toString.call(e)}function yG(e){return e>255?255:e<0?0:Math.round(e)}function Ye(){if(gt.isUnminified)return function(e,t){return de._isNumber(e)||de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function bG(e){if(gt.isUnminified)return function(t,n){let r=de._isNumber(t),i=de._isArray(t)&&t.length==e;return!r&&!i&&de.warn(hf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function xP(){if(gt.isUnminified)return function(e,t){var n=de._isNumber(e),r=e==="auto";return n||r||de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function L0(){if(gt.isUnminified)return function(e,t){return de._isString(e)||de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function SG(){if(gt.isUnminified)return function(e,t){const n=de._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function B7e(){if(gt.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(de._isArray(e)?e.forEach(function(r){de._isNumber(r)||de.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function il(){if(gt.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function $7e(e){if(gt.isUnminified)return function(t,n){return t==null||de.isObject(t)||de.warn(hf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var cv="get",dv="set";const ee={addGetterSetter(e,t,n,r,i){ee.addGetter(e,t,n),ee.addSetter(e,t,r,i),ee.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=cv+de._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=dv+de._capitalize(t);e.prototype[i]||ee.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=dv+de._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=de._capitalize,s=cv+a(t),l=dv+a(t),u,d;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(S),void 0)}),this._fireChangeEvent(t,v,m),i&&i.call(this),this},ee.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=de._capitalize(t),r=dv+n,i=cv+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){de.error("Adding deprecated "+t);var i=cv+de._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){de.error(o);var a=this.attrs[t];return a===void 0?n:a},ee.addSetter(e,t,r,function(){de.error(o)}),ee.addOverloadedGetterSetter(e,t)},backCompat(e,t){de.each(t,function(n,r){var i=e.prototype[r],o=cv+de._capitalize(n),a=dv+de._capitalize(n);function s(){i.apply(this,arguments),de.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function F7e(e){var t=[],n=e.length,r=de,i,o;for(i=0;itypeof d=="number"?Math.floor(d):d)),o+=z7e+u.join(GR)+H7e)):(o+=s.property,t||(o+=q7e+s.val)),o+=U7e;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=K7e&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var d=arguments,h=this._context;d.length===3?h.drawImage(t,n,r):d.length===5?h.drawImage(t,n,r,i,o):d.length===9&&h.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){return this._context.isPointInPath(t,n)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=qR.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=F7e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return vn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];vn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=de._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];vn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(vn.justDragged=!0,gt._mouseListenClick=!1,gt._touchListenClick=!1,gt._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof gt.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){vn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&vn._dragElements.delete(n)})}};gt.isBrowser&&(window.addEventListener("mouseup",vn._endDragBefore,!0),window.addEventListener("touchend",vn._endDragBefore,!0),window.addEventListener("mousemove",vn._drag),window.addEventListener("touchmove",vn._drag),window.addEventListener("mouseup",vn._endDragAfter,!1),window.addEventListener("touchend",vn._endDragAfter,!1));var H4="absoluteOpacity",jb="allEventListeners",Hu="absoluteTransform",YR="absoluteScale",lh="canvas",J7e="Change",e9e="children",t9e="konva",L8="listening",KR="mouseenter",XR="mouseleave",ZR="set",QR="Shape",V4=" ",JR="stage",pd="transform",n9e="Stage",A8="visible",r9e=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(V4);let i9e=1,Qe=class O8{constructor(t){this._id=i9e++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===pd||t===Hu)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===pd||t===Hu,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(V4);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(lh)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Hu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(lh)){const{scene:t,filter:n,hit:r}=this._cache.get(lh);de.releaseCanvas(t,n,r),this._cache.delete(lh)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,h=n.hitCanvasPixelRatio||1;if(!i||!o){de.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new Vm({pixelRatio:a,width:i,height:o}),v=new Vm({pixelRatio:a,width:0,height:0}),b=new wP({pixelRatio:h,width:i,height:o}),S=m.getContext(),_=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(lh),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,v.getContext()._context.imageSmoothingEnabled=!1),S.save(),_.save(),S.translate(-s,-l),_.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(H4),this._clearSelfAndDescendantCache(YR),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,S.restore(),_.restore(),d&&(S.save(),S.beginPath(),S.rect(0,0,i,o),S.closePath(),S.setAttr("strokeStyle","red"),S.setAttr("lineWidth",5),S.stroke(),S.restore()),this._cache.set(lh,{scene:m,filter:v,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(lh)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=l.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==e9e&&(r=ZR+de._capitalize(n),de._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(L8,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(A8,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;vn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!gt.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==n9e&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(pd),this._clearSelfAndDescendantCache(Hu)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new Ea,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(pd);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(pd),this._clearSelfAndDescendantCache(Hu),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return de.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return de.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&de.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(H4,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=de.isObject(i)&&!de._isPlainObject(i)&&!de._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),de._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,de._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():gt.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(r&&!this.isDragging()){var i=!1;vn._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=vn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&vn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return de.haveIntersection(r,this.getClientRect())}static create(t,n){return de._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=O8.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),gt[r]||(de.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=gt[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(arguments.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Qe.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Qe.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const d=r===this;if(u){o.save();var h=this.getAbsoluteTransform(r),m=h.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var v=this.clipX(),b=this.clipY();o.rect(v,b,a,s)}o.clip(),m=h.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var S=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";S&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(_){_[t](n,r)}),S&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(S){if(S.visible()){var _=S.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});_.width===0&&_.height===0||(o===void 0?(o=_.x,a=_.y,s=_.x+_.width,l=_.y+_.height):(o=Math.min(o,_.x),a=Math.min(a,_.y),s=Math.max(s,_.x+_.width),l=Math.max(l,_.y+_.height)))}});for(var h=this.find("Shape"),m=!1,v=0;ve.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",jg=e=>{const t=Dv(e);if(t==="pointer")return gt.pointerEventsEnabled&&IC.pointer;if(t==="touch")return IC.touch;if(t==="mouse")return IC.mouse};function tD(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&de.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const d9e="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",W4=[];let Gx=class extends Oa{constructor(t){super(tD(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),W4.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{tD(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||de.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===a9e){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t=this.children,n=t.length,r;for(r=0;r-1&&W4.splice(n,1),de.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(de.warn(d9e),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t=t||{},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var n=new Vm({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+eD,this.content.style.height=n+eD),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;ru9e&&de.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),gt.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return wG(t,this)}setPointerCapture(t){CG(t,this)}releaseCapture(t){c2(t)}getLayers(){return this.children}_bindContentEvents(){gt.isBrowser&&c9e.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=jg(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=jg(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=jg(t.type),r=Dv(t.type);if(n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!vn.isDragging||gt.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=jg(t.type),r=Dv(t.type);if(n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(vn.justDragged=!1,gt["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;gt.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=jg(t.type),r=Dv(t.type);if(!n)return;vn.isDragging&&vn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!vn.isDragging||gt.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=MC(l.id)||this.getIntersection(l),d=l.id,h={evt:t,pointerId:d};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},h),u),s._fireAndBubble(n.pointerleave,Object.assign({},h),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},h),s),u._fireAndBubble(n.pointerenter,Object.assign({},h),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},h))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=jg(t.type),r=Dv(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=MC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const d=l.id,h={evt:t,pointerId:d};let m=!1;gt["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):vn.justDragged||(gt["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){gt["_"+r+"InDblClickWindow"]=!1},gt.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},h)),gt["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},h)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},h)))):(this[r+"ClickEndShape"]=null,gt["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:d}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:d}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),gt["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(M8,{evt:t}):this._fire(M8,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(I8,{evt:t}):this._fire(I8,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=MC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(fm,CP(t)),c2(t.pointerId)}_lostpointercapture(t){c2(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}])}_setPointerPosition(t){de.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Vm({width:this.width(),height:this.height()}),this.bufferHitCanvas=new wP({pixelRatio:1,width:this.width(),height:this.height()}),!!gt.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return de.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};Gx.prototype.nodeType=o9e;Or(Gx);ee.addGetterSetter(Gx,"container");var RG="hasShadow",DG="shadowRGBA",NG="patternImage",jG="linearGradient",BG="radialGradient";let Hb;function RC(){return Hb||(Hb=de.createCanvasElement().getContext("2d"),Hb)}const d2={};function f9e(e){e.fill()}function h9e(e){e.stroke()}function p9e(e){e.fill()}function g9e(e){e.stroke()}function m9e(){this._clearCache(RG)}function v9e(){this._clearCache(DG)}function y9e(){this._clearCache(NG)}function b9e(){this._clearCache(jG)}function S9e(){this._clearCache(BG)}class $e extends Qe{constructor(t){super(t);let n;for(;n=de.getRandomColor(),!(n&&!(n in d2)););this.colorKey=n,d2[n]=this}getContext(){return de.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return de.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(RG,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(NG,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=RC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Ea;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(gt.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(jG,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=RC(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return Qe.prototype.destroy.call(this),delete d2[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){de.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),d=u?this.shadowOffsetX():0,h=u?this.shadowOffsetY():0,m=s+Math.abs(d),v=l+Math.abs(h),b=u&&this.shadowBlur()||0,S=m+b*2,_=v+b*2,E={width:S,height:_,x:-(a/2+b)+Math.min(d,0)+i.x,y:-(a/2+b)+Math.min(h,0)+i.y};return n?E:this._transformedRect(E,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,d,h,m=i.isCache,v=n===this;if(!this.isVisible()&&!v)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),d=u.bufferCanvas,h=d.getContext(),h.clear(),h.save(),h._applyLineJoin(this);var S=this.getAbsoluteTransform(n).getMatrix();h.transform(S[0],S[1],S[2],S[3],S[4],S[5]),s.call(this,h,this),h.restore();var _=d.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(d._canvas,0,0,d.width/_,d.height/_)}else{if(o._applyLineJoin(this),!v){var S=this.getAbsoluteTransform(n).getMatrix();o.transform(S[0],S[1],S[2],S[3],S[4],S[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||de.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){a.save();var d=this.getAbsoluteTransform(n).getMatrix();return a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,d,h,m,v;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,d=u.length,h=de._hexToRgb(this.colorKey),m=0;mt?(u[m]=h.r,u[m+1]=h.g,u[m+2]=h.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){de.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return wG(t,this)}setPointerCapture(t){CG(t,this)}releaseCapture(t){c2(t)}}$e.prototype._fillFunc=f9e;$e.prototype._strokeFunc=h9e;$e.prototype._fillFuncHit=p9e;$e.prototype._strokeFuncHit=g9e;$e.prototype._centroid=!1;$e.prototype.nodeType="Shape";Or($e);$e.prototype.eventListeners={};$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m9e);$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",y9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",b9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",S9e);ee.addGetterSetter($e,"stroke",void 0,SG());ee.addGetterSetter($e,"strokeWidth",2,Ye());ee.addGetterSetter($e,"fillAfterStrokeEnabled",!1);ee.addGetterSetter($e,"hitStrokeWidth","auto",xP());ee.addGetterSetter($e,"strokeHitEnabled",!0,il());ee.addGetterSetter($e,"perfectDrawEnabled",!0,il());ee.addGetterSetter($e,"shadowForStrokeEnabled",!0,il());ee.addGetterSetter($e,"lineJoin");ee.addGetterSetter($e,"lineCap");ee.addGetterSetter($e,"sceneFunc");ee.addGetterSetter($e,"hitFunc");ee.addGetterSetter($e,"dash");ee.addGetterSetter($e,"dashOffset",0,Ye());ee.addGetterSetter($e,"shadowColor",void 0,L0());ee.addGetterSetter($e,"shadowBlur",0,Ye());ee.addGetterSetter($e,"shadowOpacity",1,Ye());ee.addComponentsGetterSetter($e,"shadowOffset",["x","y"]);ee.addGetterSetter($e,"shadowOffsetX",0,Ye());ee.addGetterSetter($e,"shadowOffsetY",0,Ye());ee.addGetterSetter($e,"fillPatternImage");ee.addGetterSetter($e,"fill",void 0,SG());ee.addGetterSetter($e,"fillPatternX",0,Ye());ee.addGetterSetter($e,"fillPatternY",0,Ye());ee.addGetterSetter($e,"fillLinearGradientColorStops");ee.addGetterSetter($e,"strokeLinearGradientColorStops");ee.addGetterSetter($e,"fillRadialGradientStartRadius",0);ee.addGetterSetter($e,"fillRadialGradientEndRadius",0);ee.addGetterSetter($e,"fillRadialGradientColorStops");ee.addGetterSetter($e,"fillPatternRepeat","repeat");ee.addGetterSetter($e,"fillEnabled",!0);ee.addGetterSetter($e,"strokeEnabled",!0);ee.addGetterSetter($e,"shadowEnabled",!0);ee.addGetterSetter($e,"dashEnabled",!0);ee.addGetterSetter($e,"strokeScaleEnabled",!0);ee.addGetterSetter($e,"fillPriority","color");ee.addComponentsGetterSetter($e,"fillPatternOffset",["x","y"]);ee.addGetterSetter($e,"fillPatternOffsetX",0,Ye());ee.addGetterSetter($e,"fillPatternOffsetY",0,Ye());ee.addComponentsGetterSetter($e,"fillPatternScale",["x","y"]);ee.addGetterSetter($e,"fillPatternScaleX",1,Ye());ee.addGetterSetter($e,"fillPatternScaleY",1,Ye());ee.addComponentsGetterSetter($e,"fillLinearGradientStartPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientStartPointX",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointX",0);ee.addGetterSetter($e,"fillLinearGradientStartPointY",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillLinearGradientEndPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientEndPointX",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointX",0);ee.addGetterSetter($e,"fillLinearGradientEndPointY",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientStartPointX",0);ee.addGetterSetter($e,"fillRadialGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientEndPointX",0);ee.addGetterSetter($e,"fillRadialGradientEndPointY",0);ee.addGetterSetter($e,"fillPatternRotation",0);ee.backCompat($e,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var x9e="#",w9e="beforeDraw",C9e="draw",$G=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],_9e=$G.length;let pp=class extends Oa{constructor(t){super(t),this.canvas=new Vm,this.hitCanvas=new wP({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i<_9e;i++){const o=$G[i],a=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),s=a.shape;if(s)return s;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,i=r[3];if(i===255){const o=de._rgbToHex(r[0],r[1],r[2]),a=d2[x9e+o];return a?{shape:a}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(w9e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Oa.prototype.drawScene.call(this,i,n),this._fire(C9e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Oa.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return de.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};pp.prototype.nodeType="Layer";Or(pp);ee.addGetterSetter(pp,"imageSmoothingEnabled",!0);ee.addGetterSetter(pp,"clearBeforeDraw",!0);ee.addGetterSetter(pp,"hitGraphEnabled",!0,il());class _P extends pp{constructor(t){super(t),this.listening(!1),de.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}_P.prototype.nodeType="FastLayer";Or(_P);let s0=class extends Oa{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&de.throw("You may only add groups and shapes to groups.")}};s0.prototype.nodeType="Group";Or(s0);var DC=function(){return Hm.performance&&Hm.performance.now?function(){return Hm.performance.now()}:function(){return new Date().getTime()}}();class rs{constructor(t,n){this.id=rs.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:DC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=nD,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=rD,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;this.state===nD?this.setTime(t):this.state===rD&&this.setTime(this.duration-t)}pause(){this.state=E9e,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Xr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||f2.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=P9e++;var u=r.getLayer()||(r instanceof gt.Stage?r.getLayers():null);u||de.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new rs(function(){n.tween.onEnterFrame()},u),this.tween=new T9e(l,function(d){n._tweenFunc(d)},a,0,1,o*1e3,s),this._addListeners(),Xr.attrs[i]||(Xr.attrs[i]={}),Xr.attrs[i][this._id]||(Xr.attrs[i][this._id]={}),Xr.tweens[i]||(Xr.tweens[i]={});for(l in t)k9e[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,d,h,m;if(s=Xr.tweens[i][t],s&&delete Xr.attrs[i][s][t],o=r.getAttr(t),de._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(h=o,o=de._prepareArrayForTween(o,n,r.closed())):(d=n,n=de._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t=this.node._id,n=this._id,r=Xr.tweens[t],i;this.pause();for(i in r)delete Xr.tweens[t][i];delete Xr.attrs[t][n]}}Xr.attrs={};Xr.tweens={};Qe.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Xr(e);n.play()};const f2={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),d=a*n,h=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:h,width:d-u,height:m-h}}}fc.prototype._centroid=!0;fc.prototype.className="Arc";fc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Or(fc);ee.addGetterSetter(fc,"innerRadius",0,Ye());ee.addGetterSetter(fc,"outerRadius",0,Ye());ee.addGetterSetter(fc,"angle",0,Ye());ee.addGetterSetter(fc,"clockwise",!1,il());function R8(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),d=a*l/(s+l),h=n-u*(i-e),m=r-u*(o-t),v=n+d*(i-e),b=r+d*(o-t);return[h,m,v,b]}function oD(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);ud?u:d,_=u>d?1:u/d,E=u>d?d/u:1;t.translate(s,l),t.rotate(v),t.scale(_,E),t.arc(0,0,S,h,h+m,1-b),t.scale(1/_,1/E),t.rotate(-v),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],h=u.points[5],m=u.points[4]+h,v=Math.PI/180;if(Math.abs(d-m)m;b-=v){const S=zn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(S.x,S.y)}else for(let b=d+v;bthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return zn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return zn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return zn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],d=a[3],h=a[4],m=a[5],v=a[6];return h+=m*t/o.pathLength,zn.getPointOnEllipticalArc(s,l,u,d,h,v)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var k=null,T=[],A=l,M=u,R,D,j,z,H,K,te,G,$,W;switch(v){case"l":l+=b.shift(),u+=b.shift(),k="L",T.push(l,u);break;case"L":l=b.shift(),u=b.shift(),T.push(l,u);break;case"m":var X=b.shift(),Z=b.shift();if(l+=X,u+=Z,k="M",a.length>2&&a[a.length-1].command==="z"){for(var U=a.length-2;U>=0;U--)if(a[U].command==="M"){l=a[U].points[0]+X,u=a[U].points[1]+Z;break}}T.push(l,u),v="l";break;case"M":l=b.shift(),u=b.shift(),k="M",T.push(l,u),v="L";break;case"h":l+=b.shift(),k="L",T.push(l,u);break;case"H":l=b.shift(),k="L",T.push(l,u);break;case"v":u+=b.shift(),k="L",T.push(l,u);break;case"V":u=b.shift(),k="L",T.push(l,u);break;case"C":T.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"c":T.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="C",T.push(l,u);break;case"S":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),T.push(D,j,b.shift(),b.shift()),l=b.shift(),u=b.shift(),k="C",T.push(l,u);break;case"s":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),T.push(D,j,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="C",T.push(l,u);break;case"Q":T.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"q":T.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="Q",T.push(l,u);break;case"T":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l=b.shift(),u=b.shift(),k="Q",T.push(D,j,l,u);break;case"t":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l+=b.shift(),u+=b.shift(),k="Q",T.push(D,j,l,u);break;case"A":z=b.shift(),H=b.shift(),K=b.shift(),te=b.shift(),G=b.shift(),$=l,W=u,l=b.shift(),u=b.shift(),k="A",T=this.convertEndpointToCenterParameterization($,W,l,u,te,G,z,H,K);break;case"a":z=b.shift(),H=b.shift(),K=b.shift(),te=b.shift(),G=b.shift(),$=l,W=u,l+=b.shift(),u+=b.shift(),k="A",T=this.convertEndpointToCenterParameterization($,W,l,u,te,G,z,H,K);break}a.push({command:k||v,points:T,start:{x:A,y:M},pathLength:this.calcLength(A,M,k||v,T)})}(v==="z"||v==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=zn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var d=i[4],h=i[5],m=i[4]+h,v=Math.PI/180;if(Math.abs(d-m)m;l-=v)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=d+v;l1&&(s*=Math.sqrt(v),l*=Math.sqrt(v));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(h*h))/(s*s*(m*m)+l*l*(h*h)));o===a&&(b*=-1),isNaN(b)&&(b=0);var S=b*s*m/l,_=b*-l*h/s,E=(t+r)/2+Math.cos(d)*S-Math.sin(d)*_,k=(n+i)/2+Math.sin(d)*S+Math.cos(d)*_,T=function(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])},A=function(H,K){return(H[0]*K[0]+H[1]*K[1])/(T(H)*T(K))},M=function(H,K){return(H[0]*K[1]=1&&(z=0),a===0&&z>0&&(z=z-2*Math.PI),a===1&&z<0&&(z=z+2*Math.PI),[E,k,s,l,R,z,d,a]}}zn.prototype.className="Path";zn.prototype._attrsAffectingSize=["data"];Or(zn);ee.addGetterSetter(zn,"data");class gp extends hc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],v=zn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=zn.getPointOnQuadraticBezier(Math.min(1,1-a/v),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var d=(Math.atan2(u,l)+n)%n,h=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}gp.prototype.className="Arrow";Or(gp);ee.addGetterSetter(gp,"pointerLength",10,Ye());ee.addGetterSetter(gp,"pointerWidth",10,Ye());ee.addGetterSetter(gp,"pointerAtBeginning",!1);ee.addGetterSetter(gp,"pointerAtEnding",!0);let A0=class extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};A0.prototype._centroid=!0;A0.prototype.className="Circle";A0.prototype._attrsAffectingSize=["radius"];Or(A0);ee.addGetterSetter(A0,"radius",0,Ye());class pf extends $e{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}pf.prototype.className="Ellipse";pf.prototype._centroid=!0;pf.prototype._attrsAffectingSize=["radiusX","radiusY"];Or(pf);ee.addComponentsGetterSetter(pf,"radius",["x","y"]);ee.addGetterSetter(pf,"radiusX",0,Ye());ee.addGetterSetter(pf,"radiusY",0,Ye());let pc=class FG extends $e{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.attrs.image;let o;if(i){const a=this.attrs.cropWidth,s=this.attrs.cropHeight;a&&s?o=[i,this.cropX(),this.cropY(),a,s,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&t.drawImage.apply(t,o)}_hitFunc(t){var n=this.width(),r=this.height();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=de.createImageElement();i.onload=function(){var o=new FG({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};pc.prototype.className="Image";Or(pc);ee.addGetterSetter(pc,"image");ee.addComponentsGetterSetter(pc,"crop",["x","y","width","height"]);ee.addGetterSetter(pc,"cropX",0,Ye());ee.addGetterSetter(pc,"cropY",0,Ye());ee.addGetterSetter(pc,"cropWidth",0,Ye());ee.addGetterSetter(pc,"cropHeight",0,Ye());var zG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],L9e="Change.konva",A9e="none",D8="up",N8="right",j8="down",B8="left",O9e=zG.length;class kP extends s0{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}vp.prototype.className="RegularPolygon";vp.prototype._centroid=!0;vp.prototype._attrsAffectingSize=["radius"];Or(vp);ee.addGetterSetter(vp,"radius",0,Ye());ee.addGetterSetter(vp,"sides",0,Ye());var aD=Math.PI*2;class yp extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,aD,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),aD,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}yp.prototype.className="Ring";yp.prototype._centroid=!0;yp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Or(yp);ee.addGetterSetter(yp,"innerRadius",0,Ye());ee.addGetterSetter(yp,"outerRadius",0,Ye());class vu extends $e{constructor(t){super(t),this._updated=!0,this.anim=new rs(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],d=o[i+3],h=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,d),t.closePath(),t.fillStrokeShape(this)),h)if(a){var m=a[n],v=r*2;t.drawImage(h,s,l,u,d,m[v+0],m[v+1],u,d)}else t.drawImage(h,s,l,u,d,0,0,u,d)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],d=r*2;t.rect(u[d+0],u[d+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Wb;function jC(){return Wb||(Wb=de.createCanvasElement().getContext(R9e),Wb)}function U9e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function G9e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function q9e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Ar extends $e{constructor(t){super(q9e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(E+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=de._isString(t)?t:t==null?"":t+"";return this._setAttr(D9e,n),this}getWidth(){var t=this.attrs.width===Bg||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Bg||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return de.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=jC(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+Vb+this.fontVariant()+Vb+(this.fontSize()+$9e)+W9e(this.fontFamily())}_addTextLine(t){this.align()===fv&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return jC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` +`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Bg&&o!==void 0,l=a!==Bg&&a!==void 0,u=this.padding(),d=o-u*2,h=a-u*2,m=0,v=this.wrap(),b=v!==uD,S=v!==H9e&&b,_=this.ellipsis();this.textArr=[],jC().font=this._getContextFont();for(var E=_?this._getTextWidth(NC):0,k=0,T=t.length;kd)for(;A.length>0;){for(var R=0,D=A.length,j="",z=0;R>>1,K=A.slice(0,H+1),te=this._getTextWidth(K)+E;te<=d?(R=H+1,j=K,z=te):D=H}if(j){if(S){var G,$=A[j.length],W=$===Vb||$===sD;W&&z<=d?G=j.length:G=Math.max(j.lastIndexOf(Vb),j.lastIndexOf(sD))+1,G>0&&(R=G,j=j.slice(0,R),z=this._getTextWidth(j))}j=j.trimRight(),this._addTextLine(j),r=Math.max(r,z),m+=i;var X=this._shouldHandleEllipsis(m);if(X){this._tryToAddEllipsisToLastLine();break}if(A=A.slice(R),A=A.trimLeft(),A.length>0&&(M=this._getTextWidth(A),M<=d)){this._addTextLine(A),m+=i,r=Math.max(r,M);break}}else break}else this._addTextLine(A),m+=i,r=Math.max(r,M),this._shouldHandleEllipsis(m)&&kh)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Bg&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==uD;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Bg&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+NC)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var d=HG(this.text()),h=this.text().split(" ").length-1,m,v,b,S=-1,_=0,E=function(){_=0;for(var te=t.dataArray,G=S+1;G0)return S=G,te[G];te[G].command==="M"&&(m={x:te[G].points[0],y:te[G].points[1]})}return{}},k=function(te){var G=t._getTextSize(te).width+r;te===" "&&i==="justify"&&(G+=(s-a)/h);var $=0,W=0;for(v=void 0;Math.abs(G-$)/G>.01&&W<20;){W++;for(var X=$;b===void 0;)b=E(),b&&X+b.pathLengthG?v=zn.getPointOnLine(G,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var U=b.points[4],Q=b.points[5],re=b.points[4]+Q;_===0?_=U+1e-8:G>$?_+=Math.PI/180*Q/Math.abs(Q):_-=Math.PI/360*Q/Math.abs(Q),(Q<0&&_=0&&_>re)&&(_=re,Z=!0),v=zn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],_,b.points[6]);break;case"C":_===0?G>b.pathLength?_=1e-8:_=G/b.pathLength:G>$?_+=(G-$)/b.pathLength/2:_=Math.max(_-($-G)/b.pathLength/2,0),_>1&&(_=1,Z=!0),v=zn.getPointOnCubicBezier(_,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":_===0?_=G/b.pathLength:G>$?_+=(G-$)/b.pathLength:_-=($-G)/b.pathLength,_>1&&(_=1,Z=!0),v=zn.getPointOnQuadraticBezier(_,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}v!==void 0&&($=zn.getLineLength(m.x,m.y,v.x,v.y)),Z&&(Z=!1,b=void 0)}},T="C",A=t._getTextSize(T).width+r,M=u/A-1,R=0;Re+`.${KG}`).join(" "),cD="nodesRect",X9e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Z9e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const Q9e="ontouchstart"in gt._global;function J9e(e,t){if(e==="rotater")return"crosshair";t+=de.degToRad(Z9e[e]||0);var n=(de.radToDeg(t)%360+360)%360;return de._inRange(n,315+22.5,360)||de._inRange(n,0,22.5)?"ns-resize":de._inRange(n,45-22.5,45+22.5)?"nesw-resize":de._inRange(n,90-22.5,90+22.5)?"ew-resize":de._inRange(n,135-22.5,135+22.5)?"nwse-resize":de._inRange(n,180-22.5,180+22.5)?"ns-resize":de._inRange(n,225-22.5,225+22.5)?"nesw-resize":de._inRange(n,270-22.5,270+22.5)?"ew-resize":de._inRange(n,315-22.5,315+22.5)?"nwse-resize":(de.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var rS=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],dD=1e8;function e8e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function XG(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function t8e(e,t){const n=e8e(e);return XG(e,t,n)}function n8e(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(X9e.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(cD),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(cD,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(gt.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return XG(d,-gt.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-dD,y:-dD,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const d=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var h=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],m=u.getAbsoluteTransform();h.forEach(function(v){var b=m.point(v);n.push(b)})});const r=new Ea;r.rotate(-gt.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var d=r.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:gt.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),rS.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new Hy({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Q9e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=gt.getAngle(this.rotation()),o=J9e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new $e({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*de._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const d=o.getAbsolutePosition();if(!(u.x===d.x&&u.y===d.y)){if(this._movingAnchorName==="rotater"){var h=this._getNodeRect();n=o.x()-h.width/2,r=-o.y()+h.height/2;let te=Math.atan2(-r,n)+Math.PI/2;h.height<0&&(te-=Math.PI);var m=gt.getAngle(this.rotation());const G=m+te,$=gt.getAngle(this.rotationSnapTolerance()),X=n8e(this.rotationSnaps(),G,$)-h.rotation,Z=t8e(h,X);this._fitNodesInto(Z,t);return}var v=this.keepRatio()||t.shiftKey,k=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(v){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var S=this.findOne(".top-left").x()>b.x?-1:1,_=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*S,r=i*this.sin*_,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(v){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-b.x,2)+Math.pow(b.y-o.y(),2));var S=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*S,r=i*this.sin*_,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var E=o.position();this.findOne(".top-left").y(E.y),this.findOne(".bottom-right").x(E.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(v){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var S=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(de._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(de._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new Ea;if(a.rotate(gt.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const h=a.point({x:-this.padding()*2,y:0});if(t.x+=h.x,t.y+=h.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const h=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const h=a.point({x:0,y:-this.padding()*2});if(t.x+=h.x,t.y+=h.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const h=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const h=this.boundBoxFunc()(r,t);h?t=h:de.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new Ea;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new Ea;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const d=u.multiply(l.invert());this._nodes.forEach(h=>{var m;const v=h.getParent().getAbsoluteTransform(),b=h.getTransform().copy();b.translate(h.offsetX(),h.offsetY());const S=new Ea;S.multiply(v.copy().invert()).multiply(d).multiply(v).multiply(b);const _=S.decompose();h.setAttrs(_),this._fire("transform",{evt:n,target:h}),h._fire("transform",{evt:n,target:h}),(m=h.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(de._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(de._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*de._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),s0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Qe.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function r8e(e){return e instanceof Array||de.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){rS.indexOf(t)===-1&&de.warn("Unknown anchor name: "+t+". Available names are: "+rS.join(", "))}),e||[]}In.prototype.className="Transformer";Or(In);ee.addGetterSetter(In,"enabledAnchors",rS,r8e);ee.addGetterSetter(In,"flipEnabled",!0,il());ee.addGetterSetter(In,"resizeEnabled",!0);ee.addGetterSetter(In,"anchorSize",10,Ye());ee.addGetterSetter(In,"rotateEnabled",!0);ee.addGetterSetter(In,"rotationSnaps",[]);ee.addGetterSetter(In,"rotateAnchorOffset",50,Ye());ee.addGetterSetter(In,"rotationSnapTolerance",5,Ye());ee.addGetterSetter(In,"borderEnabled",!0);ee.addGetterSetter(In,"anchorStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"anchorStrokeWidth",1,Ye());ee.addGetterSetter(In,"anchorFill","white");ee.addGetterSetter(In,"anchorCornerRadius",0,Ye());ee.addGetterSetter(In,"borderStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"borderStrokeWidth",1,Ye());ee.addGetterSetter(In,"borderDash");ee.addGetterSetter(In,"keepRatio",!0);ee.addGetterSetter(In,"centeredScaling",!1);ee.addGetterSetter(In,"ignoreStroke",!1);ee.addGetterSetter(In,"padding",0,Ye());ee.addGetterSetter(In,"node");ee.addGetterSetter(In,"nodes");ee.addGetterSetter(In,"boundBoxFunc");ee.addGetterSetter(In,"anchorDragBoundFunc");ee.addGetterSetter(In,"shouldOverdrawWholeArea",!1);ee.addGetterSetter(In,"useSingleNodeRotation",!0);ee.backCompat(In,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class gc extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,gt.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}gc.prototype.className="Wedge";gc.prototype._centroid=!0;gc.prototype._attrsAffectingSize=["radius"];Or(gc);ee.addGetterSetter(gc,"radius",0,Ye());ee.addGetterSetter(gc,"angle",0,Ye());ee.addGetterSetter(gc,"clockwise",!1);ee.backCompat(gc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function fD(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var i8e=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],o8e=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function a8e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,d,h,m,v,b,S,_,E,k,T,A,M,R,D,j,z,H,K,te,G=t+t+1,$=r-1,W=i-1,X=t+1,Z=X*(X+1)/2,U=new fD,Q=null,re=U,fe=null,Ee=null,be=i8e[t],ye=o8e[t];for(s=1;s>ye,K!==0?(K=255/K,n[d]=(m*be>>ye)*K,n[d+1]=(v*be>>ye)*K,n[d+2]=(b*be>>ye)*K):n[d]=n[d+1]=n[d+2]=0,m-=_,v-=E,b-=k,S-=T,_-=fe.r,E-=fe.g,k-=fe.b,T-=fe.a,l=h+((l=o+t+1)<$?l:$)<<2,A+=fe.r=n[l],M+=fe.g=n[l+1],R+=fe.b=n[l+2],D+=fe.a=n[l+3],m+=A,v+=M,b+=R,S+=D,fe=fe.next,_+=j=Ee.r,E+=z=Ee.g,k+=H=Ee.b,T+=K=Ee.a,A-=j,M-=z,R-=H,D-=K,Ee=Ee.next,d+=4;h+=r}for(o=0;o>ye,K>0?(K=255/K,n[l]=(m*be>>ye)*K,n[l+1]=(v*be>>ye)*K,n[l+2]=(b*be>>ye)*K):n[l]=n[l+1]=n[l+2]=0,m-=_,v-=E,b-=k,S-=T,_-=fe.r,E-=fe.g,k-=fe.b,T-=fe.a,l=o+((l=a+X)0&&a8e(t,n)};ee.addGetterSetter(Qe,"blurRadius",0,Ye(),ee.afterSetFilter);const l8e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};ee.addGetterSetter(Qe,"contrast",0,Ye(),ee.afterSetFilter);const c8e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,d=l*4,h=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:de.error("Unknown emboss direction: "+r)}do{var m=(h-1)*d,v=o;h+v<1&&(v=0),h+v>u&&(v=0);var b=(h-1+v)*l*4,S=l;do{var _=m+(S-1)*4,E=a;S+E<1&&(E=0),S+E>l&&(E=0);var k=b+(S-1+E)*4,T=s[_]-s[k],A=s[_+1]-s[k+1],M=s[_+2]-s[k+2],R=T,D=R>0?R:-R,j=A>0?A:-A,z=M>0?M:-M;if(j>D&&(R=A),z>D&&(R=M),R*=t,i){var H=s[_]+R,K=s[_+1]+R,te=s[_+2]+R;s[_]=H>255?255:H<0?0:H,s[_+1]=K>255?255:K<0?0:K,s[_+2]=te>255?255:te<0?0:te}else{var G=n-R;G<0?G=0:G>255&&(G=255),s[_]=s[_+1]=s[_+2]=G}}while(--S)}while(--h)};ee.addGetterSetter(Qe,"embossStrength",.5,Ye(),ee.afterSetFilter);ee.addGetterSetter(Qe,"embossWhiteLevel",.5,Ye(),ee.afterSetFilter);ee.addGetterSetter(Qe,"embossDirection","top-left",null,ee.afterSetFilter);ee.addGetterSetter(Qe,"embossBlend",!1,null,ee.afterSetFilter);function BC(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const d8e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],d=u,h,m,v=this.enhance();if(v!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),h=t[m+2],hd&&(d=h);i===r&&(i=255,r=0),s===a&&(s=255,a=0),d===u&&(d=255,u=0);var b,S,_,E,k,T,A,M,R;for(v>0?(S=i+v*(255-i),_=r-v*(r-0),k=s+v*(255-s),T=a-v*(a-0),M=d+v*(255-d),R=u-v*(u-0)):(b=(i+r)*.5,S=i+v*(i-b),_=r+v*(r-b),E=(s+a)*.5,k=s+v*(s-E),T=a+v*(a-E),A=(d+u)*.5,M=d+v*(d-A),R=u+v*(u-A)),m=0;mE?_:E;var k=a,T=o,A,M,R=360/T*Math.PI/180,D,j;for(M=0;MT?k:T;var A=a,M=o,R,D,j=n.polarRotation||0,z,H;for(d=0;dt&&(A=T,M=0,R=-1),i=0;i=0&&v=0&&b=0&&v=0&&b=255*4?255:0}return a}function _8e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&v=0&&b=n))for(o=S;o<_;o+=1)o>=r||(a=(n*o+i)*4,s+=A[a+0],l+=A[a+1],u+=A[a+2],d+=A[a+3],T+=1);for(s=s/T,l=l/T,u=u/T,d=d/T,i=v;i=n))for(o=S;o<_;o+=1)o>=r||(a=(n*o+i)*4,A[a+0]=s,A[a+1]=l,A[a+2]=u,A[a+3]=d)}};ee.addGetterSetter(Qe,"pixelSize",8,Ye(),ee.afterSetFilter);const T8e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"blue",0,yG,ee.afterSetFilter);const A8e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"blue",0,yG,ee.afterSetFilter);ee.addGetterSetter(Qe,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const O8e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),d>127&&(d=255-d),h>127&&(h=255-h),t[l]=u,t[l+1]=d,t[l+2]=h}while(--s)}while(--o)},I8e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new Vg.Stage({container:i,width:n,height:r}),a=new Vg.Layer,s=new Vg.Layer;a.add(new Vg.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new Vg.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l};let ZG=null,QG=null;const D8e=e=>{ZG=e},nl=()=>ZG,N8e=e=>{QG=e},JG=()=>QG,j8e=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},eq=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),B8e=e=>{const t=nl(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:o,systemState:a}=e,{codeformerFidelity:s,facetoolStrength:l,facetoolType:u,hiresFix:d,hiresStrength:h,shouldRunESRGAN:m,shouldRunFacetool:v,upscalingLevel:b,upscalingStrength:S,upscalingDenoising:_}=i,{cfgScale:E,height:k,img2imgStrength:T,infillMethod:A,initialImage:M,iterations:R,perlin:D,prompt:j,negativePrompt:z,sampler:H,seamBlur:K,seamless:te,seamSize:G,seamSteps:$,seamStrength:W,seed:X,seedWeights:Z,shouldFitToWidthHeight:U,shouldGenerateVariations:Q,shouldRandomizeSeed:re,steps:fe,threshold:Ee,tileSize:be,variationAmount:ye,width:Fe}=r,{shouldDisplayInProgressType:Me,saveIntermediatesInterval:rt,enableImageDebugging:Ve}=a,je={prompt:j,iterations:R,steps:fe,cfg_scale:E,threshold:Ee,perlin:D,height:k,width:Fe,sampler_name:H,seed:X,progress_images:Me==="full-res",progress_latents:Me==="latents",save_intermediates:rt,generation_mode:n,init_mask:""};let wt=!1,Be=!1;if(z!==""&&(je.prompt=`${j} [${z}]`),je.seed=re?eq(bP,SP):X,["txt2img","img2img"].includes(n)&&(je.seamless=te,je.hires_fix=d,d&&(je.strength=h),m&&(wt={level:b,denoise_str:_,strength:S}),v&&(Be={type:u,strength:l},u==="codeformer"&&(Be.codeformer_fidelity=s))),n==="img2img"&&M&&(je.init_img=typeof M=="string"?M:M.url,je.strength=T,je.fit=U),n==="unifiedCanvas"&&t){const{layerState:{objects:at},boundingBoxCoordinates:bt,boundingBoxDimensions:Le,stageScale:ut,isMaskEnabled:Mt,shouldPreserveMaskedArea:ct,boundingBoxScaleMethod:_t,scaledBoundingBoxDimensions:un}=o,ae={...bt,...Le},De=R8e(Mt?at.filter(sP):[],ae);je.init_mask=De,je.fit=!1,je.strength=T,je.invert_mask=ct,je.bounding_box=ae;const Ke=t.scale();t.scale({x:1/ut,y:1/ut});const Xe=t.getAbsolutePosition(),xe=t.toDataURL({x:ae.x+Xe.x,y:ae.y+Xe.y,width:ae.width,height:ae.height});Ve&&j8e([{base64:De,caption:"mask sent as init_mask"},{base64:xe,caption:"image sent as init_img"}]),t.scale(Ke),je.init_img=xe,je.progress_images=!1,_t!=="none"&&(je.inpaint_width=un.width,je.inpaint_height=un.height),je.seam_size=G,je.seam_blur=K,je.seam_strength=W,je.seam_steps=$,je.tile_size=be,je.infill_method=A,je.force_outpaint=!1}return Q?(je.variation_amount=ye,Z&&(je.with_variations=dwe(Z))):je.variation_amount=0,Ve&&(je.enable_image_debugging=Ve),{generationParameters:je,esrganParameters:wt,facetoolParameters:Be}};var $8e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,F8e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,z8e=/[^-+\dA-Z]/g;function no(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(hD[t]||t||hD.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},d=function(){return e[o()+"Hours"]()},h=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},v=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},S=function(){return H8e(e)},_=function(){return V8e(e)},E={d:function(){return a()},dd:function(){return Ca(a())},ddd:function(){return Go.dayNames[s()]},DDD:function(){return pD({y:u(),m:l(),d:a(),_:o(),dayName:Go.dayNames[s()],short:!0})},dddd:function(){return Go.dayNames[s()+7]},DDDD:function(){return pD({y:u(),m:l(),d:a(),_:o(),dayName:Go.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Ca(l()+1)},mmm:function(){return Go.monthNames[l()]},mmmm:function(){return Go.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return Ca(u(),4)},h:function(){return d()%12||12},hh:function(){return Ca(d()%12||12)},H:function(){return d()},HH:function(){return Ca(d())},M:function(){return h()},MM:function(){return Ca(h())},s:function(){return m()},ss:function(){return Ca(m())},l:function(){return Ca(v(),3)},L:function(){return Ca(Math.floor(v()/10))},t:function(){return d()<12?Go.timeNames[0]:Go.timeNames[1]},tt:function(){return d()<12?Go.timeNames[2]:Go.timeNames[3]},T:function(){return d()<12?Go.timeNames[4]:Go.timeNames[5]},TT:function(){return d()<12?Go.timeNames[6]:Go.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":W8e(e)},o:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60),2)+":"+Ca(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return S()},WW:function(){return Ca(S())},N:function(){return _()}};return t.replace($8e,function(k){return k in E?E[k]():k.slice(1,k.length-1)})}var hD={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Go={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Ca=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},pD=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,d=new Date;d.setDate(d[o+"Date"]()-1);var h=new Date;h.setDate(h[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},v=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},S=function(){return d[o+"Date"]()},_=function(){return d[o+"Month"]()},E=function(){return d[o+"FullYear"]()},k=function(){return h[o+"Date"]()},T=function(){return h[o+"Month"]()},A=function(){return h[o+"FullYear"]()};return b()===n&&v()===r&&m()===i?l?"Tdy":"Today":E()===n&&_()===r&&S()===i?l?"Ysd":"Yesterday":A()===n&&T()===r&&k()===i?l?"Tmw":"Tomorrow":a},H8e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},V8e=function(t){var n=t.getDay();return n===0&&(n=7),n},W8e=function(t){return(String(t).match(F8e)||[""]).pop().replace(z8e,"").replace(/GMT\+0000/g,"UTC")};const U8e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(ns(!0));const o=r(),{generation:a,postprocessing:s,system:l,canvas:u}=o,d={generationMode:i,generationState:a,postprocessingState:s,canvasState:u,systemState:l};n(mCe());const{generationParameters:h,esrganParameters:m,facetoolParameters:v}=B8e(d);t.emit("generateImage",h,m,v),h.init_mask&&(h.init_mask=h.init_mask.substr(0,64).concat("...")),h.init_img&&(h.init_img=h.init_img.substr(0,64).concat("...")),n(to({timestamp:no(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...h,...m,...v})}`}))},emitRunESRGAN:i=>{n(ns(!0));const{postprocessing:{upscalingLevel:o,upscalingDenoising:a,upscalingStrength:s}}=r(),l={upscale:[o,a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(ns(!0));const{postprocessing:{facetoolType:o,facetoolStrength:a,codeformerFidelity:s}}=r(),l={facetool_strength:a};o==="codeformer"&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",i,{type:o,...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`Face restoration (${o}) requested: ${JSON.stringify({file:i.url,...l})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(fU(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitConvertToDiffusers:i=>{t.emit("convertToDiffusers",i)},emitRequestModelChange:i=>{n(hCe()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}};let Gb;const G8e=new Uint8Array(16);function q8e(){if(!Gb&&(Gb=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gb(G8e)}const Hi=[];for(let e=0;e<256;++e)Hi.push((e+256).toString(16).slice(1));function Y8e(e,t=0){return(Hi[e[t+0]]+Hi[e[t+1]]+Hi[e[t+2]]+Hi[e[t+3]]+"-"+Hi[e[t+4]]+Hi[e[t+5]]+"-"+Hi[e[t+6]]+Hi[e[t+7]]+"-"+Hi[e[t+8]]+Hi[e[t+9]]+"-"+Hi[e[t+10]]+Hi[e[t+11]]+Hi[e[t+12]]+Hi[e[t+13]]+Hi[e[t+14]]+Hi[e[t+15]]).toLowerCase()}const K8e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gD={randomUUID:K8e};function hm(e,t,n){if(gD.randomUUID&&!t&&!e)return gD.randomUUID();e=e||{};const r=e.random||(e.rng||q8e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Y8e(r)}const $8=Tr("socketio/generateImage"),X8e=Tr("socketio/runESRGAN"),Z8e=Tr("socketio/runFacetool"),Q8e=Tr("socketio/deleteImage"),F8=Tr("socketio/requestImages"),mD=Tr("socketio/requestNewImages"),J8e=Tr("socketio/cancelProcessing"),e_e=Tr("socketio/requestSystemConfig"),vD=Tr("socketio/searchForModels"),Vy=Tr("socketio/addNewModel"),t_e=Tr("socketio/deleteModel"),n_e=Tr("socketio/convertToDiffusers"),tq=Tr("socketio/requestModelChange"),r_e=Tr("socketio/saveStagingAreaImageToGallery"),i_e=Tr("socketio/requestEmptyTempFolder"),o_e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(RR(!0)),t(B4(zt.t("common:statusConnected"))),t(e_e());const r=n().gallery;r.categories.result.latest_mtime?t(mD("result")):t(F8("result")),r.categories.user.latest_mtime?t(mD("user")):t(F8("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(RR(!1)),t(B4(zt.t("common:statusDisconnected"))),t(to({timestamp:no(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:o}=i.ui,{shouldLoopback:a}=i.postprocessing,{boundingBox:s,generationMode:l,...u}=r,d={uuid:hm(),...u};if(["txt2img","img2img"].includes(l)&&t(cm({category:"result",image:{...d,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:h}=r;t(Axe({image:{...d,category:"temp"},boundingBox:h})),i.canvas.shouldAutoSave&&t(cm({image:{...d,category:"result"},category:"result"}))}if(a)switch(mP[o]){case"img2img":{t(P0(d));break}}t(EC()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(Jxe({uuid:hm(),...r,category:"result"})),r.isBase64||t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(cm({category:"result",image:{uuid:hm(),...r,category:"result"}})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(ns(!0)),t(uCe(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(to({timestamp:no(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(DR()),t(EC())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:hm(),...l}));t(Qxe({images:s,areMoreImagesAvailable:o,category:a})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(fCe());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(cm({category:"result",image:r})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(EC())),t(to({timestamp:no(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(fU(r));const{generation:{initialImage:o,maskPath:a}}=n();(o===i||(o==null?void 0:o.url)===i)&&t(vU()),a===i&&t(wU("")),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(cCe(r)),r.infill_methods.includes("patchmatch")||t(xU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(QU(i)),t(JU(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(Mb(o)),t(ns(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t(Ah({title:a?`${zt.t("modelmanager:modelUpdated")}: ${i}`:`${zt.t("modelmanager:modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(Mb(o)),t(ns(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`${zt.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t(Ah({title:`${zt.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(Mb(o)),t(B4(zt.t("common:statusModelChanged"))),t(ns(!1)),t(dm(!0)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(Mb(o)),t(ns(!1)),t(dm(!0)),t(DR()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Ah({title:zt.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},a_e=()=>{const{origin:e}=new URL(window.location.href),t=z4(e,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:d,onGenerationResult:h,onIntermediateResult:m,onProgressUpdate:v,onGalleryImages:b,onProcessingCanceled:S,onImageDeleted:_,onSystemConfig:E,onModelChanged:k,onFoundModels:T,onNewModelAdded:A,onModelDeleted:M,onModelChangeFailed:R,onTempFolderEmptied:D}=o_e(i),{emitGenerateImage:j,emitRunESRGAN:z,emitRunFacetool:H,emitDeleteImage:K,emitRequestImages:te,emitRequestNewImages:G,emitCancelProcessing:$,emitRequestSystemConfig:W,emitSearchForModels:X,emitAddNewModel:Z,emitDeleteModel:U,emitConvertToDiffusers:Q,emitRequestModelChange:re,emitSaveStagingAreaImageToGallery:fe,emitRequestEmptyTempFolder:Ee}=U8e(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",be=>u(be)),t.on("generationResult",be=>h(be)),t.on("postprocessingResult",be=>d(be)),t.on("intermediateResult",be=>m(be)),t.on("progressUpdate",be=>v(be)),t.on("galleryImages",be=>b(be)),t.on("processingCanceled",()=>{S()}),t.on("imageDeleted",be=>{_(be)}),t.on("systemConfig",be=>{E(be)}),t.on("foundModels",be=>{T(be)}),t.on("newModelAdded",be=>{A(be)}),t.on("modelDeleted",be=>{M(be)}),t.on("modelChanged",be=>{k(be)}),t.on("modelChangeFailed",be=>{R(be)}),t.on("tempFolderEmptied",()=>{D()}),n=!0),a.type){case"socketio/generateImage":{j(a.payload);break}case"socketio/runESRGAN":{z(a.payload);break}case"socketio/runFacetool":{H(a.payload);break}case"socketio/deleteImage":{K(a.payload);break}case"socketio/requestImages":{te(a.payload);break}case"socketio/requestNewImages":{G(a.payload);break}case"socketio/cancelProcessing":{$();break}case"socketio/requestSystemConfig":{W();break}case"socketio/searchForModels":{X(a.payload);break}case"socketio/addNewModel":{Z(a.payload);break}case"socketio/deleteModel":{U(a.payload);break}case"socketio/convertToDiffusers":{Q(a.payload);break}case"socketio/requestModelChange":{re(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{fe(a.payload);break}case"socketio/requestEmptyTempFolder":{Ee();break}}o(a)}},s_e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),l_e=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map(e=>`system.${e}`),u_e=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),nq=RW({generation:ywe,postprocessing:Cwe,gallery:awe,system:bCe,canvas:Xxe,ui:LCe,lightbox:uwe}),c_e=UW.getPersistConfig({key:"root",storage:WW,rootReducer:nq,blacklist:[...s_e,...l_e,...u_e],debounce:300}),d_e=rxe(c_e,nq),rq=ISe({reducer:d_e,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(a_e()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),iq=uxe(rq),EP=w.createContext(null),Oe=q5e,he=N5e;let yD;const PP=()=>({setOpenUploader:e=>{e&&(yD=e)},openUploader:yD}),Mr=lt(e=>e.ui,e=>mP[e.activeTab],{memoizeOptions:{equalityCheck:ke.isEqual}}),f_e=lt(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:ke.isEqual}}),bp=lt(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),bD=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Mr(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:a})).json(),u={uuid:hm(),category:"user",...l};t(cm({image:u,category:"user"})),o==="unifiedCanvas"?t($x(u)):o==="img2img"&&t(P0(u))};function h_e(){const{t:e}=Ue();return y.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[y.jsx("h1",{children:e("common:nodes")}),y.jsx("p",{children:e("common:nodesDesc")})]})}const p_e=()=>{const{t:e}=Ue();return y.jsxs("div",{className:"work-in-progress post-processing-work-in-progress",children:[y.jsx("h1",{children:e("common:postProcessing")}),y.jsx("p",{children:e("common:postProcessDesc1")}),y.jsx("p",{children:e("common:postProcessDesc2")}),y.jsx("p",{children:e("common:postProcessDesc3")})]})};function g_e(){const{t:e}=Ue();return y.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[y.jsx("h1",{children:e("common:training")}),y.jsxs("p",{children:[e("common:trainingDesc1"),y.jsx("br",{}),y.jsx("br",{}),e("common:trainingDesc2")]})]})}function m_e(e){const{i18n:t}=Ue(),n=localStorage.getItem("i18nextLng");N.useEffect(()=>{e()},[e]),N.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const v_e=yt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:y.jsx("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),y_e=yt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),b_e=yt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),S_e=yt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:y.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:y.jsx("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})}),x_e=yt({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),w_e=yt({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})}),Je=Ae((e,t)=>{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return y.jsx(uo,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:y.jsx(us,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})}),nr=Ae((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return y.jsx(uo,{label:r,...i,children:y.jsx(ls,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),Js=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return y.jsxs(BE,{...o,children:[y.jsx(zE,{children:t}),y.jsxs(FE,{className:`invokeai__popover-content ${r}`,children:[i&&y.jsx($E,{className:"invokeai__popover-arrow"}),n]})]})},qx=lt(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),SD=/^-?(0\.)?\.?$/,ia=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:d,min:h,max:m,isInteger:v=!0,formControlProps:b,formLabelProps:S,numberInputFieldProps:_,numberInputStepperProps:E,tooltipProps:k,...T}=e,[A,M]=w.useState(String(u));w.useEffect(()=>{!A.match(SD)&&u!==Number(A)&&M(String(u))},[u,A]);const R=j=>{M(j),j.match(SD)||d(v?Math.floor(Number(j)):Number(j))},D=j=>{const z=ke.clamp(v?Math.floor(Number(j.target.value)):Number(j.target.value),h,m);M(String(z)),d(z)};return y.jsx(uo,{...k,children:y.jsxs(fn,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&y.jsx(En,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...S,children:t}),y.jsxs(RE,{className:"invokeai__number-input-root",value:A,min:h,max:m,keepWithinRange:!0,clampValueOnBlur:!1,onChange:R,onBlur:D,width:a,...T,children:[y.jsx(DE,{className:"invokeai__number-input-field",textAlign:s,..._}),o&&y.jsxs("div",{className:"invokeai__number-input-stepper",children:[y.jsx(jE,{...E,className:"invokeai__number-input-stepper-button"}),y.jsx(NE,{...E,className:"invokeai__number-input-stepper-button"})]})]})]})})},rl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return y.jsxs(fn,{isDisabled:n,className:`invokeai__select ${l}`,onClick:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation(),d.nativeEvent.stopPropagation(),d.nativeEvent.cancelBubble=!0},children:[t&&y.jsx(En,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),y.jsx(uo,{label:i,...o,children:y.jsx(QV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(d=>typeof d=="string"||typeof d=="number"?y.jsx("option",{value:d,className:"invokeai__select-option",children:d},d):y.jsx("option",{value:d.value,className:"invokeai__select-option",children:d.key},d.value))})})]})},Wy=e=>e.postprocessing,or=e=>e.system,C_e=e=>e.system.toastQueue,oq=lt(or,e=>{const{model_list:t}=e,n=ke.reduce(t,(r,i,o)=>(i.status==="active"&&(r=o),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),__e=lt([Wy,or],({facetoolStrength:e,facetoolType:t,codeformerFidelity:n},{isGFPGANAvailable:r})=>({facetoolStrength:e,facetoolType:t,codeformerFidelity:n,isGFPGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),TP=()=>{const e=Oe(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r,isGFPGANAvailable:i}=he(__e),o=u=>e(g8(u)),a=u=>e(IU(u)),s=u=>e(j4(u.target.value)),{t:l}=Ue();return y.jsxs(Ge,{direction:"column",gap:2,children:[y.jsx(rl,{label:l("parameters:type"),validValues:w7e.concat(),value:n,onChange:s}),y.jsx(ia,{isDisabled:!i,label:l("parameters:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&y.jsx(ia,{isDisabled:!i,label:l("parameters:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};var aq={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},xD=N.createContext&&N.createContext(aq),Hd=globalThis&&globalThis.__assign||function(){return Hd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{Ee(i)},[i]);const be=w.useMemo(()=>W!=null&&W.max?W.max:a,[a,W==null?void 0:W.max]),ye=Ve=>{l(Ve)},Fe=Ve=>{Ve.target.value===""&&(Ve.target.value=String(o));const je=ke.clamp(S?Math.floor(Number(Ve.target.value)):Number(fe),o,be);l(je)},Me=Ve=>{Ee(Ve)},rt=()=>{M&&M()};return y.jsxs(fn,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":h,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...H,children:[y.jsx(En,{className:"invokeai__slider-component-label",...K,children:r}),y.jsxs(Ey,{w:"100%",gap:2,alignItems:"center",children:[y.jsxs(VE,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:ye,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...re,children:[h&&y.jsxs(y.Fragment,{children:[y.jsx(Q9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),y.jsx(Q9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:v,...te,children:a})]}),y.jsx(uW,{className:"invokeai__slider_track",...G,children:y.jsx(cW,{className:"invokeai__slider_track-filled"})}),y.jsx(uo,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${d}`,hidden:T,...U,children:y.jsx(lW,{className:"invokeai__slider-thumb",...$})})]}),b&&y.jsxs(RE,{min:o,max:be,step:s,value:fe,onChange:Me,onBlur:Fe,className:"invokeai__slider-number-field",isDisabled:j,...W,children:[y.jsx(DE,{className:"invokeai__slider-number-input",width:_,readOnly:E,minWidth:_,...X}),y.jsxs(VV,{...Z,children:[y.jsx(jE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"}),y.jsx(NE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"})]})]}),k&&y.jsx(Je,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:y.jsx(Yx,{}),onClick:rt,isDisabled:R,...Q})]})]})}const M_e=lt([Wy,or],({upscalingLevel:e,upscalingStrength:t,upscalingDenoising:n},{isESRGANAvailable:r})=>({upscalingLevel:e,upscalingDenoising:n,upscalingStrength:t,isESRGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),LP=()=>{const e=Oe(),{upscalingLevel:t,upscalingStrength:n,upscalingDenoising:r,isESRGANAvailable:i}=he(M_e),{t:o}=Ue(),a=l=>e(RU(Number(l.target.value))),s=l=>e(v8(l));return y.jsxs(Ge,{flexDir:"column",rowGap:"1rem",minWidth:"20rem",children:[y.jsx(rl,{isDisabled:!i,label:o("parameters:scale"),value:t,onChange:a,validValues:x7e}),y.jsx(so,{label:o("parameters:denoisingStrength"),value:r,min:0,max:1,step:.01,onChange:l=>{e(m8(l))},handleReset:()=>e(m8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i}),y.jsx(so,{label:`${o("parameters:upscale")} ${o("parameters:strength")}`,value:n,min:0,max:1,step:.05,onChange:s,handleReset:()=>e(v8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i})]})};var I_e=Object.create,uq=Object.defineProperty,R_e=Object.getOwnPropertyDescriptor,D_e=Object.getOwnPropertyNames,N_e=Object.getPrototypeOf,j_e=Object.prototype.hasOwnProperty,qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),B_e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of D_e(t))!j_e.call(e,i)&&i!==n&&uq(e,i,{get:()=>t[i],enumerable:!(r=R_e(t,i))||r.enumerable});return e},cq=(e,t,n)=>(n=e!=null?I_e(N_e(e)):{},B_e(t||!e||!e.__esModule?uq(n,"default",{value:e,enumerable:!0}):n,e)),$_e=qe((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),dq=qe((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Kx=qe((e,t)=>{var n=dq();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),F_e=qe((e,t)=>{var n=Kx(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),z_e=qe((e,t)=>{var n=Kx();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),H_e=qe((e,t)=>{var n=Kx();function r(i){return n(this.__data__,i)>-1}t.exports=r}),V_e=qe((e,t)=>{var n=Kx();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Xx=qe((e,t)=>{var n=$_e(),r=F_e(),i=z_e(),o=H_e(),a=V_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Xx();function r(){this.__data__=new n,this.size=0}t.exports=r}),U_e=qe((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),G_e=qe((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),q_e=qe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),fq=qe((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),mc=qe((e,t)=>{var n=fq(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),AP=qe((e,t)=>{var n=mc(),r=n.Symbol;t.exports=r}),Y_e=qe((e,t)=>{var n=AP(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),d=l[a];try{l[a]=void 0;var h=!0}catch{}var m=o.call(l);return h&&(u?l[a]=d:delete l[a]),m}t.exports=s}),K_e=qe((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),Zx=qe((e,t)=>{var n=AP(),r=Y_e(),i=K_e(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),hq=qe((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),pq=qe((e,t)=>{var n=Zx(),r=hq(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var d=n(u);return d==o||d==a||d==i||d==s}t.exports=l}),X_e=qe((e,t)=>{var n=mc(),r=n["__core-js_shared__"];t.exports=r}),Z_e=qe((e,t)=>{var n=X_e(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),gq=qe((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch{}try{return o+""}catch{}}return""}t.exports=i}),Q_e=qe((e,t)=>{var n=pq(),r=Z_e(),i=hq(),o=gq(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,h=u.hasOwnProperty,m=RegExp("^"+d.call(h).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(b){if(!i(b)||r(b))return!1;var S=n(b)?m:s;return S.test(o(b))}t.exports=v}),J_e=qe((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),O0=qe((e,t)=>{var n=Q_e(),r=J_e();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),OP=qe((e,t)=>{var n=O0(),r=mc(),i=n(r,"Map");t.exports=i}),Qx=qe((e,t)=>{var n=O0(),r=n(Object,"create");t.exports=r}),eke=qe((e,t)=>{var n=Qx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),tke=qe((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),nke=qe((e,t)=>{var n=Qx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),rke=qe((e,t)=>{var n=Qx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),ike=qe((e,t)=>{var n=Qx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),oke=qe((e,t)=>{var n=eke(),r=tke(),i=nke(),o=rke(),a=ike();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=oke(),r=Xx(),i=OP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),ske=qe((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),Jx=qe((e,t)=>{var n=ske();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),lke=qe((e,t)=>{var n=Jx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),uke=qe((e,t)=>{var n=Jx();function r(i){return n(this,i).get(i)}t.exports=r}),cke=qe((e,t)=>{var n=Jx();function r(i){return n(this,i).has(i)}t.exports=r}),dke=qe((e,t)=>{var n=Jx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),mq=qe((e,t)=>{var n=ake(),r=lke(),i=uke(),o=cke(),a=dke();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Xx(),r=OP(),i=mq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var d=u.__data__;if(!r||d.length{var n=Xx(),r=W_e(),i=U_e(),o=G_e(),a=q_e(),s=fke();function l(u){var d=this.__data__=new n(u);this.size=d.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),pke=qe((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),gke=qe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),mke=qe((e,t)=>{var n=mq(),r=pke(),i=gke();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),vq=qe((e,t)=>{var n=mke(),r=vke(),i=yke(),o=1,a=2;function s(l,u,d,h,m,v){var b=d&o,S=l.length,_=u.length;if(S!=_&&!(b&&_>S))return!1;var E=v.get(l),k=v.get(u);if(E&&k)return E==u&&k==l;var T=-1,A=!0,M=d&a?new n:void 0;for(v.set(l,u),v.set(u,l);++T{var n=mc(),r=n.Uint8Array;t.exports=r}),Ske=qe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),xke=qe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),wke=qe((e,t)=>{var n=AP(),r=bke(),i=dq(),o=vq(),a=Ske(),s=xke(),l=1,u=2,d="[object Boolean]",h="[object Date]",m="[object Error]",v="[object Map]",b="[object Number]",S="[object RegExp]",_="[object Set]",E="[object String]",k="[object Symbol]",T="[object ArrayBuffer]",A="[object DataView]",M=n?n.prototype:void 0,R=M?M.valueOf:void 0;function D(j,z,H,K,te,G,$){switch(H){case A:if(j.byteLength!=z.byteLength||j.byteOffset!=z.byteOffset)return!1;j=j.buffer,z=z.buffer;case T:return!(j.byteLength!=z.byteLength||!G(new r(j),new r(z)));case d:case h:case b:return i(+j,+z);case m:return j.name==z.name&&j.message==z.message;case S:case E:return j==z+"";case v:var W=a;case _:var X=K&l;if(W||(W=s),j.size!=z.size&&!X)return!1;var Z=$.get(j);if(Z)return Z==z;K|=u,$.set(j,z);var U=o(W(j),W(z),K,te,G,$);return $.delete(j),U;case k:if(R)return R.call(j)==R.call(z)}return!1}t.exports=D}),Cke=qe((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),_ke=qe((e,t)=>{var n=Cke(),r=MP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),kke=qe((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),Pke=qe((e,t)=>{var n=kke(),r=Eke(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),Tke=qe((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),Lke=qe((e,t)=>{var n=Zx(),r=ew(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),Ake=qe((e,t)=>{var n=Lke(),r=ew(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),Oke=qe((e,t)=>{function n(){return!1}t.exports=n}),yq=qe((e,t)=>{var n=mc(),r=Oke(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),Mke=qe((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a??n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),Ike=qe((e,t)=>{var n=Zx(),r=bq(),i=ew(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",h="[object Map]",m="[object Number]",v="[object Object]",b="[object RegExp]",S="[object Set]",_="[object String]",E="[object WeakMap]",k="[object ArrayBuffer]",T="[object DataView]",A="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",j="[object Int32Array]",z="[object Uint8Array]",H="[object Uint8ClampedArray]",K="[object Uint16Array]",te="[object Uint32Array]",G={};G[A]=G[M]=G[R]=G[D]=G[j]=G[z]=G[H]=G[K]=G[te]=!0,G[o]=G[a]=G[k]=G[s]=G[T]=G[l]=G[u]=G[d]=G[h]=G[m]=G[v]=G[b]=G[S]=G[_]=G[E]=!1;function $(W){return i(W)&&r(W.length)&&!!G[n(W)]}t.exports=$}),Rke=qe((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),Dke=qe((e,t)=>{var n=fq(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s}),Sq=qe((e,t)=>{var n=Ike(),r=Rke(),i=Dke(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),Nke=qe((e,t)=>{var n=Tke(),r=Ake(),i=MP(),o=yq(),a=Mke(),s=Sq(),l=Object.prototype,u=l.hasOwnProperty;function d(h,m){var v=i(h),b=!v&&r(h),S=!v&&!b&&o(h),_=!v&&!b&&!S&&s(h),E=v||b||S||_,k=E?n(h.length,String):[],T=k.length;for(var A in h)(m||u.call(h,A))&&!(E&&(A=="length"||S&&(A=="offset"||A=="parent")||_&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,T)))&&k.push(A);return k}t.exports=d}),jke=qe((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),Bke=qe((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),$ke=qe((e,t)=>{var n=Bke(),r=n(Object.keys,Object);t.exports=r}),Fke=qe((e,t)=>{var n=jke(),r=$ke(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),zke=qe((e,t)=>{var n=pq(),r=bq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),Hke=qe((e,t)=>{var n=Nke(),r=Fke(),i=zke();function o(a){return i(a)?n(a):r(a)}t.exports=o}),Vke=qe((e,t)=>{var n=_ke(),r=Pke(),i=Hke();function o(a){return n(a,i,r)}t.exports=o}),Wke=qe((e,t)=>{var n=Vke(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,d,h,m){var v=u&r,b=n(s),S=b.length,_=n(l),E=_.length;if(S!=E&&!v)return!1;for(var k=S;k--;){var T=b[k];if(!(v?T in l:o.call(l,T)))return!1}var A=m.get(s),M=m.get(l);if(A&&M)return A==l&&M==s;var R=!0;m.set(s,l),m.set(l,s);for(var D=v;++k{var n=O0(),r=mc(),i=n(r,"DataView");t.exports=i}),Gke=qe((e,t)=>{var n=O0(),r=mc(),i=n(r,"Promise");t.exports=i}),qke=qe((e,t)=>{var n=O0(),r=mc(),i=n(r,"Set");t.exports=i}),Yke=qe((e,t)=>{var n=O0(),r=mc(),i=n(r,"WeakMap");t.exports=i}),Kke=qe((e,t)=>{var n=Uke(),r=OP(),i=Gke(),o=qke(),a=Yke(),s=Zx(),l=gq(),u="[object Map]",d="[object Object]",h="[object Promise]",m="[object Set]",v="[object WeakMap]",b="[object DataView]",S=l(n),_=l(r),E=l(i),k=l(o),T=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=h||o&&A(new o)!=m||a&&A(new a)!=v)&&(A=function(M){var R=s(M),D=R==d?M.constructor:void 0,j=D?l(D):"";if(j)switch(j){case S:return b;case _:return u;case E:return h;case k:return m;case T:return v}return R}),t.exports=A}),Xke=qe((e,t)=>{var n=hke(),r=vq(),i=wke(),o=Wke(),a=Kke(),s=MP(),l=yq(),u=Sq(),d=1,h="[object Arguments]",m="[object Array]",v="[object Object]",b=Object.prototype,S=b.hasOwnProperty;function _(E,k,T,A,M,R){var D=s(E),j=s(k),z=D?m:a(E),H=j?m:a(k);z=z==h?v:z,H=H==h?v:H;var K=z==v,te=H==v,G=z==H;if(G&&l(E)){if(!l(k))return!1;D=!0,K=!1}if(G&&!K)return R||(R=new n),D||u(E)?r(E,k,T,A,M,R):i(E,k,z,T,A,M,R);if(!(T&d)){var $=K&&S.call(E,"__wrapped__"),W=te&&S.call(k,"__wrapped__");if($||W){var X=$?E.value():E,Z=W?k.value():k;return R||(R=new n),M(X,Z,T,A,R)}}return G?(R||(R=new n),o(E,k,T,A,M,R)):!1}t.exports=_}),Zke=qe((e,t)=>{var n=Xke(),r=ew();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),xq=qe((e,t)=>{var n=Zke();function r(i,o){return n(i,o)}t.exports=r}),Qke=["ctrl","shift","alt","meta","mod"],Jke={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function $C(e,t=","){return typeof e=="string"?e.split(t):e}function h2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>Jke[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!Qke.includes(o));return{...r,keys:i}}function eEe(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function tEe(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function nEe(e){return wq(e,["input","textarea","select"])}function wq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function rEe(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var iEe=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:d,metaKey:h,shiftKey:m,key:v,code:b}=e,S=b.toLowerCase().replace("key",""),_=v.toLowerCase();if(u!==r&&_!=="alt"||m!==s&&_!=="shift")return!1;if(a){if(!h&&!d)return!1}else if(h!==o&&S!=="meta"||d!==i&&S!=="ctrl")return!1;return l&&l.length===1&&(l.includes(_)||l.includes(S))?!0:l?l.every(E=>n.has(E)):!l},oEe=w.createContext(void 0),aEe=()=>w.useContext(oEe),sEe=w.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),lEe=()=>w.useContext(sEe),uEe=cq(xq());function cEe(e){let t=w.useRef(void 0);return(0,uEe.default)(t.current,e)||(t.current=e),t.current}var wD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function et(e,t,n,r){let i=w.useRef(null),{current:o}=w.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=w.useCallback(t,[...s]),u=cEe(a),{enabledScopes:d}=lEe(),h=aEe();return w.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!rEe(d,u==null?void 0:u.scopes))return;let m=S=>{var _;if(!(nEe(S)&&!wq(S,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){wD(S);return}(_=S.target)!=null&&_.isContentEditable&&!(u!=null&&u.enableOnContentEditable)||$C(e,u==null?void 0:u.splitKey).forEach(E=>{var T;let k=h2(E,u==null?void 0:u.combinationKey);if(iEe(S,k,o)||(T=k.keys)!=null&&T.includes("*")){if(eEe(S,k,u==null?void 0:u.preventDefault),!tEe(S,k,u==null?void 0:u.enabled)){wD(S);return}l(S,k)}})}},v=S=>{o.add(S.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||u!=null&&u.keydown)&&m(S)},b=S=>{S.key.toLowerCase()!=="meta"?o.delete(S.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(S)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",v),h&&$C(e,u==null?void 0:u.splitKey).forEach(S=>h.addHotkey(h2(S,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",v),h&&$C(e,u==null?void 0:u.splitKey).forEach(S=>h.removeHotkey(h2(S,u==null?void 0:u.combinationKey)))}},[e,l,u,d]),i}cq(xq());var z8=new Set;function dEe(e){(Array.isArray(e)?e:[e]).forEach(t=>z8.add(h2(t)))}function fEe(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=h2(t);for(let i of z8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&z8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{dEe(e.key)}),document.addEventListener("keyup",e=>{fEe(e.key)})});function hEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function pEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function gEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function Cq(e){return mt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function _q(e){return mt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function mEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function vEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function kq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function yEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function bEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function IP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function Eq(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function l0(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function Pq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function SEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function RP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function Tq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function xEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function wEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function Lq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function CEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function _Ee(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function Aq(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function kEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function EEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function PEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function TEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"}}]})(e)}function Oq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function LEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function AEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function Mq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function OEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function MEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function Uy(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function IEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function REe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function DEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function DP(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function NEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function jEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function CD(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function NP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function BEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function Sp(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function $Ee(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function tw(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function FEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function jP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const ln=e=>e.canvas,Ir=lt([ln,Mr,or],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Iq=e=>e.canvas.layerState.objects.find(Y5),xp=e=>e.gallery,zEe=lt([xp,qx,Ir,Mr],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,galleryWidth:b,shouldUseSingleGalleryColumn:S}=e,{isLightboxOpen:_}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,galleryGridTemplateColumns:S?"auto":`repeat(auto-fill, minmax(${d}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightboxOpen:_,isStaging:n,shouldEnableResize:!(_||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:S}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HEe=lt([xp,or,qx,Mr],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VEe=lt(or,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),iS=w.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Gh(),a=Oe(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=he(VEe),d=w.useRef(null),h=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(Q8e(e)),o()};et("delete",()=>{s?i():m()},[e,s,l,u]);const v=b=>a(XU(!b.target.checked));return y.jsxs(y.Fragment,{children:[w.cloneElement(t,{onClick:e?h:void 0,ref:n}),y.jsx(FV,{isOpen:r,leastDestructiveRef:d,onClose:o,children:y.jsx(Zd,{children:y.jsxs(zV,{className:"modal",children:[y.jsx(_0,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),y.jsx(o0,{children:y.jsxs(Ge,{direction:"column",gap:5,children:[y.jsx(Jt,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),y.jsx(fn,{children:y.jsxs(Ge,{alignItems:"center",children:[y.jsx(En,{mb:0,children:"Don't ask me again"}),y.jsx(WE,{checked:!s,onChange:v})]})})]})}),y.jsxs(wx,{children:[y.jsx(ls,{ref:d,onClick:o,className:"modal-close-btn",children:"Cancel"}),y.jsx(ls,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})});iS.displayName="DeleteImageModal";const WEe=lt([or,xp,Wy,bp,qx,Mr],(e,t,n,r,i,o)=>{const{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u}=e,{upscalingLevel:d,facetoolStrength:h}=n,{isLightboxOpen:m}=i,{shouldShowImageDetails:v}=r,{intermediateImage:b,currentImage:S}=t;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:d,facetoolStrength:h,shouldDisableToolbarButtons:Boolean(b)||!S,currentImage:S,shouldShowImageDetails:v,activeTabName:o,isLightboxOpen:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),Rq=()=>{var z,H,K,te,G,$;const e=Oe(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightboxOpen:d,activeTabName:h}=he(WEe),m=By(),{t:v}=Ue(),b=()=>{u&&(d&&e(zm(!1)),e(P0(u)),e(Yo("img2img")))},S=async()=>{if(!u)return;const W=await fetch(u.url).then(Z=>Z.blob()),X=[new ClipboardItem({[W.type]:W})];await navigator.clipboard.write(X),m({title:v("toast:imageCopied"),status:"success",duration:2500,isClosable:!0})},_=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:v("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};et("shift+i",()=>{u?(b(),m({title:v("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:imageNotLoaded"),description:v("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var W,X;u&&(u.metadata&&e(yU(u.metadata)),((W=u.metadata)==null?void 0:W.image.type)==="img2img"?e(Yo("img2img")):((X=u.metadata)==null?void 0:X.image.type)==="txt2img"&&e(Yo("txt2img")))};et("a",()=>{var W,X;["txt2img","img2img"].includes((X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)==null?void 0:X.type)?(E(),m({title:v("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:parametersNotSet"),description:v("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const k=()=>{u!=null&&u.metadata&&e(Fy(u.metadata.image.seed))};et("s",()=>{var W,X;(X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.seed?(k(),m({title:v("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:seedNotSet"),description:v("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const T=()=>{var W,X,Z,U;if((X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.prompt){const[Q,re]=fP((U=(Z=u==null?void 0:u.metadata)==null?void 0:Z.image)==null?void 0:U.prompt);Q&&e(Fx(Q)),e(ny(re||""))}};et("p",()=>{var W,X;(X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.prompt?(T(),m({title:v("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:promptNotSet"),description:v("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const A=()=>{u&&e(X8e(u))};et("Shift+U",()=>{i&&!s&&n&&!t&&o?A():m({title:v("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const M=()=>{u&&e(Z8e(u))};et("Shift+R",()=>{r&&!s&&n&&!t&&a?M():m({title:v("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(tG(!l)),D=()=>{u&&(d&&e(zm(!1)),e($x(u)),e(vi(!0)),h!=="unifiedCanvas"&&e(Yo("unifiedCanvas")),m({title:v("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};et("i",()=>{u?R():m({title:v("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const j=()=>{e(zm(!d))};return y.jsxs("div",{className:"current-image-options",children:[y.jsxs(oo,{isAttached:!0,children:[y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{"aria-label":`${v("parameters:sendTo")}...`,icon:y.jsx(jEe,{})}),children:y.jsxs("div",{className:"current-image-send-to-popover",children:[y.jsx(nr,{size:"sm",onClick:b,leftIcon:y.jsx(CD,{}),children:v("parameters:sendToImg2Img")}),y.jsx(nr,{size:"sm",onClick:D,leftIcon:y.jsx(CD,{}),children:v("parameters:sendToUnifiedCanvas")}),y.jsx(nr,{size:"sm",onClick:S,leftIcon:y.jsx(l0,{}),children:v("parameters:copyImage")}),y.jsx(nr,{size:"sm",onClick:_,leftIcon:y.jsx(l0,{}),children:v("parameters:copyImageToLink")}),y.jsx(Bh,{download:!0,href:u==null?void 0:u.url,children:y.jsx(nr,{leftIcon:y.jsx(RP,{}),size:"sm",w:"100%",children:v("parameters:downloadImage")})})]})}),y.jsx(Je,{icon:y.jsx(wEe,{}),tooltip:d?`${v("parameters:closeViewer")} (Z)`:`${v("parameters:openInViewer")} (Z)`,"aria-label":d?`${v("parameters:closeViewer")} (Z)`:`${v("parameters:openInViewer")} (Z)`,"data-selected":d,onClick:j})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{icon:y.jsx(IEe,{}),tooltip:`${v("parameters:usePrompt")} (P)`,"aria-label":`${v("parameters:usePrompt")} (P)`,isDisabled:!((H=(z=u==null?void 0:u.metadata)==null?void 0:z.image)!=null&&H.prompt),onClick:T}),y.jsx(Je,{icon:y.jsx(NEe,{}),tooltip:`${v("parameters:useSeed")} (S)`,"aria-label":`${v("parameters:useSeed")} (S)`,isDisabled:!((te=(K=u==null?void 0:u.metadata)==null?void 0:K.image)!=null&&te.seed),onClick:k}),y.jsx(Je,{icon:y.jsx(yEe,{}),tooltip:`${v("parameters:useAll")} (A)`,"aria-label":`${v("parameters:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes(($=(G=u==null?void 0:u.metadata)==null?void 0:G.image)==null?void 0:$.type),onClick:E})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{icon:y.jsx(kEe,{}),"aria-label":v("parameters:restoreFaces")}),children:y.jsxs("div",{className:"current-image-postprocessing-popover",children:[y.jsx(TP,{}),y.jsx(nr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:M,children:v("parameters:restoreFaces")})]})}),y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{icon:y.jsx(xEe,{}),"aria-label":v("parameters:upscale")}),children:y.jsxs("div",{className:"current-image-postprocessing-popover",children:[y.jsx(LP,{}),y.jsx(nr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:A,children:v("parameters:upscaleImage")})]})})]}),y.jsx(oo,{isAttached:!0,children:y.jsx(Je,{icon:y.jsx(Eq,{}),tooltip:`${v("parameters:info")} (I)`,"aria-label":`${v("parameters:info")} (I)`,"data-selected":l,onClick:R})}),y.jsx(iS,{image:u,children:y.jsx(Je,{icon:y.jsx(Sp,{}),tooltip:`${v("parameters:deleteImage")} (Del)`,"aria-label":`${v("parameters:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};yt({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});yt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});yt({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});yt({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});yt({displayName:"SunIcon",path:N.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},N.createElement("circle",{cx:"12",cy:"12",r:"5"}),N.createElement("path",{d:"M12 1v2"}),N.createElement("path",{d:"M12 21v2"}),N.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),N.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),N.createElement("path",{d:"M1 12h2"}),N.createElement("path",{d:"M21 12h2"}),N.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),N.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))});yt({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});yt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:N.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});yt({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});yt({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});yt({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});yt({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});yt({displayName:"ViewIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),N.createElement("circle",{cx:"12",cy:"12",r:"2"}))});yt({displayName:"ViewOffIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),N.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))});yt({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});var UEe=yt({displayName:"DeleteIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"}))});yt({displayName:"RepeatIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),N.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))});yt({displayName:"RepeatClockIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),N.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))});var GEe=yt({displayName:"EditIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),N.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});yt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});yt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});yt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});yt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});yt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});yt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});yt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});yt({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});yt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var Dq=yt({displayName:"ExternalLinkIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),N.createElement("path",{d:"M15 3h6v6"}),N.createElement("path",{d:"M10 14L21 3"}))});yt({displayName:"LinkIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),N.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))});yt({displayName:"PlusSquareIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),N.createElement("path",{d:"M12 8v8"}),N.createElement("path",{d:"M8 12h8"}))});yt({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});yt({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});yt({displayName:"TimeIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),N.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))});yt({displayName:"ArrowRightIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),N.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))});yt({displayName:"ArrowLeftIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),N.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))});yt({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});yt({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});yt({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});yt({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});yt({displayName:"EmailIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),N.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))});yt({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});yt({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});yt({displayName:"SpinnerIcon",path:N.createElement(N.Fragment,null,N.createElement("defs",null,N.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},N.createElement("stop",{stopColor:"currentColor",offset:"0%"}),N.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),N.createElement("g",{transform:"translate(2)",fill:"none"},N.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),N.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),N.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))});yt({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});yt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:N.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});yt({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});yt({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});yt({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});yt({displayName:"InfoOutlineIcon",path:N.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},N.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),N.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),N.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))});yt({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});yt({displayName:"QuestionOutlineIcon",path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))});yt({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});yt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});yt({viewBox:"0 0 14 14",path:N.createElement("g",{fill:"currentColor"},N.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))});yt({displayName:"MinusIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))});yt({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function qEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Qn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>y.jsxs(Ge,{gap:2,children:[n&&y.jsx(uo,{label:`Recall ${e}`,children:y.jsx(us,{"aria-label":"Use this parameter",icon:y.jsx(qEe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&y.jsx(uo,{label:`Copy ${e}`,children:y.jsx(us,{"aria-label":`Copy ${e}`,icon:y.jsx(l0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),y.jsxs(Ge,{direction:i?"column":"row",children:[y.jsxs(Jt,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?y.jsxs(Bh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",y.jsx(Dq,{mx:"2px"})]}):y.jsx(Jt,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),YEe=(e,t)=>e.image.uuid===t.image.uuid,BP=w.memo(({image:e,styleClass:t})=>{var H,K;const n=Oe();et("esc",()=>{n(tG(!1))});const r=((H=e==null?void 0:e.metadata)==null?void 0:H.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:d,orig_path:h,perlin:m,postprocessing:v,prompt:b,sampler:S,seamless:_,seed:E,steps:k,strength:T,denoise_str:A,threshold:M,type:R,variations:D,width:j}=r,z=JSON.stringify(e.metadata,null,2);return y.jsx("div",{className:`image-metadata-viewer ${t}`,children:y.jsxs(Ge,{gap:1,direction:"column",width:"100%",children:[y.jsxs(Ge,{gap:2,children:[y.jsx(Jt,{fontWeight:"semibold",children:"File:"}),y.jsxs(Bh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,y.jsx(Dq,{mx:"2px"})]})]}),Object.keys(r).length>0?y.jsxs(y.Fragment,{children:[R&&y.jsx(Qn,{label:"Generation type",value:R}),((K=e.metadata)==null?void 0:K.model_weights)&&y.jsx(Qn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(R)&&y.jsx(Qn,{label:"Original image",value:h}),b&&y.jsx(Qn,{label:"Prompt",labelPosition:"top",value:l2(b),onClick:()=>n(Fx(b))}),E!==void 0&&y.jsx(Qn,{label:"Seed",value:E,onClick:()=>n(Fy(E))}),M!==void 0&&y.jsx(Qn,{label:"Noise Threshold",value:M,onClick:()=>n(LU(M))}),m!==void 0&&y.jsx(Qn,{label:"Perlin Noise",value:m,onClick:()=>n(CU(m))}),S&&y.jsx(Qn,{label:"Sampler",value:S,onClick:()=>n(_U(S))}),k&&y.jsx(Qn,{label:"Steps",value:k,onClick:()=>n(TU(k))}),o!==void 0&&y.jsx(Qn,{label:"CFG scale",value:o,onClick:()=>n(bU(o))}),D&&D.length>0&&y.jsx(Qn,{label:"Seed-weight pairs",value:Q5(D),onClick:()=>n(EU(Q5(D)))}),_&&y.jsx(Qn,{label:"Seamless",value:_,onClick:()=>n(kU(_))}),l&&y.jsx(Qn,{label:"High Resolution Optimization",value:l,onClick:()=>n(pP(l))}),j&&y.jsx(Qn,{label:"Width",value:j,onClick:()=>n(AU(j))}),s&&y.jsx(Qn,{label:"Height",value:s,onClick:()=>n(SU(s))}),u&&y.jsx(Qn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(P0(u))}),d&&y.jsx(Qn,{label:"Mask image",value:d,isLink:!0,onClick:()=>n(wU(d))}),R==="img2img"&&T&&y.jsx(Qn,{label:"Image to image strength",value:T,onClick:()=>n(p8(T))}),a&&y.jsx(Qn,{label:"Image to image fit",value:a,onClick:()=>n(PU(a))}),v&&v.length>0&&y.jsxs(y.Fragment,{children:[y.jsx(jh,{size:"sm",children:"Postprocessing"}),v.map((te,G)=>{if(te.type==="esrgan"){const{scale:$,strength:W,denoise_str:X}=te;return y.jsxs(Ge,{pl:"2rem",gap:1,direction:"column",children:[y.jsx(Jt,{size:"md",children:`${G+1}: Upscale (ESRGAN)`}),y.jsx(Qn,{label:"Scale",value:$,onClick:()=>n(RU($))}),y.jsx(Qn,{label:"Strength",value:W,onClick:()=>n(v8(W))}),X!==void 0&&y.jsx(Qn,{label:"Denoising strength",value:X,onClick:()=>n(m8(X))})]},G)}else if(te.type==="gfpgan"){const{strength:$}=te;return y.jsxs(Ge,{pl:"2rem",gap:1,direction:"column",children:[y.jsx(Jt,{size:"md",children:`${G+1}: Face restoration (GFPGAN)`}),y.jsx(Qn,{label:"Strength",value:$,onClick:()=>{n(g8($)),n(j4("gfpgan"))}})]},G)}else if(te.type==="codeformer"){const{strength:$,fidelity:W}=te;return y.jsxs(Ge,{pl:"2rem",gap:1,direction:"column",children:[y.jsx(Jt,{size:"md",children:`${G+1}: Face restoration (Codeformer)`}),y.jsx(Qn,{label:"Strength",value:$,onClick:()=>{n(g8($)),n(j4("codeformer"))}}),W&&y.jsx(Qn,{label:"Fidelity",value:W,onClick:()=>{n(IU(W)),n(j4("codeformer"))}})]},G)}})]}),i&&y.jsx(Qn,{withCopy:!0,label:"Dream Prompt",value:i}),y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsxs(Ge,{gap:2,children:[y.jsx(uo,{label:"Copy metadata JSON",children:y.jsx(us,{"aria-label":"Copy metadata JSON",icon:y.jsx(l0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),y.jsx(Jt,{fontWeight:"semibold",children:"Metadata JSON:"})]}),y.jsx("div",{className:"image-json-viewer",children:y.jsx("pre",{children:z})})]})]}):y.jsx(yF,{width:"100%",pt:10,children:y.jsx(Jt,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},YEe);BP.displayName="ImageMetadataViewer";const Nq=lt([xp,bp],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var d;return u.uuid===((d=e==null?void 0:e.currentImage)==null?void 0:d.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function KEe(){const e=Oe(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=he(Nq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(dP())},h=()=>{e(cP())};return y.jsxs("div",{className:"current-image-preview",children:[i&&y.jsx(JS,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&y.jsxs("div",{className:"current-image-next-prev-buttons",children:[y.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&y.jsx(us,{"aria-label":"Previous image",icon:y.jsx(Cq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),y.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&y.jsx(us,{"aria-label":"Next image",icon:y.jsx(_q,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),r&&i&&y.jsx(BP,{image:i,styleClass:"current-image-metadata"})]})}var XEe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=globalThis&&globalThis.__assign||function(){return ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},rPe=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],TD="__resizable_base__",jq=function(e){JEe(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(TD):o.className+=TD,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;o&&o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||ePe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),d=u/l[s]*100;return d+"%"}return FC(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?FC(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?FC(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&$g("left",o),s=i&&$g("top",o),l,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=a?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,h=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,v=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,S=u||0;if(s){var _=(m-b)*this.ratio+S,E=(v-b)*this.ratio+S,k=(d-S)/this.ratio+b,T=(h-S)/this.ratio+b,A=Math.max(d,_),M=Math.min(h,E),R=Math.max(m,k),D=Math.min(v,T);n=Yb(n,A,M),r=Yb(r,R,D)}else n=Yb(n,d,h),r=Yb(r,m,v);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&tPe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Kb(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Bl(Bl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(h)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Kb(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Kb(n)?n.touches[0].clientX:n.clientX,d=Kb(n)?n.touches[0].clientY:n.clientY,h=this.state,m=h.direction,v=h.original,b=h.width,S=h.height,_=this.getParentSize(),E=nPe(_,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=E.maxWidth,a=E.maxHeight,s=E.minWidth,l=E.minHeight;var k=this.calculateNewSizeFromDirection(u,d),T=k.newHeight,A=k.newWidth,M=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=PD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=PD(T,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(A,T,{width:M.maxWidth,height:M.maxHeight},{width:s,height:l});if(A=R.newWidth,T=R.newHeight,this.props.grid){var D=ED(A,this.props.grid[0]),j=ED(T,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,T=z===0||Math.abs(j-T)<=z?j:T}var H={width:A-v.width,height:T-v.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var K=A/_.width*100;A=K+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var G=A/this.window.innerHeight*100;A=G+"vh"}}if(S&&typeof S=="string"){if(S.endsWith("%")){var K=T/_.height*100;T=K+"%"}else if(S.endsWith("vw")){var te=T/this.window.innerWidth*100;T=te+"vw"}else if(S.endsWith("vh")){var G=T/this.window.innerHeight*100;T=G+"vh"}}var $={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?$.flexBasis=$.width:this.flexDir==="column"&&($.flexBasis=$.height),el.flushSync(function(){r.setState($)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,H)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Bl(Bl({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(h){return i[h]!==!1?w.createElement(QEe,{key:h,direction:h,onResizeStart:n.onResizeStart,replaceStyles:o&&o[h],className:a&&a[h]},u&&u[h]?u[h]:null):null});return w.createElement("div",{className:l,style:s},d)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return rPe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Bl(Bl(Bl({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return w.createElement(o,Bl({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&w.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(w.PureComponent);const er=e=>{const{label:t,styleClass:n,...r}=e;return y.jsx(sF,{className:`invokeai__checkbox ${n}`,...r,children:t})};function Bq(e){return mt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function $q(e){return mt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function iPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function oPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function aPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function sPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function Fq(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function lPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function uPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function cPe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function dPe(e,t){e.classList?e.classList.add(t):cPe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function LD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function fPe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=LD(e.className,t):e.setAttribute("class",LD(e.className&&e.className.baseVal||"",t))}const AD={disabled:!1},zq=N.createContext(null);var Hq=function(t){return t.scrollTop},Nv="unmounted",mh="exited",vh="entering",Wg="entered",H8="exiting",vc=function(e){_E(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=mh,o.appearStatus=vh):l=Wg:r.unmountOnExit||r.mountOnEnter?l=Nv:l=mh,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Nv?{status:mh}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==vh&&a!==Wg&&(o=vh):(a===vh||a===Wg)&&(o=H8)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===vh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:xb.findDOMNode(this);a&&Hq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===mh&&this.setState({status:Nv})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[xb.findDOMNode(this),s],u=l[0],d=l[1],h=this.getTimeouts(),m=s?h.appear:h.enter;if(!i&&!a||AD.disabled){this.safeSetState({status:Wg},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:vh},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:Wg},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:xb.findDOMNode(this);if(!o||AD.disabled){this.safeSetState({status:mh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:H8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:mh},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:xb.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Nv)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=xE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return N.createElement(zq.Provider,{value:null},typeof a=="function"?a(i,s):N.cloneElement(N.Children.only(a),s))},t}(N.Component);vc.contextType=zq;vc.propTypes={};function Fg(){}vc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Fg,onEntering:Fg,onEntered:Fg,onExit:Fg,onExiting:Fg,onExited:Fg};vc.UNMOUNTED=Nv;vc.EXITED=mh;vc.ENTERING=vh;vc.ENTERED=Wg;vc.EXITING=H8;const hPe=vc;var pPe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return dPe(t,r)})},zC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return fPe(t,r)})},$P=function(e){_E(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ab,Object.values(b));return w.createElement(S.Provider,{value:_},v)}function d(h,m){const v=(m==null?void 0:m[e][l])||s,b=w.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const i=()=>{const o=n.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,gPe(i,...t)]}function gPe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...s,...h}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function mPe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Wq(...e){return t=>e.forEach(n=>mPe(n,t))}function ps(...e){return w.useCallback(Wq(...e),e)}const uy=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),o=i.find(yPe);if(o){const a=o.props.children,s=i.map(l=>l===o?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return w.createElement(V8,bn({},r,{ref:t}),w.isValidElement(a)?w.cloneElement(a,void 0,s):null)}return w.createElement(V8,bn({},r,{ref:t}),n)});uy.displayName="Slot";const V8=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...bPe(r,n.props),ref:Wq(t,n.ref)}):w.Children.count(n)>1?w.Children.only(null):null});V8.displayName="SlotClone";const vPe=({children:e})=>w.createElement(w.Fragment,null,e);function yPe(e){return w.isValidElement(e)&&e.type===vPe}function bPe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const SPe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],lc=SPe.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?uy:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(s,bn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Uq(e,t){e&&el.flushSync(()=>e.dispatchEvent(t))}function Gq(e){const t=e+"CollectionProvider",[n,r]=Gy(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:S}=v,_=N.useRef(null),E=N.useRef(new Map).current;return N.createElement(i,{scope:b,itemMap:E,collectionRef:_},S)},s=e+"CollectionSlot",l=N.forwardRef((v,b)=>{const{scope:S,children:_}=v,E=o(s,S),k=ps(b,E.collectionRef);return N.createElement(uy,{ref:k},_)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=N.forwardRef((v,b)=>{const{scope:S,children:_,...E}=v,k=N.useRef(null),T=ps(b,k),A=o(u,S);return N.useEffect(()=>(A.itemMap.set(k,{ref:k,...E}),()=>void A.itemMap.delete(k))),N.createElement(uy,{[d]:"",ref:T},_)});function m(v){const b=o(e+"CollectionConsumer",v);return N.useCallback(()=>{const _=b.collectionRef.current;if(!_)return[];const E=Array.from(_.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((A,M)=>E.indexOf(A.ref.current)-E.indexOf(M.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:h},m,r]}const xPe=w.createContext(void 0);function qq(e){const t=w.useContext(xPe);return e||t||"ltr"}function du(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function wPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const W8="dismissableLayer.update",CPe="dismissableLayer.pointerDownOutside",_Pe="dismissableLayer.focusOutside";let OD;const kPe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),EPe=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=w.useContext(kPe),[h,m]=w.useState(null),v=(n=h==null?void 0:h.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=w.useState({}),S=ps(t,j=>m(j)),_=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=_.indexOf(E),T=h?_.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,M=T>=k,R=PPe(j=>{const z=j.target,H=[...d.branches].some(K=>K.contains(z));!M||H||(o==null||o(j),s==null||s(j),j.defaultPrevented||l==null||l())},v),D=TPe(j=>{const z=j.target;[...d.branches].some(K=>K.contains(z))||(a==null||a(j),s==null||s(j),j.defaultPrevented||l==null||l())},v);return wPe(j=>{T===d.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},v),w.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(OD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),MD(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=OD)}},[h,v,r,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),MD())},[h,d]),w.useEffect(()=>{const j=()=>b({});return document.addEventListener(W8,j),()=>document.removeEventListener(W8,j)},[]),w.createElement(lc.div,bn({},u,{ref:S,style:{pointerEvents:A?M?"auto":"none":void 0,...e.style},onFocusCapture:ir(e.onFocusCapture,D.onFocusCapture),onBlurCapture:ir(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:ir(e.onPointerDownCapture,R.onPointerDownCapture)}))});function PPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){Yq(CPe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function TPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&Yq(_Pe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function MD(){const e=new CustomEvent(W8);document.dispatchEvent(e)}function Yq(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Uq(i,o):i.dispatchEvent(o)}let HC=0;function LPe(){w.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:ID()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:ID()),HC++,()=>{HC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),HC--}},[])}function ID(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const VC="focusScope.autoFocusOnMount",WC="focusScope.autoFocusOnUnmount",RD={bubbles:!1,cancelable:!0},APe=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=w.useState(null),u=du(i),d=du(o),h=w.useRef(null),m=ps(t,S=>l(S)),v=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let S=function(E){if(v.paused||!s)return;const k=E.target;s.contains(k)?h.current=k:yh(h.current,{select:!0})},_=function(E){v.paused||!s||s.contains(E.relatedTarget)||yh(h.current,{select:!0})};return document.addEventListener("focusin",S),document.addEventListener("focusout",_),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",_)}}},[r,s,v.paused]),w.useEffect(()=>{if(s){ND.add(v);const S=document.activeElement;if(!s.contains(S)){const E=new CustomEvent(VC,RD);s.addEventListener(VC,u),s.dispatchEvent(E),E.defaultPrevented||(OPe(NPe(Kq(s)),{select:!0}),document.activeElement===S&&yh(s))}return()=>{s.removeEventListener(VC,u),setTimeout(()=>{const E=new CustomEvent(WC,RD);s.addEventListener(WC,d),s.dispatchEvent(E),E.defaultPrevented||yh(S??document.body,{select:!0}),s.removeEventListener(WC,d),ND.remove(v)},0)}}},[s,u,d,v]);const b=w.useCallback(S=>{if(!n&&!r||v.paused)return;const _=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,E=document.activeElement;if(_&&E){const k=S.currentTarget,[T,A]=MPe(k);T&&A?!S.shiftKey&&E===A?(S.preventDefault(),n&&yh(T,{select:!0})):S.shiftKey&&E===T&&(S.preventDefault(),n&&yh(A,{select:!0})):E===k&&S.preventDefault()}},[n,r,v.paused]);return w.createElement(lc.div,bn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function OPe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yh(r,{select:t}),document.activeElement!==n)return}function MPe(e){const t=Kq(e),n=DD(t,e),r=DD(t.reverse(),e);return[n,r]}function Kq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function DD(e,t){for(const n of e)if(!IPe(n,{upTo:t}))return n}function IPe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function RPe(e){return e instanceof HTMLInputElement&&"select"in e}function yh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&RPe(e)&&t&&e.select()}}const ND=DPe();function DPe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jD(e,t),e.unshift(t)},remove(t){var n;e=jD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function jD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function NPe(e){return e.filter(t=>t.tagName!=="A")}const u0=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:()=>{},jPe=n7["useId".toString()]||(()=>{});let BPe=0;function $Pe(e){const[t,n]=w.useState(jPe());return u0(()=>{e||n(r=>r??String(BPe++))},[e]),e||(t?`radix-${t}`:"")}function M0(e){return e.split("-")[0]}function nw(e){return e.split("-")[1]}function I0(e){return["top","bottom"].includes(M0(e))?"x":"y"}function FP(e){return e==="y"?"height":"width"}function BD(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=I0(t),l=FP(s),u=r[l]/2-i[l]/2,d=s==="x";let h;switch(M0(t)){case"top":h={x:o,y:r.y-i.height};break;case"bottom":h={x:o,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:a};break;case"left":h={x:r.x-i.width,y:a};break;default:h={x:r.x,y:r.y}}switch(nw(t)){case"start":h[s]-=u*(n&&d?-1:1);break;case"end":h[s]+=u*(n&&d?-1:1)}return h}const FPe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=BD(l,r,s),h=r,m={},v=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=Xq(r),d={x:i,y:o},h=I0(a),m=nw(a),v=FP(h),b=await l.getDimensions(n),S=h==="y"?"top":"left",_=h==="y"?"bottom":"right",E=s.reference[v]+s.reference[h]-d[h]-s.floating[v],k=d[h]-s.reference[h],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=T?h==="y"?T.clientHeight||0:T.clientWidth||0:0;A===0&&(A=s.floating[v]);const M=E/2-k/2,R=u[S],D=A-b[v]-u[_],j=A/2-b[v]/2+M,z=U8(R,j,D),H=(m==="start"?u[S]:u[_])>0&&j!==z&&s.reference[v]<=s.floating[v];return{[h]:d[h]-(H?jVPe[t])}function WPe(e,t,n){n===void 0&&(n=!1);const r=nw(e),i=I0(e),o=FP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=sS(a)),{main:a,cross:sS(a)}}const UPe={start:"end",end:"start"};function FD(e){return e.replace(/start|end/g,t=>UPe[t])}const Zq=["top","right","bottom","left"];Zq.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const GPe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...b}=e,S=M0(r),_=h||(S===a||!v?[sS(a)]:function(j){const z=sS(j);return[FD(j),z,FD(z)]}(a)),E=[a,..._],k=await aS(t,b),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(k[S]),d){const{main:j,cross:z}=WPe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));T.push(k[j],k[z])}if(A=[...A,{placement:r,overflows:T}],!T.every(j=>j<=0)){var M,R;const j=((M=(R=i.flip)==null?void 0:R.index)!=null?M:0)+1,z=E[j];if(z)return{data:{index:j,overflows:A},reset:{placement:z}};let H="bottom";switch(m){case"bestFit":{var D;const K=(D=A.map(te=>[te,te.overflows.filter(G=>G>0).reduce((G,$)=>G+$,0)]).sort((te,G)=>te[1]-G[1])[0])==null?void 0:D[0].placement;K&&(H=K);break}case"initialPlacement":H=a}if(r!==H)return{reset:{placement:H}}}return{}}}};function zD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function HD(e){return Zq.some(t=>e[t]>=0)}const qPe=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=zD(await aS(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:HD(o)}}}case"escaped":{const o=zD(await aS(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:o,escaped:HD(o)}}}default:return{}}}}},YPe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),h=M0(s),m=nw(s),v=I0(s)==="x",b=["left","top"].includes(h)?-1:1,S=d&&v?-1:1,_=typeof a=="function"?a(o):a;let{mainAxis:E,crossAxis:k,alignmentAxis:T}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,..._};return m&&typeof T=="number"&&(k=m==="end"?-1*T:T),v?{x:k*S,y:E*b}:{x:E*b,y:k*S}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function Qq(e){return e==="x"?"y":"x"}const KPe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:_=>{let{x:E,y:k}=_;return{x:E,y:k}}},...l}=e,u={x:n,y:r},d=await aS(t,l),h=I0(M0(i)),m=Qq(h);let v=u[h],b=u[m];if(o){const _=h==="y"?"bottom":"right";v=U8(v+d[h==="y"?"top":"left"],v,v-d[_])}if(a){const _=m==="y"?"bottom":"right";b=U8(b+d[m==="y"?"top":"left"],b,b-d[_])}const S=s.fn({...t,[h]:v,[m]:b});return{...S,data:{x:S.x-n,y:S.y-r}}}}},XPe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,d={x:n,y:r},h=I0(i),m=Qq(h);let v=d[h],b=d[m];const S=typeof s=="function"?s({...o,placement:i}):s,_=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(l){const M=h==="y"?"height":"width",R=o.reference[h]-o.floating[M]+_.mainAxis,D=o.reference[h]+o.reference[M]-_.mainAxis;vD&&(v=D)}if(u){var E,k,T,A;const M=h==="y"?"width":"height",R=["top","left"].includes(M0(i)),D=o.reference[m]-o.floating[M]+(R&&(E=(k=a.offset)==null?void 0:k[m])!=null?E:0)+(R?0:_.crossAxis),j=o.reference[m]+o.reference[M]+(R?0:(T=(A=a.offset)==null?void 0:A[m])!=null?T:0)-(R?_.crossAxis:0);bj&&(b=j)}return{[h]:v,[m]:b}}}};function Jq(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function yc(e){if(e==null)return window;if(!Jq(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function qy(e){return yc(e).getComputedStyle(e)}function Qu(e){return Jq(e)?"":e?(e.nodeName||"").toLowerCase():""}function eY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function fu(e){return e instanceof yc(e).HTMLElement}function tf(e){return e instanceof yc(e).Element}function zP(e){return typeof ShadowRoot>"u"?!1:e instanceof yc(e).ShadowRoot||e instanceof ShadowRoot}function rw(e){const{overflow:t,overflowX:n,overflowY:r}=qy(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function ZPe(e){return["table","td","th"].includes(Qu(e))}function VD(e){const t=/firefox/i.test(eY()),n=qy(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function tY(){return!/^((?!chrome|android).)*safari/i.test(eY())}const WD=Math.min,p2=Math.max,lS=Math.round;function Ju(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&fu(e)&&(l=e.offsetWidth>0&&lS(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&lS(s.height)/e.offsetHeight||1);const d=tf(e)?yc(e):window,h=!tY()&&n,m=(s.left+(h&&(r=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,v=(s.top+(h&&(o=(a=d.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,S=s.height/u;return{width:b,height:S,top:v,right:m+b,bottom:v+S,left:m,x:m,y:v}}function Vd(e){return(t=e,(t instanceof yc(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function iw(e){return tf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function nY(e){return Ju(Vd(e)).left+iw(e).scrollLeft}function QPe(e,t,n){const r=fu(t),i=Vd(t),o=Ju(e,r&&function(l){const u=Ju(l);return lS(u.width)!==l.offsetWidth||lS(u.height)!==l.offsetHeight}(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Qu(t)!=="body"||rw(i))&&(a=iw(t)),fu(t)){const l=Ju(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=nY(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function rY(e){return Qu(e)==="html"?e:e.assignedSlot||e.parentNode||(zP(e)?e.host:null)||Vd(e)}function UD(e){return fu(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function G8(e){const t=yc(e);let n=UD(e);for(;n&&ZPe(n)&&getComputedStyle(n).position==="static";)n=UD(n);return n&&(Qu(n)==="html"||Qu(n)==="body"&&getComputedStyle(n).position==="static"&&!VD(n))?t:n||function(r){let i=rY(r);for(zP(i)&&(i=i.host);fu(i)&&!["html","body"].includes(Qu(i));){if(VD(i))return i;i=i.parentNode}return null}(e)||t}function GD(e){if(fu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ju(e);return{width:t.width,height:t.height}}function iY(e){const t=rY(e);return["html","body","#document"].includes(Qu(t))?e.ownerDocument.body:fu(t)&&rw(t)?t:iY(t)}function uS(e,t){var n;t===void 0&&(t=[]);const r=iY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=yc(r),a=i?[o].concat(o.visualViewport||[],rw(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(uS(a))}function qD(e,t,n){return t==="viewport"?oS(function(r,i){const o=yc(r),a=Vd(r),s=o.visualViewport;let l=a.clientWidth,u=a.clientHeight,d=0,h=0;if(s){l=s.width,u=s.height;const m=tY();(m||!m&&i==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}return{width:l,height:u,x:d,y:h}}(e,n)):tf(t)?function(r,i){const o=Ju(r,!1,i==="fixed"),a=o.top+r.clientTop,s=o.left+r.clientLeft;return{top:a,left:s,x:s,y:a,right:s+r.clientWidth,bottom:a+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):oS(function(r){var i;const o=Vd(r),a=iw(r),s=(i=r.ownerDocument)==null?void 0:i.body,l=p2(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=p2(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let d=-a.scrollLeft+nY(r);const h=-a.scrollTop;return qy(s||o).direction==="rtl"&&(d+=p2(o.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:d,y:h}}(Vd(e)))}function JPe(e){const t=uS(e),n=["absolute","fixed"].includes(qy(e).position)&&fu(e)?G8(e):e;return tf(n)?t.filter(r=>tf(r)&&function(i,o){const a=o.getRootNode==null?void 0:o.getRootNode();if(i.contains(o))return!0;if(a&&zP(a)){let s=o;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Qu(r)!=="body"):[]}const eTe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?JPe(t):[].concat(n),r],a=o[0],s=o.reduce((l,u)=>{const d=qD(t,u,i);return l.top=p2(d.top,l.top),l.right=WD(d.right,l.right),l.bottom=WD(d.bottom,l.bottom),l.left=p2(d.left,l.left),l},qD(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=fu(n),o=Vd(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Qu(n)!=="body"||rw(o))&&(a=iw(n)),fu(n))){const l=Ju(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:tf,getDimensions:GD,getOffsetParent:G8,getDocumentElement:Vd,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:QPe(t,G8(n),r),floating:{...GD(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>qy(e).direction==="rtl"};function tTe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,d=l||u?[...tf(e)?uS(e):[],...uS(t)]:[];d.forEach(b=>{l&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});let h,m=null;if(a){let b=!0;m=new ResizeObserver(()=>{b||n(),b=!1}),tf(e)&&!s&&m.observe(e),m.observe(t)}let v=s?Ju(e):null;return s&&function b(){const S=Ju(e);!v||S.x===v.x&&S.y===v.y&&S.width===v.width&&S.height===v.height||n(),v=S,h=requestAnimationFrame(b)}(),n(),()=>{var b;d.forEach(S=>{l&&S.removeEventListener("scroll",n),u&&S.removeEventListener("resize",n)}),(b=m)==null||b.disconnect(),m=null,s&&cancelAnimationFrame(h)}}const nTe=(e,t,n)=>FPe(e,t,{platform:eTe,...n});var q8=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Y8(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Y8(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Y8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function rTe(e){const t=w.useRef(e);return q8(()=>{t.current=e}),t}function iTe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=w.useRef(null),a=w.useRef(null),s=rTe(i),l=w.useRef(null),[u,d]=w.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,m]=w.useState(t);Y8(h==null?void 0:h.map(T=>{let{options:A}=T;return A}),t==null?void 0:t.map(T=>{let{options:A}=T;return A}))||m(t);const v=w.useCallback(()=>{!o.current||!a.current||nTe(o.current,a.current,{middleware:h,placement:n,strategy:r}).then(T=>{b.current&&el.flushSync(()=>{d(T)})})},[h,n,r]);q8(()=>{b.current&&v()},[v]);const b=w.useRef(!1);q8(()=>(b.current=!0,()=>{b.current=!1}),[]);const S=w.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const T=s.current(o.current,a.current,v);l.current=T}else v()},[v,s]),_=w.useCallback(T=>{o.current=T,S()},[S]),E=w.useCallback(T=>{a.current=T,S()},[S]),k=w.useMemo(()=>({reference:o,floating:a}),[]);return w.useMemo(()=>({...u,update:v,refs:k,reference:_,floating:E}),[u,v,k,_,E])}const oTe=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?$D({element:t.current,padding:n}).fn(i):{}:t?$D({element:t,padding:n}).fn(i):{}}}};function aTe(e){const[t,n]=w.useState(void 0);return u0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const oY="Popper",[HP,aY]=Gy(oY),[sTe,sY]=HP(oY),lTe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return w.createElement(sTe,{scope:t,anchor:r,onAnchorChange:i},n)},uTe="PopperAnchor",cTe=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=sY(uTe,n),a=w.useRef(null),s=ps(t,a);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:w.createElement(lc.div,bn({},i,{ref:s}))}),cS="PopperContent",[dTe,zze]=HP(cS),[fTe,hTe]=HP(cS,{hasParent:!1,positionUpdateFns:new Set}),pTe=w.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:d,side:h="bottom",sideOffset:m=0,align:v="center",alignOffset:b=0,arrowPadding:S=0,collisionBoundary:_=[],collisionPadding:E=0,sticky:k="partial",hideWhenDetached:T=!1,avoidCollisions:A=!0,...M}=e,R=sY(cS,d),[D,j]=w.useState(null),z=ps(t,ae=>j(ae)),[H,K]=w.useState(null),te=aTe(H),G=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,$=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,W=h+(v!=="center"?"-"+v:""),X=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},Z=Array.isArray(_)?_:[_],U=Z.length>0,Q={padding:X,boundary:Z.filter(mTe),altBoundary:U},{reference:re,floating:fe,strategy:Ee,x:be,y:ye,placement:Fe,middlewareData:Me,update:rt}=iTe({strategy:"fixed",placement:W,whileElementsMounted:tTe,middleware:[YPe({mainAxis:m+$,alignmentAxis:b}),A?KPe({mainAxis:!0,crossAxis:!1,limiter:k==="partial"?XPe():void 0,...Q}):void 0,H?oTe({element:H,padding:S}):void 0,A?GPe({...Q}):void 0,vTe({arrowWidth:G,arrowHeight:$}),T?qPe({strategy:"referenceHidden"}):void 0].filter(gTe)});u0(()=>{re(R.anchor)},[re,R.anchor]);const Ve=be!==null&&ye!==null,[je,wt]=lY(Fe),Be=(i=Me.arrow)===null||i===void 0?void 0:i.x,at=(o=Me.arrow)===null||o===void 0?void 0:o.y,bt=((a=Me.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Le,ut]=w.useState();u0(()=>{D&&ut(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Mt,positionUpdateFns:ct}=hTe(cS,d),_t=!Mt;w.useLayoutEffect(()=>{if(!_t)return ct.add(rt),()=>{ct.delete(rt)}},[_t,ct,rt]),w.useLayoutEffect(()=>{_t&&Ve&&Array.from(ct).reverse().forEach(ae=>requestAnimationFrame(ae))},[_t,Ve,ct]);const un={"data-side":je,"data-align":wt,...M,ref:z,style:{...M.style,animation:Ve?void 0:"none",opacity:(s=Me.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return w.createElement("div",{ref:fe,"data-radix-popper-content-wrapper":"",style:{position:Ee,left:0,top:0,transform:Ve?`translate3d(${Math.round(be)}px, ${Math.round(ye)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Le,["--radix-popper-transform-origin"]:[(l=Me.transformOrigin)===null||l===void 0?void 0:l.x,(u=Me.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},w.createElement(dTe,{scope:d,placedSide:je,onArrowChange:K,arrowX:Be,arrowY:at,shouldHideArrow:bt},_t?w.createElement(fTe,{scope:d,hasParent:!0,positionUpdateFns:ct},w.createElement(lc.div,un)):w.createElement(lc.div,un)))});function gTe(e){return e!==void 0}function mTe(e){return e!==null}const vTe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,h=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=h?0:e.arrowWidth,v=h?0:e.arrowHeight,[b,S]=lY(s),_={start:"0%",center:"50%",end:"100%"}[S],E=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,k=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+v/2;let T="",A="";return b==="bottom"?(T=h?_:`${E}px`,A=`${-v}px`):b==="top"?(T=h?_:`${E}px`,A=`${l.floating.height+v}px`):b==="right"?(T=`${-v}px`,A=h?_:`${k}px`):b==="left"&&(T=`${l.floating.width+v}px`,A=h?_:`${k}px`),{data:{x:T,y:A}}}});function lY(e){const[t,n="center"]=e.split("-");return[t,n]}const yTe=lTe,bTe=cTe,STe=pTe;function xTe(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const uY=e=>{const{present:t,children:n}=e,r=wTe(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=ps(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};uY.displayName="Presence";function wTe(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[s,l]=xTe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=Zb(r.current);o.current=s==="mounted"?u:"none"},[s]),u0(()=>{const u=r.current,d=i.current;if(d!==e){const m=o.current,v=Zb(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),u0(()=>{if(t){const u=h=>{const v=Zb(r.current).includes(h.animationName);h.target===t&&v&&el.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(o.current=Zb(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Zb(e){return(e==null?void 0:e.animationName)||"none"}function CTe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=_Te({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=du(n),l=w.useCallback(u=>{if(o){const h=typeof u=="function"?u(e):u;h!==e&&s(h)}else i(u)},[o,e,i,s]);return[a,l]}function _Te({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),o=du(t);return w.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const UC="rovingFocusGroup.onEntryFocus",kTe={bubbles:!1,cancelable:!0},VP="RovingFocusGroup",[K8,cY,ETe]=Gq(VP),[PTe,dY]=Gy(VP,[ETe]),[TTe,LTe]=PTe(VP),ATe=w.forwardRef((e,t)=>w.createElement(K8.Provider,{scope:e.__scopeRovingFocusGroup},w.createElement(K8.Slot,{scope:e.__scopeRovingFocusGroup},w.createElement(OTe,bn({},e,{ref:t}))))),OTe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=w.useRef(null),m=ps(t,h),v=qq(o),[b=null,S]=CTe({prop:a,defaultProp:s,onChange:l}),[_,E]=w.useState(!1),k=du(u),T=cY(n),A=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const D=h.current;if(D)return D.addEventListener(UC,k),()=>D.removeEventListener(UC,k)},[k]),w.createElement(TTe,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:b,onItemFocus:w.useCallback(D=>S(D),[S]),onItemShiftTab:w.useCallback(()=>E(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>R(D=>D-1),[])},w.createElement(lc.div,bn({tabIndex:_||M===0?-1:0,"data-orientation":r},d,{ref:m,style:{outline:"none",...e.style},onMouseDown:ir(e.onMouseDown,()=>{A.current=!0}),onFocus:ir(e.onFocus,D=>{const j=!A.current;if(D.target===D.currentTarget&&j&&!_){const z=new CustomEvent(UC,kTe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=T().filter(W=>W.focusable),K=H.find(W=>W.active),te=H.find(W=>W.id===b),$=[K,te,...H].filter(Boolean).map(W=>W.ref.current);fY($)}}A.current=!1}),onBlur:ir(e.onBlur,()=>E(!1))})))}),MTe="RovingFocusGroupItem",ITe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=$Pe(),s=LTe(MTe,n),l=s.currentTabStopId===a,u=cY(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=s;return w.useEffect(()=>{if(r)return d(),()=>h()},[r,d,h]),w.createElement(K8.ItemSlot,{scope:n,id:a,focusable:r,active:i},w.createElement(lc.span,bn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:ir(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:ir(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:ir(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=NTe(m,s.orientation,s.dir);if(v!==void 0){m.preventDefault();let S=u().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")S.reverse();else if(v==="prev"||v==="next"){v==="prev"&&S.reverse();const _=S.indexOf(m.currentTarget);S=s.loop?jTe(S,_+1):S.slice(_+1)}setTimeout(()=>fY(S))}})})))}),RTe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DTe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NTe(e,t,n){const r=DTe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return RTe[r]}function fY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const BTe=ATe,$Te=ITe,FTe=["Enter"," "],zTe=["ArrowDown","PageUp","Home"],hY=["ArrowUp","PageDown","End"],HTe=[...zTe,...hY],ow="Menu",[X8,VTe,WTe]=Gq(ow),[wp,pY]=Gy(ow,[WTe,aY,dY]),WP=aY(),gY=dY(),[UTe,aw]=wp(ow),[GTe,UP]=wp(ow),qTe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=WP(t),[l,u]=w.useState(null),d=w.useRef(!1),h=du(o),m=qq(i);return w.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),w.createElement(yTe,s,w.createElement(UTe,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u},w.createElement(GTe,{scope:t,onClose:w.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:m,modal:a},r)))},YTe=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=WP(n);return w.createElement(bTe,bn({},i,r,{ref:t}))}),KTe="MenuPortal",[Hze,XTe]=wp(KTe,{forceMount:void 0}),Wd="MenuContent",[ZTe,mY]=wp(Wd),QTe=w.forwardRef((e,t)=>{const n=XTe(Wd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=aw(Wd,e.__scopeMenu),a=UP(Wd,e.__scopeMenu);return w.createElement(X8.Provider,{scope:e.__scopeMenu},w.createElement(uY,{present:r||o.open},w.createElement(X8.Slot,{scope:e.__scopeMenu},a.modal?w.createElement(JTe,bn({},i,{ref:t})):w.createElement(eLe,bn({},i,{ref:t})))))}),JTe=w.forwardRef((e,t)=>{const n=aw(Wd,e.__scopeMenu),r=w.useRef(null),i=ps(t,r);return w.useEffect(()=>{const o=r.current;if(o)return ZH(o)},[]),w.createElement(vY,bn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ir(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),eLe=w.forwardRef((e,t)=>{const n=aw(Wd,e.__scopeMenu);return w.createElement(vY,bn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),vY=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m,disableOutsideScroll:v,...b}=e,S=aw(Wd,n),_=UP(Wd,n),E=WP(n),k=gY(n),T=VTe(n),[A,M]=w.useState(null),R=w.useRef(null),D=ps(t,R,S.onContentChange),j=w.useRef(0),z=w.useRef(""),H=w.useRef(0),K=w.useRef(null),te=w.useRef("right"),G=w.useRef(0),$=v?jV:w.Fragment,W=v?{as:uy,allowPinchZoom:!0}:void 0,X=U=>{var Q,re;const fe=z.current+U,Ee=T().filter(Ve=>!Ve.disabled),be=document.activeElement,ye=(Q=Ee.find(Ve=>Ve.ref.current===be))===null||Q===void 0?void 0:Q.textValue,Fe=Ee.map(Ve=>Ve.textValue),Me=uLe(Fe,fe,ye),rt=(re=Ee.find(Ve=>Ve.textValue===Me))===null||re===void 0?void 0:re.ref.current;(function Ve(je){z.current=je,window.clearTimeout(j.current),je!==""&&(j.current=window.setTimeout(()=>Ve(""),1e3))})(fe),rt&&setTimeout(()=>rt.focus())};w.useEffect(()=>()=>window.clearTimeout(j.current),[]),LPe();const Z=w.useCallback(U=>{var Q,re;return te.current===((Q=K.current)===null||Q===void 0?void 0:Q.side)&&dLe(U,(re=K.current)===null||re===void 0?void 0:re.area)},[]);return w.createElement(ZTe,{scope:n,searchRef:z,onItemEnter:w.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),onItemLeave:w.useCallback(U=>{var Q;Z(U)||((Q=R.current)===null||Q===void 0||Q.focus(),M(null))},[Z]),onTriggerLeave:w.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),pointerGraceTimerRef:H,onPointerGraceIntentChange:w.useCallback(U=>{K.current=U},[])},w.createElement($,W,w.createElement(APe,{asChild:!0,trapped:i,onMountAutoFocus:ir(o,U=>{var Q;U.preventDefault(),(Q=R.current)===null||Q===void 0||Q.focus()}),onUnmountAutoFocus:a},w.createElement(EPe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m},w.createElement(BTe,bn({asChild:!0},k,{dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:M,onEntryFocus:U=>{_.isUsingKeyboardRef.current||U.preventDefault()}}),w.createElement(STe,bn({role:"menu","aria-orientation":"vertical","data-state":aLe(S.open),"data-radix-menu-content":"",dir:_.dir},E,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:ir(b.onKeyDown,U=>{const re=U.target.closest("[data-radix-menu-content]")===U.currentTarget,fe=U.ctrlKey||U.altKey||U.metaKey,Ee=U.key.length===1;re&&(U.key==="Tab"&&U.preventDefault(),!fe&&Ee&&X(U.key));const be=R.current;if(U.target!==be||!HTe.includes(U.key))return;U.preventDefault();const Fe=T().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);hY.includes(U.key)&&Fe.reverse(),sLe(Fe)}),onBlur:ir(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(j.current),z.current="")}),onPointerMove:ir(e.onPointerMove,Q8(U=>{const Q=U.target,re=G.current!==U.clientX;if(U.currentTarget.contains(Q)&&re){const fe=U.clientX>G.current?"right":"left";te.current=fe,G.current=U.clientX}}))})))))))}),Z8="MenuItem",YD="menu.itemSelect",tLe=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=w.useRef(null),a=UP(Z8,e.__scopeMenu),s=mY(Z8,e.__scopeMenu),l=ps(t,o),u=w.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const m=new CustomEvent(YD,{bubbles:!0,cancelable:!0});h.addEventListener(YD,v=>r==null?void 0:r(v),{once:!0}),Uq(h,m),m.defaultPrevented?u.current=!1:a.onClose()}};return w.createElement(nLe,bn({},i,{ref:l,disabled:n,onClick:ir(e.onClick,d),onPointerDown:h=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,h),u.current=!0},onPointerUp:ir(e.onPointerUp,h=>{var m;u.current||(m=h.currentTarget)===null||m===void 0||m.click()}),onKeyDown:ir(e.onKeyDown,h=>{const m=s.searchRef.current!=="";n||m&&h.key===" "||FTe.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}))}),nLe=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=mY(Z8,n),s=gY(n),l=w.useRef(null),u=ps(t,l),[d,h]=w.useState(!1),[m,v]=w.useState("");return w.useEffect(()=>{const b=l.current;if(b){var S;v(((S=b.textContent)!==null&&S!==void 0?S:"").trim())}},[o.children]),w.createElement(X8.ItemSlot,{scope:n,disabled:r,textValue:i??m},w.createElement($Te,bn({asChild:!0},s,{focusable:!r}),w.createElement(lc.div,bn({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:ir(e.onPointerMove,Q8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:ir(e.onPointerLeave,Q8(b=>a.onItemLeave(b))),onFocus:ir(e.onFocus,()=>h(!0)),onBlur:ir(e.onBlur,()=>h(!1))}))))}),rLe="MenuRadioGroup";wp(rLe,{value:void 0,onValueChange:()=>{}});const iLe="MenuItemIndicator";wp(iLe,{checked:!1});const oLe="MenuSub";wp(oLe);function aLe(e){return e?"open":"closed"}function sLe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function lLe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function uLe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=lLe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function cLe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(u-s)*(r-l)/(d-l)+s&&(i=!i)}return i}function dLe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return cLe(n,t)}function Q8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const fLe=qTe,hLe=YTe,pLe=QTe,gLe=tLe,yY="ContextMenu",[mLe,Vze]=Gy(yY,[pY]),sw=pY(),[vLe,bY]=mLe(yY),yLe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=w.useState(!1),l=sw(t),u=du(r),d=w.useCallback(h=>{s(h),u(h)},[u]);return w.createElement(vLe,{scope:t,open:a,onOpenChange:d,modal:o},w.createElement(fLe,bn({},l,{dir:i,open:a,onOpenChange:d,modal:o}),n))},bLe="ContextMenuTrigger",SLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bY(bLe,n),o=sw(n),a=w.useRef({x:0,y:0}),s=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=w.useRef(0),u=w.useCallback(()=>window.clearTimeout(l.current),[]),d=h=>{a.current={x:h.clientX,y:h.clientY},i.onOpenChange(!0)};return w.useEffect(()=>u,[u]),w.createElement(w.Fragment,null,w.createElement(hLe,bn({},o,{virtualRef:s})),w.createElement(lc.span,bn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:ir(e.onContextMenu,h=>{u(),d(h),h.preventDefault()}),onPointerDown:ir(e.onPointerDown,Qb(h=>{u(),l.current=window.setTimeout(()=>d(h),700)})),onPointerMove:ir(e.onPointerMove,Qb(u)),onPointerCancel:ir(e.onPointerCancel,Qb(u)),onPointerUp:ir(e.onPointerUp,Qb(u))})))}),xLe="ContextMenuContent",wLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bY(xLe,n),o=sw(n),a=w.useRef(!1);return w.createElement(pLe,bn({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),CLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=sw(n);return w.createElement(gLe,bn({},i,r,{ref:t}))});function Qb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const _Le=yLe,kLe=SLe,ELe=wLe,dd=CLe,PLe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,SY=w.memo(e=>{var te,G,$,W,X,Z,U,Q;const t=Oe(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,shouldUseSingleGalleryColumn:a}=he(HEe),{image:s,isSelected:l}=e,{url:u,thumbnail:d,uuid:h,metadata:m}=s,[v,b]=w.useState(!1),S=By(),{t:_}=Ue(),E=()=>b(!0),k=()=>b(!1),T=()=>{var re,fe;if(s.metadata){const[Ee,be]=fP((fe=(re=s.metadata)==null?void 0:re.image)==null?void 0:fe.prompt);Ee&&t(Fx(Ee)),t(ny(be||""))}S({title:_("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},A=()=>{s.metadata&&t(Fy(s.metadata.image.seed)),S({title:_("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},M=()=>{t(P0(s)),n!=="img2img"&&t(Yo("img2img")),S({title:_("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},R=()=>{t($x(s)),t(Bx()),n!=="unifiedCanvas"&&t(Yo("unifiedCanvas")),S({title:_("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},D=()=>{m&&t(yU(m)),S({title:_("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},j=async()=>{var re;if((re=m==null?void 0:m.image)!=null&&re.init_image_path&&(await fetch(m.image.init_image_path)).ok){t(Yo("img2img")),t(hwe(m)),S({title:_("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}S({title:_("toast:initialImageNotSet"),description:_("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},z=()=>t(WI(s)),H=re=>{re.dataTransfer.setData("invokeai/imageUuid",h),re.dataTransfer.effectAllowed="move"},K=()=>{t(WI(s))};return y.jsxs(_Le,{onOpenChange:re=>{t(hU(re))},children:[y.jsx(kLe,{children:y.jsxs(Eo,{position:"relative",className:"hoverable-image",onMouseOver:E,onMouseOut:k,userSelect:"none",draggable:!0,onDragStart:H,children:[y.jsx(JS,{className:"hoverable-image-image",objectFit:a?"contain":r,rounded:"md",src:d||u,loading:"lazy"}),y.jsx("div",{className:"hoverable-image-content",onClick:z,children:l&&y.jsx(Na,{width:"50%",height:"50%",as:IP,className:"hoverable-image-check"})}),v&&i>=64&&y.jsx("div",{className:"hoverable-image-delete-button",children:y.jsx(iS,{image:s,children:y.jsx(us,{"aria-label":_("parameters:deleteImage"),icon:y.jsx(BEe,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},h)}),y.jsxs(ELe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:re=>{re.detail.originalEvent.preventDefault()},children:[y.jsx(dd,{onClickCapture:K,children:_("parameters:openInViewer")}),y.jsx(dd,{onClickCapture:T,disabled:((G=(te=s==null?void 0:s.metadata)==null?void 0:te.image)==null?void 0:G.prompt)===void 0,children:_("parameters:usePrompt")}),y.jsx(dd,{onClickCapture:A,disabled:((W=($=s==null?void 0:s.metadata)==null?void 0:$.image)==null?void 0:W.seed)===void 0,children:_("parameters:useSeed")}),y.jsx(dd,{onClickCapture:D,disabled:!["txt2img","img2img"].includes((Z=(X=s==null?void 0:s.metadata)==null?void 0:X.image)==null?void 0:Z.type),children:_("parameters:useAll")}),y.jsx(dd,{onClickCapture:j,disabled:((Q=(U=s==null?void 0:s.metadata)==null?void 0:U.image)==null?void 0:Q.type)!=="img2img",children:_("parameters:useInitImg")}),y.jsx(dd,{onClickCapture:M,children:_("parameters:sendToImg2Img")}),y.jsx(dd,{onClickCapture:R,children:_("parameters:sendToUnifiedCanvas")}),y.jsx(dd,{"data-warning":!0,children:y.jsx(iS,{image:s,children:y.jsx("p",{children:_("parameters:deleteImage")})})})]})]})},PLe);SY.displayName="HoverableImage";const Jb=320,KD=40,TLe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},XD=400;function xY(){const e=Oe(),{t}=Ue(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,areMoreImagesAvailable:b,galleryWidth:S,isLightboxOpen:_,isStaging:E,shouldEnableResize:k,shouldUseSingleGalleryColumn:T}=he(zEe),{galleryMinWidth:A,galleryMaxWidth:M}=_?{galleryMinWidth:XD,galleryMaxWidth:XD}:TLe[d],[R,D]=w.useState(S>=Jb),[j,z]=w.useState(!1),[H,K]=w.useState(0),te=w.useRef(null),G=w.useRef(null),$=w.useRef(null);w.useEffect(()=>{S>=Jb&&D(!1)},[S]);const W=()=>{e(ewe(!o)),e(vi(!0))},X=()=>{a?U():Z()},Z=()=>{e(Fd(!0)),o&&e(vi(!0))},U=w.useCallback(()=>{e(Fd(!1)),e(hU(!1)),e(twe(G.current?G.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),Q=()=>{e(F8(r))},re=ye=>{e(ov(ye))},fe=()=>{m||($.current=window.setTimeout(()=>U(),500))},Ee=()=>{$.current&&window.clearTimeout($.current)};et("g",()=>{X()},[a,o]),et("left",()=>{e(dP())},{enabled:!E||d!=="unifiedCanvas"},[E]),et("right",()=>{e(cP())},{enabled:!E||d!=="unifiedCanvas"},[E]),et("shift+g",()=>{W()},[o]),et("esc",()=>{e(Fd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const be=32;return et("shift+up",()=>{if(l<256){const ye=ke.clamp(l+be,32,256);e(ov(ye))}},[l]),et("shift+down",()=>{if(l>32){const ye=ke.clamp(l-be,32,256);e(ov(ye))}},[l]),w.useEffect(()=>{G.current&&(G.current.scrollTop=s)},[s,a]),w.useEffect(()=>{function ye(Fe){!o&&te.current&&!te.current.contains(Fe.target)&&U()}return document.addEventListener("mousedown",ye),()=>{document.removeEventListener("mousedown",ye)}},[U,o]),y.jsx(Vq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:y.jsxs("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Ee,onMouseOver:o?void 0:Ee,children:[y.jsxs(jq,{minWidth:A,maxWidth:o?M:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:k},size:{width:S,height:o?"100%":"100vh"},onResizeStart:(ye,Fe,Me)=>{K(Me.clientHeight),Me.style.height=`${Me.clientHeight}px`,o&&(Me.style.position="fixed",Me.style.right="1rem",z(!0))},onResizeStop:(ye,Fe,Me,rt)=>{const Ve=o?ke.clamp(Number(S)+rt.width,A,Number(M)):Number(S)+rt.width;e(iwe(Ve)),Me.removeAttribute("data-resize-alert"),o&&(Me.style.position="relative",Me.style.removeProperty("right"),Me.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(ye,Fe,Me,rt)=>{const Ve=ke.clamp(Number(S)+rt.width,A,Number(o?M:.95*window.innerWidth));Ve>=Jb&&!R?D(!0):VeVe-KD&&e(ov(Ve-KD)),o&&(Ve>=M?Me.setAttribute("data-resize-alert","true"):Me.removeAttribute("data-resize-alert")),Me.style.height=`${H}px`},children:[y.jsxs("div",{className:"image-gallery-header",children:[y.jsx(oo,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:R?y.jsxs(y.Fragment,{children:[y.jsx(nr,{size:"sm","data-selected":r==="result",onClick:()=>e(Lb("result")),children:t("gallery:generations")}),y.jsx(nr,{size:"sm","data-selected":r==="user",onClick:()=>e(Lb("user")),children:t("gallery:uploads")})]}):y.jsxs(y.Fragment,{children:[y.jsx(Je,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:y.jsx(EEe,{}),onClick:()=>e(Lb("result"))}),y.jsx(Je,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:y.jsx(FEe,{}),onClick:()=>e(Lb("user"))})]})}),y.jsxs("div",{className:"image-gallery-header-right-icons",children:[y.jsx(Js,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:y.jsx(Je,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:y.jsx(jP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:y.jsxs("div",{className:"image-gallery-settings-popover",children:[y.jsxs("div",{children:[y.jsx(so,{value:l,onChange:re,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),y.jsx(Je,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(ov(64)),icon:y.jsx(Yx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),y.jsx("div",{children:y.jsx(er,{label:t("gallery:maintainAspectRatio"),isChecked:h==="contain",onChange:()=>e(nwe(h==="contain"?"cover":"contain"))})}),y.jsx("div",{children:y.jsx(er,{label:t("gallery:autoSwitchNewImages"),isChecked:v,onChange:ye=>e(rwe(ye.target.checked))})}),y.jsx("div",{children:y.jsx(er,{label:t("gallery:singleColumnLayout"),isChecked:T,onChange:ye=>e(owe(ye.target.checked))})})]})}),y.jsx(Je,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:W,icon:o?y.jsx(Bq,{}):y.jsx($q,{})})]})]}),y.jsx("div",{className:"image-gallery-container",ref:G,children:n.length||b?y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(ye=>{const{uuid:Fe}=ye,Me=i===Fe;return y.jsx(SY,{image:ye,isSelected:Me},Fe)})}),y.jsx(ls,{onClick:Q,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):y.jsxs("div",{className:"image-gallery-container-placeholder",children:[y.jsx(Fq,{}),y.jsx("p",{children:t("gallery:noImagesInGallery")})]})})]}),j&&y.jsx("div",{style:{width:`${S}px`,height:"100%"}})]})})}/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var J8=function(e,t){return J8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},J8(e,t)};function LLe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");J8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ou=function(){return ou=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function mf(e,t,n,r){var i=ULe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=t.scale-s,h=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):_Y(e,r,n,function(v){var b=s+d*v,S=l+h*v,_=u+m*v;o(b,S,_)})}}function ULe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function GLe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,d=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:d}}var qLe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,d=s,h=r-i-l,m=l;return{minPositionX:u,maxPositionX:d,minPositionY:h,maxPositionY:m}},GP=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=GLe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,d=o.newContentHeight,h=o.newDiffHeight,m=qLe(a,l,u,s,d,h,Boolean(i));return m},c0=function(e,t){var n=GP(e,t);return e.bounds=n,n};function lw(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,d=n.maxPositionY,h=0,m=0;a&&(h=i,m=o);var v=e_(e,s-h,u+h,r),b=e_(t,l-m,d+m,r);return{x:v,y:b}}var e_=function(e,t,n,r){return r?en?os(n,2):os(e,2):os(e,2)};function uw(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var h=l-t*d,m=u-n*d,v=lw(h,m,i,o,0,0,null);return v}function Yy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var QD=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=cw(o,n);return!l},JD=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},YLe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},KLe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function XLe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var d=e.bounds,h=d.maxPositionX,m=d.minPositionX,v=d.maxPositionY,b=d.minPositionY,S=n>h||nv||rh?u.offsetWidth:e.setup.minPositionX||0,k=r>v?u.offsetHeight:e.setup.minPositionY||0,T=uw(e,E,k,i,e.bounds,s||l),A=T.x,M=T.y;return{scale:i,positionX:S?A:n,positionY:_?M:r}}}function ZLe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,d=l.positionX,h=l.positionY,m=t!==d,v=n!==h,b=!m||!v;if(!(!a||b||!s)){var S=lw(t,n,s,o,r,i,a),_=S.x,E=S.y;e.setTransformState(u,_,E)}}var QLe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var d=t-r.x,h=n-r.y,m=a?l:d,v=s?u:h;return{x:m,y:v}},dS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},JLe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},eAe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function tAe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function eN(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var d=a+(e-a)*u;return d>l?l:do?o:d}}return r?t:e_(e,o,a,i)}function nAe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function rAe(e,t){var n=JLe(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=nAe(a,s),d=t.x-r.x,h=t.y-r.y,m=d/u,v=h/u,b=l-i,S=d*d+h*h,_=Math.sqrt(S)/b;e.velocity={velocityX:m,velocityY:v,total:_}}e.lastMousePosition=t,e.velocityTime=l}}function iAe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=eAe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,d=n.minPositionX,h=n.maxPositionY,m=n.minPositionY,v=r.limitToBounds,b=r.alignmentAnimation,S=r.zoomAnimation,_=r.panning,E=_.lockAxisY,k=_.lockAxisX,T=S.animationType,A=b.sizeX,M=b.sizeY,R=b.velocityAlignmentTime,D=R,j=tAe(e,l),z=Math.max(j,D),H=dS(e,A),K=dS(e,M),te=H*i.offsetWidth/100,G=K*i.offsetHeight/100,$=u+te,W=d-te,X=h+G,Z=m-G,U=e.transformState,Q=new Date().getTime();_Y(e,T,z,function(re){var fe=e.transformState,Ee=fe.scale,be=fe.positionX,ye=fe.positionY,Fe=new Date().getTime()-Q,Me=Fe/D,rt=wY[b.animationType],Ve=1-rt(Math.min(1,Me)),je=1-re,wt=be+a*je,Be=ye+s*je,at=eN(wt,U.positionX,be,k,v,d,u,W,$,Ve),bt=eN(Be,U.positionY,ye,E,v,m,h,Z,X,Ve);(be!==wt||ye!==Be)&&e.setTransformState(Ee,at,bt)})}}function tN(e,t){var n=e.transformState.scale;Ul(e),c0(e,n),t.touches?KLe(e,t):YLe(e,t)}function nN(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(r){var l=QLe(e,t,n),u=l.x,d=l.y,h=dS(e,a),m=dS(e,s);rAe(e,{x:u,y:d}),ZLe(e,u,d,h,m)}}function oAe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,d=(a==null?void 0:a.height)||0,h=s.1&&h;m?iAe(e):kY(e)}}function kY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,d=o||t=a;if((r>=1||s)&&kY(e),!(m||!i||!e.mounted)){var v=t||i.offsetWidth/2,b=n||i.offsetHeight/2,S=qP(e,a,v,b);S&&mf(e,S,d,h)}}function qP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Yy(os(t,2),o,a,0,!1),u=c0(e,l),d=uw(e,n,r,l,u,s),h=d.x,m=d.y;return{scale:l,positionX:h,positionY:m}}var pm={previousScale:1,scale:1,positionX:0,positionY:0},aAe=ou(ou({},pm),{setComponents:function(){},contextInstance:null}),pv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},PY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:pm.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:pm.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:pm.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:pm.positionY}},rN=function(e){var t=ou({},pv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof pv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(pv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=ou(ou({},pv[n]),e[n]):s?t[n]=ZD(ZD([],pv[n]),e[n]):t[n]=e[n]}}),t},TY=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var d=r*Math.exp(t*n),h=Yy(os(d,3),s,a,u,!1);return h};function LY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var d=o.offsetWidth,h=o.offsetHeight,m=(d/2-l)/s,v=(h/2-u)/s,b=TY(e,t,n),S=qP(e,b,m,v);if(!S)return console.error("Error during zoom event. New transformation state was not calculated.");mf(e,S,r,i)}function AY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=PY(e.props),s=e.transformState,l=s.scale,u=s.positionX,d=s.positionY;if(i){var h=GP(e,a.scale),m=lw(a.positionX,a.positionY,h,o,0,0,i),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&d===a.positionY||mf(e,v,t,n)}}function sAe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return pm;var l=r.getBoundingClientRect(),u=lAe(t),d=u.x,h=u.y,m=t.offsetWidth,v=t.offsetHeight,b=r.offsetWidth/m,S=r.offsetHeight/v,_=Yy(n||Math.min(b,S),a,s,0,!1),E=(l.width-m*_)/2,k=(l.height-v*_)/2,T=(l.left-d)*_+E,A=(l.top-h)*_+k,M=GP(e,_),R=lw(T,A,M,o,0,0,r),D=R.x,j=R.y;return{positionX:D,positionY:j,scale:_}}function lAe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function uAe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var cAe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),LY(e,1,t,n,r)}},dAe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),LY(e,-1,t,n,r)}},fAe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,d=e.wrapperComponent,h=e.contentComponent,m=e.setup.disabled;if(!(m||!d||!h)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};mf(e,v,i,o)}}},hAe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),AY(e,t,n)}},pAe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=OY(t||i.scale,o,a);mf(e,s,n,r)}}},gAe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Ul(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&uAe(a)&&a&&o.contains(a)){var s=sAe(e,a,n);mf(e,s,r,i)}}},ri=function(e){return{instance:e,state:e.transformState,zoomIn:cAe(e),zoomOut:dAe(e),setTransform:fAe(e),resetTransform:hAe(e),centerView:pAe(e),zoomToElement:gAe(e)}},GC=!1;function qC(){try{var e={get passive(){return GC=!0,!1}};return e}catch{return GC=!1,GC}}var cw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},iN=function(e){e&&clearTimeout(e)},mAe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},OY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},vAe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,d=s&&!l&&!r&&u;if(!d||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var h=cw(u,a);return!h};function yAe(e,t){var n=e?e.deltaY<0?1:-1:0,r=ALe(t,n);return r}function MY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var bAe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,d=s.zoomAnimation,h=d.size,m=d.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*n)*n;if(i)return v;var b=r?!1:!m,S=Yy(os(v,3),u,l,h,b);return S},SAe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},xAe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=cw(a,i);return!l},wAe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},CAe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=os(i[0].clientX-r.left,5),a=os(i[0].clientY-r.top,5),s=os(i[1].clientX-r.left,5),l=os(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},IY=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},_Ae=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var d=t/r,h=d*n;return Yy(os(h,2),a,o,l,!u)},kAe=160,EAe=100,PAe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Ul(e),Pi(ri(e),t,r),Pi(ri(e),t,i))},TAe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,d=a.centerZoomedOut,h=a.zoomAnimation,m=a.wheel,v=h.size,b=h.disabled,S=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var _=yAe(t,null),E=bAe(e,_,S,!t.ctrlKey);if(l!==E){var k=c0(e,E),T=MY(t,o,l),A=b||v===0||d,M=u&&A,R=uw(e,T.x,T.y,E,k,M),D=R.x,j=R.y;e.previousWheelEvent=t,e.setTransformState(E,D,j),Pi(ri(e),t,r),Pi(ri(e),t,i)}},LAe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;iN(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(EY(e,t.x,t.y),e.wheelAnimationTimer=null)},EAe);var o=SAe(e,t);o&&(iN(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Pi(ri(e),t,r),Pi(ri(e),t,i))},kAe))},AAe=function(e,t){var n=IY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Ul(e)},OAe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,d=l.size;if(!(r===null||!n)){var h=CAe(t,i,n);if(!(!isFinite(h.x)||!isFinite(h.y))){var m=IY(t),v=_Ae(e,m);if(v!==i){var b=c0(e,v),S=u||d===0||s,_=a&&S,E=uw(e,h.x,h.y,v,b,_),k=E.x,T=E.y;e.pinchMidpoint=h,e.lastDistance=m,e.setTransformState(v,k,T)}}}},MAe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,EY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function IAe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return AY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var d=i==="zoomOut"?-1:1,h=TY(e,d,o),m=MY(t,u,l),v=qP(e,h,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");mf(e,v,a,s)}}var RAe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),d=n&&l&&u&&!a;if(!d)return!1;var h=cw(l,s);return!(h||!d)},RY=N.createContext(aAe),DAe=function(e){LLe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=PY(n.props),n.setup=rN(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=qC();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=vAe(n,r);if(o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(PAe(n,r),TAe(n,r),LAe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=QD(n,r);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),Ul(n),tN(n,r),Pi(ri(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=JD(n);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),nN(n,r.clientX,r.clientY),Pi(ri(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(oAe(n),Pi(ri(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=xAe(n,r);l&&(AAe(n,r),Ul(n),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=wAe(n);l&&(r.preventDefault(),r.stopPropagation(),OAe(n,r),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(MAe(n),Pi(ri(n),r,o),Pi(ri(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=QD(n,r);if(a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Ul(n);var l=r.touches,u=l.length===1,d=l.length===2;u&&(Ul(n),tN(n,r),Pi(ri(n),r,o)),d&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=JD(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];nN(n,s.clientX,s.clientY),Pi(ri(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=RAe(n,r);o&&IAe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,c0(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Pi(ri(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=OY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=mAe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ri(n))},n}return t.prototype.componentDidMount=function(){var n=qC();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=qC();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Ul(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(c0(this,this.transformState.scale),this.setup=rN(this.props))},t.prototype.render=function(){var n=ri(this),r=this.props.children,i=typeof r=="function"?r(n):r;return N.createElement(RY.Provider,{value:ou(ou({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},i)},t}(w.Component),NAe=N.forwardRef(function(e,t){var n=w.useState(null),r=n[0],i=n[1];return w.useImperativeHandle(t,function(){return r},[r]),N.createElement(DAe,ou({},e,{setRef:i}))});function jAe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var BAe=`.transform-component-module_wrapper__1_Fgj { + position: relative; + width: -moz-fit-content; + width: fit-content; + height: -moz-fit-content; + height: fit-content; + overflow: hidden; + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; + margin: 0; + padding: 0; +} +.transform-component-module_content__2jYgh { + display: flex; + flex-wrap: wrap; + width: -moz-fit-content; + width: fit-content; + height: -moz-fit-content; + height: fit-content; + margin: 0; + padding: 0; + transform-origin: 0% 0%; +} +.transform-component-module_content__2jYgh img { + pointer-events: none; +} +`,oN={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};jAe(BAe);var $Ae=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=w.useContext(RY).setComponents,u=w.useRef(null),d=w.useRef(null);return w.useEffect(function(){var h=u.current,m=d.current;h!==null&&m!==null&&l&&l(h,m)},[]),N.createElement("div",{ref:u,className:"react-transform-wrapper "+oN.wrapper+" "+r,style:a},N.createElement("div",{ref:d,className:"react-transform-component "+oN.content+" "+o,style:s},t))};function FAe({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=w.useState(0),[a,s]=w.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},d=()=>{s(!a)};return y.jsx(NAe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:h,zoomOut:m,resetTransform:v,centerView:b})=>y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"lightbox-image-options",children:[y.jsx(Je,{icon:y.jsx(A_e,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>h(),fontSize:20}),y.jsx(Je,{icon:y.jsx(O_e,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),y.jsx(Je,{icon:y.jsx(T_e,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),y.jsx(Je,{icon:y.jsx(L_e,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),y.jsx(Je,{icon:y.jsx(sPe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),y.jsx(Je,{icon:y.jsx(Yx,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{v(),o(0),s(!1)},fontSize:20})]}),y.jsx($Ae,{wrapperStyle:{width:"100%",height:"100%"},children:y.jsx("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function zAe(){const e=Oe(),t=he(m=>m.lightbox.isLightboxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=he(Nq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(dP())},h=()=>{e(cP())};return et("Esc",()=>{t&&e(zm(!1))},[t]),y.jsxs("div",{className:"lightbox-container",children:[y.jsx(Je,{icon:y.jsx(P_e,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(zm(!1))},fontSize:20}),y.jsxs("div",{className:"lightbox-display-container",children:[y.jsxs("div",{className:"lightbox-preview-wrapper",children:[y.jsx(Rq,{}),!r&&y.jsxs("div",{className:"current-image-next-prev-buttons",children:[y.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&y.jsx(us,{"aria-label":"Previous image",icon:y.jsx(Cq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),y.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&y.jsx(us,{"aria-label":"Next image",icon:y.jsx(_q,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),n&&y.jsxs(y.Fragment,{children:[y.jsx(FAe,{image:n.url,styleClass:"lightbox-image"}),r&&y.jsx(BP,{image:n})]})]}),y.jsx(xY,{})]})]})}function HAe(e){return mt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}const VAe=lt(xp,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),WAe=()=>{const{resultImages:e,userImages:t}=he(VAe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},UAe=lt([bp,qx,Mr],(e,t,n)=>{const{shouldShowDualDisplay:r,shouldPinParametersPanel:i}=e,{isLightboxOpen:o}=t;return{shouldShowDualDisplay:r,shouldPinParametersPanel:i,isLightboxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),YP=e=>{const t=Oe(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,shouldShowDualDisplay:a,isLightboxOpen:s,shouldShowDualDisplayButton:l}=he(UAe),u=WAe(),d=()=>{t(ECe(!a)),t(vi(!0))},h=m=>{const v=m.dataTransfer.getData("invokeai/imageUuid"),b=u(v);b&&(o==="img2img"?t(P0(b)):o==="unifiedCanvas"&&t($x(b)))};return y.jsx("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:y.jsxs("div",{className:"workarea-main",children:[n,y.jsxs("div",{className:"workarea-children-wrapper",onDrop:h,children:[r,l&&y.jsx(uo,{label:"Toggle Split View",children:y.jsx("div",{className:"workarea-split-button","data-selected":a,onClick:d,children:y.jsx(HAe,{})})})]}),!s&&y.jsx(xY,{})]})})},GAe=e=>{const{styleClass:t}=e,n=w.useContext(EP),r=()=>{n&&n()};return y.jsx("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:y.jsxs("div",{className:"image-upload-button",children:[y.jsx(tw,{}),y.jsx(jh,{size:"lg",children:"Click or Drag and Drop"})]})})},qAe=lt([xp,bp,Mr],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),DY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=he(qAe);return y.jsx("div",{className:"current-image-area","data-tab-name":t,children:e?y.jsxs(y.Fragment,{children:[y.jsx(Rq,{}),y.jsx(KEe,{})]}):y.jsx("div",{className:"current-image-display-placeholder",children:y.jsx(lPe,{})})})},YAe=()=>{const e=w.useContext(EP);return y.jsx(Je,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:y.jsx(tw,{}),onClick:e||void 0})};function KAe(){const e=he(o=>o.generation.initialImage),{t}=Ue(),n=Oe(),r=By(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(vU())};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"init-image-preview-header",children:[y.jsx("h2",{children:t("parameters:initialImage")}),y.jsx(YAe,{})]}),e&&y.jsx("div",{className:"init-image-preview",children:y.jsx(JS,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const XAe=()=>{const e=he(r=>r.generation.initialImage),{currentImage:t}=he(r=>r.gallery),n=e?y.jsx("div",{className:"image-to-image-area",children:y.jsx(KAe,{})}):y.jsx(GAe,{});return y.jsxs("div",{className:"workarea-split-view",children:[y.jsx("div",{className:"workarea-split-view-left",children:n}),t&&y.jsx("div",{className:"workarea-split-view-right",children:y.jsx(DY,{})})]})};var ao=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(ao||{});const ZAe=()=>{const{t:e}=Ue();return w.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},QAe=e=>ZAe()[e],Us=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return y.jsxs(fn,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[y.jsx(En,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),y.jsx(WE,{className:"invokeai__switch-root",...s})]})};function NY(){const e=he(i=>i.system.isGFPGANAvailable),t=he(i=>i.postprocessing.shouldRunFacetool),n=Oe(),r=i=>n(wwe(i.target.checked));return y.jsx(Us,{isDisabled:!e,isChecked:t,onChange:r})}function JAe(){const e=Oe(),t=he(i=>i.generation.shouldFitToWidthHeight),n=i=>e(PU(i.target.checked)),{t:r}=Ue();return y.jsx(Us,{label:r("parameters:imageFit"),isChecked:t,onChange:n})}function jY(e){const{t}=Ue(),{label:n=`${t("parameters:strength")}`,styleClass:r}=e,i=he(l=>l.generation.img2imgStrength),o=Oe(),a=l=>o(p8(l)),s=()=>{o(p8(.75))};return y.jsx(so,{label:n,step:.01,min:.01,max:1,onChange:a,value:i,isInteger:!1,styleClass:r,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:s})}const BY=()=>{const e=Oe(),t=he(i=>i.generation.seamless),n=i=>e(kU(i.target.checked)),{t:r}=Ue();return y.jsx(Ge,{gap:2,direction:"column",children:y.jsx(Us,{label:r("parameters:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},eOe=()=>y.jsx(Ge,{gap:2,direction:"column",children:y.jsx(BY,{})});function tOe(){const e=Oe(),t=he(i=>i.generation.perlin),{t:n}=Ue(),r=i=>e(CU(i));return y.jsx(ia,{label:n("parameters:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}function nOe(){const e=Oe(),{t}=Ue(),n=he(i=>i.generation.shouldRandomizeSeed),r=i=>e(mwe(i.target.checked));return y.jsx(Us,{label:t("parameters:randomizeSeed"),isChecked:n,onChange:r})}function rOe(){const e=he(a=>a.generation.seed),t=he(a=>a.generation.shouldRandomizeSeed),n=he(a=>a.generation.shouldGenerateVariations),{t:r}=Ue(),i=Oe(),o=a=>i(Fy(a));return y.jsx(ia,{label:r("parameters:seed"),step:1,precision:0,flexGrow:1,min:bP,max:SP,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function iOe(){const e=Oe(),t=he(i=>i.generation.shouldRandomizeSeed),{t:n}=Ue(),r=()=>e(Fy(eq(bP,SP)));return y.jsx(ls,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:y.jsx("p",{children:n("parameters:shuffle")})})}function oOe(){const e=Oe(),t=he(i=>i.generation.threshold),{t:n}=Ue(),r=i=>e(LU(i));return y.jsx(ia,{label:n("parameters:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}const KP=()=>y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(nOe,{}),y.jsxs(Ge,{gap:2,children:[y.jsx(rOe,{}),y.jsx(iOe,{})]}),y.jsx(Ge,{gap:2,children:y.jsx(oOe,{})}),y.jsx(Ge,{gap:2,children:y.jsx(tOe,{})})]});function $Y(){const e=he(i=>i.system.isESRGANAvailable),t=he(i=>i.postprocessing.shouldRunESRGAN),n=Oe(),r=i=>n(xwe(i.target.checked));return y.jsx(Us,{isDisabled:!e,isChecked:t,onChange:r})}function XP(){const e=he(r=>r.generation.shouldGenerateVariations),t=Oe(),n=r=>t(gwe(r.target.checked));return y.jsx(Us,{isChecked:e,width:"auto",onChange:n})}function br(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return y.jsxs(fn,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&y.jsx(En,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),y.jsx(bk,{...l,className:"input-entry",size:a,width:o})]})}function aOe(){const e=he(o=>o.generation.seedWeights),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ue(),r=Oe(),i=o=>r(EU(o.target.value));return y.jsx(br,{label:n("parameters:seedWeights"),value:e,isInvalid:t&&!(hP(e)||e===""),isDisabled:!t,onChange:i})}function sOe(){const e=he(o=>o.generation.variationAmount),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ue(),r=Oe(),i=o=>r(vwe(o));return y.jsx(ia,{label:n("parameters:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const ZP=()=>y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(sOe,{}),y.jsx(aOe,{})]});function lOe(){const e=Oe(),t=he(i=>i.generation.cfgScale),{t:n}=Ue(),r=i=>e(bU(i));return y.jsx(ia,{label:n("parameters:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function uOe(){const e=he(o=>o.generation.height),t=he(Mr),n=Oe(),{t:r}=Ue(),i=o=>n(SU(Number(o.target.value)));return y.jsx(rl,{isDisabled:t==="unifiedCanvas",label:r("parameters:height"),value:e,flexGrow:1,onChange:i,validValues:S7e,styleClass:"main-settings-block"})}const cOe=lt([e=>e.generation],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function dOe(){const e=Oe(),{iterations:t}=he(cOe),{t:n}=Ue(),r=i=>e(pwe(i));return y.jsx(ia,{label:n("parameters:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function fOe(){const e=he(o=>o.generation.sampler),t=he(oq),n=Oe(),{t:r}=Ue(),i=o=>n(_U(o.target.value));return y.jsx(rl,{label:r("parameters:sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?y7e:v7e,styleClass:"main-settings-block"})}function hOe(){const e=Oe(),t=he(i=>i.generation.steps),{t:n}=Ue(),r=i=>e(TU(i));return y.jsx(ia,{label:n("parameters:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function pOe(){const e=he(o=>o.generation.width),t=he(Mr),{t:n}=Ue(),r=Oe(),i=o=>r(AU(Number(o.target.value)));return y.jsx(rl,{isDisabled:t==="unifiedCanvas",label:n("parameters:width"),value:e,flexGrow:1,onChange:i,validValues:b7e,styleClass:"main-settings-block"})}function QP(){return y.jsx("div",{className:"main-settings",children:y.jsxs("div",{className:"main-settings-list",children:[y.jsxs("div",{className:"main-settings-row",children:[y.jsx(dOe,{}),y.jsx(hOe,{}),y.jsx(lOe,{})]}),y.jsxs("div",{className:"main-settings-row",children:[y.jsx(pOe,{}),y.jsx(uOe,{}),y.jsx(fOe,{})]})]})})}const gOe=lt(or,e=>e.shouldDisplayGuides),mOe=({children:e,feature:t})=>{const n=he(gOe),{text:r}=QAe(t);return n?y.jsxs(BE,{trigger:"hover",children:[y.jsx(zE,{children:y.jsx(Eo,{children:e})}),y.jsxs(FE,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[y.jsx($E,{className:"guide-popover-arrow"}),y.jsx("div",{className:"guide-popover-guide-content",children:r})]})]}):null},vOe=Ae(({feature:e,icon:t=oPe},n)=>y.jsx(mOe,{feature:e,children:y.jsx(Eo,{ref:n,children:y.jsx(Na,{marginBottom:"-.15rem",as:t})})}));function yOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return y.jsxs(Kg,{className:"advanced-parameters-item",children:[y.jsx(qg,{className:"advanced-parameters-header",children:y.jsxs(Ge,{width:"100%",gap:"0.5rem",align:"center",children:[y.jsx(Eo,{flexGrow:1,textAlign:"left",children:t}),i,n&&y.jsx(vOe,{feature:n}),y.jsx(Yg,{})]})}),y.jsx(Xg,{className:"advanced-parameters-panel",children:r})]})}const JP=e=>{const{accordionInfo:t}=e,n=he(a=>a.system.openAccordions),r=Oe(),i=a=>r(lCe(a)),o=()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:d,additionalHeaderComponents:h}=t[s];a.push(y.jsx(yOe,{header:l,feature:u,content:d,additionalHeaderComponents:h},s))}),a};return y.jsx(dk,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:i,className:"advanced-parameters",children:o()})},bOe=lt(or,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function eT(e){const{...t}=e,n=Oe(),{isProcessing:r,isConnected:i,isCancelable:o}=he(bOe),a=()=>n(J8e()),{t:s}=Ue();return et("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),y.jsx(Je,{icon:y.jsx(uPe,{}),tooltip:s("parameters:cancel"),"aria-label":s("parameters:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const tT=e=>e.generation;lt(tT,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:ke.isEqual}});const FY=lt([tT,or,Iq,Mr],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:d}=t;let h=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(h=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(h=!1,m.push("No initial image selected")),u&&(h=!1,m.push("System Busy")),d||(h=!1,m.push("System Disconnected")),o&&(!(hP(a)||a==="")||l===-1)&&(h=!1,m.push("Seed-Weights badly formatted.")),{isReady:h,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:ke.isEqual,resultEqualityCheck:ke.isEqual}});function nT(e){const{iconButton:t=!1,...n}=e,r=Oe(),{isReady:i}=he(FY),o=he(Mr),a=()=>{r($8(o))},{t:s}=Ue();return et(["ctrl+enter","meta+enter"],()=>{r($8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),y.jsx("div",{style:{flexGrow:4},children:t?y.jsx(Je,{"aria-label":s("parameters:invoke"),type:"submit",icon:y.jsx(MEe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("parameters:invoke"),tooltipProps:{placement:"bottom"},...n}):y.jsx(nr,{"aria-label":s("parameters:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const SOe=lt(Wy,({shouldLoopback:e})=>e),xOe=()=>{const e=Oe(),t=he(SOe),{t:n}=Ue();return y.jsx(Je,{"aria-label":n("parameters:toggleLoopback"),tooltip:n("parameters:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:y.jsx(REe,{}),onClick:()=>{e(Swe(!t))}})},rT=()=>{const e=he(Mr);return y.jsxs("div",{className:"process-buttons",children:[y.jsx(nT,{}),e==="img2img"&&y.jsx(xOe,{}),y.jsx(eT,{})]})},iT=()=>{const e=he(r=>r.generation.negativePrompt),t=Oe(),{t:n}=Ue();return y.jsx(fn,{children:y.jsx(UE,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(ny(r.target.value)),background:"var(--prompt-bg-color)",placeholder:n("parameters:negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},wOe=lt([e=>e.generation,Mr],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),oT=()=>{const e=Oe(),{prompt:t,activeTabName:n}=he(wOe),{isReady:r}=he(FY),i=w.useRef(null),{t:o}=Ue(),a=l=>{e(Fx(l.target.value))};et("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e($8(n)))};return y.jsx("div",{className:"prompt-bar",children:y.jsx(fn,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:y.jsx(UE,{id:"prompt",name:"prompt",placeholder:o("parameters:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},zY=""+new URL("logo-13003d72.png",import.meta.url).href,COe=lt(bp,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),aT=e=>{const t=Oe(),{shouldShowParametersPanel:n,shouldHoldParametersPanelOpen:r,shouldPinParametersPanel:i}=he(COe),o=w.useRef(null),a=w.useRef(null),s=w.useRef(null),{children:l}=e;et("o",()=>{t(Zu(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),et("esc",()=>{t(Zu(!1))},{enabled:()=>!i,preventDefault:!0},[i]),et("shift+o",()=>{m(),t(vi(!0))},[i]);const u=w.useCallback(()=>{i||(t(CCe(a.current?a.current.scrollTop:0)),t(Zu(!1)),t(_Ce(!1)))},[t,i]),d=()=>{s.current=window.setTimeout(()=>u(),500)},h=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(kCe(!i)),t(vi(!0))};return w.useEffect(()=>{function v(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[u]),y.jsx(Vq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:y.jsx("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:h,onMouseOver:i?void 0:h,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:y.jsx("div",{className:"parameters-panel-margin",children:y.jsxs("div",{className:"parameters-panel",ref:a,onMouseLeave:v=>{v.target!==a.current?h():!i&&d()},children:[y.jsx(uo,{label:"Pin Options Panel",children:y.jsx("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:m,children:i?y.jsx(Bq,{}):y.jsx($q,{})})}),!i&&y.jsxs("div",{className:"invoke-ai-logo-wrapper",children:[y.jsx("img",{src:zY,alt:"invoke-ai-logo"}),y.jsxs("h1",{children:["invoke ",y.jsx("strong",{children:"ai"})]})]}),l]})})})})};function _Oe(){const{t:e}=Ue(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:y.jsx(KP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:y.jsx(ZP,{}),additionalHeaderComponents:y.jsx(XP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:y.jsx(TP,{}),additionalHeaderComponents:y.jsx(NY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:y.jsx(LP,{}),additionalHeaderComponents:y.jsx($Y,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:y.jsx(eOe,{})}},n=Oe(),r=he(Mr);return w.useEffect(()=>{r==="img2img"&&n(pP(!1))},[r,n]),y.jsxs(aT,{children:[y.jsxs(Ge,{flexDir:"column",rowGap:"0.5rem",children:[y.jsx(oT,{}),y.jsx(iT,{})]}),y.jsx(rT,{}),y.jsx(QP,{}),y.jsx(jY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),y.jsx(JAe,{}),y.jsx(JP,{accordionInfo:t})]})}function kOe(){return y.jsx(YP,{optionsPanel:y.jsx(_Oe,{}),children:y.jsx(XAe,{})})}const EOe=()=>y.jsx("div",{className:"workarea-single-view",children:y.jsx("div",{className:"text-to-image-area",children:y.jsx(DY,{})})}),POe=lt([Wy],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),TOe=()=>{const{hiresFix:e,hiresStrength:t}=he(POe),n=Oe(),{t:r}=Ue(),i=a=>{n(XI(a))},o=()=>{n(XI(.75))};return y.jsx(so,{label:r("parameters:hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:o,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},LOe=()=>{const e=Oe(),t=he(i=>i.postprocessing.hiresFix),{t:n}=Ue(),r=i=>e(pP(i.target.checked));return y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(Us,{label:n("parameters:hiresOptim"),fontSize:"md",isChecked:t,onChange:r}),y.jsx(TOe,{})]})},AOe=()=>y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(BY,{}),y.jsx(LOe,{})]});function OOe(){const{t:e}=Ue(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:y.jsx(KP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:y.jsx(ZP,{}),additionalHeaderComponents:y.jsx(XP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:y.jsx(TP,{}),additionalHeaderComponents:y.jsx(NY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:y.jsx(LP,{}),additionalHeaderComponents:y.jsx($Y,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:y.jsx(AOe,{})}};return y.jsxs(aT,{children:[y.jsxs(Ge,{flexDir:"column",rowGap:"0.5rem",children:[y.jsx(oT,{}),y.jsx(iT,{})]}),y.jsx(rT,{}),y.jsx(QP,{}),y.jsx(JP,{accordionInfo:t})]})}function MOe(){return y.jsx(YP,{optionsPanel:y.jsx(OOe,{}),children:y.jsx(EOe,{})})}var t_={},IOe={get exports(){return t_},set exports(e){t_=e}};/** + * @license React + * react-reconciler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ROe=function(t){var n={},r=w,i=Fh,o=Object.assign;function a(f){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+f,x=1;xle||L[q]!==I[le]){var pe=` +`+L[q].replace(" at new "," at ");return f.displayName&&pe.includes("")&&(pe=pe.replace("",f.displayName)),pe}while(1<=q&&0<=le);break}}}finally{ll=!1,Error.prepareStackTrace=x}return(f=f?f.displayName||f.name:"")?Su(f):""}var Op=Object.prototype.hasOwnProperty,Cc=[],ul=-1;function aa(f){return{current:f}}function Dn(f){0>ul||(f.current=Cc[ul],Cc[ul]=null,ul--)}function Tn(f,p){ul++,Cc[ul]=f.current,f.current=p}var sa={},Hr=aa(sa),li=aa(!1),la=sa;function cl(f,p){var x=f.type.contextTypes;if(!x)return sa;var P=f.stateNode;if(P&&P.__reactInternalMemoizedUnmaskedChildContext===p)return P.__reactInternalMemoizedMaskedChildContext;var L={},I;for(I in x)L[I]=p[I];return P&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=p,f.__reactInternalMemoizedMaskedChildContext=L),L}function ui(f){return f=f.childContextTypes,f!=null}function bs(){Dn(li),Dn(Hr)}function xf(f,p,x){if(Hr.current!==sa)throw Error(a(168));Tn(Hr,p),Tn(li,x)}function wu(f,p,x){var P=f.stateNode;if(p=p.childContextTypes,typeof P.getChildContext!="function")return x;P=P.getChildContext();for(var L in P)if(!(L in p))throw Error(a(108,j(f)||"Unknown",L));return o({},x,P)}function Ss(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||sa,la=Hr.current,Tn(Hr,f),Tn(li,li.current),!0}function wf(f,p,x){var P=f.stateNode;if(!P)throw Error(a(169));x?(f=wu(f,p,la),P.__reactInternalMemoizedMergedChildContext=f,Dn(li),Dn(Hr),Tn(Hr,f)):Dn(li),Tn(li,x)}var Ii=Math.clz32?Math.clz32:Cf,Mp=Math.log,Ip=Math.LN2;function Cf(f){return f>>>=0,f===0?32:31-(Mp(f)/Ip|0)|0}var dl=64,Ro=4194304;function fl(f){switch(f&-f){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function Cu(f,p){var x=f.pendingLanes;if(x===0)return 0;var P=0,L=f.suspendedLanes,I=f.pingedLanes,q=x&268435455;if(q!==0){var le=q&~L;le!==0?P=fl(le):(I&=q,I!==0&&(P=fl(I)))}else q=x&~L,q!==0?P=fl(q):I!==0&&(P=fl(I));if(P===0)return 0;if(p!==0&&p!==P&&!(p&L)&&(L=P&-P,I=p&-p,L>=I||L===16&&(I&4194240)!==0))return p;if(P&4&&(P|=x&16),p=f.entangledLanes,p!==0)for(f=f.entanglements,p&=P;0x;x++)p.push(f);return p}function Fa(f,p,x){f.pendingLanes|=p,p!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,p=31-Ii(p),f[p]=x}function kf(f,p){var x=f.pendingLanes&~p;f.pendingLanes=p,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=p,f.mutableReadLanes&=p,f.entangledLanes&=p,p=f.entanglements;var P=f.eventTimes;for(f=f.expirationTimes;0>=q,L-=q,co=1<<32-Ii(p)+L|x<Gt?(ti=Rt,Rt=null):ti=Rt.sibling;var en=ot(me,Rt,Se[Gt],tt);if(en===null){Rt===null&&(Rt=ti);break}f&&Rt&&en.alternate===null&&p(me,Rt),ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en,Rt=ti}if(Gt===Se.length)return x(me,Rt),Wn&&hl(me,Gt),Ie;if(Rt===null){for(;GtGt?(ti=Rt,Rt=null):ti=Rt.sibling;var Ls=ot(me,Rt,en.value,tt);if(Ls===null){Rt===null&&(Rt=ti);break}f&&Rt&&Ls.alternate===null&&p(me,Rt),ue=I(Ls,ue,Gt),Bt===null?Ie=Ls:Bt.sibling=Ls,Bt=Ls,Rt=ti}if(en.done)return x(me,Rt),Wn&&hl(me,Gt),Ie;if(Rt===null){for(;!en.done;Gt++,en=Se.next())en=jt(me,en.value,tt),en!==null&&(ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en);return Wn&&hl(me,Gt),Ie}for(Rt=P(me,Rt);!en.done;Gt++,en=Se.next())en=Gn(Rt,me,Gt,en.value,tt),en!==null&&(f&&en.alternate!==null&&Rt.delete(en.key===null?Gt:en.key),ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en);return f&&Rt.forEach(function(ki){return p(me,ki)}),Wn&&hl(me,Gt),Ie}function ba(me,ue,Se,tt){if(typeof Se=="object"&&Se!==null&&Se.type===d&&Se.key===null&&(Se=Se.props.children),typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case l:e:{for(var Ie=Se.key,Bt=ue;Bt!==null;){if(Bt.key===Ie){if(Ie=Se.type,Ie===d){if(Bt.tag===7){x(me,Bt.sibling),ue=L(Bt,Se.props.children),ue.return=me,me=ue;break e}}else if(Bt.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===T&&r1(Ie)===Bt.type){x(me,Bt.sibling),ue=L(Bt,Se.props),ue.ref=Va(me,Bt,Se),ue.return=me,me=ue;break e}x(me,Bt);break}else p(me,Bt);Bt=Bt.sibling}Se.type===d?(ue=Pl(Se.props.children,me.mode,tt,Se.key),ue.return=me,me=ue):(tt=Jf(Se.type,Se.key,Se.props,null,me.mode,tt),tt.ref=Va(me,ue,Se),tt.return=me,me=tt)}return q(me);case u:e:{for(Bt=Se.key;ue!==null;){if(ue.key===Bt)if(ue.tag===4&&ue.stateNode.containerInfo===Se.containerInfo&&ue.stateNode.implementation===Se.implementation){x(me,ue.sibling),ue=L(ue,Se.children||[]),ue.return=me,me=ue;break e}else{x(me,ue);break}else p(me,ue);ue=ue.sibling}ue=Tl(Se,me.mode,tt),ue.return=me,me=ue}return q(me);case T:return Bt=Se._init,ba(me,ue,Bt(Se._payload),tt)}if(W(Se))return Nn(me,ue,Se,tt);if(R(Se))return mr(me,ue,Se,tt);Xi(me,Se)}return typeof Se=="string"&&Se!==""||typeof Se=="number"?(Se=""+Se,ue!==null&&ue.tag===6?(x(me,ue.sibling),ue=L(ue,Se),ue.return=me,me=ue):(x(me,ue),ue=Sg(Se,me.mode,tt),ue.return=me,me=ue),q(me)):x(me,ue)}return ba}var Rc=s3(!0),l3=s3(!1),Nf={},Bo=aa(Nf),Wa=aa(Nf),oe=aa(Nf);function we(f){if(f===Nf)throw Error(a(174));return f}function ve(f,p){Tn(oe,p),Tn(Wa,f),Tn(Bo,Nf),f=Z(p),Dn(Bo),Tn(Bo,f)}function it(){Dn(Bo),Dn(Wa),Dn(oe)}function It(f){var p=we(oe.current),x=we(Bo.current);p=U(x,f.type,p),x!==p&&(Tn(Wa,f),Tn(Bo,p))}function on(f){Wa.current===f&&(Dn(Bo),Dn(Wa))}var $t=aa(0);function mn(f){for(var p=f;p!==null;){if(p.tag===13){var x=p.memoizedState;if(x!==null&&(x=x.dehydrated,x===null||xc(x)||Sf(x)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if(p.flags&128)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var jf=[];function i1(){for(var f=0;fx?x:4,f(!0);var P=Dc.transition;Dc.transition={};try{f(!1),p()}finally{Yt=x,Dc.transition=P}}function Hc(){return Ni().memoizedState}function f1(f,p,x){var P=qr(f);if(x={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null},Wc(f))Uc(p,x);else if(x=Ic(f,p,x,P),x!==null){var L=_i();zo(x,f,P,L),Vf(x,p,P)}}function Vc(f,p,x){var P=qr(f),L={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null};if(Wc(f))Uc(p,L);else{var I=f.alternate;if(f.lanes===0&&(I===null||I.lanes===0)&&(I=p.lastRenderedReducer,I!==null))try{var q=p.lastRenderedState,le=I(q,x);if(L.hasEagerState=!0,L.eagerState=le,Y(le,q)){var pe=p.interleaved;pe===null?(L.next=L,Rf(p)):(L.next=pe.next,pe.next=L),p.interleaved=L;return}}catch{}finally{}x=Ic(f,p,L,P),x!==null&&(L=_i(),zo(x,f,P,L),Vf(x,p,P))}}function Wc(f){var p=f.alternate;return f===Ln||p!==null&&p===Ln}function Uc(f,p){Bf=cn=!0;var x=f.pending;x===null?p.next=p:(p.next=x.next,x.next=p),f.pending=p}function Vf(f,p,x){if(x&4194240){var P=p.lanes;P&=f.pendingLanes,x|=P,p.lanes=x,_u(f,x)}}var Cs={readContext:fo,useCallback:Si,useContext:Si,useEffect:Si,useImperativeHandle:Si,useInsertionEffect:Si,useLayoutEffect:Si,useMemo:Si,useReducer:Si,useRef:Si,useState:Si,useDebugValue:Si,useDeferredValue:Si,useTransition:Si,useMutableSource:Si,useSyncExternalStore:Si,useId:Si,unstable_isNewReconciler:!1},Sw={readContext:fo,useCallback:function(f,p){return di().memoizedState=[f,p===void 0?null:p],f},useContext:fo,useEffect:d3,useImperativeHandle:function(f,p,x){return x=x!=null?x.concat([f]):null,Tu(4194308,4,Dr.bind(null,p,f),x)},useLayoutEffect:function(f,p){return Tu(4194308,4,f,p)},useInsertionEffect:function(f,p){return Tu(4,2,f,p)},useMemo:function(f,p){var x=di();return p=p===void 0?null:p,f=f(),x.memoizedState=[f,p],f},useReducer:function(f,p,x){var P=di();return p=x!==void 0?x(p):p,P.memoizedState=P.baseState=p,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:p},P.queue=f,f=f.dispatch=f1.bind(null,Ln,f),[P.memoizedState,f]},useRef:function(f){var p=di();return f={current:f},p.memoizedState=f},useState:c3,useDebugValue:u1,useDeferredValue:function(f){return di().memoizedState=f},useTransition:function(){var f=c3(!1),p=f[0];return f=d1.bind(null,f[1]),di().memoizedState=f,[p,f]},useMutableSource:function(){},useSyncExternalStore:function(f,p,x){var P=Ln,L=di();if(Wn){if(x===void 0)throw Error(a(407));x=x()}else{if(x=p(),ei===null)throw Error(a(349));Pu&30||l1(P,p,x)}L.memoizedState=x;var I={value:x,getSnapshot:p};return L.queue=I,d3(ml.bind(null,P,I,f),[f]),P.flags|=2048,zf(9,Fc.bind(null,P,I,x,p),void 0,null),x},useId:function(){var f=di(),p=ei.identifierPrefix;if(Wn){var x=za,P=co;x=(P&~(1<<32-Ii(P)-1)).toString(32)+x,p=":"+p+"R"+x,x=Nc++,0cg&&(p.flags|=128,P=!0,Yc(L,!1),p.lanes=4194304)}else{if(!P)if(f=mn(I),f!==null){if(p.flags|=128,P=!0,f=f.updateQueue,f!==null&&(p.updateQueue=f,p.flags|=4),Yc(L,!0),L.tail===null&&L.tailMode==="hidden"&&!I.alternate&&!Wn)return xi(p),null}else 2*Kn()-L.renderingStartTime>cg&&x!==1073741824&&(p.flags|=128,P=!0,Yc(L,!1),p.lanes=4194304);L.isBackwards?(I.sibling=p.child,p.child=I):(f=L.last,f!==null?f.sibling=I:p.child=I,L.last=I)}return L.tail!==null?(p=L.tail,L.rendering=p,L.tail=p.sibling,L.renderingStartTime=Kn(),p.sibling=null,f=$t.current,Tn($t,P?f&1|2:f&1),p):(xi(p),null);case 22:case 23:return rd(),x=p.memoizedState!==null,f!==null&&f.memoizedState!==null!==x&&(p.flags|=8192),x&&p.mode&1?po&1073741824&&(xi(p),Be&&p.subtreeFlags&6&&(p.flags|=8192)):xi(p),null;case 24:return null;case 25:return null}throw Error(a(156,p.tag))}function S1(f,p){switch(J0(p),p.tag){case 1:return ui(p.type)&&bs(),f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 3:return it(),Dn(li),Dn(Hr),i1(),f=p.flags,f&65536&&!(f&128)?(p.flags=f&-65537|128,p):null;case 5:return on(p),null;case 13:if(Dn($t),f=p.memoizedState,f!==null&&f.dehydrated!==null){if(p.alternate===null)throw Error(a(340));Ac()}return f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 19:return Dn($t),null;case 4:return it(),null;case 10:return Mf(p.type._context),null;case 22:case 23:return rd(),null;case 24:return null;default:return null}}var yl=!1,Wr=!1,Ew=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Kc(f,p){var x=f.ref;if(x!==null)if(typeof x=="function")try{x(null)}catch(P){Zn(f,p,P)}else x.current=null}function ga(f,p,x){try{x()}catch(P){Zn(f,p,P)}}var Zp=!1;function Au(f,p){for(Q(f.containerInfo),dt=p;dt!==null;)if(f=dt,p=f.child,(f.subtreeFlags&1028)!==0&&p!==null)p.return=f,dt=p;else for(;dt!==null;){f=dt;try{var x=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var P=x.memoizedProps,L=x.memoizedState,I=f.stateNode,q=I.getSnapshotBeforeUpdate(f.elementType===f.type?P:ca(f.type,P),L);I.__reactInternalSnapshotBeforeUpdate=q}break;case 3:Be&&ol(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(le){Zn(f,f.return,le)}if(p=f.sibling,p!==null){p.return=f.return,dt=p;break}dt=f.return}return x=Zp,Zp=!1,x}function wi(f,p,x){var P=p.updateQueue;if(P=P!==null?P.lastEffect:null,P!==null){var L=P=P.next;do{if((L.tag&f)===f){var I=L.destroy;L.destroy=void 0,I!==void 0&&ga(p,x,I)}L=L.next}while(L!==P)}}function Qp(f,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var x=p=p.next;do{if((x.tag&f)===f){var P=x.create;x.destroy=P()}x=x.next}while(x!==p)}}function Jp(f){var p=f.ref;if(p!==null){var x=f.stateNode;switch(f.tag){case 5:f=X(x);break;default:f=x}typeof p=="function"?p(f):p.current=f}}function x1(f){var p=f.alternate;p!==null&&(f.alternate=null,x1(p)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(p=f.stateNode,p!==null&&ct(p)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Xc(f){return f.tag===5||f.tag===3||f.tag===4}function ks(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Xc(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function eg(f,p,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,p?Ze(x,f,p):At(x,f);else if(P!==4&&(f=f.child,f!==null))for(eg(f,p,x),f=f.sibling;f!==null;)eg(f,p,x),f=f.sibling}function w1(f,p,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,p?Rn(x,f,p):Te(x,f);else if(P!==4&&(f=f.child,f!==null))for(w1(f,p,x),f=f.sibling;f!==null;)w1(f,p,x),f=f.sibling}var jr=null,ma=!1;function va(f,p,x){for(x=x.child;x!==null;)Ur(f,p,x),x=x.sibling}function Ur(f,p,x){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(gn,x)}catch{}switch(x.tag){case 5:Wr||Kc(x,p);case 6:if(Be){var P=jr,L=ma;jr=null,va(f,p,x),jr=P,ma=L,jr!==null&&(ma?ht(jr,x.stateNode):xt(jr,x.stateNode))}else va(f,p,x);break;case 18:Be&&jr!==null&&(ma?Y0(jr,x.stateNode):q0(jr,x.stateNode));break;case 4:Be?(P=jr,L=ma,jr=x.stateNode.containerInfo,ma=!0,va(f,p,x),jr=P,ma=L):(at&&(P=x.stateNode.containerInfo,L=$a(P),Sc(P,L)),va(f,p,x));break;case 0:case 11:case 14:case 15:if(!Wr&&(P=x.updateQueue,P!==null&&(P=P.lastEffect,P!==null))){L=P=P.next;do{var I=L,q=I.destroy;I=I.tag,q!==void 0&&(I&2||I&4)&&ga(x,p,q),L=L.next}while(L!==P)}va(f,p,x);break;case 1:if(!Wr&&(Kc(x,p),P=x.stateNode,typeof P.componentWillUnmount=="function"))try{P.props=x.memoizedProps,P.state=x.memoizedState,P.componentWillUnmount()}catch(le){Zn(x,p,le)}va(f,p,x);break;case 21:va(f,p,x);break;case 22:x.mode&1?(Wr=(P=Wr)||x.memoizedState!==null,va(f,p,x),Wr=P):va(f,p,x);break;default:va(f,p,x)}}function tg(f){var p=f.updateQueue;if(p!==null){f.updateQueue=null;var x=f.stateNode;x===null&&(x=f.stateNode=new Ew),p.forEach(function(P){var L=L3.bind(null,f,P);x.has(P)||(x.add(P),P.then(L,L))})}}function $o(f,p){var x=p.deletions;if(x!==null)for(var P=0;P";case og:return":has("+(k1(f)||"")+")";case ag:return'[role="'+f.value+'"]';case sg:return'"'+f.value+'"';case Zc:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Qc(f,p){var x=[];f=[f,0];for(var P=0;PL&&(L=q),P&=~I}if(P=L,P=Kn()-P,P=(120>P?120:480>P?480:1080>P?1080:1920>P?1920:3e3>P?3e3:4320>P?4320:1960*Pw(P/1960))-P,10f?16:f,Ot===null)var P=!1;else{if(f=Ot,Ot=null,dg=0,Ut&6)throw Error(a(331));var L=Ut;for(Ut|=4,dt=f.current;dt!==null;){var I=dt,q=I.child;if(dt.flags&16){var le=I.deletions;if(le!==null){for(var pe=0;peKn()-T1?_l(f,0):P1|=x),hi(f,p)}function I1(f,p){p===0&&(f.mode&1?(p=Ro,Ro<<=1,!(Ro&130023424)&&(Ro=4194304)):p=1);var x=_i();f=da(f,p),f!==null&&(Fa(f,p,x),hi(f,x))}function Lw(f){var p=f.memoizedState,x=0;p!==null&&(x=p.retryLane),I1(f,x)}function L3(f,p){var x=0;switch(f.tag){case 13:var P=f.stateNode,L=f.memoizedState;L!==null&&(x=L.retryLane);break;case 19:P=f.stateNode;break;default:throw Error(a(314))}P!==null&&P.delete(p),I1(f,x)}var R1;R1=function(f,p,x){if(f!==null)if(f.memoizedProps!==p.pendingProps||li.current)Zi=!0;else{if(!(f.lanes&x)&&!(p.flags&128))return Zi=!1,_w(f,p,x);Zi=!!(f.flags&131072)}else Zi=!1,Wn&&p.flags&1048576&&Q0(p,Rr,p.index);switch(p.lanes=0,p.tag){case 2:var P=p.type;Ua(f,p),f=p.pendingProps;var L=cl(p,Hr.current);Mc(p,x),L=a1(null,p,P,f,L,x);var I=jc();return p.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,ui(P)?(I=!0,Ss(p)):I=!1,p.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,t1(p),L.updater=fa,p.stateNode=L,L._reactInternals=p,n1(p,P,f,x),p=ha(null,p,P,!0,I,x)):(p.tag=0,Wn&&I&&Ri(p),ji(null,p,L,x),p=p.child),p;case 16:P=p.elementType;e:{switch(Ua(f,p),f=p.pendingProps,L=P._init,P=L(P._payload),p.type=P,L=p.tag=yg(P),f=ca(P,f),L){case 0:p=g1(null,p,P,f,x);break e;case 1:p=S3(null,p,P,f,x);break e;case 11:p=m3(null,p,P,f,x);break e;case 14:p=vl(null,p,P,ca(P.type,f),x);break e}throw Error(a(306,P,""))}return p;case 0:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ca(P,L),g1(f,p,P,L,x);case 1:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ca(P,L),S3(f,p,P,L,x);case 3:e:{if(x3(p),f===null)throw Error(a(387));P=p.pendingProps,I=p.memoizedState,L=I.element,r3(f,p),Hp(p,P,null,x);var q=p.memoizedState;if(P=q.element,bt&&I.isDehydrated)if(I={element:P,isDehydrated:!1,cache:q.cache,pendingSuspenseBoundaries:q.pendingSuspenseBoundaries,transitions:q.transitions},p.updateQueue.baseState=I,p.memoizedState=I,p.flags&256){L=Gc(Error(a(423)),p),p=w3(f,p,P,x,L);break e}else if(P!==L){L=Gc(Error(a(424)),p),p=w3(f,p,P,x,L);break e}else for(bt&&(No=F0(p.stateNode.containerInfo),Xn=p,Wn=!0,Ki=null,jo=!1),x=l3(p,null,P,x),p.child=x;x;)x.flags=x.flags&-3|4096,x=x.sibling;else{if(Ac(),P===L){p=_s(f,p,x);break e}ji(f,p,P,x)}p=p.child}return p;case 5:return It(p),f===null&&Tf(p),P=p.type,L=p.pendingProps,I=f!==null?f.memoizedProps:null,q=L.children,Fe(P,L)?q=null:I!==null&&Fe(P,I)&&(p.flags|=32),b3(f,p),ji(f,p,q,x),p.child;case 6:return f===null&&Tf(p),null;case 13:return C3(f,p,x);case 4:return ve(p,p.stateNode.containerInfo),P=p.pendingProps,f===null?p.child=Rc(p,null,P,x):ji(f,p,P,x),p.child;case 11:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ca(P,L),m3(f,p,P,L,x);case 7:return ji(f,p,p.pendingProps,x),p.child;case 8:return ji(f,p,p.pendingProps.children,x),p.child;case 12:return ji(f,p,p.pendingProps.children,x),p.child;case 10:e:{if(P=p.type._context,L=p.pendingProps,I=p.memoizedProps,q=L.value,n3(p,P,q),I!==null)if(Y(I.value,q)){if(I.children===L.children&&!li.current){p=_s(f,p,x);break e}}else for(I=p.child,I!==null&&(I.return=p);I!==null;){var le=I.dependencies;if(le!==null){q=I.child;for(var pe=le.firstContext;pe!==null;){if(pe.context===P){if(I.tag===1){pe=ws(-1,x&-x),pe.tag=2;var We=I.updateQueue;if(We!==null){We=We.shared;var ft=We.pending;ft===null?pe.next=pe:(pe.next=ft.next,ft.next=pe),We.pending=pe}}I.lanes|=x,pe=I.alternate,pe!==null&&(pe.lanes|=x),If(I.return,x,p),le.lanes|=x;break}pe=pe.next}}else if(I.tag===10)q=I.type===p.type?null:I.child;else if(I.tag===18){if(q=I.return,q===null)throw Error(a(341));q.lanes|=x,le=q.alternate,le!==null&&(le.lanes|=x),If(q,x,p),q=I.sibling}else q=I.child;if(q!==null)q.return=I;else for(q=I;q!==null;){if(q===p){q=null;break}if(I=q.sibling,I!==null){I.return=q.return,q=I;break}q=q.return}I=q}ji(f,p,L.children,x),p=p.child}return p;case 9:return L=p.type,P=p.pendingProps.children,Mc(p,x),L=fo(L),P=P(L),p.flags|=1,ji(f,p,P,x),p.child;case 14:return P=p.type,L=ca(P,p.pendingProps),L=ca(P.type,L),vl(f,p,P,L,x);case 15:return v3(f,p,p.type,p.pendingProps,x);case 17:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ca(P,L),Ua(f,p),p.tag=1,ui(P)?(f=!0,Ss(p)):f=!1,Mc(p,x),o3(p,P,L),n1(p,P,L,x),ha(null,p,P,!0,f,x);case 19:return k3(f,p,x);case 22:return y3(f,p,x)}throw Error(a(156,p.tag))};function Fi(f,p){return Pc(f,p)}function Ga(f,p,x,P){this.tag=f,this.key=x,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=P,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ho(f,p,x,P){return new Ga(f,p,x,P)}function D1(f){return f=f.prototype,!(!f||!f.isReactComponent)}function yg(f){if(typeof f=="function")return D1(f)?1:0;if(f!=null){if(f=f.$$typeof,f===S)return 11;if(f===k)return 14}return 2}function mo(f,p){var x=f.alternate;return x===null?(x=Ho(f.tag,p,f.key,f.mode),x.elementType=f.elementType,x.type=f.type,x.stateNode=f.stateNode,x.alternate=f,f.alternate=x):(x.pendingProps=p,x.type=f.type,x.flags=0,x.subtreeFlags=0,x.deletions=null),x.flags=f.flags&14680064,x.childLanes=f.childLanes,x.lanes=f.lanes,x.child=f.child,x.memoizedProps=f.memoizedProps,x.memoizedState=f.memoizedState,x.updateQueue=f.updateQueue,p=f.dependencies,x.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},x.sibling=f.sibling,x.index=f.index,x.ref=f.ref,x}function Jf(f,p,x,P,L,I){var q=2;if(P=f,typeof f=="function")D1(f)&&(q=1);else if(typeof f=="string")q=5;else e:switch(f){case d:return Pl(x.children,L,I,p);case h:q=8,L|=8;break;case m:return f=Ho(12,x,p,L|2),f.elementType=m,f.lanes=I,f;case _:return f=Ho(13,x,p,L),f.elementType=_,f.lanes=I,f;case E:return f=Ho(19,x,p,L),f.elementType=E,f.lanes=I,f;case A:return bg(x,L,I,p);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case v:q=10;break e;case b:q=9;break e;case S:q=11;break e;case k:q=14;break e;case T:q=16,P=null;break e}throw Error(a(130,f==null?f:typeof f,""))}return p=Ho(q,x,p,L),p.elementType=f,p.type=P,p.lanes=I,p}function Pl(f,p,x,P){return f=Ho(7,f,P,p),f.lanes=x,f}function bg(f,p,x,P){return f=Ho(22,f,P,p),f.elementType=A,f.lanes=x,f.stateNode={isHidden:!1},f}function Sg(f,p,x){return f=Ho(6,f,null,p),f.lanes=x,f}function Tl(f,p,x){return p=Ho(4,f.children!==null?f.children:[],f.key,p),p.lanes=x,p.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},p}function eh(f,p,x,P,L){this.tag=p,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=je,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ec(0),this.expirationTimes=Ec(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ec(0),this.identifierPrefix=P,this.onRecoverableError=L,bt&&(this.mutableSourceEagerHydrationData=null)}function A3(f,p,x,P,L,I,q,le,pe){return f=new eh(f,p,x,le,pe),p===1?(p=1,I===!0&&(p|=8)):p=0,I=Ho(3,null,null,p),f.current=I,I.stateNode=f,I.memoizedState={element:P,isDehydrated:x,cache:null,transitions:null,pendingSuspenseBoundaries:null},t1(I),f}function N1(f){if(!f)return sa;f=f._reactInternals;e:{if(z(f)!==f||f.tag!==1)throw Error(a(170));var p=f;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(ui(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(a(171))}if(f.tag===1){var x=f.type;if(ui(x))return wu(f,x,p)}return p}function j1(f){var p=f._reactInternals;if(p===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=te(p),f===null?null:f.stateNode}function th(f,p){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var x=f.retryLane;f.retryLane=x!==0&&x=We&&I>=jt&&L<=ft&&q<=ot){f.splice(p,1);break}else if(P!==We||x.width!==pe.width||otq){if(!(I!==jt||x.height!==pe.height||ftL)){We>P&&(pe.width+=We-P,pe.x=P),ftI&&(pe.height+=jt-I,pe.y=I),otx&&(x=q)),q ")+` + +No matching component was found for: + `)+f.join(" > ")}return null},n.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return X(f.child.stateNode);default:return f.child.stateNode}},n.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:xg,findFiberByHostInstance:f.findFiberByHostInstance||B1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(p.isDisabled||!p.supportsFiber)f=!0;else{try{gn=p.inject(f),Kt=p}catch{}f=!!p.checkDCE}}return f},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(f,p,x,P){if(!ae)throw Error(a(363));f=E1(f,p);var L=Dt(f,x,P).disconnect;return{disconnect:function(){L()}}},n.registerMutableSourceForHydration=function(f,p){var x=p._getVersion;x=x(p._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[p,x]:f.mutableSourceEagerHydrationData.push(p,x)},n.runWithPriority=function(f,p){var x=Yt;try{return Yt=f,p()}finally{Yt=x}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(f,p,x,P){var L=p.current,I=_i(),q=qr(L);return x=N1(x),p.context===null?p.context=x:p.pendingContext=x,p=ws(I,q),p.payload={element:f},P=P===void 0?null:P,P!==null&&(p.callback=P),f=gl(L,p,q),f!==null&&(zo(f,L,q,I),zp(f,L,q)),q},n};(function(e){e.exports=ROe})(IOe);const DOe=v_(t_);var fS={},NOe={get exports(){return fS},set exports(e){fS=e}},Cp={};/** + * @license React + * react-reconciler-constants.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */Cp.ConcurrentRoot=1;Cp.ContinuousEventPriority=4;Cp.DefaultEventPriority=16;Cp.DiscreteEventPriority=1;Cp.IdleEventPriority=536870912;Cp.LegacyRoot=0;(function(e){e.exports=Cp})(NOe);const aN={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let sN=!1,lN=!1;const sT=".react-konva-event",jOe=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. +Position of a node will be changed during drag&drop, so you should update state of the react app as well. +Consider to add onDragMove or onDragEnd events. +For more info see: https://github.com/konvajs/react-konva/issues/256 +`,BOe=`ReactKonva: You are using "zIndex" attribute for a Konva node. +react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. +For more info see: https://github.com/konvajs/react-konva/issues/194 +`,$Oe={};function dw(e,t,n=$Oe){if(!sN&&"zIndex"in t&&(console.warn(BOe),sN=!0),!lN&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(jOe),lN=!0)}for(var o in n)if(!aN[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var d=t._useStrictMode,h={},m=!1;const v={};for(var o in t)if(!aN[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(v[l]=t[o])}!a&&(t[o]!==n[o]||d&&t[o]!==e.getAttr(o))&&(m=!0,h[o]=t[o])}m&&(e.setAttrs(h),vf(e));for(var l in v)e.on(l+sT,v[l])}function vf(e){if(!gt.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const HY={},FOe={};np.Node.prototype._applyProps=dw;function zOe(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),vf(e)}function HOe(e,t,n){let r=np[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=np.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return dw(l,o),l}function VOe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function WOe(e,t,n){return!1}function UOe(e){return e}function GOe(){return null}function qOe(){return null}function YOe(e,t,n,r){return FOe}function KOe(){}function XOe(e){}function ZOe(e,t){return!1}function QOe(){return HY}function JOe(){return HY}const eMe=setTimeout,tMe=clearTimeout,nMe=-1;function rMe(e,t){return!1}const iMe=!1,oMe=!0,aMe=!0;function sMe(e,t){t.parent===e?t.moveToTop():e.add(t),vf(e)}function lMe(e,t){t.parent===e?t.moveToTop():e.add(t),vf(e)}function VY(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),vf(e)}function uMe(e,t,n){VY(e,t,n)}function cMe(e,t){t.destroy(),t.off(sT),vf(e)}function dMe(e,t){t.destroy(),t.off(sT),vf(e)}function fMe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function hMe(e,t,n){}function pMe(e,t,n,r,i){dw(e,i,r)}function gMe(e){e.hide(),vf(e)}function mMe(e){}function vMe(e,t){(t.visible==null||t.visible)&&e.show()}function yMe(e,t){}function bMe(e){}function SMe(){}const xMe=()=>fS.DefaultEventPriority,wMe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:sMe,appendChildToContainer:lMe,appendInitialChild:zOe,cancelTimeout:tMe,clearContainer:bMe,commitMount:hMe,commitTextUpdate:fMe,commitUpdate:pMe,createInstance:HOe,createTextInstance:VOe,detachDeletedInstance:SMe,finalizeInitialChildren:WOe,getChildHostContext:JOe,getCurrentEventPriority:xMe,getPublicInstance:UOe,getRootHostContext:QOe,hideInstance:gMe,hideTextInstance:mMe,idlePriority:Fh.unstable_IdlePriority,insertBefore:VY,insertInContainerBefore:uMe,isPrimaryRenderer:iMe,noTimeout:nMe,now:Fh.unstable_now,prepareForCommit:GOe,preparePortalMount:qOe,prepareUpdate:YOe,removeChild:cMe,removeChildFromContainer:dMe,resetAfterCommit:KOe,resetTextContent:XOe,run:Fh.unstable_runWithPriority,scheduleTimeout:eMe,shouldDeprioritizeSubtree:ZOe,shouldSetTextContent:rMe,supportsMutation:aMe,unhideInstance:vMe,unhideTextInstance:yMe,warnsIfNotActing:oMe},Symbol.toStringTag,{value:"Module"}));var CMe=Object.defineProperty,_Me=Object.defineProperties,kMe=Object.getOwnPropertyDescriptors,uN=Object.getOwnPropertySymbols,EMe=Object.prototype.hasOwnProperty,PMe=Object.prototype.propertyIsEnumerable,cN=(e,t,n)=>t in e?CMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dN=(e,t)=>{for(var n in t||(t={}))EMe.call(t,n)&&cN(e,n,t[n]);if(uN)for(var n of uN(t))PMe.call(t,n)&&cN(e,n,t[n]);return e},TMe=(e,t)=>_Me(e,kMe(t));function lT(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=lT(r,t,n);if(i)return i;r=t?null:r.sibling}}function WY(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const uT=WY(w.createContext(null));class UY extends w.Component{render(){return w.createElement(uT.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:LMe,ReactCurrentDispatcher:AMe}=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function OMe(){const e=w.useContext(uT);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=w.useId();return w.useMemo(()=>{var r;return(r=LMe.current)!=null?r:lT(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const gv=[],fN=new WeakMap;function MMe(){var e;const t=OMe();gv.splice(0,gv.length),lT(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==uT&&gv.push(WY(i))});for(const n of gv){const r=(e=AMe.current)==null?void 0:e.readContext(n);fN.set(n,r)}return w.useMemo(()=>gv.reduce((n,r)=>i=>w.createElement(n,null,w.createElement(r.Provider,TMe(dN({},i),{value:fN.get(r)}))),n=>w.createElement(UY,dN({},n))),[])}function IMe(e){const t=N.useRef();return N.useLayoutEffect(()=>{t.current=e}),t.current}const RMe=e=>{const t=N.useRef(),n=N.useRef(),r=N.useRef(),i=IMe(e),o=MMe(),a=s=>{const{forwardedRef:l}=e;l&&(typeof l=="function"?l(s):l.current=s)};return N.useLayoutEffect(()=>(n.current=new np.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=jv.createContainer(n.current,fS.LegacyRoot,!1,null),jv.updateContainer(N.createElement(o,{},e.children),r.current),()=>{np.isBrowser&&(a(null),jv.updateContainer(null,r.current,null),n.current.destroy())}),[]),N.useLayoutEffect(()=>{a(n.current),dw(n.current,e,i),jv.updateContainer(N.createElement(o,{},e.children),r.current,null)}),N.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},mv="Layer",uc="Group",cc="Rect",uh="Circle",hS="Line",GY="Image",DMe="Transformer",jv=DOe(wMe);jv.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:N.version,rendererPackageName:"react-konva"});const NMe=N.forwardRef((e,t)=>N.createElement(UY,{},N.createElement(RMe,{...e,forwardedRef:t}))),jMe=lt([ln,Ir],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),BMe=()=>{const e=Oe(),{tool:t,isStaging:n,isMovingBoundingBox:r}=he(jMe);return{handleDragStart:w.useCallback(()=>{(t==="move"||n)&&!r&&e(K5(!0))},[e,r,n,t]),handleDragMove:w.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(uU(o))},[e,r,n,t]),handleDragEnd:w.useCallback(()=>{(t==="move"||n)&&!r&&e(K5(!1))},[e,r,n,t])}},$Me=lt([ln,Mr,Ir],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),FMe=()=>{const e=Oe(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=he($Me),s=w.useRef(null),l=JG(),u=()=>e(lP());et(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const d=()=>e($y(!o));et(["h"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[o]),et(["n"],()=>{e(Z5(!a))},{enabled:!0,preventDefault:!0},[a]),et("esc",()=>{e($xe())},{enabled:()=>!0,preventDefault:!0}),et("shift+h",()=>{e(Gxe(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),et(["space"],h=>{h.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(ru("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(ru(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},cT=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},qY=()=>{const e=Oe(),t=nl(),n=JG();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=Vg.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(Vxe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(Mxe())}}},zMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HMe=e=>{const t=Oe(),{tool:n,isStaging:r}=he(zMe),{commitColorUnderCursor:i}=qY();return w.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(K5(!0));return}if(n==="colorPicker"){i();return}const a=cT(e.current);a&&(o.evt.preventDefault(),t(eU(!0)),t(Oxe([a.x,a.y])))},[e,n,r,t,i])},VMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WMe=(e,t,n)=>{const r=Oe(),{isDrawing:i,tool:o,isStaging:a}=he(VMe),{updateColorUnderCursor:s}=qY();return w.useCallback(()=>{if(!e.current)return;const l=cT(e.current);if(l){if(r(Wxe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(ZW([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},UMe=()=>{const e=Oe();return w.useCallback(()=>{e(Dxe())},[e])},GMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),qMe=(e,t)=>{const n=Oe(),{tool:r,isDrawing:i,isStaging:o}=he(GMe);return w.useCallback(()=>{if(r==="move"||o){n(K5(!1));return}if(!t.current&&i&&e.current){const a=cT(e.current);if(!a)return;n(ZW([a.x,a.y]))}else t.current=!1;n(eU(!1))},[t,n,i,o,e,r])},YMe=lt([ln],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KMe=e=>{const t=Oe(),{isMoveStageKeyHeld:n,stageScale:r}=he(YMe);return w.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=ke.clamp(r*Sxe**s,xxe,wxe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(Yxe(l)),t(uU(u))},[e,n,r,t])},XMe=lt(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ZMe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(XMe);return y.jsxs(uc,{children:[y.jsx(cc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),y.jsx(cc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},QMe=lt([ln],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),JMe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},eIe=()=>{const{colorMode:e}=gy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=he(QMe),[i,o]=w.useState([]),a=w.useCallback(s=>s/t,[t]);return w.useLayoutEffect(()=>{const s=JMe[e],{width:l,height:u}=r,{x:d,y:h}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(d),y:a(h)}},v={x:Math.ceil(a(d)/64)*64,y:Math.ceil(a(h)/64)*64},b={x1:-v.x,y1:-v.y,x2:a(l)-v.x+64,y2:a(u)-v.y+64},_={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},E=_.x2-_.x1,k=_.y2-_.y1,T=Math.round(E/64)+1,A=Math.round(k/64)+1,M=ke.range(0,T).map(D=>y.jsx(hS,{x:_.x1+D*64,y:_.y1,points:[0,0,0,k],stroke:s,strokeWidth:1},`x_${D}`)),R=ke.range(0,A).map(D=>y.jsx(hS,{x:_.x1,y:_.y1+D*64,points:[0,0,E,0],stroke:s,strokeWidth:1},`y_${D}`));o(M.concat(R))},[t,n,r,e,a]),y.jsx(uc,{children:i})},tIe=lt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),nIe=e=>{const{...t}=e,n=he(tIe),[r,i]=w.useState(null);if(w.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?y.jsx(GY,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},Wh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},rIe=lt(ln,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:Wh(t)}}),hN=e=>`data:image/svg+xml;utf8, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`.replaceAll("black",e),iIe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(rIe),[a,s]=w.useState(null),[l,u]=w.useState(0),d=w.useRef(null),h=w.useCallback(()=>{u(l+1),setTimeout(h,500)},[l]);return w.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=hN(n)},[a,n]),w.useEffect(()=>{a&&(a.src=hN(n))},[a,n]),w.useEffect(()=>{const m=setInterval(()=>u(v=>(v+1)%5),50);return()=>clearInterval(m)},[]),!a||!ke.isNumber(r.x)||!ke.isNumber(r.y)||!ke.isNumber(o)||!ke.isNumber(i.width)||!ke.isNumber(i.height)?null:y.jsx(cc,{ref:d,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:ke.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},oIe=lt([ln],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),aIe=e=>{const{...t}=e,{objects:n}=he(oIe);return y.jsx(uc,{listening:!1,...t,children:n.filter(sP).map((r,i)=>y.jsx(hS,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})};var ch=w,sIe=function(t,n,r){const i=ch.useRef("loading"),o=ch.useRef(),[a,s]=ch.useState(0),l=ch.useRef(),u=ch.useRef(),d=ch.useRef();return(l.current!==t||u.current!==n||d.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,d.current=r),ch.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function m(){i.current="loaded",o.current=h,s(Math.random())}function v(){i.current="failed",o.current=void 0,s(Math.random())}return h.addEventListener("load",m),h.addEventListener("error",v),n&&(h.crossOrigin=n),r&&(h.referrerpolicy=r),h.src=t,function(){h.removeEventListener("load",m),h.removeEventListener("error",v)}},[t,n,r]),[o.current,i.current]};const YY=e=>{const{url:t,x:n,y:r}=e,[i]=sIe(t);return y.jsx(GY,{x:n,y:r,image:i,listening:!1})},lIe=lt([ln],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),uIe=()=>{const{objects:e}=he(lIe);return e?y.jsx(uc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(Y5(t))return y.jsx(YY,{x:t.x,y:t.y,url:t.image.url},n);if(kxe(t)){const r=y.jsx(hS,{points:t.points,stroke:t.color?Wh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?y.jsx(uc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(Exe(t))return y.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Wh(t.color)},n);if(Pxe(t))return y.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},cIe=lt([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),dIe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=he(cIe);return y.jsxs(uc,{...t,children:[r&&n&&y.jsx(YY,{url:n.image.url,x:o,y:a}),i&&y.jsxs(uc,{children:[y.jsx(cc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),y.jsx(cc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},fIe=lt([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),hIe=()=>{const e=Oe(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=he(fIe),{t:o}=Ue(),a=w.useCallback(()=>{e(VI(!0))},[e]),s=w.useCallback(()=>{e(VI(!1))},[e]);et(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),et(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),et(["enter"],()=>{d()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(jxe()),u=()=>e(Nxe()),d=()=>e(Ixe());return r?y.jsx(Ge,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{tooltip:`${o("unifiedcanvas:previous")} (Left)`,"aria-label":`${o("unifiedcanvas:previous")} (Left)`,icon:y.jsx(mEe,{}),onClick:l,"data-selected":!0,isDisabled:t}),y.jsx(Je,{tooltip:`${o("unifiedcanvas:next")} (Right)`,"aria-label":`${o("unifiedcanvas:next")} (Right)`,icon:y.jsx(vEe,{}),onClick:u,"data-selected":!0,isDisabled:n}),y.jsx(Je,{tooltip:`${o("unifiedcanvas:accept")} (Enter)`,"aria-label":`${o("unifiedcanvas:accept")} (Enter)`,icon:y.jsx(IP,{}),onClick:d,"data-selected":!0}),y.jsx(Je,{tooltip:o("unifiedcanvas:showHide"),"aria-label":o("unifiedcanvas:showHide"),"data-alert":!i,icon:i?y.jsx(_Ee,{}):y.jsx(CEe,{}),onClick:()=>e(qxe(!i)),"data-selected":!0}),y.jsx(Je,{tooltip:o("unifiedcanvas:saveToGallery"),"aria-label":o("unifiedcanvas:saveToGallery"),icon:y.jsx(DP,{}),onClick:()=>e(r_e(r.image.url)),"data-selected":!0}),y.jsx(Je,{tooltip:o("unifiedcanvas:discardAll"),"aria-label":o("unifiedcanvas:discardAll"),icon:y.jsx(Uy,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(Rxe()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},gm=e=>Math.round(e*100)/100,pIe=lt([ln],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${gm(n)}, ${gm(r)})`}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function gIe(){const{cursorCoordinatesString:e}=he(pIe),{t}=Ue();return y.jsx("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const mIe=lt([ln],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:d},stageScale:h,shouldShowCanvasDebugInfo:m,layer:v,boundingBoxScaleMethod:b,shouldPreserveMaskedArea:S}=e;let _="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(_="var(--status-working-color)"),{activeLayerColor:v==="mask"?"var(--status-working-color)":"inherit",activeLayerString:v.charAt(0).toUpperCase()+v.slice(1),boundingBoxColor:_,boundingBoxCoordinatesString:`(${gm(u)}, ${gm(d)})`,boundingBoxDimensionsString:`${o}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${gm(r)}×${gm(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none",shouldPreserveMaskedArea:S}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),vIe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:d,shouldShowBoundingBox:h,shouldPreserveMaskedArea:m}=he(mIe),{t:v}=Ue();return y.jsxs("div",{className:"canvas-status-text",children:[y.jsx("div",{style:{color:e},children:`${v("unifiedcanvas:activeLayer")}: ${t}`}),y.jsx("div",{children:`${v("unifiedcanvas:canvasScale")}: ${u}%`}),m&&y.jsx("div",{style:{color:"var(--status-working-color)"},children:"Preserve Masked Area: On"}),h&&y.jsx("div",{style:{color:n},children:`${v("unifiedcanvas:boundingBox")}: ${i}`}),a&&y.jsx("div",{style:{color:n},children:`${v("unifiedcanvas:scaledBoundingBox")}: ${o}`}),d&&y.jsxs(y.Fragment,{children:[y.jsx("div",{children:`${v("unifiedcanvas:boundingBoxPosition")}: ${r}`}),y.jsx("div",{children:`${v("unifiedcanvas:canvasDimensions")}: ${l}`}),y.jsx("div",{children:`${v("unifiedcanvas:canvasPosition")}: ${s}`}),y.jsx(gIe,{})]})]})},yIe=lt(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),bIe=e=>{const{...t}=e,n=Oe(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:d,hitStrokeWidth:h}=he(yIe),m=w.useRef(null),v=w.useRef(null),[b,S]=w.useState(!1);w.useEffect(()=>{var te;!m.current||!v.current||(m.current.nodes([v.current]),(te=m.current.getLayer())==null||te.batchDraw())},[]);const _=64*l,E=w.useCallback(te=>{if(!u){n(CC({x:Math.floor(te.target.x()),y:Math.floor(te.target.y())}));return}const G=te.target.x(),$=te.target.y(),W=Yl(G,64),X=Yl($,64);te.target.x(W),te.target.y(X),n(CC({x:W,y:X}))},[n,u]),k=w.useCallback(()=>{if(!v.current)return;const te=v.current,G=te.scaleX(),$=te.scaleY(),W=Math.round(te.width()*G),X=Math.round(te.height()*$),Z=Math.round(te.x()),U=Math.round(te.y());n(Av({width:W,height:X})),n(CC({x:u?Td(Z,64):Z,y:u?Td(U,64):U})),te.scaleX(1),te.scaleY(1)},[n,u]),T=w.useCallback((te,G,$)=>{const W=te.x%_,X=te.y%_;return{x:Td(G.x,_)+W,y:Td(G.y,_)+X}},[_]),A=()=>{n(kC(!0))},M=()=>{n(kC(!1)),n(_C(!1)),n(Pb(!1)),S(!1)},R=()=>{n(_C(!0))},D=()=>{n(kC(!1)),n(_C(!1)),n(Pb(!1)),S(!1)},j=()=>{S(!0)},z=()=>{!s&&!a&&S(!1)},H=()=>{n(Pb(!0))},K=()=>{n(Pb(!1))};return y.jsxs(uc,{...t,children:[y.jsx(cc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:H,onMouseOver:H,onMouseLeave:K,onMouseOut:K}),y.jsx(cc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:h,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onDragMove:E,onMouseDown:R,onMouseOut:z,onMouseOver:j,onMouseEnter:j,onMouseUp:D,onTransform:k,onTransformEnd:M,ref:v,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),y.jsx(DMe,{anchorCornerRadius:3,anchorDragBoundFunc:T,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:d==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onMouseDown:A,onMouseUp:M,onTransformEnd:M,ref:m,rotateEnabled:!1})]})},SIe=lt(ln,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:d,stageScale:h,stageDimensions:m,boundingBoxCoordinates:v,boundingBoxDimensions:b,shouldRestrictStrokesToBox:S}=e,_=S?{clipX:v.x,clipY:v.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:zI/h,colorPickerInnerRadius:(zI-h8+1)/h,maskColorString:Wh({...i,a:.5}),brushColorString:Wh(o),colorPickerColorString:Wh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||d||!t)&&l,strokeWidth:1.5/h,dotRadius:1.5/h,clip:_}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),xIe=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:d,brushColorString:h,colorPickerColorString:m,colorPickerInnerRadius:v,colorPickerOuterRadius:b,clip:S}=he(SIe);return l?y.jsxs(uc,{listening:!1,...S,...t,children:[a==="colorPicker"?y.jsxs(y.Fragment,{children:[y.jsx(uh,{x:n,y:r,radius:b,stroke:h,strokeWidth:h8,strokeScaleEnabled:!1}),y.jsx(uh,{x:n,y:r,radius:v,stroke:m,strokeWidth:h8,strokeScaleEnabled:!1})]}):y.jsxs(y.Fragment,{children:[y.jsx(uh,{x:n,y:r,radius:i,fill:s==="mask"?o:h,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),y.jsx(uh,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:d*2,strokeEnabled:!0,listening:!1}),y.jsx(uh,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),y.jsx(uh,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),y.jsx(uh,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},wIe=lt([ln,Ir],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:d,isMovingStage:h,shouldShowIntermediates:m,shouldShowGrid:v,shouldRestrictStrokesToBox:b}=e;let S="none";return d==="move"||t?h?S="grabbing":S="grab":o?S=void 0:b&&!a&&(S="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:v,stageCoordinates:u,stageCursor:S,stageDimensions:l,stageScale:r,tool:d,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KY=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:d}=he(wIe);FMe();const h=w.useRef(null),m=w.useRef(null),v=w.useCallback(z=>{N8e(z),h.current=z},[]),b=w.useCallback(z=>{D8e(z),m.current=z},[]),S=w.useRef({x:0,y:0}),_=w.useRef(!1),E=KMe(h),k=HMe(h),T=qMe(h,_),A=WMe(h,_,S),M=UMe(),{handleDragStart:R,handleDragMove:D,handleDragEnd:j}=BMe();return y.jsx("div",{className:"inpainting-canvas-container",children:y.jsxs("div",{className:"inpainting-canvas-wrapper",children:[y.jsxs(NMe,{tabIndex:-1,ref:v,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:k,onTouchMove:A,onTouchEnd:T,onMouseDown:k,onMouseLeave:M,onMouseMove:A,onMouseUp:T,onDragStart:R,onDragMove:D,onDragEnd:j,onContextMenu:z=>z.evt.preventDefault(),onWheel:E,draggable:(l==="move"||u)&&!t,children:[y.jsx(mv,{id:"grid",visible:r,children:y.jsx(eIe,{})}),y.jsx(mv,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:y.jsx(uIe,{})}),y.jsxs(mv,{id:"mask",visible:e,listening:!1,children:[y.jsx(aIe,{visible:!0,listening:!1}),y.jsx(iIe,{listening:!1})]}),y.jsx(mv,{children:y.jsx(ZMe,{})}),y.jsxs(mv,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&y.jsx(xIe,{visible:l!=="move",listening:!1}),y.jsx(dIe,{visible:u}),d&&y.jsx(nIe,{}),y.jsx(bIe,{visible:n&&!u})]})]}),y.jsx(vIe,{}),y.jsx(hIe,{})]})})},CIe=lt(ln,Iq,Mr,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),XY=()=>{const e=Oe(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=he(CIe),o=w.useRef(null);return w.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(Hxe({width:a,height:s})),e(i?Fxe():Bx()),e(vi(!1))},0)},[e,r,t,n,i]),y.jsx("div",{ref:o,className:"inpainting-canvas-area",children:y.jsx(ky,{thickness:"2px",speed:"1s",size:"xl"})})},_Ie=lt([ln,Mr,or],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function ZY(){const e=Oe(),{canRedo:t,activeTabName:n}=he(_Ie),{t:r}=Ue(),i=()=>{e(Bxe())};return et(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),y.jsx(Je,{"aria-label":`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,icon:y.jsx(DEe,{}),onClick:i,isDisabled:!t})}const kIe=lt([ln,Mr,or],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function QY(){const e=Oe(),{t}=Ue(),{canUndo:n,activeTabName:r}=he(kIe),i=()=>{e(Kxe())};return et(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),y.jsx(Je,{"aria-label":`${t("unifiedcanvas:undo")} (Ctrl+Z)`,tooltip:`${t("unifiedcanvas:undo")} (Ctrl+Z)`,icon:y.jsx($Ee,{}),onClick:i,isDisabled:!n})}const EIe=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");o&&(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},PIe=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},TIe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:a,y:s,width:l,height:u},h=e.toDataURL(d);return e.scale(i),{dataURL:h,boundingBox:{x:o.x,y:o.y,width:l,height:u}}},LIe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Ad=(e=LIe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(yCe("Exporting Image")),t(dm(!1));const u=n(),{stageScale:d,boundingBoxCoordinates:h,boundingBoxDimensions:m,stageCoordinates:v}=u.canvas,b=nl();if(!b){t(ns(!1)),t(dm(!0));return}const{dataURL:S,boundingBox:_}=TIe(b,d,v,i?{...h,...m}:void 0);if(!S){t(ns(!1)),t(dm(!0));return}const E=new FormData;E.append("data",JSON.stringify({dataURL:S,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:E})).json(),{url:A,width:M,height:R}=T,D={uuid:hm(),category:o?"result":"user",...T};a&&(PIe(A),t(Ah({title:zt.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(EIe(A,M,R),t(Ah({title:zt.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(cm({image:D,category:"result"})),t(Ah({title:zt.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(Uxe({kind:"image",layer:"base",..._,image:D})),t(Ah({title:zt.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(ns(!1)),t(B4(zt.t("common:statusConnected"))),t(dm(!0))};function AIe(){const e=he(Ir),t=nl(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Oe(),{t:o}=Ue();et(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Ad({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return y.jsx(Je,{"aria-label":`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:y.jsx(l0,{}),onClick:a,isDisabled:e})}function OIe(){const e=Oe(),{t}=Ue(),n=nl(),r=he(Ir),i=he(s=>s.system.isProcessing),o=he(s=>s.canvas.shouldCropToBoundingBoxOnSave);et(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Ad({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return y.jsx(Je,{"aria-label":`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:y.jsx(RP,{}),onClick:a,isDisabled:r})}function MIe(){const e=he(Ir),{openUploader:t}=PP(),{t:n}=Ue();return y.jsx(Je,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:y.jsx(tw,{}),onClick:t,isDisabled:e})}const IIe=lt([ln,Ir],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function RIe(){const e=Oe(),{t}=Ue(),{layer:n,isMaskEnabled:r,isStaging:i}=he(IIe),o=()=>{e(X5(n==="mask"?"base":"mask"))};et(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(X5(l)),l==="mask"&&!r&&e($y(!0))};return y.jsx(rl,{tooltip:`${t("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:qW,onChange:a,isDisabled:i})}function DIe(){const e=Oe(),{t}=Ue(),n=nl(),r=he(Ir),i=he(a=>a.system.isProcessing);et(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Ad({cropVisible:!1,shouldSetAsInitialImage:!0}))};return y.jsx(Je,{"aria-label":`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:y.jsx(Oq,{}),onClick:o,isDisabled:r})}function NIe(){const e=he(o=>o.canvas.tool),t=he(Ir),n=Oe(),{t:r}=Ue();et(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(ru("move"));return y.jsx(Je,{"aria-label":`${r("unifiedcanvas:move")} (V)`,tooltip:`${r("unifiedcanvas:move")} (V)`,icon:y.jsx(kq,{}),"data-selected":e==="move"||t,onClick:i})}function jIe(){const e=he(i=>i.ui.shouldPinParametersPanel),t=Oe(),{t:n}=Ue(),r=()=>{t(Zu(!0)),e&&setTimeout(()=>t(vi(!0)),400)};return y.jsxs(Ge,{flexDirection:"column",gap:"0.5rem",children:[y.jsx(Je,{tooltip:`${n("parameters:showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters:showOptionsPanel"),onClick:r,children:y.jsx(NP,{})}),y.jsx(Ge,{children:y.jsx(nT,{iconButton:!0})}),y.jsx(Ge,{children:y.jsx(eT,{width:"100%",height:"40px"})})]})}function BIe(){const e=Oe(),{t}=Ue(),n=he(Ir),r=()=>{e(uP()),e(Bx())};return y.jsx(Je,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:y.jsx(Sp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function JY(e,t,n=250){const[r,i]=w.useState(0);return w.useEffect(()=>{const o=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(o)},[r,e,t,n]),()=>i(o=>o+1)}function $Ie(){const e=nl(),t=Oe(),{t:n}=Ue();et(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=JY(()=>i(!1),()=>i(!0)),i=(o=!1)=>{const a=nl();if(!a)return;const s=a.getClientRect({skipTransform:!0});t(JW({contentRect:s,shouldScaleTo1:o}))};return y.jsx(Je,{"aria-label":`${n("unifiedcanvas:resetView")} (R)`,tooltip:`${n("unifiedcanvas:resetView")} (R)`,icon:y.jsx(Pq,{}),onClick:r})}function FIe(){const e=he(Ir),t=nl(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Oe(),{t:o}=Ue();et(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Ad({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return y.jsx(Je,{"aria-label":`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:y.jsx(DP,{}),onClick:a,isDisabled:e})}const zIe=lt([ln,Ir,or],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HIe=()=>{const e=Oe(),{t}=Ue(),{tool:n,isStaging:r}=he(zIe);et(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),et(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),et(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),et(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),et(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(ru("brush")),o=()=>e(ru("eraser")),a=()=>e(ru("colorPicker")),s=()=>e(XW()),l=()=>e(KW());return y.jsxs(Ge,{flexDirection:"column",gap:"0.5rem",children:[y.jsxs(oo,{children:[y.jsx(Je,{"aria-label":`${t("unifiedcanvas:brush")} (B)`,tooltip:`${t("unifiedcanvas:brush")} (B)`,icon:y.jsx(Mq,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),y.jsx(Je,{"aria-label":`${t("unifiedcanvas:eraser")} (E)`,tooltip:`${t("unifiedcanvas:eraser")} (B)`,icon:y.jsx(Tq,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),y.jsxs(oo,{children:[y.jsx(Je,{"aria-label":`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:y.jsx(Aq,{}),isDisabled:r,onClick:s}),y.jsx(Je,{"aria-label":`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:y.jsx(Uy,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),y.jsx(Je,{"aria-label":`${t("unifiedcanvas:colorPicker")} (C)`,tooltip:`${t("unifiedcanvas:colorPicker")} (C)`,icon:y.jsx(Lq,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},fw=Ae((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:d,onClose:h}=Gh(),m=w.useRef(null),v=()=>{r(),h()},b=()=>{o&&o(),h()};return y.jsxs(y.Fragment,{children:[w.cloneElement(l,{onClick:d,ref:t}),y.jsx(FV,{isOpen:u,leastDestructiveRef:m,onClose:h,children:y.jsx(Zd,{children:y.jsxs(zV,{className:"modal",children:[y.jsx(_0,{fontSize:"lg",fontWeight:"bold",children:s}),y.jsx(o0,{children:a}),y.jsxs(wx,{children:[y.jsx(ls,{ref:m,onClick:b,className:"modal-close-btn",children:i}),y.jsx(ls,{colorScheme:"red",onClick:v,ml:3,children:n})]})]})})})]})}),eK=()=>{const e=he(Ir),t=Oe(),{t:n}=Ue(),r=()=>{t(i_e()),t(uP()),t(QW())};return y.jsxs(fw,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:y.jsx(nr,{leftIcon:y.jsx(Sp,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[y.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),y.jsx("br",{}),y.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},tK=()=>{const e=he(Ir),t=Oe(),{t:n}=Ue();return y.jsxs(fw,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:()=>t(QW()),acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:y.jsx(nr,{size:"sm",leftIcon:y.jsx(Sp,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[y.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),y.jsx("br",{}),y.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},VIe=lt([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WIe=()=>{const e=Oe(),{t}=Ue(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=he(VIe);return y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:y.jsx(jP,{})}),children:y.jsxs(Ge,{direction:"column",gap:"0.5rem",children:[y.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:o,onChange:a=>e(lU(a.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:a=>e(nU(a.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:a=>e(rU(a.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:a=>e(aU(a.target.checked))}),y.jsx(tK,{}),y.jsx(eK,{})]})})},UIe=()=>{const e=he(t=>t.ui.shouldShowParametersPanel);return y.jsxs(Ge,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[y.jsx(RIe,{}),y.jsx(HIe,{}),y.jsxs(Ge,{gap:"0.5rem",children:[y.jsx(NIe,{}),y.jsx($Ie,{})]}),y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(DIe,{}),y.jsx(FIe,{})]}),y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(AIe,{}),y.jsx(OIe,{})]}),y.jsxs(Ge,{gap:"0.5rem",children:[y.jsx(QY,{}),y.jsx(ZY,{})]}),y.jsxs(Ge,{gap:"0.5rem",children:[y.jsx(MIe,{}),y.jsx(BIe,{})]}),y.jsx(WIe,{}),!e&&y.jsx(jIe,{})]})};function GIe(){const e=Oe(),t=he(i=>i.canvas.brushSize),{t:n}=Ue(),r=he(Ir);return et(["BracketLeft"],()=>{e(Fm(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),et(["BracketRight"],()=>{e(Fm(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),y.jsx(so,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:i=>e(Fm(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function hw(){return(hw=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function n_(e){var t=w.useRef(e),n=w.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var d0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:_.buttons>0)&&i.current?o(pN(i.current,_,s.current)):S(!1)},b=function(){return S(!1)};function S(_){var E=l.current,k=r_(i.current),T=_?k.addEventListener:k.removeEventListener;T(E?"touchmove":"mousemove",v),T(E?"touchend":"mouseup",b)}return[function(_){var E=_.nativeEvent,k=i.current;if(k&&(gN(E),!function(A,M){return M&&!g2(A)}(E,l.current)&&k)){if(g2(E)){l.current=!0;var T=E.changedTouches||[];T.length&&(s.current=T[0].identifier)}k.focus(),o(pN(k,E,s.current)),S(!0)}},function(_){var E=_.which||_.keyCode;E<37||E>40||(_.preventDefault(),a({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},S]},[a,o]),d=u[0],h=u[1],m=u[2];return w.useEffect(function(){return m},[m]),N.createElement("div",hw({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),pw=function(e){return e.filter(Boolean).join(" ")},fT=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=pw(["react-colorful__pointer",e.className]);return N.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},N.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Po=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},rK=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Po(e.h),s:Po(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Po(i/2),a:Po(r,2)}},i_=function(e){var t=rK(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},YC=function(e){var t=rK(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},qIe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:Po(255*[r,s,a,a,l,r][u]),g:Po(255*[l,r,r,s,a,a][u]),b:Po(255*[a,a,l,r,r,s][u]),a:Po(i,2)}},YIe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Po(60*(s<0?s+6:s)),s:Po(o?a/o*100:0),v:Po(o/255*100),a:i}},KIe=N.memo(function(e){var t=e.hue,n=e.onChange,r=pw(["react-colorful__hue",e.className]);return N.createElement("div",{className:r},N.createElement(dT,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:d0(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Po(t),"aria-valuemax":"360","aria-valuemin":"0"},N.createElement(fT,{className:"react-colorful__hue-pointer",left:t/360,color:i_({h:t,s:100,v:100,a:1})})))}),XIe=N.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:i_({h:t.h,s:100,v:100,a:1})};return N.createElement("div",{className:"react-colorful__saturation",style:r},N.createElement(dT,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:d0(t.s+100*i.left,0,100),v:d0(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Po(t.s)+"%, Brightness "+Po(t.v)+"%"},N.createElement(fT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:i_(t)})))}),iK=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function ZIe(e,t,n){var r=n_(n),i=w.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=w.useRef({color:t,hsva:o});w.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),w.useEffect(function(){var u;iK(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=w.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var QIe=typeof window<"u"?w.useLayoutEffect:w.useEffect,JIe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},mN=new Map,eRe=function(e){QIe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!mN.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,mN.set(t,n);var r=JIe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},tRe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+YC(Object.assign({},n,{a:0}))+", "+YC(Object.assign({},n,{a:1}))+")"},o=pw(["react-colorful__alpha",t]),a=Po(100*n.a);return N.createElement("div",{className:o},N.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),N.createElement(dT,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:d0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},N.createElement(fT,{className:"react-colorful__alpha-pointer",left:n.a,color:YC(n)})))},nRe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=nK(e,["className","colorModel","color","onChange"]),s=w.useRef(null);eRe(s);var l=ZIe(n,i,o),u=l[0],d=l[1],h=pw(["react-colorful",t]);return N.createElement("div",hw({},a,{ref:s,className:h}),N.createElement(XIe,{hsva:u,onChange:d}),N.createElement(KIe,{hue:u.h,onChange:d}),N.createElement(tRe,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},rRe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:YIe,fromHsva:qIe,equal:iK},iRe=function(e){return N.createElement(nRe,hw({},e,{colorModel:rRe}))};const pS=e=>{const{styleClass:t,...n}=e;return y.jsx(iRe,{className:`invokeai__color-picker ${t}`,...n})},oRe=lt([ln,Ir],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function aRe(){const e=Oe(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=he(oRe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return et(["shift+BracketLeft"],()=>{e($m({...t,a:ke.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),et(["shift+BracketRight"],()=>{e($m({...t,a:ke.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Eo,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:y.jsxs(Ge,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&y.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e($m(a))}),r==="mask"&&y.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(tU(a))})]})})}function oK(){return y.jsxs(Ge,{columnGap:"1rem",alignItems:"center",children:[y.jsx(GIe,{}),y.jsx(aRe,{})]})}function sRe(){const e=Oe(),t=he(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ue();return y.jsx(er,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:r=>e(cU(r.target.checked))})}function lRe(){return y.jsxs(Ge,{gap:"1rem",alignItems:"center",children:[y.jsx(oK,{}),y.jsx(sRe,{})]})}function uRe(){const e=Oe(),{t}=Ue(),n=()=>e(lP());return y.jsx(nr,{size:"sm",leftIcon:y.jsx(Sp,{}),onClick:n,tooltip:`${t("unifiedcanvas:clearMask")} (Shift+C)`,children:t("unifiedcanvas:betaClear")})}function cRe(){const e=he(i=>i.canvas.isMaskEnabled),t=Oe(),{t:n}=Ue(),r=()=>t($y(!e));return y.jsx(er,{label:`${n("unifiedcanvas:enableMask")} (H)`,isChecked:e,onChange:r})}function dRe(){const e=Oe(),{t}=Ue(),n=he(r=>r.canvas.shouldPreserveMaskedArea);return y.jsx(er,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:r=>e(oU(r.target.checked))})}function fRe(){return y.jsxs(Ge,{gap:"1rem",alignItems:"center",children:[y.jsx(oK,{}),y.jsx(cRe,{}),y.jsx(dRe,{}),y.jsx(uRe,{})]})}function hRe(){const e=he(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Oe(),{t:n}=Ue();return y.jsx(er,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:r=>t(iU(r.target.checked))})}function pRe(){const e=he(r=>r.canvas.shouldShowGrid),t=Oe(),{t:n}=Ue();return y.jsx(er,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:r=>t(sU(r.target.checked))})}function gRe(){const e=he(i=>i.canvas.shouldSnapToGrid),t=Oe(),{t:n}=Ue(),r=i=>t(Z5(i.target.checked));return y.jsx(er,{label:`${n("unifiedcanvas:snapToGrid")} (N)`,isChecked:e,onChange:r})}function mRe(){return y.jsxs(Ge,{alignItems:"center",gap:"1rem",children:[y.jsx(pRe,{}),y.jsx(gRe,{}),y.jsx(hRe,{})]})}const vRe=lt([ln],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function yRe(){const{tool:e,layer:t}=he(vRe);return y.jsxs(Ge,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&y.jsx(lRe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&y.jsx(fRe,{}),e=="move"&&y.jsx(mRe,{})]})}const bRe=lt([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),SRe=()=>{const e=Oe(),{doesCanvasNeedScaling:t}=he(bRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),y.jsx("div",{className:"workarea-single-view",children:y.jsxs(Ge,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[y.jsx(UIe,{}),y.jsxs(Ge,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[y.jsx(yRe,{}),t?y.jsx(XY,{}):y.jsx(KY,{})]})]})})},xRe=lt([ln,Ir],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:Wh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),wRe=()=>{const e=Oe(),{t}=Ue(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=he(xRe);et(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),et(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),et(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(X5(n==="mask"?"base":"mask"))},l=()=>e(lP()),u=()=>e($y(!i));return y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(oo,{children:y.jsx(Je,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:y.jsx(LEe,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:y.jsxs(Ge,{direction:"column",gap:"0.5rem",children:[y.jsx(er,{label:`${t("unifiedcanvas:enableMask")} (H)`,isChecked:i,onChange:u}),y.jsx(er,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:o,onChange:d=>e(oU(d.target.checked))}),y.jsx(pS,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:d=>e(tU(d))}),y.jsxs(nr,{size:"sm",leftIcon:y.jsx(Sp,{}),onClick:l,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},CRe=lt([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),_Re=()=>{const e=Oe(),{t}=Ue(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=he(CRe);et(["n"],()=>{e(Z5(!l))},{enabled:!0,preventDefault:!0},[l]);const d=h=>e(Z5(h.target.checked));return y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:y.jsx(jP,{})}),children:y.jsxs(Ge,{direction:"column",gap:"0.5rem",children:[y.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:s,onChange:h=>e(lU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:showGrid"),isChecked:a,onChange:h=>e(sU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:snapToGrid"),isChecked:l,onChange:d}),y.jsx(er,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:h=>e(iU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:h=>e(nU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:h=>e(rU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:u,onChange:h=>e(cU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:o,onChange:h=>e(aU(h.target.checked))}),y.jsx(tK,{}),y.jsx(eK,{})]})})},kRe=lt([ln,Ir,or],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ERe=()=>{const e=Oe(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=he(kRe),{t:o}=Ue();et(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),et(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),et(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),et(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),et(["delete","backspace"],()=>{d()},{enabled:()=>!i,preventDefault:!0}),et(["BracketLeft"],()=>{e(Fm(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),et(["BracketRight"],()=>{e(Fm(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),et(["shift+BracketLeft"],()=>{e($m({...n,a:ke.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),et(["shift+BracketRight"],()=>{e($m({...n,a:ke.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(ru("brush")),s=()=>e(ru("eraser")),l=()=>e(ru("colorPicker")),u=()=>e(XW()),d=()=>e(KW());return y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{"aria-label":`${o("unifiedcanvas:brush")} (B)`,tooltip:`${o("unifiedcanvas:brush")} (B)`,icon:y.jsx(Mq,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),y.jsx(Je,{"aria-label":`${o("unifiedcanvas:eraser")} (E)`,tooltip:`${o("unifiedcanvas:eraser")} (E)`,icon:y.jsx(Tq,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),y.jsx(Je,{"aria-label":`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:y.jsx(Aq,{}),isDisabled:i,onClick:u}),y.jsx(Je,{"aria-label":`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:y.jsx(Uy,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),y.jsx(Je,{"aria-label":`${o("unifiedcanvas:colorPicker")} (C)`,tooltip:`${o("unifiedcanvas:colorPicker")} (C)`,icon:y.jsx(Lq,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{"aria-label":o("unifiedcanvas:brushOptions"),tooltip:o("unifiedcanvas:brushOptions"),icon:y.jsx(NP,{})}),children:y.jsxs(Ge,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[y.jsx(Ge,{gap:"1rem",justifyContent:"space-between",children:y.jsx(so,{label:o("unifiedcanvas:brushSize"),value:r,withInput:!0,onChange:h=>e(Fm(h)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),y.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:h=>e($m(h))})]})})]})},PRe=lt([or,ln,Ir],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),TRe=()=>{const e=Oe(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=he(PRe),s=nl(),{t:l}=Ue(),{openUploader:u}=PP();et(["v"],()=>{d()},{enabled:()=>!n,preventDefault:!0},[]),et(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[s]),et(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["shift+s"],()=>{S()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["meta+c","ctrl+c"],()=>{_()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["shift+d"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]);const d=()=>e(ru("move")),h=JY(()=>m(!1),()=>m(!0)),m=(T=!1)=>{const A=nl();if(!A)return;const M=A.getClientRect({skipTransform:!0});e(JW({contentRect:M,shouldScaleTo1:T}))},v=()=>{e(uP()),e(Bx())},b=()=>{e(Ad({cropVisible:!1,shouldSetAsInitialImage:!0}))},S=()=>{e(Ad({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},_=()=>{e(Ad({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},E=()=>{e(Ad({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},k=T=>{const A=T.target.value;e(X5(A)),A==="mask"&&!r&&e($y(!0))};return y.jsxs("div",{className:"inpainting-settings",children:[y.jsx(rl,{tooltip:`${l("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:qW,onChange:k,isDisabled:n}),y.jsx(wRe,{}),y.jsx(ERe,{}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{"aria-label":`${l("unifiedcanvas:move")} (V)`,tooltip:`${l("unifiedcanvas:move")} (V)`,icon:y.jsx(kq,{}),"data-selected":o==="move"||n,onClick:d}),y.jsx(Je,{"aria-label":`${l("unifiedcanvas:resetView")} (R)`,tooltip:`${l("unifiedcanvas:resetView")} (R)`,icon:y.jsx(Pq,{}),onClick:h})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{"aria-label":`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:y.jsx(Oq,{}),onClick:b,isDisabled:n}),y.jsx(Je,{"aria-label":`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:y.jsx(DP,{}),onClick:S,isDisabled:n}),y.jsx(Je,{"aria-label":`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:y.jsx(l0,{}),onClick:_,isDisabled:n}),y.jsx(Je,{"aria-label":`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:y.jsx(RP,{}),onClick:E,isDisabled:n})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(QY,{}),y.jsx(ZY,{})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{"aria-label":`${l("common:upload")}`,tooltip:`${l("common:upload")}`,icon:y.jsx(tw,{}),onClick:u,isDisabled:n}),y.jsx(Je,{"aria-label":`${l("unifiedcanvas:clearCanvas")}`,tooltip:`${l("unifiedcanvas:clearCanvas")}`,icon:y.jsx(Sp,{}),onClick:v,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),y.jsx(oo,{isAttached:!0,children:y.jsx(_Re,{})})]})},LRe=lt([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ARe=()=>{const e=Oe(),{doesCanvasNeedScaling:t}=he(LRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),y.jsx("div",{className:"workarea-single-view",children:y.jsx("div",{className:"workarea-split-view-left",children:y.jsxs("div",{className:"inpainting-main-area",children:[y.jsx(TRe,{}),y.jsx("div",{className:"inpainting-canvas-area",children:t?y.jsx(XY,{}):y.jsx(KY,{})})]})})})},ORe=lt(ln,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),MRe=()=>{const e=Oe(),{boundingBoxDimensions:t}=he(ORe),{t:n}=Ue(),r=s=>{e(Av({...t,width:Math.floor(s)}))},i=s=>{e(Av({...t,height:Math.floor(s)}))},o=()=>{e(Av({...t,width:Math.floor(512)}))},a=()=>{e(Av({...t,height:Math.floor(512)}))};return y.jsxs(Ge,{direction:"column",gap:"1rem",children:[y.jsx(so,{label:n("parameters:width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:o}),y.jsx(so,{label:n("parameters:height"),min:64,max:1024,step:64,value:t.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:a})]})},IRe=lt([tT,or,ln],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),RRe=()=>{const e=Oe(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=he(IRe),{t:s}=Ue(),l=v=>{e(Tb({...a,width:Math.floor(v)}))},u=v=>{e(Tb({...a,height:Math.floor(v)}))},d=()=>{e(Tb({...a,width:Math.floor(512)}))},h=()=>{e(Tb({...a,height:Math.floor(512)}))},m=v=>{e(zxe(v.target.value))};return y.jsxs(Ge,{direction:"column",gap:"1rem",children:[y.jsx(rl,{label:s("parameters:scaleBeforeProcessing"),validValues:_xe,value:i,onChange:m}),y.jsx(so,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:d}),y.jsx(so,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:h}),y.jsx(rl,{label:s("parameters:infillMethod"),value:n,validValues:r,onChange:v=>e(xU(v.target.value))}),y.jsx(so,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("parameters:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:v=>{e(KI(v))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(KI(32))}})]})};function DRe(){const e=Oe(),t=he(r=>r.generation.seamBlur),{t:n}=Ue();return y.jsx(so,{sliderMarkRightOffset:-4,label:n("parameters:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(UI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(UI(16))}})}function NRe(){const e=Oe(),{t}=Ue(),n=he(r=>r.generation.seamSize);return y.jsx(so,{sliderMarkRightOffset:-6,label:t("parameters:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(GI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(GI(96))})}function jRe(){const{t:e}=Ue(),t=he(r=>r.generation.seamSteps),n=Oe();return y.jsx(so,{sliderMarkRightOffset:-4,label:e("parameters:seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(qI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(qI(30))}})}function BRe(){const e=Oe(),{t}=Ue(),n=he(r=>r.generation.seamStrength);return y.jsx(so,{sliderMarkRightOffset:-7,label:t("parameters:seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(YI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(YI(.7))}})}const $Re=()=>y.jsxs(Ge,{direction:"column",gap:"1rem",children:[y.jsx(NRe,{}),y.jsx(DRe,{}),y.jsx(BRe,{}),y.jsx(jRe,{})]});function FRe(){const{t:e}=Ue(),t={boundingBox:{header:`${e("parameters:boundingBoxHeader")}`,feature:ao.BOUNDING_BOX,content:y.jsx(MRe,{})},seamCorrection:{header:`${e("parameters:seamCorrectionHeader")}`,feature:ao.SEAM_CORRECTION,content:y.jsx($Re,{})},infillAndScaling:{header:`${e("parameters:infillScalingHeader")}`,feature:ao.INFILL_AND_SCALING,content:y.jsx(RRe,{})},seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:y.jsx(KP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:y.jsx(ZP,{}),additionalHeaderComponents:y.jsx(XP,{})}};return y.jsxs(aT,{children:[y.jsxs(Ge,{flexDir:"column",rowGap:"0.5rem",children:[y.jsx(oT,{}),y.jsx(iT,{})]}),y.jsx(rT,{}),y.jsx(QP,{}),y.jsx(jY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),y.jsx(JP,{accordionInfo:t})]})}function zRe(){const e=he(t=>t.ui.shouldUseCanvasBetaLayout);return y.jsx(YP,{optionsPanel:y.jsx(FRe,{}),styleClass:"inpainting-workarea-overrides",children:e?y.jsx(SRe,{}):y.jsx(ARe,{})})}const ts={txt2img:{title:y.jsx(S_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(MOe,{}),tooltip:"Text To Image"},img2img:{title:y.jsx(v_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(kOe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:y.jsx(w_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(zRe,{}),tooltip:"Unified Canvas"},nodes:{title:y.jsx(y_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(h_e,{}),tooltip:"Nodes"},postprocess:{title:y.jsx(b_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(p_e,{}),tooltip:"Post Processing"},training:{title:y.jsx(x_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(g_e,{}),tooltip:"Training"}};function HRe(){ts.txt2img.tooltip=zt.t("common:text2img"),ts.img2img.tooltip=zt.t("common:img2img"),ts.unifiedCanvas.tooltip=zt.t("common:unifiedCanvas"),ts.nodes.tooltip=zt.t("common:nodes"),ts.postprocess.tooltip=zt.t("common:postProcessing"),ts.training.tooltip=zt.t("common:training")}function VRe(){const e=he(f_e),t=he(o=>o.lightbox.isLightboxOpen);m_e(HRe);const n=Oe();et("1",()=>{n(Yo(0))}),et("2",()=>{n(Yo(1))}),et("3",()=>{n(Yo(2))}),et("4",()=>{n(Yo(3))}),et("5",()=>{n(Yo(4))}),et("6",()=>{n(Yo(5))}),et("z",()=>{n(zm(!t))},[t]);const r=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(y.jsx(uo,{hasArrow:!0,label:ts[a].tooltip,placement:"right",children:y.jsx(vW,{children:ts[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(y.jsx(gW,{className:"app-tabs-panel",children:ts[a].workarea},a))}),o};return y.jsxs(pW,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(Yo(o))},children:[y.jsx("div",{className:"app-tabs-list",children:r()}),y.jsx(mW,{className:"app-tabs-panels",children:t?y.jsx(zAe,{}):i()})]})}var WRe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Ky(e,t){var n=URe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function URe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=WRe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var GRe=[".DS_Store","Thumbs.db"];function qRe(e){return b0(this,void 0,void 0,function(){return S0(this,function(t){return gS(e)&&YRe(e.dataTransfer)?[2,QRe(e.dataTransfer,e.type)]:KRe(e)?[2,XRe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,ZRe(e)]:[2,[]]})})}function YRe(e){return gS(e)}function KRe(e){return gS(e)&&gS(e.target)}function gS(e){return typeof e=="object"&&e!==null}function XRe(e){return o_(e.target.files).map(function(t){return Ky(t)})}function ZRe(e){return b0(this,void 0,void 0,function(){var t;return S0(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Ky(r)})]}})})}function QRe(e,t){return b0(this,void 0,void 0,function(){var n,r;return S0(this,function(i){switch(i.label){case 0:return e.items?(n=o_(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(JRe))]):[3,2];case 1:return r=i.sent(),[2,vN(aK(r))];case 2:return[2,vN(o_(e.files).map(function(o){return Ky(o)}))]}})})}function vN(e){return e.filter(function(t){return GRe.indexOf(t.name)===-1})}function o_(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,wN(n)];if(e.sizen)return[!1,wN(n)]}return[!0,null]}function wh(e){return e!=null}function gDe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=cK(l,n),d=cy(u,1),h=d[0],m=dK(l,r,i),v=cy(m,1),b=v[0],S=s?s(l):null;return h&&b&&!S})}function mS(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function e4(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function _N(e){e.preventDefault()}function mDe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function vDe(e){return e.indexOf("Edge/")!==-1}function yDe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return mDe(e)||vDe(e)}function Dl(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DDe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var hT=w.forwardRef(function(e,t){var n=e.children,r=vS(e,_De),i=mK(r),o=i.open,a=vS(i,kDe);return w.useImperativeHandle(t,function(){return{open:o}},[o]),N.createElement(w.Fragment,null,n(_r(_r({},a),{},{open:o})))});hT.displayName="Dropzone";var gK={disabled:!1,getFilesFromEvent:qRe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};hT.defaultProps=gK;hT.propTypes={children:jn.func,accept:jn.objectOf(jn.arrayOf(jn.string)),multiple:jn.bool,preventDropOnDocument:jn.bool,noClick:jn.bool,noKeyboard:jn.bool,noDrag:jn.bool,noDragEventsBubbling:jn.bool,minSize:jn.number,maxSize:jn.number,maxFiles:jn.number,disabled:jn.bool,getFilesFromEvent:jn.func,onFileDialogCancel:jn.func,onFileDialogOpen:jn.func,useFsAccessApi:jn.bool,autoFocus:jn.bool,onDragEnter:jn.func,onDragLeave:jn.func,onDragOver:jn.func,onDrop:jn.func,onDropAccepted:jn.func,onDropRejected:jn.func,onError:jn.func,validator:jn.func};var u_={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function mK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_r(_r({},gK),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,h=t.onDragOver,m=t.onDrop,v=t.onDropAccepted,b=t.onDropRejected,S=t.onFileDialogCancel,_=t.onFileDialogOpen,E=t.useFsAccessApi,k=t.autoFocus,T=t.preventDropOnDocument,A=t.noClick,M=t.noKeyboard,R=t.noDrag,D=t.noDragEventsBubbling,j=t.onError,z=t.validator,H=w.useMemo(function(){return xDe(n)},[n]),K=w.useMemo(function(){return SDe(n)},[n]),te=w.useMemo(function(){return typeof _=="function"?_:EN},[_]),G=w.useMemo(function(){return typeof S=="function"?S:EN},[S]),$=w.useRef(null),W=w.useRef(null),X=w.useReducer(NDe,u_),Z=KC(X,2),U=Z[0],Q=Z[1],re=U.isFocused,fe=U.isFileDialogActive,Ee=w.useRef(typeof window<"u"&&window.isSecureContext&&E&&bDe()),be=function(){!Ee.current&&fe&&setTimeout(function(){if(W.current){var Ne=W.current.files;Ne.length||(Q({type:"closeDialog"}),G())}},300)};w.useEffect(function(){return window.addEventListener("focus",be,!1),function(){window.removeEventListener("focus",be,!1)}},[W,fe,G,Ee]);var ye=w.useRef([]),Fe=function(Ne){$.current&&$.current.contains(Ne.target)||(Ne.preventDefault(),ye.current=[])};w.useEffect(function(){return T&&(document.addEventListener("dragover",_N,!1),document.addEventListener("drop",Fe,!1)),function(){T&&(document.removeEventListener("dragover",_N),document.removeEventListener("drop",Fe))}},[$,T]),w.useEffect(function(){return!r&&k&&$.current&&$.current.focus(),function(){}},[$,k,r]);var Me=w.useCallback(function(xe){j?j(xe):console.error(xe)},[j]),rt=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe),ye.current=[].concat(TDe(ye.current),[xe.target]),e4(xe)&&Promise.resolve(i(xe)).then(function(Ne){if(!(mS(xe)&&!D)){var Ct=Ne.length,Dt=Ct>0&&gDe({files:Ne,accept:H,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:z}),Te=Ct>0&&!Dt;Q({isDragAccept:Dt,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),u&&u(xe)}}).catch(function(Ne){return Me(Ne)})},[i,u,Me,D,H,a,o,s,l,z]),Ve=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe);var Ne=e4(xe);if(Ne&&xe.dataTransfer)try{xe.dataTransfer.dropEffect="copy"}catch{}return Ne&&h&&h(xe),!1},[h,D]),je=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe);var Ne=ye.current.filter(function(Dt){return $.current&&$.current.contains(Dt)}),Ct=Ne.indexOf(xe.target);Ct!==-1&&Ne.splice(Ct,1),ye.current=Ne,!(Ne.length>0)&&(Q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),e4(xe)&&d&&d(xe))},[$,d,D]),wt=w.useCallback(function(xe,Ne){var Ct=[],Dt=[];xe.forEach(function(Te){var At=cK(Te,H),ze=KC(At,2),vt=ze[0],nn=ze[1],Rn=dK(Te,a,o),Ze=KC(Rn,2),xt=Ze[0],ht=Ze[1],Ht=z?z(Te):null;if(vt&&xt&&!Ht)Ct.push(Te);else{var rn=[nn,ht];Ht&&(rn=rn.concat(Ht)),Dt.push({file:Te,errors:rn.filter(function(pr){return pr})})}}),(!s&&Ct.length>1||s&&l>=1&&Ct.length>l)&&(Ct.forEach(function(Te){Dt.push({file:Te,errors:[pDe]})}),Ct.splice(0)),Q({acceptedFiles:Ct,fileRejections:Dt,type:"setFiles"}),m&&m(Ct,Dt,Ne),Dt.length>0&&b&&b(Dt,Ne),Ct.length>0&&v&&v(Ct,Ne)},[Q,s,H,a,o,l,m,v,b,z]),Be=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe),ye.current=[],e4(xe)&&Promise.resolve(i(xe)).then(function(Ne){mS(xe)&&!D||wt(Ne,xe)}).catch(function(Ne){return Me(Ne)}),Q({type:"reset"})},[i,wt,Me,D]),at=w.useCallback(function(){if(Ee.current){Q({type:"openDialog"}),te();var xe={multiple:s,types:K};window.showOpenFilePicker(xe).then(function(Ne){return i(Ne)}).then(function(Ne){wt(Ne,null),Q({type:"closeDialog"})}).catch(function(Ne){wDe(Ne)?(G(Ne),Q({type:"closeDialog"})):CDe(Ne)?(Ee.current=!1,W.current?(W.current.value=null,W.current.click()):Me(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Me(Ne)});return}W.current&&(Q({type:"openDialog"}),te(),W.current.value=null,W.current.click())},[Q,te,G,E,wt,Me,K,s]),bt=w.useCallback(function(xe){!$.current||!$.current.isEqualNode(xe.target)||(xe.key===" "||xe.key==="Enter"||xe.keyCode===32||xe.keyCode===13)&&(xe.preventDefault(),at())},[$,at]),Le=w.useCallback(function(){Q({type:"focus"})},[]),ut=w.useCallback(function(){Q({type:"blur"})},[]),Mt=w.useCallback(function(){A||(yDe()?setTimeout(at,0):at())},[A,at]),ct=function(Ne){return r?null:Ne},_t=function(Ne){return M?null:ct(Ne)},un=function(Ne){return R?null:ct(Ne)},ae=function(Ne){D&&Ne.stopPropagation()},De=w.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=xe.refKey,Ct=Ne===void 0?"ref":Ne,Dt=xe.role,Te=xe.onKeyDown,At=xe.onFocus,ze=xe.onBlur,vt=xe.onClick,nn=xe.onDragEnter,Rn=xe.onDragOver,Ze=xe.onDragLeave,xt=xe.onDrop,ht=vS(xe,EDe);return _r(_r(l_({onKeyDown:_t(Dl(Te,bt)),onFocus:_t(Dl(At,Le)),onBlur:_t(Dl(ze,ut)),onClick:ct(Dl(vt,Mt)),onDragEnter:un(Dl(nn,rt)),onDragOver:un(Dl(Rn,Ve)),onDragLeave:un(Dl(Ze,je)),onDrop:un(Dl(xt,Be)),role:typeof Dt=="string"&&Dt!==""?Dt:"presentation"},Ct,$),!r&&!M?{tabIndex:0}:{}),ht)}},[$,bt,Le,ut,Mt,rt,Ve,je,Be,M,R,r]),Ke=w.useCallback(function(xe){xe.stopPropagation()},[]),Xe=w.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=xe.refKey,Ct=Ne===void 0?"ref":Ne,Dt=xe.onChange,Te=xe.onClick,At=vS(xe,PDe),ze=l_({accept:H,multiple:s,type:"file",style:{display:"none"},onChange:ct(Dl(Dt,Be)),onClick:ct(Dl(Te,Ke)),tabIndex:-1},Ct,W);return _r(_r({},ze),At)}},[W,n,s,Be,r]);return _r(_r({},U),{},{isFocused:re&&!r,getRootProps:De,getInputProps:Xe,rootRef:$,inputRef:W,open:ct(at)})}function NDe(e,t){switch(t.type){case"focus":return _r(_r({},e),{},{isFocused:!0});case"blur":return _r(_r({},e),{},{isFocused:!1});case"openDialog":return _r(_r({},u_),{},{isFileDialogActive:!0});case"closeDialog":return _r(_r({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _r(_r({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _r(_r({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return _r({},u_);default:return e}}function EN(){}const jDe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return et("esc",()=>{i(!1)}),y.jsxs("div",{className:"dropzone-container",children:[t&&y.jsx("div",{className:"dropzone-overlay is-drag-accept",children:y.jsxs(jh,{size:"lg",children:["Upload Image",r]})}),n&&y.jsxs("div",{className:"dropzone-overlay is-drag-reject",children:[y.jsx(jh,{size:"lg",children:"Invalid Upload"}),y.jsx(jh,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},BDe=e=>{const{children:t}=e,n=Oe(),r=he(Mr),i=By({}),{t:o}=Ue(),[a,s]=w.useState(!1),{setOpenUploader:l}=PP(),u=w.useCallback(T=>{s(!0);const A=T.errors.reduce((M,R)=>`${M} +${R.message}`,"");i({title:o("toast:uploadFailed"),description:A,status:"error",isClosable:!0})},[o,i]),d=w.useCallback(async T=>{n(bD({imageFile:T}))},[n]),h=w.useCallback((T,A)=>{A.forEach(M=>{u(M)}),T.forEach(M=>{d(M)})},[d,u]),{getRootProps:m,getInputProps:v,isDragAccept:b,isDragReject:S,isDragActive:_,open:E}=mK({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:()=>s(!0),maxFiles:1});l(E),w.useEffect(()=>{const T=A=>{var j;const M=(j=A.clipboardData)==null?void 0:j.items;if(!M)return;const R=[];for(const z of M)z.kind==="file"&&["image/png","image/jpg"].includes(z.type)&&R.push(z);if(!R.length)return;if(A.stopImmediatePropagation(),R.length>1){i({description:o("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=R[0].getAsFile();if(!D){i({description:o("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(bD({imageFile:D}))};return document.addEventListener("paste",T),()=>{document.removeEventListener("paste",T)}},[o,n,i,r]);const k=["img2img","unifiedCanvas"].includes(r)?` to ${ts[r].tooltip}`:"";return y.jsx(EP.Provider,{value:E,children:y.jsxs("div",{...m({style:{}}),onKeyDown:T=>{T.key},children:[y.jsx("input",{...v()}),t,_&&a&&y.jsx(jDe,{isDragAccept:b,isDragReject:S,overlaySecondaryText:k,setIsHandlingUpload:s})]})})},$De=lt(or,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),FDe=lt(or,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),zDe=()=>{const e=Oe(),t=he($De),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=he(FDe),[o,a]=w.useState(!0),s=w.useRef(null);w.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(ZU()),e(LC(!n))};et("`",()=>{e(LC(!n))},[n]),et("esc",()=>{e(LC(!1))});const u=()=>{s.current&&o&&s.current.scrollTop{const{timestamp:m,message:v,level:b}=d;return y.jsxs("div",{className:`console-entry console-${b}-color`,children:[y.jsxs("p",{className:"console-timestamp",children:[m,":"]}),y.jsx("p",{className:"console-message",children:v})]},h)})})}),n&&y.jsx(uo,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:y.jsx(us,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:y.jsx(gEe,{}),onClick:()=>a(!o)})}),y.jsx(uo,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:y.jsx(us,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?y.jsx(AEe,{}):y.jsx(Eq,{}),onClick:l})})]})},HDe=lt(or,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VDe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=he(HDe),i=t?Math.round(t*100/n):0;return y.jsx(YV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function WDe(e){const{title:t,hotkey:n,description:r}=e;return y.jsxs("div",{className:"hotkey-modal-item",children:[y.jsxs("div",{className:"hotkey-info",children:[y.jsx("p",{className:"hotkey-title",children:t}),r&&y.jsx("p",{className:"hotkey-description",children:r})]}),y.jsx("div",{className:"hotkey-key",children:n})]})}function UDe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Gh(),{t:i}=Ue(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=d=>{const h=[];return d.forEach((m,v)=>{h.push(y.jsx(WDe,{title:m.title,description:m.desc,hotkey:m.hotkey},v))}),y.jsx("div",{className:"hotkey-modal-category",children:h})};return y.jsxs(y.Fragment,{children:[w.cloneElement(e,{onClick:n}),y.jsxs(Xd,{isOpen:t,onClose:r,children:[y.jsx(Zd,{}),y.jsxs(Jh,{className:" modal hotkeys-modal",children:[y.jsx(Iy,{className:"modal-close-btn"}),y.jsx("h1",{children:"Keyboard Shorcuts"}),y.jsx("div",{className:"hotkeys-modal-items",children:y.jsxs(dk,{allowMultiple:!0,children:[y.jsxs(Kg,{children:[y.jsxs(qg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:appHotkeys")}),y.jsx(Yg,{})]}),y.jsx(Xg,{children:u(o)})]}),y.jsxs(Kg,{children:[y.jsxs(qg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:generalHotkeys")}),y.jsx(Yg,{})]}),y.jsx(Xg,{children:u(a)})]}),y.jsxs(Kg,{children:[y.jsxs(qg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:galleryHotkeys")}),y.jsx(Yg,{})]}),y.jsx(Xg,{children:u(s)})]}),y.jsxs(Kg,{children:[y.jsxs(qg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),y.jsx(Yg,{})]}),y.jsx(Xg,{children:u(l)})]})]})})]})]})]})}var PN=Array.isArray,TN=Object.keys,GDe=Object.prototype.hasOwnProperty,qDe=typeof Element<"u";function c_(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=PN(e),r=PN(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!c_(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var h=TN(e);if(o=h.length,o!==TN(t).length)return!1;for(i=o;i--!==0;)if(!GDe.call(t,h[i]))return!1;if(qDe&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=h[i],!(a==="_owner"&&e.$$typeof)&&!c_(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var yd=function(t,n){try{return c_(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},YDe=function(t){return KDe(t)&&!XDe(t)};function KDe(e){return!!e&&typeof e=="object"}function XDe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||JDe(e)}var ZDe=typeof Symbol=="function"&&Symbol.for,QDe=ZDe?Symbol.for("react.element"):60103;function JDe(e){return e.$$typeof===QDe}function eNe(e){return Array.isArray(e)?[]:{}}function yS(e,t){return t.clone!==!1&&t.isMergeableObject(e)?dy(eNe(e),e,t):e}function tNe(e,t,n){return e.concat(t).map(function(r){return yS(r,n)})}function nNe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=yS(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=yS(t[i],n):r[i]=dy(e[i],t[i],n)}),r}function dy(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||tNe,n.isMergeableObject=n.isMergeableObject||YDe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):nNe(e,t,n):yS(t,n)}dy.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return dy(r,i,n)},{})};var d_=dy,rNe=typeof global=="object"&&global&&global.Object===Object&&global;const vK=rNe;var iNe=typeof self=="object"&&self&&self.Object===Object&&self,oNe=vK||iNe||Function("return this")();const yu=oNe;var aNe=yu.Symbol;const nf=aNe;var yK=Object.prototype,sNe=yK.hasOwnProperty,lNe=yK.toString,vv=nf?nf.toStringTag:void 0;function uNe(e){var t=sNe.call(e,vv),n=e[vv];try{e[vv]=void 0;var r=!0}catch{}var i=lNe.call(e);return r&&(t?e[vv]=n:delete e[vv]),i}var cNe=Object.prototype,dNe=cNe.toString;function fNe(e){return dNe.call(e)}var hNe="[object Null]",pNe="[object Undefined]",LN=nf?nf.toStringTag:void 0;function _p(e){return e==null?e===void 0?pNe:hNe:LN&&LN in Object(e)?uNe(e):fNe(e)}function bK(e,t){return function(n){return e(t(n))}}var gNe=bK(Object.getPrototypeOf,Object);const pT=gNe;function kp(e){return e!=null&&typeof e=="object"}var mNe="[object Object]",vNe=Function.prototype,yNe=Object.prototype,SK=vNe.toString,bNe=yNe.hasOwnProperty,SNe=SK.call(Object);function AN(e){if(!kp(e)||_p(e)!=mNe)return!1;var t=pT(e);if(t===null)return!0;var n=bNe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&SK.call(n)==SNe}function xNe(){this.__data__=[],this.size=0}function xK(e,t){return e===t||e!==e&&t!==t}function gw(e,t){for(var n=e.length;n--;)if(xK(e[n][0],t))return n;return-1}var wNe=Array.prototype,CNe=wNe.splice;function _Ne(e){var t=this.__data__,n=gw(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():CNe.call(t,n,1),--this.size,!0}function kNe(e){var t=this.__data__,n=gw(t,e);return n<0?void 0:t[n][1]}function ENe(e){return gw(this.__data__,e)>-1}function PNe(e,t){var n=this.__data__,r=gw(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function bc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=Rje}var Dje="[object Arguments]",Nje="[object Array]",jje="[object Boolean]",Bje="[object Date]",$je="[object Error]",Fje="[object Function]",zje="[object Map]",Hje="[object Number]",Vje="[object Object]",Wje="[object RegExp]",Uje="[object Set]",Gje="[object String]",qje="[object WeakMap]",Yje="[object ArrayBuffer]",Kje="[object DataView]",Xje="[object Float32Array]",Zje="[object Float64Array]",Qje="[object Int8Array]",Jje="[object Int16Array]",eBe="[object Int32Array]",tBe="[object Uint8Array]",nBe="[object Uint8ClampedArray]",rBe="[object Uint16Array]",iBe="[object Uint32Array]",lr={};lr[Xje]=lr[Zje]=lr[Qje]=lr[Jje]=lr[eBe]=lr[tBe]=lr[nBe]=lr[rBe]=lr[iBe]=!0;lr[Dje]=lr[Nje]=lr[Yje]=lr[jje]=lr[Kje]=lr[Bje]=lr[$je]=lr[Fje]=lr[zje]=lr[Hje]=lr[Vje]=lr[Wje]=lr[Uje]=lr[Gje]=lr[qje]=!1;function oBe(e){return kp(e)&&TK(e.length)&&!!lr[_p(e)]}function gT(e){return function(t){return e(t)}}var LK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,m2=LK&&typeof module=="object"&&module&&!module.nodeType&&module,aBe=m2&&m2.exports===LK,ZC=aBe&&vK.process,sBe=function(){try{var e=m2&&m2.require&&m2.require("util").types;return e||ZC&&ZC.binding&&ZC.binding("util")}catch{}}();const f0=sBe;var NN=f0&&f0.isTypedArray,lBe=NN?gT(NN):oBe;const uBe=lBe;var cBe=Object.prototype,dBe=cBe.hasOwnProperty;function AK(e,t){var n=Zy(e),r=!n&&kje(e),i=!n&&!r&&PK(e),o=!n&&!r&&!i&&uBe(e),a=n||r||i||o,s=a?Sje(e.length,String):[],l=s.length;for(var u in e)(t||dBe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ije(u,l)))&&s.push(u);return s}var fBe=Object.prototype;function mT(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||fBe;return e===n}var hBe=bK(Object.keys,Object);const pBe=hBe;var gBe=Object.prototype,mBe=gBe.hasOwnProperty;function vBe(e){if(!mT(e))return pBe(e);var t=[];for(var n in Object(e))mBe.call(e,n)&&n!="constructor"&&t.push(n);return t}function OK(e){return e!=null&&TK(e.length)&&!wK(e)}function vT(e){return OK(e)?AK(e):vBe(e)}function yBe(e,t){return e&&vw(t,vT(t),e)}function bBe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var SBe=Object.prototype,xBe=SBe.hasOwnProperty;function wBe(e){if(!Xy(e))return bBe(e);var t=mT(e),n=[];for(var r in e)r=="constructor"&&(t||!xBe.call(e,r))||n.push(r);return n}function yT(e){return OK(e)?AK(e,!0):wBe(e)}function CBe(e,t){return e&&vw(t,yT(t),e)}var MK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jN=MK&&typeof module=="object"&&module&&!module.nodeType&&module,_Be=jN&&jN.exports===MK,BN=_Be?yu.Buffer:void 0,$N=BN?BN.allocUnsafe:void 0;function kBe(e,t){if(t)return e.slice();var n=e.length,r=$N?$N(n):new e.constructor(n);return e.copy(r),r}function IK(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function tj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var nj=function(t){return Array.isArray(t)&&t.length===0},qo=function(t){return typeof t=="function"},yw=function(t){return t!==null&&typeof t=="object"},CFe=function(t){return String(Math.floor(Number(t)))===t},QC=function(t){return Object.prototype.toString.call(t)==="[object String]"},WK=function(t){return w.Children.count(t)===0},JC=function(t){return yw(t)&&qo(t.then)};function Wi(e,t,n,r){r===void 0&&(r=0);for(var i=VK(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function UK(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?De.map(function(Xe){return j(Xe,Wi(ae,Xe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ke).then(function(Xe){return Xe.reduce(function(xe,Ne,Ct){return Ne==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ne&&(xe=au(xe,De[Ct],Ne)),xe},{})})},[j]),H=w.useCallback(function(ae){return Promise.all([z(ae),m.validationSchema?D(ae):{},m.validate?R(ae):{}]).then(function(De){var Ke=De[0],Xe=De[1],xe=De[2],Ne=d_.all([Ke,Xe,xe],{arrayMerge:LFe});return Ne})},[m.validate,m.validationSchema,z,R,D]),K=Xa(function(ae){return ae===void 0&&(ae=A.values),M({type:"SET_ISVALIDATING",payload:!0}),H(ae).then(function(De){return E.current&&(M({type:"SET_ISVALIDATING",payload:!1}),M({type:"SET_ERRORS",payload:De})),De})});w.useEffect(function(){a&&E.current===!0&&yd(v.current,m.initialValues)&&K(v.current)},[a,K]);var te=w.useCallback(function(ae){var De=ae&&ae.values?ae.values:v.current,Ke=ae&&ae.errors?ae.errors:b.current?b.current:m.initialErrors||{},Xe=ae&&ae.touched?ae.touched:S.current?S.current:m.initialTouched||{},xe=ae&&ae.status?ae.status:_.current?_.current:m.initialStatus;v.current=De,b.current=Ke,S.current=Xe,_.current=xe;var Ne=function(){M({type:"RESET_FORM",payload:{isSubmitting:!!ae&&!!ae.isSubmitting,errors:Ke,touched:Xe,status:xe,values:De,isValidating:!!ae&&!!ae.isValidating,submitCount:ae&&ae.submitCount&&typeof ae.submitCount=="number"?ae.submitCount:0}})};if(m.onReset){var Ct=m.onReset(A.values,Be);JC(Ct)?Ct.then(Ne):Ne()}else Ne()},[m.initialErrors,m.initialStatus,m.initialTouched]);w.useEffect(function(){E.current===!0&&!yd(v.current,m.initialValues)&&(u&&(v.current=m.initialValues,te()),a&&K(v.current))},[u,m.initialValues,te,a,K]),w.useEffect(function(){u&&E.current===!0&&!yd(b.current,m.initialErrors)&&(b.current=m.initialErrors||dh,M({type:"SET_ERRORS",payload:m.initialErrors||dh}))},[u,m.initialErrors]),w.useEffect(function(){u&&E.current===!0&&!yd(S.current,m.initialTouched)&&(S.current=m.initialTouched||t4,M({type:"SET_TOUCHED",payload:m.initialTouched||t4}))},[u,m.initialTouched]),w.useEffect(function(){u&&E.current===!0&&!yd(_.current,m.initialStatus)&&(_.current=m.initialStatus,M({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var G=Xa(function(ae){if(k.current[ae]&&qo(k.current[ae].validate)){var De=Wi(A.values,ae),Ke=k.current[ae].validate(De);return JC(Ke)?(M({type:"SET_ISVALIDATING",payload:!0}),Ke.then(function(Xe){return Xe}).then(function(Xe){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Xe}}),M({type:"SET_ISVALIDATING",payload:!1})})):(M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Ke}}),Promise.resolve(Ke))}else if(m.validationSchema)return M({type:"SET_ISVALIDATING",payload:!0}),D(A.values,ae).then(function(Xe){return Xe}).then(function(Xe){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Xe[ae]}}),M({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),$=w.useCallback(function(ae,De){var Ke=De.validate;k.current[ae]={validate:Ke}},[]),W=w.useCallback(function(ae){delete k.current[ae]},[]),X=Xa(function(ae,De){M({type:"SET_TOUCHED",payload:ae});var Ke=De===void 0?i:De;return Ke?K(A.values):Promise.resolve()}),Z=w.useCallback(function(ae){M({type:"SET_ERRORS",payload:ae})},[]),U=Xa(function(ae,De){var Ke=qo(ae)?ae(A.values):ae;M({type:"SET_VALUES",payload:Ke});var Xe=De===void 0?n:De;return Xe?K(Ke):Promise.resolve()}),Q=w.useCallback(function(ae,De){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:De}})},[]),re=Xa(function(ae,De,Ke){M({type:"SET_FIELD_VALUE",payload:{field:ae,value:De}});var Xe=Ke===void 0?n:Ke;return Xe?K(au(A.values,ae,De)):Promise.resolve()}),fe=w.useCallback(function(ae,De){var Ke=De,Xe=ae,xe;if(!QC(ae)){ae.persist&&ae.persist();var Ne=ae.target?ae.target:ae.currentTarget,Ct=Ne.type,Dt=Ne.name,Te=Ne.id,At=Ne.value,ze=Ne.checked,vt=Ne.outerHTML,nn=Ne.options,Rn=Ne.multiple;Ke=De||Dt||Te,Xe=/number|range/.test(Ct)?(xe=parseFloat(At),isNaN(xe)?"":xe):/checkbox/.test(Ct)?OFe(Wi(A.values,Ke),ze,At):nn&&Rn?AFe(nn):At}Ke&&re(Ke,Xe)},[re,A.values]),Ee=Xa(function(ae){if(QC(ae))return function(De){return fe(De,ae)};fe(ae)}),be=Xa(function(ae,De,Ke){De===void 0&&(De=!0),M({type:"SET_FIELD_TOUCHED",payload:{field:ae,value:De}});var Xe=Ke===void 0?i:Ke;return Xe?K(A.values):Promise.resolve()}),ye=w.useCallback(function(ae,De){ae.persist&&ae.persist();var Ke=ae.target,Xe=Ke.name,xe=Ke.id,Ne=Ke.outerHTML,Ct=De||Xe||xe;be(Ct,!0)},[be]),Fe=Xa(function(ae){if(QC(ae))return function(De){return ye(De,ae)};ye(ae)}),Me=w.useCallback(function(ae){qo(ae)?M({type:"SET_FORMIK_STATE",payload:ae}):M({type:"SET_FORMIK_STATE",payload:function(){return ae}})},[]),rt=w.useCallback(function(ae){M({type:"SET_STATUS",payload:ae})},[]),Ve=w.useCallback(function(ae){M({type:"SET_ISSUBMITTING",payload:ae})},[]),je=Xa(function(){return M({type:"SUBMIT_ATTEMPT"}),K().then(function(ae){var De=ae instanceof Error,Ke=!De&&Object.keys(ae).length===0;if(Ke){var Xe;try{if(Xe=at(),Xe===void 0)return}catch(xe){throw xe}return Promise.resolve(Xe).then(function(xe){return E.current&&M({type:"SUBMIT_SUCCESS"}),xe}).catch(function(xe){if(E.current)throw M({type:"SUBMIT_FAILURE"}),xe})}else if(E.current&&(M({type:"SUBMIT_FAILURE"}),De))throw ae})}),wt=Xa(function(ae){ae&&ae.preventDefault&&qo(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&qo(ae.stopPropagation)&&ae.stopPropagation(),je().catch(function(De){console.warn("Warning: An unhandled error was caught from submitForm()",De)})}),Be={resetForm:te,validateForm:K,validateField:G,setErrors:Z,setFieldError:Q,setFieldTouched:be,setFieldValue:re,setStatus:rt,setSubmitting:Ve,setTouched:X,setValues:U,setFormikState:Me,submitForm:je},at=Xa(function(){return d(A.values,Be)}),bt=Xa(function(ae){ae&&ae.preventDefault&&qo(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&qo(ae.stopPropagation)&&ae.stopPropagation(),te()}),Le=w.useCallback(function(ae){return{value:Wi(A.values,ae),error:Wi(A.errors,ae),touched:!!Wi(A.touched,ae),initialValue:Wi(v.current,ae),initialTouched:!!Wi(S.current,ae),initialError:Wi(b.current,ae)}},[A.errors,A.touched,A.values]),ut=w.useCallback(function(ae){return{setValue:function(Ke,Xe){return re(ae,Ke,Xe)},setTouched:function(Ke,Xe){return be(ae,Ke,Xe)},setError:function(Ke){return Q(ae,Ke)}}},[re,be,Q]),Mt=w.useCallback(function(ae){var De=yw(ae),Ke=De?ae.name:ae,Xe=Wi(A.values,Ke),xe={name:Ke,value:Xe,onChange:Ee,onBlur:Fe};if(De){var Ne=ae.type,Ct=ae.value,Dt=ae.as,Te=ae.multiple;Ne==="checkbox"?Ct===void 0?xe.checked=!!Xe:(xe.checked=!!(Array.isArray(Xe)&&~Xe.indexOf(Ct)),xe.value=Ct):Ne==="radio"?(xe.checked=Xe===Ct,xe.value=Ct):Dt==="select"&&Te&&(xe.value=xe.value||[],xe.multiple=!0)}return xe},[Fe,Ee,A.values]),ct=w.useMemo(function(){return!yd(v.current,A.values)},[v.current,A.values]),_t=w.useMemo(function(){return typeof s<"u"?ct?A.errors&&Object.keys(A.errors).length===0:s!==!1&&qo(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,ct,A.errors,m]),un=qn({},A,{initialValues:v.current,initialErrors:b.current,initialTouched:S.current,initialStatus:_.current,handleBlur:Fe,handleChange:Ee,handleReset:bt,handleSubmit:wt,resetForm:te,setErrors:Z,setFormikState:Me,setFieldTouched:be,setFieldValue:re,setFieldError:Q,setStatus:rt,setSubmitting:Ve,setTouched:X,setValues:U,submitForm:je,validateForm:K,validateField:G,isValid:_t,dirty:ct,unregisterField:W,registerField:$,getFieldProps:Mt,getFieldMeta:Le,getFieldHelpers:ut,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return un}function Qy(e){var t=EFe(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return w.useImperativeHandle(o,function(){return t}),w.createElement(_Fe,{value:t},n?w.createElement(n,t):i?i(t):r?qo(r)?r(t):WK(r)?null:w.Children.only(r):null)}function PFe(e){var t={};if(e.inner){if(e.inner.length===0)return au(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Wi(t,a.path)||(t=au(t,a.path,a.message))}}return t}function TFe(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=m_(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function m_(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||AN(i)?m_(i):i!==""?i:void 0}):AN(e[r])?t[r]=m_(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function LFe(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?d_(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=d_(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function AFe(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function OFe(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var MFe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function Xa(e){var t=w.useRef(e);return MFe(function(){t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(qn({},t,{length:n+1}))}else return[]},jFe=function(e){wFe(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,d=l.formik.setFormikState;d(function(h){var m=typeof s=="function"?s:o,v=typeof a=="function"?a:o,b=au(h.values,u,o(Wi(h.values,u))),S=s?m(Wi(h.errors,u)):void 0,_=a?v(Wi(h.touched,u)):void 0;return nj(S)&&(S=void 0),nj(_)&&(_=void 0),qn({},h,{values:b,errors:s?au(h.errors,u,S):h.errors,touched:a?au(h.touched,u,_):h.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(h0(a),[xFe(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return DFe(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return RFe(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return e7(s,o,a)},function(s){return e7(s,o,null)},function(s){return e7(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return NFe(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(tj(i)),i.pop=i.pop.bind(tj(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!yd(Wi(i.formik.values,i.name),Wi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?h0(a):[];return o||(o=s[i]),qo(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,d=o.formik,h=Oh(d,["validate","validationSchema"]),m=qn({},i,{form:h,name:u});return a?w.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):WK(l)?null:w.Children.only(l):null},t}(w.Component);jFe.defaultProps={validateOnChange:!0};function BFe(e){const{model:t}=e,r=he(S=>S.system.model_list)[t],[i,o]=w.useState(""),[a,s]=w.useState("1"),l=Oe(),{t:u}=Ue(),d=he(S=>S.system.isProcessing),h=he(S=>S.system.isConnected),m=()=>{s("1"),o("")};w.useEffect(()=>{m()},[t]);const v=()=>{m()},b=()=>{const S={name:t,model_type:a,custom_config:a==="custom"&&i!==""?i:null};l(ns(!0)),l(n_e(S)),m()};return y.jsx(fw,{title:`${u("modelmanager:convert")} ${t}`,acceptCallback:b,cancelCallback:v,acceptButtonText:`${u("modelmanager:convert")}`,triggerComponent:y.jsxs(nr,{size:"sm","aria-label":u("modelmanager:convertToDiffusers"),isDisabled:r.status==="active"||d||!h,className:" modal-close-btn",marginRight:"2rem",children:["🧨 ",u("modelmanager:convertToDiffusers")]}),motionPreset:"slideInBottom",children:y.jsxs(Ge,{flexDirection:"column",rowGap:4,children:[y.jsx(Jt,{children:u("modelmanager:convertToDiffusersHelpText1")}),y.jsxs(xF,{children:[y.jsx(Sv,{children:u("modelmanager:convertToDiffusersHelpText2")}),y.jsx(Sv,{children:u("modelmanager:convertToDiffusersHelpText3")}),y.jsx(Sv,{children:u("modelmanager:convertToDiffusersHelpText4")}),y.jsx(Sv,{children:u("modelmanager:convertToDiffusersHelpText5")})]}),y.jsx(Jt,{children:u("modelmanager:convertToDiffusersHelpText6")}),y.jsx(XV,{value:a,onChange:S=>s(S),defaultValue:"1",name:"model_type",children:y.jsxs(Ge,{gap:4,children:[y.jsx(Ev,{value:"1",children:u("modelmanager:v1")}),y.jsx(Ev,{value:"2",children:u("modelmanager:v2")}),y.jsx(Ev,{value:"inpainting",children:u("modelmanager:inpainting")}),y.jsx(Ev,{value:"custom",children:u("modelmanager:custom")})]})}),a==="custom"&&y.jsxs(Ge,{flexDirection:"column",rowGap:2,children:[y.jsx(Jt,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:u("modelmanager:pathToCustomConfig")}),y.jsx(br,{value:i,onChange:S=>{S.target.value!==""&&o(S.target.value)},width:"25rem"})]})]})})}const $Fe=lt([or],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),rj=64,ij=2048;function FFe(){const{openModel:e,model_list:t}=he($Fe),n=he(l=>l.system.isProcessing),r=Oe(),{t:i}=Ue(),[o,a]=w.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});w.useEffect(()=>{var l,u,d,h,m,v,b;if(e){const S=ke.pickBy(t,(_,E)=>ke.isEqual(E,e));a({name:e,description:(l=S[e])==null?void 0:l.description,config:(u=S[e])==null?void 0:u.config,weights:(d=S[e])==null?void 0:d.weights,vae:(h=S[e])==null?void 0:h.vae,width:(m=S[e])==null?void 0:m.width,height:(v=S[e])==null?void 0:v.height,default:(b=S[e])==null?void 0:b.default,format:"ckpt"})}},[t,e]);const s=l=>{r(Vy({...l,width:Number(l.width),height:Number(l.height)}))};return e?y.jsxs(Ge,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[y.jsxs(Ge,{alignItems:"center",gap:4,justifyContent:"space-between",children:[y.jsx(Jt,{fontSize:"lg",fontWeight:"bold",children:e}),y.jsx(BFe,{model:e})]}),y.jsx(Ge,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:y.jsx(Qy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>y.jsx("form",{onSubmit:l,children:y.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[y.jsxs(fn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[y.jsx(En,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?y.jsx(cr,{children:u.description}):y.jsx(ur,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.config&&d.config,isRequired:!0,children:[y.jsx(En,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"config",name:"config",type:"text",width:"lg"}),u.config&&d.config?y.jsx(cr,{children:u.config}):y.jsx(ur,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.weights&&d.weights,isRequired:!0,children:[y.jsx(En,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"weights",name:"weights",type:"text",width:"lg"}),u.weights&&d.weights?y.jsx(cr,{children:u.weights}):y.jsx(ur,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.vae&&d.vae,children:[y.jsx(En,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae",name:"vae",type:"text",width:"lg"}),u.vae&&d.vae?y.jsx(cr,{children:u.vae}):y.jsx(ur,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(Ey,{width:"100%",children:[y.jsxs(fn,{isInvalid:!!u.width&&d.width,children:[y.jsx(En,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"width",name:"width",children:({field:h,form:m})=>y.jsx(ia,{id:"width",name:"width",min:rj,max:ij,step:64,value:m.values.width,onChange:v=>m.setFieldValue(h.name,Number(v))})}),u.width&&d.width?y.jsx(cr,{children:u.width}):y.jsx(ur,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.height&&d.height,children:[y.jsx(En,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"height",name:"height",children:({field:h,form:m})=>y.jsx(ia,{id:"height",name:"height",min:rj,max:ij,step:64,value:m.values.height,onChange:v=>m.setFieldValue(h.name,Number(v))})}),u.height&&d.height?y.jsx(cr,{children:u.height}):y.jsx(ur,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):y.jsx(Ge,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:y.jsx(Jt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const zFe=lt([or],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function HFe(){const{openModel:e,model_list:t}=he(zFe),n=he(l=>l.system.isProcessing),r=Oe(),{t:i}=Ue(),[o,a]=w.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});w.useEffect(()=>{var l,u,d,h,m,v,b,S,_,E,k,T,A,M,R,D;if(e){const j=ke.pickBy(t,(z,H)=>ke.isEqual(H,e));a({name:e,description:(l=j[e])==null?void 0:l.description,path:(u=j[e])!=null&&u.path&&((d=j[e])==null?void 0:d.path)!=="None"?(h=j[e])==null?void 0:h.path:"",repo_id:(m=j[e])!=null&&m.repo_id&&((v=j[e])==null?void 0:v.repo_id)!=="None"?(b=j[e])==null?void 0:b.repo_id:"",vae:{repo_id:(_=(S=j[e])==null?void 0:S.vae)!=null&&_.repo_id?(k=(E=j[e])==null?void 0:E.vae)==null?void 0:k.repo_id:"",path:(A=(T=j[e])==null?void 0:T.vae)!=null&&A.path?(R=(M=j[e])==null?void 0:M.vae)==null?void 0:R.path:""},default:(D=j[e])==null?void 0:D.default,format:"diffusers"})}},[t,e]);const s=l=>{const u=l;l.path===""&&delete u.path,l.repo_id===""&&delete u.repo_id,l.vae.path===""&&delete u.vae.path,l.vae.repo_id===""&&delete u.vae.repo_id,r(Vy(l))};return e?y.jsxs(Ge,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[y.jsx(Ge,{alignItems:"center",children:y.jsx(Jt,{fontSize:"lg",fontWeight:"bold",children:e})}),y.jsx(Ge,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:y.jsx(Qy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>{var h,m,v,b,S,_,E,k,T,A;return y.jsx("form",{onSubmit:l,children:y.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[y.jsxs(fn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[y.jsx(En,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?y.jsx(cr,{children:u.description}):y.jsx(ur,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.path&&d.path,isRequired:!0,children:[y.jsx(En,{htmlFor:"path",fontSize:"sm",children:i("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"path",name:"path",type:"text",width:"lg"}),u.path&&d.path?y.jsx(cr,{children:u.path}):y.jsx(ur,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.repo_id&&d.repo_id,children:[y.jsx(En,{htmlFor:"repo_id",fontSize:"sm",children:i("modelmanager:repo_id")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"repo_id",name:"repo_id",type:"text",width:"lg"}),u.repo_id&&d.repo_id?y.jsx(cr,{children:u.repo_id}):y.jsx(ur,{margin:0,children:i("modelmanager:repoIDValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!((h=u.vae)!=null&&h.path)&&((m=d.vae)==null?void 0:m.path),children:[y.jsx(En,{htmlFor:"vae.path",fontSize:"sm",children:i("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae.path",name:"vae.path",type:"text",width:"lg"}),(v=u.vae)!=null&&v.path&&((b=d.vae)!=null&&b.path)?y.jsx(cr,{children:(S=u.vae)==null?void 0:S.path}):y.jsx(ur,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!((_=u.vae)!=null&&_.repo_id)&&((E=d.vae)==null?void 0:E.repo_id),children:[y.jsx(En,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelmanager:vaeRepoID")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"lg"}),(k=u.vae)!=null&&k.repo_id&&((T=d.vae)!=null&&T.repo_id)?y.jsx(cr,{children:(A=u.vae)==null?void 0:A.repo_id}):y.jsx(ur,{margin:0,children:i("modelmanager:vaeRepoIDValidationMsg")})]})]}),y.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})}})})]}):y.jsx(Ge,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:y.jsx(Jt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const qK=lt([or],e=>{const{model_list:t}=e,n=[];return ke.forEach(t,r=>{n.push(r.weights)}),n});function VFe(){const{t:e}=Ue();return y.jsx(Eo,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function oj({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=he(qK),i=o=>{t.includes(o.target.value)?n(ke.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return y.jsxs(Eo,{position:"relative",children:[r.includes(e.location)?y.jsx(VFe,{}):null,y.jsx(er,{value:e.name,label:y.jsx(y.Fragment,{children:y.jsxs(yn,{alignItems:"start",children:[y.jsx("p",{style:{fontWeight:"bold"},children:e.name}),y.jsx("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function WFe(){const e=Oe(),{t}=Ue(),n=he(S=>S.system.searchFolder),r=he(S=>S.system.foundModels),i=he(qK),o=he(S=>S.ui.shouldShowExistingModelsInSearch),a=he(S=>S.system.isProcessing),[s,l]=N.useState([]),u=()=>{e(QU(null)),e(JU(null)),l([])},d=S=>{e(vD(S.checkpointFolder))},h=()=>{l([]),r&&r.forEach(S=>{i.includes(S.location)||l(_=>[..._,S.name])})},m=()=>{l([])},v=()=>{const S=r==null?void 0:r.filter(_=>s.includes(_.name));S==null||S.forEach(_=>{const E={name:_.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:_.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(Vy(E))}),l([])},b=()=>{const S=[],_=[];return r&&r.forEach((E,k)=>{i.includes(E.location)?_.push(y.jsx(oj,{model:E,modelsToAdd:s,setModelsToAdd:l},k)):S.push(y.jsx(oj,{model:E,modelsToAdd:s,setModelsToAdd:l},k))}),y.jsxs(y.Fragment,{children:[S,o&&_]})};return y.jsxs(y.Fragment,{children:[n?y.jsxs(Ge,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[y.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),y.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),y.jsx(Je,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:y.jsx(Yx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(vD(n))}),y.jsx(Je,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:y.jsx(Uy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:u})]}):y.jsx(Qy,{initialValues:{checkpointFolder:""},onSubmit:S=>{d(S)},children:({handleSubmit:S})=>y.jsx("form",{onSubmit:S,children:y.jsxs(Ey,{columnGap:"0.5rem",children:[y.jsx(fn,{isRequired:!0,width:"max-content",children:y.jsx(dr,{as:br,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),y.jsx(Je,{icon:y.jsx(iPe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&y.jsxs(Ge,{flexDirection:"column",rowGap:"1rem",children:[y.jsxs(Ge,{justifyContent:"space-between",alignItems:"center",children:[y.jsxs("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),y.jsxs("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),y.jsxs(Ge,{columnGap:"0.5rem",justifyContent:"space-between",children:[y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(nr,{isDisabled:s.length===r.length,onClick:h,children:t("modelmanager:selectAll")}),y.jsx(nr,{isDisabled:s.length===0,onClick:m,children:t("modelmanager:deselectAll")}),y.jsx(er,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(TCe(!o))})]}),y.jsx(nr,{isDisabled:s.length===0,onClick:v,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),y.jsxs(Ge,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&y.jsx(Jt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):y.jsx(Jt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),b()]})]})]})}const aj=64,sj=2048;function UFe(){const e=Oe(),{t}=Ue(),n=he(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(u){let d;return r(u)&&(d=t("modelmanager:cannotUseSpaces")),d}const o={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=u=>{e(Vy(u)),e(Vh(null))},[s,l]=N.useState(!1);return y.jsxs(y.Fragment,{children:[y.jsx(Je,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Vh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:y.jsx(lq,{})}),y.jsx(WFe,{}),y.jsx(er,{label:t("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&y.jsx(Qy,{initialValues:o,onSubmit:a,children:({handleSubmit:u,errors:d,touched:h})=>y.jsx("form",{onSubmit:u,children:y.jsxs(yn,{rowGap:"0.5rem",children:[y.jsx(Jt,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelmanager:manual")}),y.jsxs(fn,{isInvalid:!!d.name&&h.name,isRequired:!0,children:[y.jsx(En,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),d.name&&h.name?y.jsx(cr,{children:d.name}):y.jsx(ur,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!d.description&&h.description,isRequired:!0,children:[y.jsx(En,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"description",name:"description",type:"text",width:"2xl"}),d.description&&h.description?y.jsx(cr,{children:d.description}):y.jsx(ur,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!d.config&&h.config,isRequired:!0,children:[y.jsx(En,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:config")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"config",name:"config",type:"text",width:"2xl"}),d.config&&h.config?y.jsx(cr,{children:d.config}):y.jsx(ur,{margin:0,children:t("modelmanager:configValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!d.weights&&h.weights,isRequired:!0,children:[y.jsx(En,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"weights",name:"weights",type:"text",width:"2xl"}),d.weights&&h.weights?y.jsx(cr,{children:d.weights}):y.jsx(ur,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!d.vae&&h.vae,children:[y.jsx(En,{htmlFor:"vae",fontSize:"sm",children:t("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae",name:"vae",type:"text",width:"2xl"}),d.vae&&h.vae?y.jsx(cr,{children:d.vae}):y.jsx(ur,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(Ey,{width:"100%",children:[y.jsxs(fn,{isInvalid:!!d.width&&h.width,children:[y.jsx(En,{htmlFor:"width",fontSize:"sm",children:t("modelmanager:width")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"width",name:"width",children:({field:m,form:v})=>y.jsx(ia,{id:"width",name:"width",min:aj,max:sj,step:64,width:"90%",value:v.values.width,onChange:b=>v.setFieldValue(m.name,Number(b))})}),d.width&&h.width?y.jsx(cr,{children:d.width}):y.jsx(ur,{margin:0,children:t("modelmanager:widthValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!d.height&&h.height,children:[y.jsx(En,{htmlFor:"height",fontSize:"sm",children:t("modelmanager:height")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"height",name:"height",children:({field:m,form:v})=>y.jsx(ia,{id:"height",name:"height",min:aj,max:sj,width:"90%",step:64,value:v.values.height,onChange:b=>v.setFieldValue(m.name,Number(b))})}),d.height&&h.height?y.jsx(cr,{children:d.height}):y.jsx(ur,{margin:0,children:t("modelmanager:heightValidationMsg")})]})]})]}),y.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})})]})}function n4({children:e}){return y.jsx(Ge,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:e})}function GFe(){const e=Oe(),{t}=Ue(),n=he(s=>s.system.isProcessing);function r(s){return/\s/.test(s)}function i(s){let l;return r(s)&&(l=t("modelmanager:cannotUseSpaces")),l}const o={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=s=>{const l=s;s.path===""&&delete l.path,s.repo_id===""&&delete l.repo_id,s.vae.path===""&&delete l.vae.path,s.vae.repo_id===""&&delete l.vae.repo_id,e(Vy(l)),e(Vh(null))};return y.jsxs(Ge,{children:[y.jsx(Je,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Vh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:y.jsx(lq,{})}),y.jsx(Qy,{initialValues:o,onSubmit:a,children:({handleSubmit:s,errors:l,touched:u})=>{var d,h,m,v,b,S,_,E,k,T;return y.jsx("form",{onSubmit:s,children:y.jsxs(yn,{rowGap:"0.5rem",children:[y.jsx(n4,{children:y.jsxs(fn,{isInvalid:!!l.name&&u.name,isRequired:!0,children:[y.jsx(En,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),l.name&&u.name?y.jsx(cr,{children:l.name}):y.jsx(ur,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]})}),y.jsx(n4,{children:y.jsxs(fn,{isInvalid:!!l.description&&u.description,isRequired:!0,children:[y.jsx(En,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),l.description&&u.description?y.jsx(cr,{children:l.description}):y.jsx(ur,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]})}),y.jsxs(n4,{children:[y.jsx(Jt,{fontWeight:"bold",fontSize:"sm",children:t("modelmanager:formMessageDiffusersModelLocation")}),y.jsx(Jt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersModelLocationDesc")}),y.jsxs(fn,{isInvalid:!!l.path&&u.path,children:[y.jsx(En,{htmlFor:"path",fontSize:"sm",children:t("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"path",name:"path",type:"text",width:"2xl"}),l.path&&u.path?y.jsx(cr,{children:l.path}):y.jsx(ur,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!l.repo_id&&u.repo_id,children:[y.jsx(En,{htmlFor:"repo_id",fontSize:"sm",children:t("modelmanager:repo_id")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),l.repo_id&&u.repo_id?y.jsx(cr,{children:l.repo_id}):y.jsx(ur,{margin:0,children:t("modelmanager:repoIDValidationMsg")})]})]})]}),y.jsxs(n4,{children:[y.jsx(Jt,{fontWeight:"bold",children:t("modelmanager:formMessageDiffusersVAELocation")}),y.jsx(Jt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersVAELocationDesc")}),y.jsxs(fn,{isInvalid:!!((d=l.vae)!=null&&d.path)&&((h=u.vae)==null?void 0:h.path),children:[y.jsx(En,{htmlFor:"vae.path",fontSize:"sm",children:t("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(m=l.vae)!=null&&m.path&&((v=u.vae)!=null&&v.path)?y.jsx(cr,{children:(b=l.vae)==null?void 0:b.path}):y.jsx(ur,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!((S=l.vae)!=null&&S.repo_id)&&((_=u.vae)==null?void 0:_.repo_id),children:[y.jsx(En,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelmanager:vaeRepoID")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(E=l.vae)!=null&&E.repo_id&&((k=u.vae)!=null&&k.repo_id)?y.jsx(cr,{children:(T=l.vae)==null?void 0:T.repo_id}):y.jsx(ur,{margin:0,children:t("modelmanager:vaeRepoIDValidationMsg")})]})]})]}),y.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function lj({text:e,onClick:t}){return y.jsx(Ge,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:t,children:y.jsx(Jt,{fontWeight:"bold",children:e})})}function qFe(){const{isOpen:e,onOpen:t,onClose:n}=Gh(),r=he(s=>s.ui.addNewModelUIOption),i=Oe(),{t:o}=Ue(),a=()=>{n(),i(Vh(null))};return y.jsxs(y.Fragment,{children:[y.jsx(nr,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:y.jsxs(Ge,{columnGap:"0.5rem",alignItems:"center",children:[y.jsx(Uy,{}),o("modelmanager:addNew")]})}),y.jsxs(Xd,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[y.jsx(Zd,{}),y.jsxs(Jh,{className:"modal add-model-modal",fontFamily:"Inter",children:[y.jsx(_0,{children:o("modelmanager:addNewModel")}),y.jsx(Iy,{marginTop:"0.3rem"}),y.jsxs(o0,{className:"add-model-modal-body",children:[r==null&&y.jsxs(Ge,{columnGap:"1rem",children:[y.jsx(lj,{text:o("modelmanager:addCheckpointModel"),onClick:()=>i(Vh("ckpt"))}),y.jsx(lj,{text:o("modelmanager:addDiffuserModel"),onClick:()=>i(Vh("diffusers"))})]}),r=="ckpt"&&y.jsx(UFe,{}),r=="diffusers"&&y.jsx(GFe,{})]})]})]})]})}function r4(e){const{isProcessing:t,isConnected:n}=he(v=>v.system),r=he(v=>v.system.openModel),{t:i}=Ue(),o=Oe(),{name:a,status:s,description:l}=e,u=()=>{o(tq(a))},d=()=>{o(NR(a))},h=()=>{o(t_e(a)),o(NR(null))},m=()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}};return y.jsxs(Ge,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[y.jsx(Eo,{onClick:d,cursor:"pointer",children:y.jsx(uo,{label:l,hasArrow:!0,placement:"bottom",children:y.jsx(Jt,{fontWeight:"bold",children:a})})}),y.jsx(wF,{onClick:d,cursor:"pointer"}),y.jsxs(Ge,{gap:2,alignItems:"center",children:[y.jsx(Jt,{color:m(),children:s}),y.jsx(ls,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),y.jsx(Je,{icon:y.jsx(GEe,{}),size:"sm",onClick:d,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),y.jsx(fw,{title:i("modelmanager:deleteModel"),acceptCallback:h,acceptButtonText:i("modelmanager:delete"),triggerComponent:y.jsx(Je,{icon:y.jsx(UEe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:y.jsxs(Ge,{rowGap:"1rem",flexDirection:"column",children:[y.jsx("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),y.jsx("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const YFe=lt(or,e=>ke.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function t7({label:e,isActive:t,onClick:n}){return y.jsx(nr,{onClick:n,isActive:t,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:e})}const KFe=()=>{const e=he(YFe),[t,n]=w.useState(""),[r,i]=w.useState("all"),[o,a]=w.useTransition(),{t:s}=Ue(),l=d=>{a(()=>{n(d.target.value)})},u=w.useMemo(()=>{const d=[],h=[],m=[],v=[];return e.forEach((b,S)=>{b.name.toLowerCase().includes(t.toLowerCase())&&(m.push(y.jsx(r4,{name:b.name,status:b.status,description:b.description},S)),b.format===r&&v.push(y.jsx(r4,{name:b.name,status:b.status,description:b.description},S))),b.format!=="diffusers"?d.push(y.jsx(r4,{name:b.name,status:b.status,description:b.description},S)):h.push(y.jsx(r4,{name:b.name,status:b.status,description:b.description},S))}),t!==""?r==="all"?y.jsx(Eo,{marginTop:"1rem",children:m}):y.jsx(Eo,{marginTop:"1rem",children:v}):y.jsxs(Ge,{flexDirection:"column",rowGap:"1.5rem",children:[r==="all"&&y.jsxs(y.Fragment,{children:[y.jsxs(Eo,{children:[y.jsx(Jt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:s("modelmanager:checkpointModels")}),d]}),y.jsxs(Eo,{children:[y.jsx(Jt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:s("modelmanager:diffusersModels")}),h]})]}),r==="ckpt"&&y.jsx(Ge,{flexDirection:"column",marginTop:"1rem",children:d}),r==="diffusers"&&y.jsx(Ge,{flexDirection:"column",marginTop:"1rem",children:h})]})},[e,t,s,r]);return y.jsxs(Ge,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[y.jsxs(Ge,{justifyContent:"space-between",children:[y.jsx(Jt,{fontSize:"1.4rem",fontWeight:"bold",children:s("modelmanager:availableModels")}),y.jsx(qFe,{})]}),y.jsx(br,{onChange:l,label:s("modelmanager:search")}),y.jsxs(Ge,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(t7,{label:s("modelmanager:allModels"),onClick:()=>i("all"),isActive:r==="all"}),y.jsx(t7,{label:s("modelmanager:checkpointModels"),onClick:()=>i("ckpt"),isActive:r==="ckpt"}),y.jsx(t7,{label:s("modelmanager:diffusersModels"),onClick:()=>i("diffusers"),isActive:r==="diffusers"})]}),u]})]})};function XFe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Gh(),i=he(s=>s.system.model_list),o=he(s=>s.system.openModel),{t:a}=Ue();return y.jsxs(y.Fragment,{children:[w.cloneElement(e,{onClick:n}),y.jsxs(Xd,{isOpen:t,onClose:r,size:"6xl",children:[y.jsx(Zd,{}),y.jsxs(Jh,{className:"modal",fontFamily:"Inter",children:[y.jsx(Iy,{className:"modal-close-btn"}),y.jsx(_0,{fontWeight:"bold",children:a("modelmanager:modelManager")}),y.jsxs(Ge,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[y.jsx(KFe,{}),o&&i[o].format==="diffusers"?y.jsx(HFe,{}):y.jsx(FFe,{})]})]})]})]})}const ZFe=lt([or],e=>{const{isProcessing:t,model_list:n}=e;return{models:ke.map(n,(i,o)=>o),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),QFe=()=>{const e=Oe(),{models:t,isProcessing:n}=he(ZFe),r=he(oq),i=o=>{e(tq(o.target.value))};return y.jsx(Ge,{style:{paddingLeft:"0.3rem"},children:y.jsx(rl,{style:{fontSize:"0.8rem"},tooltip:r.description,isDisabled:n,value:r.name,validValues:t,onChange:i})})},JFe=lt([or,bp],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:ke.map(o,(u,d)=>d),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),eze=({children:e})=>{const t=Oe(),{t:n}=Ue(),r=he(k=>k.generation.steps),{isOpen:i,onOpen:o,onClose:a}=Gh(),{isOpen:s,onOpen:l,onClose:u}=Gh(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:m,saveIntermediatesInterval:v,enableImageDebugging:b,shouldUseCanvasBetaLayout:S}=he(JFe),_=()=>{iq.purge().then(()=>{a(),l()})},E=k=>{k>r&&(k=r),k<1&&(k=1),t(pCe(k))};return y.jsxs(y.Fragment,{children:[w.cloneElement(e,{onClick:o}),y.jsxs(Xd,{isOpen:i,onClose:a,size:"lg",children:[y.jsx(Zd,{}),y.jsxs(Jh,{className:"modal settings-modal",children:[y.jsx(_0,{className:"settings-modal-header",children:n("common:settingsLabel")}),y.jsx(Iy,{className:"modal-close-btn"}),y.jsxs(o0,{className:"settings-modal-content",children:[y.jsxs("div",{className:"settings-modal-items",children:[y.jsxs("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[y.jsx(rl,{label:n("settings:displayInProgress"),validValues:C7e,value:d,onChange:k=>t(sCe(k.target.value))}),d==="full-res"&&y.jsx(ia,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:E,value:v,width:"auto",textAlign:"center"})]}),y.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:k=>t(XU(k.target.checked))}),y.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:k=>t(dCe(k.target.checked))}),y.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:S,onChange:k=>t(PCe(k.target.checked))})]}),y.jsxs("div",{className:"settings-modal-items",children:[y.jsx("h2",{style:{fontWeight:"bold"},children:"Developer"}),y.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:k=>t(gCe(k.target.checked))})]}),y.jsxs("div",{className:"settings-modal-reset",children:[y.jsx(jh,{size:"md",children:n("settings:resetWebUI")}),y.jsx(ls,{colorScheme:"red",onClick:_,children:n("settings:resetWebUI")}),y.jsx(Jt,{children:n("settings:resetWebUIDesc1")}),y.jsx(Jt,{children:n("settings:resetWebUIDesc2")})]})]}),y.jsx(wx,{children:y.jsx(ls,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),y.jsxs(Xd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[y.jsx(Zd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),y.jsx(Jh,{children:y.jsx(o0,{pb:6,pt:6,children:y.jsx(Ge,{justifyContent:"center",children:y.jsx(Jt,{fontSize:"lg",children:y.jsx(Jt,{children:n("settings:resetComplete")})})})})})]})]})},tze=lt(or,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),nze=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=he(tze),s=Oe(),{t:l}=Ue();let u;e&&!o?u="status-good":u="status-bad";let d=i;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(d)&&(u="status-working"),d&&t&&r>1&&(d=`${l(d)} (${n}/${r})`);const m=o&&!a?"Click to clear, check logs for details":void 0,v=o&&!a?"pointer":"initial",b=()=>{(o||!a)&&s(ZU())};return y.jsx(uo,{label:m,children:y.jsx(Jt,{cursor:v,onClick:b,className:`status ${u}`,children:l(d)})})};function rze(){const{t:e}=Ue(),{setColorMode:t,colorMode:n}=gy(),r=Oe(),i=he(l=>l.ui.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};w.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(wCe(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(y.jsx(nr,{style:{width:"6rem"},leftIcon:i===u?y.jsx(IP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y.jsx(OEe,{})}),children:y.jsx(yn,{align:"stretch",children:s()})})}function ize(){const{t:e,i18n:t}=Ue(),n={en:e("common:langEnglish"),nl:e("common:langDutch"),fr:e("common:langFrench"),de:e("common:langGerman"),it:e("common:langItalian"),ja:e("common:langJapanese"),pl:e("common:langPolish"),pt_br:e("common:langBrPortuguese"),ru:e("common:langRussian"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish"),ua:e("common:langUkranian")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(y.jsx(nr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:y.jsx(TEe,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:y.jsx(yn,{children:r()})})}const oze=()=>{const{t:e}=Ue(),t=he(n=>n.system.app_version);return y.jsxs("div",{className:"site-header",children:[y.jsxs("div",{className:"site-header-left-side",children:[y.jsx("img",{src:zY,alt:"invoke-ai-logo"}),y.jsxs(Ge,{alignItems:"center",columnGap:"0.6rem",children:[y.jsxs(Jt,{fontSize:"1.4rem",children:["invoke ",y.jsx("strong",{children:"ai"})]}),y.jsx(Jt,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),y.jsxs("div",{className:"site-header-right-side",children:[y.jsx(nze,{}),y.jsx(QFe,{}),y.jsx(XFe,{children:y.jsx(Je,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y.jsx(SEe,{})})}),y.jsx(UDe,{children:y.jsx(Je,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y.jsx(PEe,{})})}),y.jsx(rze,{}),y.jsx(ize,{}),y.jsx(Je,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y.jsx(Bh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:y.jsx(bEe,{})})}),y.jsx(Je,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y.jsx(Bh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:y.jsx(pEe,{})})}),y.jsx(Je,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y.jsx(Bh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:y.jsx(hEe,{})})}),y.jsx(eze,{children:y.jsx(Je,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:y.jsx(aPe,{})})})]})]})};function aze(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const sze=()=>{const e=Oe(),t=he(C_e),n=By();w.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(vCe())},[e,n,t])},YK=lt([xp,bp,Mr],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:o,shouldUseCanvasBetaLayout:a}=t,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=e,d=a&&n==="unifiedCanvas",h=!d&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!d&&(!r||!i),shouldShowParametersPanelButton:h,shouldShowParametersPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),lze=()=>{const e=Oe(),{shouldShowParametersPanel:t,shouldShowParametersPanelButton:n,shouldShowProcessButtons:r,shouldPinParametersPanel:i,shouldShowGallery:o,shouldPinGallery:a}=he(YK),s=()=>{e(Zu(!0)),i&&setTimeout(()=>e(vi(!0)),400)};return et("f",()=>{o||t?(e(Zu(!1)),e(Fd(!1))):(e(Zu(!0)),e(Fd(!0))),(a||i)&&setTimeout(()=>e(vi(!0)),400)},[o,t]),n?y.jsxs("div",{className:"show-hide-button-options",children:[y.jsx(Je,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:y.jsx(NP,{})}),r&&y.jsxs(y.Fragment,{children:[y.jsx(nT,{iconButton:!0}),y.jsx(eT,{})]})]}):null},uze=()=>{const e=Oe(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowParametersPanel:i,shouldPinParametersPanel:o}=he(YK),a=()=>{e(Fd(!0)),r&&e(vi(!0))};return et("f",()=>{t||i?(e(Zu(!1)),e(Fd(!1))):(e(Zu(!0)),e(Fd(!0))),(r||o)&&setTimeout(()=>e(vi(!0)),400)},[t,i]),n?y.jsx(Je,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:y.jsx(Fq,{})}):null};aze();const cze=()=>(sze(),y.jsxs("div",{className:"App",children:[y.jsxs(BDe,{children:[y.jsx(VDe,{}),y.jsxs("div",{className:"app-content",children:[y.jsx(oze,{}),y.jsx(VRe,{})]}),y.jsx("div",{className:"app-console",children:y.jsx(zDe,{})})]}),y.jsx(lze,{}),y.jsx(uze,{})]})),uj=()=>y.jsx(Ge,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:y.jsx(ky,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})});const dze=Bj({key:"invokeai-style-cache",prepend:!0});n8.createRoot(document.getElementById("root")).render(y.jsx(N.StrictMode,{children:y.jsx(W5e,{store:rq,children:y.jsx(TW,{loading:y.jsx(uj,{}),persistor:iq,children:y.jsx(ire,{value:dze,children:y.jsx(u5e,{children:y.jsx(N.Suspense,{fallback:y.jsx(uj,{}),children:y.jsx(cze,{})})})})})})})); diff --git a/invokeai/frontend/dist/assets/index-ad762ffd.js b/invokeai/frontend/dist/assets/index-ad762ffd.js deleted file mode 100644 index dee1d5d7e4..0000000000 --- a/invokeai/frontend/dist/assets/index-ad762ffd.js +++ /dev/null @@ -1,638 +0,0 @@ -var cee=Object.defineProperty;var dee=(e,t,n)=>t in e?cee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var an=(e,t,n)=>(dee(e,typeof t!="symbol"?t+"":t,n),n);function rj(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Co=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function d_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var y={},fee={get exports(){return y},set exports(e){y=e}},gS={},w={},hee={get exports(){return w},set exports(e){w=e}},en={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var cy=Symbol.for("react.element"),pee=Symbol.for("react.portal"),gee=Symbol.for("react.fragment"),mee=Symbol.for("react.strict_mode"),vee=Symbol.for("react.profiler"),yee=Symbol.for("react.provider"),bee=Symbol.for("react.context"),See=Symbol.for("react.forward_ref"),xee=Symbol.for("react.suspense"),wee=Symbol.for("react.memo"),Cee=Symbol.for("react.lazy"),cL=Symbol.iterator;function _ee(e){return e===null||typeof e!="object"?null:(e=cL&&e[cL]||e["@@iterator"],typeof e=="function"?e:null)}var ij={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},oj=Object.assign,aj={};function d0(e,t,n){this.props=e,this.context=t,this.refs=aj,this.updater=n||ij}d0.prototype.isReactComponent={};d0.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};d0.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function sj(){}sj.prototype=d0.prototype;function f_(e,t,n){this.props=e,this.context=t,this.refs=aj,this.updater=n||ij}var h_=f_.prototype=new sj;h_.constructor=f_;oj(h_,d0.prototype);h_.isPureReactComponent=!0;var dL=Array.isArray,lj=Object.prototype.hasOwnProperty,p_={current:null},uj={key:!0,ref:!0,__self:!0,__source:!0};function cj(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)lj.call(t,r)&&!uj.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?j3.dark:j3.light),document.body.classList.remove(r?j3.light:j3.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){return n.query().matches??r==="dark"?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var Nee="chakra-ui-color-mode";function jee(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var Bee=jee(Nee),hL=()=>{};function pL(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function fj(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=Bee}=e,s=i==="dark"?"dark":"light",[l,u]=w.useState(()=>pL(a,s)),[d,h]=w.useState(()=>pL(a)),{getSystemTheme:m,setClassName:v,setDataset:b,addListener:S}=w.useMemo(()=>Dee({preventTransition:o}),[o]),k=i==="system"&&!l?d:l,E=w.useCallback(A=>{const I=A==="system"?m():A;u(I),v(I==="dark"),b(I),a.set(I)},[a,m,v,b]);Ws(()=>{i==="system"&&h(m())},[]),w.useEffect(()=>{const A=a.get();if(A){E(A);return}if(i==="system"){E("system");return}E(s)},[a,s,i,E]);const _=w.useCallback(()=>{E(k==="dark"?"light":"dark")},[k,E]);w.useEffect(()=>{if(r)return S(E)},[r,S,E]);const T=w.useMemo(()=>({colorMode:t??k,toggleColorMode:t?hL:_,setColorMode:t?hL:E,forced:t!==void 0}),[k,_,E,t]);return N.createElement(m_.Provider,{value:T},n)}fj.displayName="ColorModeProvider";var z4={},$ee={get exports(){return z4},set exports(e){z4=e}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",m="[object Error]",v="[object Function]",b="[object GeneratorFunction]",S="[object Map]",k="[object Number]",E="[object Null]",_="[object Object]",T="[object Proxy]",A="[object RegExp]",I="[object Set]",R="[object String]",D="[object Undefined]",j="[object WeakMap]",z="[object ArrayBuffer]",V="[object DataView]",K="[object Float32Array]",te="[object Float64Array]",q="[object Int8Array]",$="[object Int16Array]",U="[object Int32Array]",X="[object Uint8Array]",Z="[object Uint8ClampedArray]",W="[object Uint16Array]",Q="[object Uint32Array]",ie=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Se=/^(?:0|[1-9]\d*)$/,Pe={};Pe[K]=Pe[te]=Pe[q]=Pe[$]=Pe[U]=Pe[X]=Pe[Z]=Pe[W]=Pe[Q]=!0,Pe[s]=Pe[l]=Pe[z]=Pe[d]=Pe[V]=Pe[h]=Pe[m]=Pe[v]=Pe[S]=Pe[k]=Pe[_]=Pe[A]=Pe[I]=Pe[R]=Pe[j]=!1;var ye=typeof Co=="object"&&Co&&Co.Object===Object&&Co,We=typeof self=="object"&&self&&self.Object===Object&&self,De=ye||We||Function("return this")(),ot=t&&!t.nodeType&&t,He=ot&&!0&&e&&!e.nodeType&&e,Be=He&&He.exports===ot,wt=Be&&ye.process,st=function(){try{var Y=He&&He.require&&He.require("util").types;return Y||wt&&wt.binding&&wt.binding("util")}catch{}}(),mt=st&&st.isTypedArray;function St(Y,re,ge){switch(ge.length){case 0:return Y.call(re);case 1:return Y.call(re,ge[0]);case 2:return Y.call(re,ge[0],ge[1]);case 3:return Y.call(re,ge[0],ge[1],ge[2])}return Y.apply(re,ge)}function Le(Y,re){for(var ge=-1,it=Array(Y);++ge-1}function N0(Y,re){var ge=this.__data__,it=ms(ge,Y);return it<0?(++this.size,ge.push([Y,re])):ge[it][1]=re,this}ia.prototype.clear=vf,ia.prototype.delete=D0,ia.prototype.get=bc,ia.prototype.has=yf,ia.prototype.set=N0;function il(Y){var re=-1,ge=Y==null?0:Y.length;for(this.clear();++re1?ge[Wt-1]:void 0,kt=Wt>2?ge[2]:void 0;for(Sn=Y.length>3&&typeof Sn=="function"?(Wt--,Sn):void 0,kt&&Ap(ge[0],ge[1],kt)&&(Sn=Wt<3?void 0:Sn,Wt=1),re=Object(re);++it-1&&Y%1==0&&Y0){if(++re>=i)return arguments[0]}else re=0;return Y.apply(void 0,arguments)}}function _c(Y){if(Y!=null){try{return Ye.call(Y)}catch{}try{return Y+""}catch{}}return""}function $a(Y,re){return Y===re||Y!==Y&&re!==re}var Cf=bu(function(){return arguments}())?bu:function(Y){return Kn(Y)&&Ke.call(Y,"callee")&&!Xe.call(Y,"callee")},wu=Array.isArray;function Yt(Y){return Y!=null&&Mp(Y.length)&&!Ec(Y)}function Op(Y){return Kn(Y)&&Yt(Y)}var kc=nn||K0;function Ec(Y){if(!la(Y))return!1;var re=al(Y);return re==v||re==b||re==u||re==T}function Mp(Y){return typeof Y=="number"&&Y>-1&&Y%1==0&&Y<=a}function la(Y){var re=typeof Y;return Y!=null&&(re=="object"||re=="function")}function Kn(Y){return Y!=null&&typeof Y=="object"}function _f(Y){if(!Kn(Y)||al(Y)!=_)return!1;var re=tn(Y);if(re===null)return!0;var ge=Ke.call(re,"constructor")&&re.constructor;return typeof ge=="function"&&ge instanceof ge&&Ye.call(ge)==Ct}var Ip=mt?lt(mt):xc;function kf(Y){return ui(Y,Rp(Y))}function Rp(Y){return Yt(Y)?G0(Y,!0):sl(Y)}var gn=vs(function(Y,re,ge,it){oa(Y,re,ge,it)});function Kt(Y){return function(){return Y}}function Dp(Y){return Y}function K0(){return!1}e.exports=gn})($ee,z4);const Wl=z4;function Us(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function xh(e,...t){return Fee(e)?e(...t):e}var Fee=e=>typeof e=="function",zee=e=>/!(important)?$/.test(e),gL=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,ZC=(e,t)=>n=>{const r=String(t),i=zee(r),o=gL(r),a=e?`${e}.${o}`:o;let s=Us(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=gL(s),i?`${s} !important`:s};function p2(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{const s=ZC(t,o)(a);let l=(n==null?void 0:n(s,a))??s;return r&&(l=r(l,a)),l}}var B3=(...e)=>t=>e.reduce((n,r)=>r(n),t);function As(e,t){return n=>{const r={property:n,scale:e};return r.transform=p2({scale:e,transform:t}),r}}var Hee=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function Vee(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:Hee(t),transform:n?p2({scale:n,compose:r}):r}}var hj=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function Wee(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...hj].join(" ")}function Uee(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...hj].join(" ")}var Gee={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},qee={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function Yee(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var Kee={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},pj="& > :not(style) ~ :not(style)",Xee={[pj]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},Zee={[pj]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},QC={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},Qee=new Set(Object.values(QC)),gj=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Jee=e=>e.trim();function ete(e,t){var n;if(e==null||gj.has(e))return e;const r=/(?^[a-z-A-Z]+)\((?(.*))\)/g,{type:i,values:o}=((n=r.exec(e))==null?void 0:n.groups)??{};if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(Jee).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in QC?QC[s]:s;l.unshift(u);const d=l.map(h=>{if(Qee.has(h))return h;const m=h.indexOf(" "),[v,b]=m!==-1?[h.substr(0,m),h.substr(m+1)]:[h],S=mj(b)?b:b&&b.split(" "),k=`colors.${v}`,E=k in t.__cssMap?t.__cssMap[k].varRef:v;return S?[E,...Array.isArray(S)?S:[S]].join(" "):E});return`${a}(${d.join(", ")})`}var mj=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),tte=(e,t)=>ete(e,t??{});function nte(e){return/^var\(--.+\)$/.test(e)}var rte=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Tl=e=>t=>`${e}(${t})`,hn={filter(e){return e!=="auto"?e:Gee},backdropFilter(e){return e!=="auto"?e:qee},ring(e){return Yee(hn.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?Wee():e==="auto-gpu"?Uee():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=rte(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(nte(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:tte,blur:Tl("blur"),opacity:Tl("opacity"),brightness:Tl("brightness"),contrast:Tl("contrast"),dropShadow:Tl("drop-shadow"),grayscale:Tl("grayscale"),hueRotate:Tl("hue-rotate"),invert:Tl("invert"),saturate:Tl("saturate"),sepia:Tl("sepia"),bgImage(e){return e==null||mj(e)||gj.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=Kee[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},se={borderWidths:As("borderWidths"),borderStyles:As("borderStyles"),colors:As("colors"),borders:As("borders"),radii:As("radii",hn.px),space:As("space",B3(hn.vh,hn.px)),spaceT:As("space",B3(hn.vh,hn.px)),degreeT(e){return{property:e,transform:hn.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:p2({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:As("sizes",B3(hn.vh,hn.px)),sizesT:As("sizes",B3(hn.vh,hn.fraction)),shadows:As("shadows"),logical:Vee,blur:As("blur",hn.blur)},n4={background:se.colors("background"),backgroundColor:se.colors("backgroundColor"),backgroundImage:se.propT("backgroundImage",hn.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:hn.bgClip},bgSize:se.prop("backgroundSize"),bgPosition:se.prop("backgroundPosition"),bg:se.colors("background"),bgColor:se.colors("backgroundColor"),bgPos:se.prop("backgroundPosition"),bgRepeat:se.prop("backgroundRepeat"),bgAttachment:se.prop("backgroundAttachment"),bgGradient:se.propT("backgroundImage",hn.gradient),bgClip:{transform:hn.bgClip}};Object.assign(n4,{bgImage:n4.backgroundImage,bgImg:n4.backgroundImage});var wn={border:se.borders("border"),borderWidth:se.borderWidths("borderWidth"),borderStyle:se.borderStyles("borderStyle"),borderColor:se.colors("borderColor"),borderRadius:se.radii("borderRadius"),borderTop:se.borders("borderTop"),borderBlockStart:se.borders("borderBlockStart"),borderTopLeftRadius:se.radii("borderTopLeftRadius"),borderStartStartRadius:se.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:se.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:se.radii("borderTopRightRadius"),borderStartEndRadius:se.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:se.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:se.borders("borderRight"),borderInlineEnd:se.borders("borderInlineEnd"),borderBottom:se.borders("borderBottom"),borderBlockEnd:se.borders("borderBlockEnd"),borderBottomLeftRadius:se.radii("borderBottomLeftRadius"),borderBottomRightRadius:se.radii("borderBottomRightRadius"),borderLeft:se.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:se.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:se.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:se.borders(["borderLeft","borderRight"]),borderInline:se.borders("borderInline"),borderY:se.borders(["borderTop","borderBottom"]),borderBlock:se.borders("borderBlock"),borderTopWidth:se.borderWidths("borderTopWidth"),borderBlockStartWidth:se.borderWidths("borderBlockStartWidth"),borderTopColor:se.colors("borderTopColor"),borderBlockStartColor:se.colors("borderBlockStartColor"),borderTopStyle:se.borderStyles("borderTopStyle"),borderBlockStartStyle:se.borderStyles("borderBlockStartStyle"),borderBottomWidth:se.borderWidths("borderBottomWidth"),borderBlockEndWidth:se.borderWidths("borderBlockEndWidth"),borderBottomColor:se.colors("borderBottomColor"),borderBlockEndColor:se.colors("borderBlockEndColor"),borderBottomStyle:se.borderStyles("borderBottomStyle"),borderBlockEndStyle:se.borderStyles("borderBlockEndStyle"),borderLeftWidth:se.borderWidths("borderLeftWidth"),borderInlineStartWidth:se.borderWidths("borderInlineStartWidth"),borderLeftColor:se.colors("borderLeftColor"),borderInlineStartColor:se.colors("borderInlineStartColor"),borderLeftStyle:se.borderStyles("borderLeftStyle"),borderInlineStartStyle:se.borderStyles("borderInlineStartStyle"),borderRightWidth:se.borderWidths("borderRightWidth"),borderInlineEndWidth:se.borderWidths("borderInlineEndWidth"),borderRightColor:se.colors("borderRightColor"),borderInlineEndColor:se.colors("borderInlineEndColor"),borderRightStyle:se.borderStyles("borderRightStyle"),borderInlineEndStyle:se.borderStyles("borderInlineEndStyle"),borderTopRadius:se.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:se.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:se.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:se.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(wn,{rounded:wn.borderRadius,roundedTop:wn.borderTopRadius,roundedTopLeft:wn.borderTopLeftRadius,roundedTopRight:wn.borderTopRightRadius,roundedTopStart:wn.borderStartStartRadius,roundedTopEnd:wn.borderStartEndRadius,roundedBottom:wn.borderBottomRadius,roundedBottomLeft:wn.borderBottomLeftRadius,roundedBottomRight:wn.borderBottomRightRadius,roundedBottomStart:wn.borderEndStartRadius,roundedBottomEnd:wn.borderEndEndRadius,roundedLeft:wn.borderLeftRadius,roundedRight:wn.borderRightRadius,roundedStart:wn.borderInlineStartRadius,roundedEnd:wn.borderInlineEndRadius,borderStart:wn.borderInlineStart,borderEnd:wn.borderInlineEnd,borderTopStartRadius:wn.borderStartStartRadius,borderTopEndRadius:wn.borderStartEndRadius,borderBottomStartRadius:wn.borderEndStartRadius,borderBottomEndRadius:wn.borderEndEndRadius,borderStartRadius:wn.borderInlineStartRadius,borderEndRadius:wn.borderInlineEndRadius,borderStartWidth:wn.borderInlineStartWidth,borderEndWidth:wn.borderInlineEndWidth,borderStartColor:wn.borderInlineStartColor,borderEndColor:wn.borderInlineEndColor,borderStartStyle:wn.borderInlineStartStyle,borderEndStyle:wn.borderInlineEndStyle});var ite={color:se.colors("color"),textColor:se.colors("color"),fill:se.colors("fill"),stroke:se.colors("stroke")},JC={boxShadow:se.shadows("boxShadow"),mixBlendMode:!0,blendMode:se.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:se.prop("backgroundBlendMode"),opacity:!0};Object.assign(JC,{shadow:JC.boxShadow});var ote={filter:{transform:hn.filter},blur:se.blur("--chakra-blur"),brightness:se.propT("--chakra-brightness",hn.brightness),contrast:se.propT("--chakra-contrast",hn.contrast),hueRotate:se.degreeT("--chakra-hue-rotate"),invert:se.propT("--chakra-invert",hn.invert),saturate:se.propT("--chakra-saturate",hn.saturate),dropShadow:se.propT("--chakra-drop-shadow",hn.dropShadow),backdropFilter:{transform:hn.backdropFilter},backdropBlur:se.blur("--chakra-backdrop-blur"),backdropBrightness:se.propT("--chakra-backdrop-brightness",hn.brightness),backdropContrast:se.propT("--chakra-backdrop-contrast",hn.contrast),backdropHueRotate:se.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:se.propT("--chakra-backdrop-invert",hn.invert),backdropSaturate:se.propT("--chakra-backdrop-saturate",hn.saturate)},H4={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:hn.flexDirection},experimental_spaceX:{static:Xee,transform:p2({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:Zee,transform:p2({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:se.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:se.space("gap"),rowGap:se.space("rowGap"),columnGap:se.space("columnGap")};Object.assign(H4,{flexDir:H4.flexDirection});var vj={gridGap:se.space("gridGap"),gridColumnGap:se.space("gridColumnGap"),gridRowGap:se.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},ate={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:hn.outline},outlineOffset:!0,outlineColor:se.colors("outlineColor")},Xa={width:se.sizesT("width"),inlineSize:se.sizesT("inlineSize"),height:se.sizes("height"),blockSize:se.sizes("blockSize"),boxSize:se.sizes(["width","height"]),minWidth:se.sizes("minWidth"),minInlineSize:se.sizes("minInlineSize"),minHeight:se.sizes("minHeight"),minBlockSize:se.sizes("minBlockSize"),maxWidth:se.sizes("maxWidth"),maxInlineSize:se.sizes("maxInlineSize"),maxHeight:se.sizes("maxHeight"),maxBlockSize:se.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:se.propT("float",hn.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Xa,{w:Xa.width,h:Xa.height,minW:Xa.minWidth,maxW:Xa.maxWidth,minH:Xa.minHeight,maxH:Xa.maxHeight,overscroll:Xa.overscrollBehavior,overscrollX:Xa.overscrollBehaviorX,overscrollY:Xa.overscrollBehaviorY});var ste={listStyleType:!0,listStylePosition:!0,listStylePos:se.prop("listStylePosition"),listStyleImage:!0,listStyleImg:se.prop("listStyleImage")};function lte(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},cte=ute(lte),dte={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},fte={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Uw=(e,t,n)=>{const r={},i=cte(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},hte={srOnly:{transform(e){return e===!0?dte:e==="focusable"?fte:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Uw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Uw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Uw(t,e,n)}},Rv={position:!0,pos:se.prop("position"),zIndex:se.prop("zIndex","zIndices"),inset:se.spaceT("inset"),insetX:se.spaceT(["left","right"]),insetInline:se.spaceT("insetInline"),insetY:se.spaceT(["top","bottom"]),insetBlock:se.spaceT("insetBlock"),top:se.spaceT("top"),insetBlockStart:se.spaceT("insetBlockStart"),bottom:se.spaceT("bottom"),insetBlockEnd:se.spaceT("insetBlockEnd"),left:se.spaceT("left"),insetInlineStart:se.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:se.spaceT("right"),insetInlineEnd:se.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Rv,{insetStart:Rv.insetInlineStart,insetEnd:Rv.insetInlineEnd});var pte={ring:{transform:hn.ring},ringColor:se.colors("--chakra-ring-color"),ringOffset:se.prop("--chakra-ring-offset-width"),ringOffsetColor:se.colors("--chakra-ring-offset-color"),ringInset:se.prop("--chakra-ring-inset")},ar={margin:se.spaceT("margin"),marginTop:se.spaceT("marginTop"),marginBlockStart:se.spaceT("marginBlockStart"),marginRight:se.spaceT("marginRight"),marginInlineEnd:se.spaceT("marginInlineEnd"),marginBottom:se.spaceT("marginBottom"),marginBlockEnd:se.spaceT("marginBlockEnd"),marginLeft:se.spaceT("marginLeft"),marginInlineStart:se.spaceT("marginInlineStart"),marginX:se.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:se.spaceT("marginInline"),marginY:se.spaceT(["marginTop","marginBottom"]),marginBlock:se.spaceT("marginBlock"),padding:se.space("padding"),paddingTop:se.space("paddingTop"),paddingBlockStart:se.space("paddingBlockStart"),paddingRight:se.space("paddingRight"),paddingBottom:se.space("paddingBottom"),paddingBlockEnd:se.space("paddingBlockEnd"),paddingLeft:se.space("paddingLeft"),paddingInlineStart:se.space("paddingInlineStart"),paddingInlineEnd:se.space("paddingInlineEnd"),paddingX:se.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:se.space("paddingInline"),paddingY:se.space(["paddingTop","paddingBottom"]),paddingBlock:se.space("paddingBlock")};Object.assign(ar,{m:ar.margin,mt:ar.marginTop,mr:ar.marginRight,me:ar.marginInlineEnd,marginEnd:ar.marginInlineEnd,mb:ar.marginBottom,ml:ar.marginLeft,ms:ar.marginInlineStart,marginStart:ar.marginInlineStart,mx:ar.marginX,my:ar.marginY,p:ar.padding,pt:ar.paddingTop,py:ar.paddingY,px:ar.paddingX,pb:ar.paddingBottom,pl:ar.paddingLeft,ps:ar.paddingInlineStart,paddingStart:ar.paddingInlineStart,pr:ar.paddingRight,pe:ar.paddingInlineEnd,paddingEnd:ar.paddingInlineEnd});var gte={textDecorationColor:se.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:se.shadows("textShadow")},mte={clipPath:!0,transform:se.propT("transform",hn.transform),transformOrigin:!0,translateX:se.spaceT("--chakra-translate-x"),translateY:se.spaceT("--chakra-translate-y"),skewX:se.degreeT("--chakra-skew-x"),skewY:se.degreeT("--chakra-skew-y"),scaleX:se.prop("--chakra-scale-x"),scaleY:se.prop("--chakra-scale-y"),scale:se.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:se.degreeT("--chakra-rotate")},vte={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:se.prop("transitionDuration","transition.duration"),transitionProperty:se.prop("transitionProperty","transition.property"),transitionTimingFunction:se.prop("transitionTimingFunction","transition.easing")},yte={fontFamily:se.prop("fontFamily","fonts"),fontSize:se.prop("fontSize","fontSizes",hn.px),fontWeight:se.prop("fontWeight","fontWeights"),lineHeight:se.prop("lineHeight","lineHeights"),letterSpacing:se.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},bte={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:se.spaceT("scrollMargin"),scrollMarginTop:se.spaceT("scrollMarginTop"),scrollMarginBottom:se.spaceT("scrollMarginBottom"),scrollMarginLeft:se.spaceT("scrollMarginLeft"),scrollMarginRight:se.spaceT("scrollMarginRight"),scrollMarginX:se.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:se.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:se.spaceT("scrollPadding"),scrollPaddingTop:se.spaceT("scrollPaddingTop"),scrollPaddingBottom:se.spaceT("scrollPaddingBottom"),scrollPaddingLeft:se.spaceT("scrollPaddingLeft"),scrollPaddingRight:se.spaceT("scrollPaddingRight"),scrollPaddingX:se.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:se.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function yj(e){return Us(e)&&e.reference?e.reference:String(e)}var mS=(e,...t)=>t.map(yj).join(` ${e} `).replace(/calc/g,""),mL=(...e)=>`calc(${mS("+",...e)})`,vL=(...e)=>`calc(${mS("-",...e)})`,e7=(...e)=>`calc(${mS("*",...e)})`,yL=(...e)=>`calc(${mS("/",...e)})`,bL=e=>{const t=yj(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:e7(t,-1)},yh=Object.assign(e=>({add:(...t)=>yh(mL(e,...t)),subtract:(...t)=>yh(vL(e,...t)),multiply:(...t)=>yh(e7(e,...t)),divide:(...t)=>yh(yL(e,...t)),negate:()=>yh(bL(e)),toString:()=>e.toString()}),{add:mL,subtract:vL,multiply:e7,divide:yL,negate:bL});function Ste(e,t="-"){return e.replace(/\s+/g,t)}function xte(e){const t=Ste(e.toString());return Cte(wte(t))}function wte(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function Cte(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function _te(e,t=""){return[t,e].filter(Boolean).join("-")}function kte(e,t){return`var(${e}${t?`, ${t}`:""})`}function Ete(e,t=""){return xte(`--${_te(e,t)}`)}function Hn(e,t,n){const r=Ete(e,n);return{variable:r,reference:kte(r,t)}}function Pte(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function Tte(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function t7(e){if(e==null)return e;const{unitless:t}=Tte(e);return t||typeof e=="number"?`${e}px`:e}var bj=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,v_=e=>Object.fromEntries(Object.entries(e).sort(bj));function SL(e){const t=v_(e);return Object.assign(Object.values(t),t)}function Lte(e){const t=Object.keys(v_(e));return new Set(t)}function xL(e){if(!e)return e;e=t7(e)??e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function mv(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${t7(e)})`),t&&n.push("and",`(max-width: ${t7(t)})`),n.join(" ")}function Ate(e){if(!e)return null;e.base=e.base??"0px";const t=SL(e),n=Object.entries(e).sort(bj).map(([o,a],s,l)=>{let[,u]=l[s+1]??[];return u=parseFloat(u)>0?xL(u):void 0,{_minW:xL(a),breakpoint:o,minW:a,maxW:u,maxWQuery:mv(null,u),minWQuery:mv(a),minMaxQuery:mv(a,u)}}),r=Lte(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(o){const a=Object.keys(o);return a.length>0&&a.every(s=>r.has(s))},asObject:v_(e),asArray:SL(e),details:n,media:[null,...t.map(o=>mv(o)).slice(1)],toArrayValue(o){if(!Us(o))throw new Error("toArrayValue: value must be an object");const a=i.map(s=>o[s]??null);for(;Pte(a)===null;)a.pop();return a},toObjectValue(o){if(!Array.isArray(o))throw new Error("toObjectValue: value must be an array");return o.reduce((a,s,l)=>{const u=i[l];return u!=null&&s!=null&&(a[u]=s),a},{})}}}var Fi={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},id=e=>Sj(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Nu=e=>Sj(t=>e(t,"~ &"),"[data-peer]",".peer"),Sj=(e,...t)=>t.map(e).join(", "),vS={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:id(Fi.hover),_peerHover:Nu(Fi.hover),_groupFocus:id(Fi.focus),_peerFocus:Nu(Fi.focus),_groupFocusVisible:id(Fi.focusVisible),_peerFocusVisible:Nu(Fi.focusVisible),_groupActive:id(Fi.active),_peerActive:Nu(Fi.active),_groupDisabled:id(Fi.disabled),_peerDisabled:Nu(Fi.disabled),_groupInvalid:id(Fi.invalid),_peerInvalid:Nu(Fi.invalid),_groupChecked:id(Fi.checked),_peerChecked:Nu(Fi.checked),_groupFocusWithin:id(Fi.focusWithin),_peerFocusWithin:Nu(Fi.focusWithin),_peerPlaceholderShown:Nu(Fi.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},Ote=Object.keys(vS);function wL(e,t){return Hn(String(e).replace(/\./g,"-"),void 0,t)}function Mte(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=wL(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[v,...b]=m,S=`${v}.-${b.join(".")}`,k=yh.negate(s),E=yh.negate(u);r[S]={value:k,var:l,varRef:E}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const d=m=>{const b=[String(i).split(".")[0],m].join(".");if(!e[b])return m;const{reference:k}=wL(b,t==null?void 0:t.cssVarPrefix);return k},h=Us(s)?s:{default:s};n=Wl(n,Object.entries(h).reduce((m,[v,b])=>{var S;const k=d(b);if(v==="default")return m[l]=k,m;const E=((S=vS)==null?void 0:S[v])??v;return m[E]={[l]:k},m},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function Ite(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Rte(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var Dte=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function Nte(e){return Rte(e,Dte)}function jte(e){return e.semanticTokens}function Bte(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function $te({tokens:e,semanticTokens:t}){const n=Object.entries(n7(e)??{}).map(([i,o])=>[i,{isSemantic:!1,value:o}]),r=Object.entries(n7(t,1)??{}).map(([i,o])=>[i,{isSemantic:!0,value:o}]);return Object.fromEntries([...n,...r])}function n7(e,t=1/0){return!Us(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(Us(i)||Array.isArray(i)?Object.entries(n7(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function Fte(e){var t;const n=Bte(e),r=Nte(n),i=jte(n),o=$te({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=Mte(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:Ate(n.breakpoints)}),n}var y_=Wl({},n4,wn,ite,H4,Xa,ote,pte,ate,vj,hte,Rv,JC,ar,bte,yte,gte,mte,ste,vte),zte=Object.assign({},ar,Xa,H4,vj,Rv),Hte=Object.keys(zte),Vte=[...Object.keys(y_),...Ote],Wte={...y_,...vS},Ute=e=>e in Wte,Gte=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=xh(e[a],t);if(s==null)continue;if(s=Us(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!Yte(t),Xte=(e,t)=>{if(t==null)return t;const n=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.varRef},r=a=>n(a)??a,[i,o]=qte(t);return t=n(i)??r(o)??r(t),t};function Zte(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s;const l=xh(o,r),u=Gte(l)(r);let d={};for(let h in u){const m=u[h];let v=xh(m,r);h in n&&(h=n[h]),Kte(h,v)&&(v=Xte(r,v));let b=t[h];if(b===!0&&(b={property:h}),Us(v)){d[h]=d[h]??{},d[h]=Wl({},d[h],i(v,!0));continue}let S=((s=b==null?void 0:b.transform)==null?void 0:s.call(b,v,r,l))??v;S=b!=null&&b.processResult?i(S,!0):S;const k=xh(b==null?void 0:b.property,r);if(!a&&(b!=null&&b.static)){const E=xh(b.static,r);d=Wl({},d,E)}if(k&&Array.isArray(k)){for(const E of k)d[E]=S;continue}if(k){k==="&"&&Us(S)?d=Wl({},d,S):d[k]=S;continue}if(Us(S)){d=Wl({},d,S);continue}d[h]=S}return d};return i}var xj=e=>t=>Zte({theme:t,pseudos:vS,configs:y_})(e);function hr(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function Qte(e,t){if(Array.isArray(e))return e;if(Us(e))return t(e);if(e!=null)return[e]}function Jte(e,t){for(let n=t+1;n{Wl(u,{[T]:m?_[T]:{[E]:_[T]}})});continue}if(!v){m?Wl(u,_):u[E]=_;continue}u[E]=_}}return u}}function tne(e){return t=>{const{variant:n,size:r,theme:i}=t,o=ene(i);return Wl({},xh(e.baseStyle??{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function nne(e,t,n){var r,i;return((i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)??n}function En(e){return Ite(e,["styleConfig","size","variant","colorScheme"])}function rne(e){if(e.sheet)return e.sheet;for(var t=0;t0?Wi(f0,--na):0,zm--,ii===10&&(zm=1,bS--),ii}function Pa(){return ii=na2||m2(ii)>3?"":" "}function gne(e,t){for(;--t&&Pa()&&!(ii<48||ii>102||ii>57&&ii<65||ii>70&&ii<97););return fy(e,r4()+(t<6&&Yl()==32&&Pa()==32))}function i7(e){for(;Pa();)switch(ii){case e:return na;case 34:case 39:e!==34&&e!==39&&i7(ii);break;case 40:e===41&&i7(e);break;case 92:Pa();break}return na}function mne(e,t){for(;Pa()&&e+ii!==47+10;)if(e+ii===42+42&&Yl()===47)break;return"/*"+fy(t,na-1)+"*"+yS(e===47?e:Pa())}function vne(e){for(;!m2(Yl());)Pa();return fy(e,na)}function yne(e){return Pj(o4("",null,null,null,[""],e=Ej(e),0,[0],e))}function o4(e,t,n,r,i,o,a,s,l){for(var u=0,d=0,h=a,m=0,v=0,b=0,S=1,k=1,E=1,_=0,T="",A=i,I=o,R=r,D=T;k;)switch(b=_,_=Pa()){case 40:if(b!=108&&Wi(D,h-1)==58){r7(D+=An(i4(_),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:D+=i4(_);break;case 9:case 10:case 13:case 32:D+=pne(b);break;case 92:D+=gne(r4()-1,7);continue;case 47:switch(Yl()){case 42:case 47:$3(bne(mne(Pa(),r4()),t,n),l);break;default:D+="/"}break;case 123*S:s[u++]=Bl(D)*E;case 125*S:case 59:case 0:switch(_){case 0:case 125:k=0;case 59+d:v>0&&Bl(D)-h&&$3(v>32?_L(D+";",r,n,h-1):_L(An(D," ","")+";",r,n,h-2),l);break;case 59:D+=";";default:if($3(R=CL(D,t,n,u,d,i,s,T,A=[],I=[],h),o),_===123)if(d===0)o4(D,t,R,R,A,o,h,s,I);else switch(m===99&&Wi(D,3)===110?100:m){case 100:case 109:case 115:o4(e,R,R,r&&$3(CL(e,R,R,0,0,i,s,T,i,A=[],h),I),i,I,h,s,r?A:I);break;default:o4(D,R,R,R,[""],I,0,s,I)}}u=d=v=0,S=E=1,T=D="",h=a;break;case 58:h=1+Bl(D),v=b;default:if(S<1){if(_==123)--S;else if(_==125&&S++==0&&hne()==125)continue}switch(D+=yS(_),_*S){case 38:E=d>0?1:(D+="\f",-1);break;case 44:s[u++]=(Bl(D)-1)*E,E=1;break;case 64:Yl()===45&&(D+=i4(Pa())),m=Yl(),d=h=Bl(T=D+=vne(r4())),_++;break;case 45:b===45&&Bl(D)==2&&(S=0)}}return o}function CL(e,t,n,r,i,o,a,s,l,u,d){for(var h=i-1,m=i===0?o:[""],v=x_(m),b=0,S=0,k=0;b0?m[E]+" "+_:An(_,/&\f/g,m[E])))&&(l[k++]=T);return SS(e,t,n,i===0?b_:s,l,u,d)}function bne(e,t,n){return SS(e,t,n,wj,yS(fne()),g2(e,2,-2),0)}function _L(e,t,n,r){return SS(e,t,n,S_,g2(e,0,r),g2(e,r+1,-1),r)}function hm(e,t){for(var n="",r=x_(e),i=0;i6)switch(Wi(e,t+1)){case 109:if(Wi(e,t+4)!==45)break;case 102:return An(e,/(.+:)(.+)-([^]+)/,"$1"+Cn+"$2-$3$1"+V4+(Wi(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~r7(e,"stretch")?Lj(An(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Wi(e,t+1)!==115)break;case 6444:switch(Wi(e,Bl(e)-3-(~r7(e,"!important")&&10))){case 107:return An(e,":",":"+Cn)+e;case 101:return An(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Cn+(Wi(e,14)===45?"inline-":"")+"box$3$1"+Cn+"$2$3$1"+eo+"$2box$3")+e}break;case 5936:switch(Wi(e,t+11)){case 114:return Cn+e+eo+An(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Cn+e+eo+An(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Cn+e+eo+An(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Cn+e+eo+e+e}return e}var Tne=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case S_:t.return=Lj(t.value,t.length);break;case Cj:return hm([F1(t,{value:An(t.value,"@","@"+Cn)})],i);case b_:if(t.length)return dne(t.props,function(o){switch(cne(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return hm([F1(t,{props:[An(o,/:(read-\w+)/,":"+V4+"$1")]})],i);case"::placeholder":return hm([F1(t,{props:[An(o,/:(plac\w+)/,":"+Cn+"input-$1")]}),F1(t,{props:[An(o,/:(plac\w+)/,":"+V4+"$1")]}),F1(t,{props:[An(o,/:(plac\w+)/,eo+"input-$1")]})],i)}return""})}},Lne=[Tne],Aj=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(S){var k=S.getAttribute("data-emotion");k.indexOf(" ")!==-1&&(document.head.appendChild(S),S.setAttribute("data-s",""))})}var i=t.stylisPlugins||Lne,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(S){for(var k=S.getAttribute("data-emotion").split(" "),E=1;E=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var zne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Hne=/[A-Z]|^ms/g,Vne=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Nj=function(t){return t.charCodeAt(1)===45},PL=function(t){return t!=null&&typeof t!="boolean"},Gw=Tj(function(e){return Nj(e)?e:e.replace(Hne,"-$&").toLowerCase()}),TL=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Vne,function(r,i,o){return $l={name:i,styles:o,next:$l},i})}return zne[t]!==1&&!Nj(t)&&typeof n=="number"&&n!==0?n+"px":n};function v2(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return $l={name:n.name,styles:n.styles,next:$l},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)$l={name:r.name,styles:r.styles,next:$l},r=r.next;var i=n.styles+";";return i}return Wne(e,t,n)}case"function":{if(e!==void 0){var o=$l,a=n(e);return $l=o,v2(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function Wne(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{t.includes(r)||(n[r]=e[r])}),n}function sre(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},Vj=lre(sre);function Wj(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var Uj=e=>Wj(e,t=>t!=null);function ure(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var cre=ure();function Gj(e,...t){return ore(e)?e(...t):e}function dre(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function fre(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=w.createContext(void 0);i.displayName=r;function o(){var a;const s=w.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}var hre=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,pre=Tj(function(e){return hre.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),gre=pre,mre=function(t){return t!=="theme"},ML=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?gre:mre},IL=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},vre=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Rj(n,r,i),Gne(function(){return Dj(n,r,i)}),null},yre=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=IL(t,n,r),l=s||ML(i),u=!l("as");return function(){var d=arguments,h=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)h.push.apply(h,d);else{h.push(d[0][0]);for(var m=d.length,v=1;v[h,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([h,m])=>[h,m.className]))}function l(d){const v=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:v,selector:`.${v}`,toString:()=>d}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var Sre=On("accordion").parts("root","container","button","panel").extend("icon"),xre=On("alert").parts("title","description","container").extend("icon","spinner"),wre=On("avatar").parts("label","badge","container").extend("excessLabel","group"),Cre=On("breadcrumb").parts("link","item","container").extend("separator");On("button").parts();var _re=On("checkbox").parts("control","icon","container").extend("label");On("progress").parts("track","filledTrack").extend("label");var kre=On("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Ere=On("editable").parts("preview","input","textarea"),Pre=On("form").parts("container","requiredIndicator","helperText"),Tre=On("formError").parts("text","icon"),Lre=On("input").parts("addon","field","element"),Are=On("list").parts("container","item","icon"),Ore=On("menu").parts("button","list","item").extend("groupTitle","command","divider"),Mre=On("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Ire=On("numberinput").parts("root","field","stepperGroup","stepper");On("pininput").parts("field");var Rre=On("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Dre=On("progress").parts("label","filledTrack","track"),Nre=On("radio").parts("container","control","label"),jre=On("select").parts("field","icon"),Bre=On("slider").parts("container","track","thumb","filledTrack","mark"),$re=On("stat").parts("container","label","helpText","number","icon"),Fre=On("switch").parts("container","track","thumb"),zre=On("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),Hre=On("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),Vre=On("tag").parts("container","label","closeButton"),Wre=On("card").parts("container","header","body","footer");function Ui(e,t){Ure(e)&&(e="100%");var n=Gre(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function F3(e){return Math.min(1,Math.max(0,e))}function Ure(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Gre(e){return typeof e=="string"&&e.indexOf("%")!==-1}function qj(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function z3(e){return e<=1?"".concat(Number(e)*100,"%"):e}function wh(e){return e.length===1?"0"+e:String(e)}function qre(e,t,n){return{r:Ui(e,255)*255,g:Ui(t,255)*255,b:Ui(n,255)*255}}function RL(e,t,n){e=Ui(e,255),t=Ui(t,255),n=Ui(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=0,s=(r+i)/2;if(r===i)a=0,o=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Yre(e,t,n){var r,i,o;if(e=Ui(e,360),t=Ui(t,100),n=Ui(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=qw(s,a,e+1/3),i=qw(s,a,e),o=qw(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function DL(e,t,n){e=Ui(e,255),t=Ui(t,255),n=Ui(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var u7={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Jre(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=nie(e)),typeof e=="object"&&(ju(e.r)&&ju(e.g)&&ju(e.b)?(t=qre(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ju(e.h)&&ju(e.s)&&ju(e.v)?(r=z3(e.s),i=z3(e.v),t=Kre(e.h,r,i),a=!0,s="hsv"):ju(e.h)&&ju(e.s)&&ju(e.l)&&(r=z3(e.s),o=z3(e.l),t=Yre(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=qj(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var eie="[-\\+]?\\d+%?",tie="[-\\+]?\\d*\\.\\d+%?",xd="(?:".concat(tie,")|(?:").concat(eie,")"),Yw="[\\s|\\(]+(".concat(xd,")[,|\\s]+(").concat(xd,")[,|\\s]+(").concat(xd,")\\s*\\)?"),Kw="[\\s|\\(]+(".concat(xd,")[,|\\s]+(").concat(xd,")[,|\\s]+(").concat(xd,")[,|\\s]+(").concat(xd,")\\s*\\)?"),Ds={CSS_UNIT:new RegExp(xd),rgb:new RegExp("rgb"+Yw),rgba:new RegExp("rgba"+Kw),hsl:new RegExp("hsl"+Yw),hsla:new RegExp("hsla"+Kw),hsv:new RegExp("hsv"+Yw),hsva:new RegExp("hsva"+Kw),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function nie(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(u7[e])e=u7[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Ds.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Ds.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Ds.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Ds.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Ds.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Ds.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Ds.hex8.exec(e),n?{r:Ca(n[1]),g:Ca(n[2]),b:Ca(n[3]),a:jL(n[4]),format:t?"name":"hex8"}:(n=Ds.hex6.exec(e),n?{r:Ca(n[1]),g:Ca(n[2]),b:Ca(n[3]),format:t?"name":"hex"}:(n=Ds.hex4.exec(e),n?{r:Ca(n[1]+n[1]),g:Ca(n[2]+n[2]),b:Ca(n[3]+n[3]),a:jL(n[4]+n[4]),format:t?"name":"hex8"}:(n=Ds.hex3.exec(e),n?{r:Ca(n[1]+n[1]),g:Ca(n[2]+n[2]),b:Ca(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function ju(e){return Boolean(Ds.CSS_UNIT.exec(String(e)))}var hy=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=Qre(t)),this.originalInput=t;var i=Jre(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,a=t.g/255,s=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=qj(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=DL(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=DL(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=RL(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=RL(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),NL(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Xre(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(Ui(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(Ui(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+NL(this.r,this.g,this.b,!1),n=0,r=Object.entries(u7);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=F3(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=F3(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=F3(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=F3(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:i,v:o})),o=(o+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(Yj(e));return e.count=t,n}var r=rie(e.hue,e.seed),i=iie(r,e),o=oie(r,i,e),a={h:r,s:i,v:o};return e.alpha!==void 0&&(a.a=e.alpha),new hy(a)}function rie(e,t){var n=sie(e),r=W4(n,t);return r<0&&(r=360+r),r}function iie(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return W4([0,100],t.seed);var n=Kj(e).saturationRange,r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55;break}return W4([r,i],t.seed)}function oie(e,t,n){var r=aie(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100;break}return W4([r,i],n.seed)}function aie(e,t){for(var n=Kj(e).lowerBounds,r=0;r=i&&t<=a){var l=(s-o)/(a-i),u=o-l*i;return l*t+u}}return 0}function sie(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=Zj.find(function(a){return a.name===e});if(n){var r=Xj(n);if(r.hueRange)return r.hueRange}var i=new hy(e);if(i.isValid){var o=i.toHsv().h;return[o,o]}}return[0,360]}function Kj(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=Zj;t=i.hueRange[0]&&e<=i.hueRange[1])return i}throw Error("Color not found")}function W4(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var i=t/233280;return Math.floor(r+i*(n-r))}function Xj(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],i=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,i]}}var Zj=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function lie(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,_o=(e,t,n)=>{const r=lie(e,`colors.${t}`,t),{isValid:i}=new hy(r);return i?r:n},cie=e=>t=>{const n=_o(t,e);return new hy(n).isDark()?"dark":"light"},die=e=>t=>cie(e)(t)==="dark",Hm=(e,t)=>n=>{const r=_o(n,e);return new hy(r).setAlpha(t).toRgbString()};function BL(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( - 45deg, - ${t} 25%, - transparent 25%, - transparent 50%, - ${t} 50%, - ${t} 75%, - transparent 75%, - transparent - )`,backgroundSize:`${e} ${e}`}}function fie(e){const t=Yj().toHexString();return!e||uie(e)?t:e.string&&e.colors?pie(e.string,e.colors):e.string&&!e.colors?hie(e.string):e.colors&&!e.string?gie(e.colors):t}function hie(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function pie(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function P_(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function mie(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Qj(e){return mie(e)&&e.reference?e.reference:String(e)}var IS=(e,...t)=>t.map(Qj).join(` ${e} `).replace(/calc/g,""),$L=(...e)=>`calc(${IS("+",...e)})`,FL=(...e)=>`calc(${IS("-",...e)})`,c7=(...e)=>`calc(${IS("*",...e)})`,zL=(...e)=>`calc(${IS("/",...e)})`,HL=e=>{const t=Qj(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:c7(t,-1)},Vu=Object.assign(e=>({add:(...t)=>Vu($L(e,...t)),subtract:(...t)=>Vu(FL(e,...t)),multiply:(...t)=>Vu(c7(e,...t)),divide:(...t)=>Vu(zL(e,...t)),negate:()=>Vu(HL(e)),toString:()=>e.toString()}),{add:$L,subtract:FL,multiply:c7,divide:zL,negate:HL});function vie(e){return!Number.isInteger(parseFloat(e.toString()))}function yie(e,t="-"){return e.replace(/\s+/g,t)}function Jj(e){const t=yie(e.toString());return t.includes("\\.")?e:vie(e)?t.replace(".","\\."):e}function bie(e,t=""){return[t,Jj(e)].filter(Boolean).join("-")}function Sie(e,t){return`var(${Jj(e)}${t?`, ${t}`:""})`}function xie(e,t=""){return`--${bie(e,t)}`}function yi(e,t){const n=xie(e,t==null?void 0:t.prefix);return{variable:n,reference:Sie(n,wie(t==null?void 0:t.fallback))}}function wie(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{definePartsStyle:Cie,defineMultiStyleConfig:_ie}=hr(Sre.keys),kie={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},Eie={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Pie={pt:"2",px:"4",pb:"5"},Tie={fontSize:"1.25em"},Lie=Cie({container:kie,button:Eie,panel:Pie,icon:Tie}),Aie=_ie({baseStyle:Lie}),{definePartsStyle:py,defineMultiStyleConfig:Oie}=hr(xre.keys),Ta=Hn("alert-fg"),Qu=Hn("alert-bg"),Mie=py({container:{bg:Qu.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Ta.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Ta.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function T_(e){const{theme:t,colorScheme:n}=e,r=Hm(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Iie=py(e=>{const{colorScheme:t}=e,n=T_(e);return{container:{[Ta.variable]:`colors.${t}.500`,[Qu.variable]:n.light,_dark:{[Ta.variable]:`colors.${t}.200`,[Qu.variable]:n.dark}}}}),Rie=py(e=>{const{colorScheme:t}=e,n=T_(e);return{container:{[Ta.variable]:`colors.${t}.500`,[Qu.variable]:n.light,_dark:{[Ta.variable]:`colors.${t}.200`,[Qu.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:Ta.reference}}}),Die=py(e=>{const{colorScheme:t}=e,n=T_(e);return{container:{[Ta.variable]:`colors.${t}.500`,[Qu.variable]:n.light,_dark:{[Ta.variable]:`colors.${t}.200`,[Qu.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:Ta.reference}}}),Nie=py(e=>{const{colorScheme:t}=e;return{container:{[Ta.variable]:"colors.white",[Qu.variable]:`colors.${t}.500`,_dark:{[Ta.variable]:"colors.gray.900",[Qu.variable]:`colors.${t}.200`},color:Ta.reference}}}),jie={subtle:Iie,"left-accent":Rie,"top-accent":Die,solid:Nie},Bie=Oie({baseStyle:Mie,variants:jie,defaultProps:{variant:"subtle",colorScheme:"blue"}}),eB={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},$ie={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},Fie={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},zie={...eB,...$ie,container:Fie},tB=zie,Hie=e=>typeof e=="function";function Po(e,...t){return Hie(e)?e(...t):e}var{definePartsStyle:nB,defineMultiStyleConfig:Vie}=hr(wre.keys),pm=Hn("avatar-border-color"),Xw=Hn("avatar-bg"),Wie={borderRadius:"full",border:"0.2em solid",[pm.variable]:"white",_dark:{[pm.variable]:"colors.gray.800"},borderColor:pm.reference},Uie={[Xw.variable]:"colors.gray.200",_dark:{[Xw.variable]:"colors.whiteAlpha.400"},bgColor:Xw.reference},VL=Hn("avatar-background"),Gie=e=>{const{name:t,theme:n}=e,r=t?fie({string:t}):"colors.gray.400",i=die(r)(n);let o="white";return i||(o="gray.800"),{bg:VL.reference,"&:not([data-loaded])":{[VL.variable]:r},color:o,[pm.variable]:"colors.white",_dark:{[pm.variable]:"colors.gray.800"},borderColor:pm.reference,verticalAlign:"top"}},qie=nB(e=>({badge:Po(Wie,e),excessLabel:Po(Uie,e),container:Po(Gie,e)}));function od(e){const t=e!=="100%"?tB[e]:void 0;return nB({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var Yie={"2xs":od(4),xs:od(6),sm:od(8),md:od(12),lg:od(16),xl:od(24),"2xl":od(32),full:od("100%")},Kie=Vie({baseStyle:qie,sizes:Yie,defaultProps:{size:"md"}}),Xie={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},gm=Hn("badge-bg"),Ul=Hn("badge-color"),Zie=e=>{const{colorScheme:t,theme:n}=e,r=Hm(`${t}.500`,.6)(n);return{[gm.variable]:`colors.${t}.500`,[Ul.variable]:"colors.white",_dark:{[gm.variable]:r,[Ul.variable]:"colors.whiteAlpha.800"},bg:gm.reference,color:Ul.reference}},Qie=e=>{const{colorScheme:t,theme:n}=e,r=Hm(`${t}.200`,.16)(n);return{[gm.variable]:`colors.${t}.100`,[Ul.variable]:`colors.${t}.800`,_dark:{[gm.variable]:r,[Ul.variable]:`colors.${t}.200`},bg:gm.reference,color:Ul.reference}},Jie=e=>{const{colorScheme:t,theme:n}=e,r=Hm(`${t}.200`,.8)(n);return{[Ul.variable]:`colors.${t}.500`,_dark:{[Ul.variable]:r},color:Ul.reference,boxShadow:`inset 0 0 0px 1px ${Ul.reference}`}},eoe={solid:Zie,subtle:Qie,outline:Jie},Nv={baseStyle:Xie,variants:eoe,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:toe,definePartsStyle:noe}=hr(Cre.keys),roe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},ioe=noe({link:roe}),ooe=toe({baseStyle:ioe}),aoe={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},rB=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Et("inherit","whiteAlpha.900")(e),_hover:{bg:Et("gray.100","whiteAlpha.200")(e)},_active:{bg:Et("gray.200","whiteAlpha.300")(e)}};const r=Hm(`${t}.200`,.12)(n),i=Hm(`${t}.200`,.24)(n);return{color:Et(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Et(`${t}.50`,r)(e)},_active:{bg:Et(`${t}.100`,i)(e)}}},soe=e=>{const{colorScheme:t}=e,n=Et("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...Po(rB,e)}},loe={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},uoe=e=>{const{colorScheme:t}=e;if(t==="gray"){const s=Et("gray.100","whiteAlpha.200")(e);return{bg:s,_hover:{bg:Et("gray.200","whiteAlpha.300")(e),_disabled:{bg:s}},_active:{bg:Et("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=loe[t]??{},a=Et(n,`${t}.200`)(e);return{bg:a,color:Et(r,"gray.800")(e),_hover:{bg:Et(i,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:Et(o,`${t}.400`)(e)}}},coe=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Et(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Et(`${t}.700`,`${t}.500`)(e)}}},doe={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},foe={ghost:rB,outline:soe,solid:uoe,link:coe,unstyled:doe},hoe={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},poe={baseStyle:aoe,variants:foe,sizes:hoe,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Ah,defineMultiStyleConfig:goe}=hr(Wre.keys),U4=Hn("card-bg"),mm=Hn("card-padding"),moe=Ah({container:{[U4.variable]:"chakra-body-bg",backgroundColor:U4.reference,color:"chakra-body-text"},body:{padding:mm.reference,flex:"1 1 0%"},header:{padding:mm.reference},footer:{padding:mm.reference}}),voe={sm:Ah({container:{borderRadius:"base",[mm.variable]:"space.3"}}),md:Ah({container:{borderRadius:"md",[mm.variable]:"space.5"}}),lg:Ah({container:{borderRadius:"xl",[mm.variable]:"space.7"}})},yoe={elevated:Ah({container:{boxShadow:"base",_dark:{[U4.variable]:"colors.gray.700"}}}),outline:Ah({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:Ah({container:{[U4.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},boe=goe({baseStyle:moe,variants:yoe,sizes:voe,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:a4,defineMultiStyleConfig:Soe}=hr(_re.keys),jv=Hn("checkbox-size"),xoe=e=>{const{colorScheme:t}=e;return{w:jv.reference,h:jv.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e),_hover:{bg:Et(`${t}.600`,`${t}.300`)(e),borderColor:Et(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Et("gray.200","transparent")(e),bg:Et("gray.200","whiteAlpha.300")(e),color:Et("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e)},_disabled:{bg:Et("gray.100","whiteAlpha.100")(e),borderColor:Et("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Et("red.500","red.300")(e)}}},woe={_disabled:{cursor:"not-allowed"}},Coe={userSelect:"none",_disabled:{opacity:.4}},_oe={transitionProperty:"transform",transitionDuration:"normal"},koe=a4(e=>({icon:_oe,container:woe,control:Po(xoe,e),label:Coe})),Eoe={sm:a4({control:{[jv.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:a4({control:{[jv.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:a4({control:{[jv.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},G4=Soe({baseStyle:koe,sizes:Eoe,defaultProps:{size:"md",colorScheme:"blue"}}),Bv=yi("close-button-size"),z1=yi("close-button-bg"),Poe={w:[Bv.reference],h:[Bv.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[z1.variable]:"colors.blackAlpha.100",_dark:{[z1.variable]:"colors.whiteAlpha.100"}},_active:{[z1.variable]:"colors.blackAlpha.200",_dark:{[z1.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:z1.reference},Toe={lg:{[Bv.variable]:"sizes.10",fontSize:"md"},md:{[Bv.variable]:"sizes.8",fontSize:"xs"},sm:{[Bv.variable]:"sizes.6",fontSize:"2xs"}},Loe={baseStyle:Poe,sizes:Toe,defaultProps:{size:"md"}},{variants:Aoe,defaultProps:Ooe}=Nv,Moe={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Ioe={baseStyle:Moe,variants:Aoe,defaultProps:Ooe},Roe={w:"100%",mx:"auto",maxW:"prose",px:"4"},Doe={baseStyle:Roe},Noe={opacity:.6,borderColor:"inherit"},joe={borderStyle:"solid"},Boe={borderStyle:"dashed"},$oe={solid:joe,dashed:Boe},Foe={baseStyle:Noe,variants:$oe,defaultProps:{variant:"solid"}},{definePartsStyle:d7,defineMultiStyleConfig:zoe}=hr(kre.keys),Zw=Hn("drawer-bg"),Qw=Hn("drawer-box-shadow");function xg(e){return d7(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Hoe={bg:"blackAlpha.600",zIndex:"overlay"},Voe={display:"flex",zIndex:"modal",justifyContent:"center"},Woe=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[Zw.variable]:"colors.white",[Qw.variable]:"shadows.lg",_dark:{[Zw.variable]:"colors.gray.700",[Qw.variable]:"shadows.dark-lg"},bg:Zw.reference,boxShadow:Qw.reference}},Uoe={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Goe={position:"absolute",top:"2",insetEnd:"3"},qoe={px:"6",py:"2",flex:"1",overflow:"auto"},Yoe={px:"6",py:"4"},Koe=d7(e=>({overlay:Hoe,dialogContainer:Voe,dialog:Po(Woe,e),header:Uoe,closeButton:Goe,body:qoe,footer:Yoe})),Xoe={xs:xg("xs"),sm:xg("md"),md:xg("lg"),lg:xg("2xl"),xl:xg("4xl"),full:xg("full")},Zoe=zoe({baseStyle:Koe,sizes:Xoe,defaultProps:{size:"xs"}}),{definePartsStyle:Qoe,defineMultiStyleConfig:Joe}=hr(Ere.keys),eae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},tae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},nae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},rae=Qoe({preview:eae,input:tae,textarea:nae}),iae=Joe({baseStyle:rae}),{definePartsStyle:oae,defineMultiStyleConfig:aae}=hr(Pre.keys),vm=Hn("form-control-color"),sae={marginStart:"1",[vm.variable]:"colors.red.500",_dark:{[vm.variable]:"colors.red.300"},color:vm.reference},lae={mt:"2",[vm.variable]:"colors.gray.600",_dark:{[vm.variable]:"colors.whiteAlpha.600"},color:vm.reference,lineHeight:"normal",fontSize:"sm"},uae=oae({container:{width:"100%",position:"relative"},requiredIndicator:sae,helperText:lae}),cae=aae({baseStyle:uae}),{definePartsStyle:dae,defineMultiStyleConfig:fae}=hr(Tre.keys),ym=Hn("form-error-color"),hae={[ym.variable]:"colors.red.500",_dark:{[ym.variable]:"colors.red.300"},color:ym.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},pae={marginEnd:"0.5em",[ym.variable]:"colors.red.500",_dark:{[ym.variable]:"colors.red.300"},color:ym.reference},gae=dae({text:hae,icon:pae}),mae=fae({baseStyle:gae}),vae={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},yae={baseStyle:vae},bae={fontFamily:"heading",fontWeight:"bold"},Sae={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},xae={baseStyle:bae,sizes:Sae,defaultProps:{size:"xl"}},{definePartsStyle:Wu,defineMultiStyleConfig:wae}=hr(Lre.keys),Cae=Wu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),ad={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},_ae={lg:Wu({field:ad.lg,addon:ad.lg}),md:Wu({field:ad.md,addon:ad.md}),sm:Wu({field:ad.sm,addon:ad.sm}),xs:Wu({field:ad.xs,addon:ad.xs})};function L_(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Et("blue.500","blue.300")(e),errorBorderColor:n||Et("red.500","red.300")(e)}}var kae=Wu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=L_(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Et("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:_o(t,r),boxShadow:`0 0 0 1px ${_o(t,r)}`},_focusVisible:{zIndex:1,borderColor:_o(t,n),boxShadow:`0 0 0 1px ${_o(t,n)}`}},addon:{border:"1px solid",borderColor:Et("inherit","whiteAlpha.50")(e),bg:Et("gray.100","whiteAlpha.300")(e)}}}),Eae=Wu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=L_(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e),_hover:{bg:Et("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:_o(t,r)},_focusVisible:{bg:"transparent",borderColor:_o(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e)}}}),Pae=Wu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=L_(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:_o(t,r),boxShadow:`0px 1px 0px 0px ${_o(t,r)}`},_focusVisible:{borderColor:_o(t,n),boxShadow:`0px 1px 0px 0px ${_o(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),Tae=Wu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),Lae={outline:kae,filled:Eae,flushed:Pae,unstyled:Tae},_n=wae({baseStyle:Cae,sizes:_ae,variants:Lae,defaultProps:{size:"md",variant:"outline"}}),Jw=Hn("kbd-bg"),Aae={[Jw.variable]:"colors.gray.100",_dark:{[Jw.variable]:"colors.whiteAlpha.100"},bg:Jw.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Oae={baseStyle:Aae},Mae={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Iae={baseStyle:Mae},{defineMultiStyleConfig:Rae,definePartsStyle:Dae}=hr(Are.keys),Nae={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},jae=Dae({icon:Nae}),Bae=Rae({baseStyle:jae}),{defineMultiStyleConfig:$ae,definePartsStyle:Fae}=hr(Ore.keys),jl=Hn("menu-bg"),e6=Hn("menu-shadow"),zae={[jl.variable]:"#fff",[e6.variable]:"shadows.sm",_dark:{[jl.variable]:"colors.gray.700",[e6.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:jl.reference,boxShadow:e6.reference},Hae={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[jl.variable]:"colors.gray.100",_dark:{[jl.variable]:"colors.whiteAlpha.100"}},_active:{[jl.variable]:"colors.gray.200",_dark:{[jl.variable]:"colors.whiteAlpha.200"}},_expanded:{[jl.variable]:"colors.gray.100",_dark:{[jl.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:jl.reference},Vae={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},Wae={opacity:.6},Uae={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},Gae={transitionProperty:"common",transitionDuration:"normal"},qae=Fae({button:Gae,list:zae,item:Hae,groupTitle:Vae,command:Wae,divider:Uae}),Yae=$ae({baseStyle:qae}),{defineMultiStyleConfig:Kae,definePartsStyle:f7}=hr(Mre.keys),Xae={bg:"blackAlpha.600",zIndex:"modal"},Zae=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},Qae=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:Et("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:Et("lg","dark-lg")(e)}},Jae={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},ese={position:"absolute",top:"2",insetEnd:"3"},tse=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},nse={px:"6",py:"4"},rse=f7(e=>({overlay:Xae,dialogContainer:Po(Zae,e),dialog:Po(Qae,e),header:Jae,closeButton:ese,body:Po(tse,e),footer:nse}));function Os(e){return f7(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var ise={xs:Os("xs"),sm:Os("sm"),md:Os("md"),lg:Os("lg"),xl:Os("xl"),"2xl":Os("2xl"),"3xl":Os("3xl"),"4xl":Os("4xl"),"5xl":Os("5xl"),"6xl":Os("6xl"),full:Os("full")},ose=Kae({baseStyle:rse,sizes:ise,defaultProps:{size:"md"}}),ase={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},iB=ase,{defineMultiStyleConfig:sse,definePartsStyle:oB}=hr(Ire.keys),A_=yi("number-input-stepper-width"),aB=yi("number-input-input-padding"),lse=Vu(A_).add("0.5rem").toString(),t6=yi("number-input-bg"),n6=yi("number-input-color"),r6=yi("number-input-border-color"),use={[A_.variable]:"sizes.6",[aB.variable]:lse},cse=e=>{var t;return((t=Po(_n.baseStyle,e))==null?void 0:t.field)??{}},dse={width:A_.reference},fse={borderStart:"1px solid",borderStartColor:r6.reference,color:n6.reference,bg:t6.reference,[n6.variable]:"colors.chakra-body-text",[r6.variable]:"colors.chakra-border-color",_dark:{[n6.variable]:"colors.whiteAlpha.800",[r6.variable]:"colors.whiteAlpha.300"},_active:{[t6.variable]:"colors.gray.200",_dark:{[t6.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},hse=oB(e=>({root:use,field:Po(cse,e)??{},stepperGroup:dse,stepper:fse}));function H3(e){var t,n;const r=(t=_n.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},o=((n=r.field)==null?void 0:n.fontSize)??"md",a=iB.fontSizes[o];return oB({field:{...r.field,paddingInlineEnd:aB.reference,verticalAlign:"top"},stepper:{fontSize:Vu(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var pse={xs:H3("xs"),sm:H3("sm"),md:H3("md"),lg:H3("lg")},gse=sse({baseStyle:hse,sizes:pse,variants:_n.variants,defaultProps:_n.defaultProps}),WL,mse={...(WL=_n.baseStyle)==null?void 0:WL.field,textAlign:"center"},vse={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},UL,yse={outline:e=>{var t,n;return((n=Po((t=_n.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=Po((t=_n.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=Po((t=_n.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((UL=_n.variants)==null?void 0:UL.unstyled.field)??{}},bse={baseStyle:mse,sizes:vse,variants:yse,defaultProps:_n.defaultProps},{defineMultiStyleConfig:Sse,definePartsStyle:xse}=hr(Rre.keys),V3=yi("popper-bg"),wse=yi("popper-arrow-bg"),GL=yi("popper-arrow-shadow-color"),Cse={zIndex:10},_se={[V3.variable]:"colors.white",bg:V3.reference,[wse.variable]:V3.reference,[GL.variable]:"colors.gray.200",_dark:{[V3.variable]:"colors.gray.700",[GL.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},kse={px:3,py:2,borderBottomWidth:"1px"},Ese={px:3,py:2},Pse={px:3,py:2,borderTopWidth:"1px"},Tse={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},Lse=xse({popper:Cse,content:_se,header:kse,body:Ese,footer:Pse,closeButton:Tse}),Ase=Sse({baseStyle:Lse}),{defineMultiStyleConfig:Ose,definePartsStyle:vv}=hr(Dre.keys),Mse=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=Et(BL(),BL("1rem","rgba(0,0,0,0.1)"))(e),a=Et(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( - to right, - transparent 0%, - ${_o(n,a)} 50%, - transparent 100% - )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},Ise={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Rse=e=>({bg:Et("gray.100","whiteAlpha.300")(e)}),Dse=e=>({transitionProperty:"common",transitionDuration:"slow",...Mse(e)}),Nse=vv(e=>({label:Ise,filledTrack:Dse(e),track:Rse(e)})),jse={xs:vv({track:{h:"1"}}),sm:vv({track:{h:"2"}}),md:vv({track:{h:"3"}}),lg:vv({track:{h:"4"}})},Bse=Ose({sizes:jse,baseStyle:Nse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:$se,definePartsStyle:s4}=hr(Nre.keys),Fse=e=>{var t;const n=(t=Po(G4.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},zse=s4(e=>{var t,n,r,i;return{label:(n=(t=G4).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=G4).baseStyle)==null?void 0:i.call(r,e).container,control:Fse(e)}}),Hse={md:s4({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:s4({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:s4({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},Vse=$se({baseStyle:zse,sizes:Hse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Wse,definePartsStyle:Use}=hr(jre.keys),W3=Hn("select-bg"),qL,Gse={...(qL=_n.baseStyle)==null?void 0:qL.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:W3.reference,[W3.variable]:"colors.white",_dark:{[W3.variable]:"colors.gray.700"},"> option, > optgroup":{bg:W3.reference}},qse={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},Yse=Use({field:Gse,icon:qse}),U3={paddingInlineEnd:"8"},YL,KL,XL,ZL,QL,JL,eA,tA,Kse={lg:{...(YL=_n.sizes)==null?void 0:YL.lg,field:{...(KL=_n.sizes)==null?void 0:KL.lg.field,...U3}},md:{...(XL=_n.sizes)==null?void 0:XL.md,field:{...(ZL=_n.sizes)==null?void 0:ZL.md.field,...U3}},sm:{...(QL=_n.sizes)==null?void 0:QL.sm,field:{...(JL=_n.sizes)==null?void 0:JL.sm.field,...U3}},xs:{...(eA=_n.sizes)==null?void 0:eA.xs,field:{...(tA=_n.sizes)==null?void 0:tA.xs.field,...U3},icon:{insetEnd:"1"}}},Xse=Wse({baseStyle:Yse,sizes:Kse,variants:_n.variants,defaultProps:_n.defaultProps}),i6=Hn("skeleton-start-color"),o6=Hn("skeleton-end-color"),Zse={[i6.variable]:"colors.gray.100",[o6.variable]:"colors.gray.400",_dark:{[i6.variable]:"colors.gray.800",[o6.variable]:"colors.gray.600"},background:i6.reference,borderColor:o6.reference,opacity:.7,borderRadius:"sm"},Qse={baseStyle:Zse},a6=Hn("skip-link-bg"),Jse={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[a6.variable]:"colors.white",_dark:{[a6.variable]:"colors.gray.700"},bg:a6.reference}},ele={baseStyle:Jse},{defineMultiStyleConfig:tle,definePartsStyle:RS}=hr(Bre.keys),S2=Hn("slider-thumb-size"),x2=Hn("slider-track-size"),vd=Hn("slider-bg"),nle=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...P_({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},rle=e=>({...P_({orientation:e.orientation,horizontal:{h:x2.reference},vertical:{w:x2.reference}}),overflow:"hidden",borderRadius:"sm",[vd.variable]:"colors.gray.200",_dark:{[vd.variable]:"colors.whiteAlpha.200"},_disabled:{[vd.variable]:"colors.gray.300",_dark:{[vd.variable]:"colors.whiteAlpha.300"}},bg:vd.reference}),ile=e=>{const{orientation:t}=e;return{...P_({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:S2.reference,h:S2.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},ole=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[vd.variable]:`colors.${t}.500`,_dark:{[vd.variable]:`colors.${t}.200`},bg:vd.reference}},ale=RS(e=>({container:nle(e),track:rle(e),thumb:ile(e),filledTrack:ole(e)})),sle=RS({container:{[S2.variable]:"sizes.4",[x2.variable]:"sizes.1"}}),lle=RS({container:{[S2.variable]:"sizes.3.5",[x2.variable]:"sizes.1"}}),ule=RS({container:{[S2.variable]:"sizes.2.5",[x2.variable]:"sizes.0.5"}}),cle={lg:sle,md:lle,sm:ule},dle=tle({baseStyle:ale,sizes:cle,defaultProps:{size:"md",colorScheme:"blue"}}),bh=yi("spinner-size"),fle={width:[bh.reference],height:[bh.reference]},hle={xs:{[bh.variable]:"sizes.3"},sm:{[bh.variable]:"sizes.4"},md:{[bh.variable]:"sizes.6"},lg:{[bh.variable]:"sizes.8"},xl:{[bh.variable]:"sizes.12"}},ple={baseStyle:fle,sizes:hle,defaultProps:{size:"md"}},{defineMultiStyleConfig:gle,definePartsStyle:sB}=hr($re.keys),mle={fontWeight:"medium"},vle={opacity:.8,marginBottom:"2"},yle={verticalAlign:"baseline",fontWeight:"semibold"},ble={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},Sle=sB({container:{},label:mle,helpText:vle,number:yle,icon:ble}),xle={md:sB({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},wle=gle({baseStyle:Sle,sizes:xle,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Cle,definePartsStyle:l4}=hr(Fre.keys),$v=yi("switch-track-width"),Oh=yi("switch-track-height"),s6=yi("switch-track-diff"),_le=Vu.subtract($v,Oh),h7=yi("switch-thumb-x"),H1=yi("switch-bg"),kle=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[$v.reference],height:[Oh.reference],transitionProperty:"common",transitionDuration:"fast",[H1.variable]:"colors.gray.300",_dark:{[H1.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[H1.variable]:`colors.${t}.500`,_dark:{[H1.variable]:`colors.${t}.200`}},bg:H1.reference}},Ele={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Oh.reference],height:[Oh.reference],_checked:{transform:`translateX(${h7.reference})`}},Ple=l4(e=>({container:{[s6.variable]:_le,[h7.variable]:s6.reference,_rtl:{[h7.variable]:Vu(s6).negate().toString()}},track:kle(e),thumb:Ele})),Tle={sm:l4({container:{[$v.variable]:"1.375rem",[Oh.variable]:"sizes.3"}}),md:l4({container:{[$v.variable]:"1.875rem",[Oh.variable]:"sizes.4"}}),lg:l4({container:{[$v.variable]:"2.875rem",[Oh.variable]:"sizes.6"}})},Lle=Cle({baseStyle:Ple,sizes:Tle,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Ale,definePartsStyle:bm}=hr(zre.keys),Ole=bm({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),q4={"&[data-is-numeric=true]":{textAlign:"end"}},Mle=bm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...q4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...q4},caption:{color:Et("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Ile=bm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...q4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...q4},caption:{color:Et("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e)},td:{background:Et(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Rle={simple:Mle,striped:Ile,unstyled:{}},Dle={sm:bm({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:bm({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:bm({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},Nle=Ale({baseStyle:Ole,variants:Rle,sizes:Dle,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Ko=Hn("tabs-color"),Fs=Hn("tabs-bg"),G3=Hn("tabs-border-color"),{defineMultiStyleConfig:jle,definePartsStyle:Kl}=hr(Hre.keys),Ble=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},$le=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Fle=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},zle={p:4},Hle=Kl(e=>({root:Ble(e),tab:$le(e),tablist:Fle(e),tabpanel:zle})),Vle={sm:Kl({tab:{py:1,px:4,fontSize:"sm"}}),md:Kl({tab:{fontSize:"md",py:2,px:4}}),lg:Kl({tab:{fontSize:"lg",py:3,px:4}})},Wle=Kl(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Ko.variable]:`colors.${t}.600`,_dark:{[Ko.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Fs.variable]:"colors.gray.200",_dark:{[Fs.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Ko.reference,bg:Fs.reference}}}),Ule=Kl(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[G3.reference]:"transparent",_selected:{[Ko.variable]:`colors.${t}.600`,[G3.variable]:"colors.white",_dark:{[Ko.variable]:`colors.${t}.300`,[G3.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:G3.reference},color:Ko.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),Gle=Kl(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Fs.variable]:"colors.gray.50",_dark:{[Fs.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Fs.variable]:"colors.white",[Ko.variable]:`colors.${t}.600`,_dark:{[Fs.variable]:"colors.gray.800",[Ko.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Ko.reference,bg:Fs.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),qle=Kl(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:_o(n,`${t}.700`),bg:_o(n,`${t}.100`)}}}}),Yle=Kl(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Ko.variable]:"colors.gray.600",_dark:{[Ko.variable]:"inherit"},_selected:{[Ko.variable]:"colors.white",[Fs.variable]:`colors.${t}.600`,_dark:{[Ko.variable]:"colors.gray.800",[Fs.variable]:`colors.${t}.300`}},color:Ko.reference,bg:Fs.reference}}}),Kle=Kl({}),Xle={line:Wle,enclosed:Ule,"enclosed-colored":Gle,"soft-rounded":qle,"solid-rounded":Yle,unstyled:Kle},Zle=jle({baseStyle:Hle,sizes:Vle,variants:Xle,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:Qle,definePartsStyle:Mh}=hr(Vre.keys),Jle={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},eue={lineHeight:1.2,overflow:"visible"},tue={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},nue=Mh({container:Jle,label:eue,closeButton:tue}),rue={sm:Mh({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Mh({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Mh({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},iue={subtle:Mh(e=>{var t;return{container:(t=Nv.variants)==null?void 0:t.subtle(e)}}),solid:Mh(e=>{var t;return{container:(t=Nv.variants)==null?void 0:t.solid(e)}}),outline:Mh(e=>{var t;return{container:(t=Nv.variants)==null?void 0:t.outline(e)}})},oue=Qle({variants:iue,baseStyle:nue,sizes:rue,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),nA,aue={...(nA=_n.baseStyle)==null?void 0:nA.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},rA,sue={outline:e=>{var t;return((t=_n.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=_n.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=_n.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((rA=_n.variants)==null?void 0:rA.unstyled.field)??{}},iA,oA,aA,sA,lue={xs:((iA=_n.sizes)==null?void 0:iA.xs.field)??{},sm:((oA=_n.sizes)==null?void 0:oA.sm.field)??{},md:((aA=_n.sizes)==null?void 0:aA.md.field)??{},lg:((sA=_n.sizes)==null?void 0:sA.lg.field)??{}},uue={baseStyle:aue,sizes:lue,variants:sue,defaultProps:{size:"md",variant:"outline"}},q3=yi("tooltip-bg"),l6=yi("tooltip-fg"),cue=yi("popper-arrow-bg"),due={bg:q3.reference,color:l6.reference,[q3.variable]:"colors.gray.700",[l6.variable]:"colors.whiteAlpha.900",_dark:{[q3.variable]:"colors.gray.300",[l6.variable]:"colors.gray.900"},[cue.variable]:q3.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},fue={baseStyle:due},hue={Accordion:Aie,Alert:Bie,Avatar:Kie,Badge:Nv,Breadcrumb:ooe,Button:poe,Checkbox:G4,CloseButton:Loe,Code:Ioe,Container:Doe,Divider:Foe,Drawer:Zoe,Editable:iae,Form:cae,FormError:mae,FormLabel:yae,Heading:xae,Input:_n,Kbd:Oae,Link:Iae,List:Bae,Menu:Yae,Modal:ose,NumberInput:gse,PinInput:bse,Popover:Ase,Progress:Bse,Radio:Vse,Select:Xse,Skeleton:Qse,SkipLink:ele,Slider:dle,Spinner:ple,Stat:wle,Switch:Lle,Table:Nle,Tabs:Zle,Tag:oue,Textarea:uue,Tooltip:fue,Card:boe},pue={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},gue=pue,mue={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},vue=mue,yue={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},bue=yue,Sue={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},xue=Sue,wue={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},Cue=wue,_ue={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},kue={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},Eue={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Pue={property:_ue,easing:kue,duration:Eue},Tue=Pue,Lue={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Aue=Lue,Oue={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Mue=Oue,Iue={breakpoints:vue,zIndices:Aue,radii:xue,blur:Mue,colors:bue,...iB,sizes:tB,shadows:Cue,space:eB,borders:gue,transition:Tue},Rue={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},Due={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},Nue="ltr",jue={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},Bue={semanticTokens:Rue,direction:Nue,...Iue,components:hue,styles:Due,config:jue},$ue=typeof Element<"u",Fue=typeof Map=="function",zue=typeof Set=="function",Hue=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function u4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!u4(e[r],t[r]))return!1;return!0}var o;if(Fue&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!u4(r.value[1],t.get(r.value[0])))return!1;return!0}if(zue&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Hue&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if($ue&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!u4(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var Vue=function(t,n){try{return u4(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function h0(){const e=w.useContext(y2);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function lB(){const e=dy(),t=h0();return{...e,theme:t}}function Wue(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__breakpoints)==null?void 0:o.asArray)==null?void 0:a[i]};return r(t)??r(n)??n}function Uue(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__cssMap)==null?void 0:o[i])==null?void 0:a.value};return r(t)??r(n)??n}function Gue(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{if(e==="breakpoints")return Wue(o,l,a[u]??l);const d=`${e}.${l}`;return Uue(o,d,a[u]??l)});return Array.isArray(t)?s:s[0]}}function que(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=w.useMemo(()=>Fte(n),[n]);return N.createElement(Xne,{theme:i},N.createElement(Yue,{root:t}),r)}function Yue({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return N.createElement(OS,{styles:n=>({[t]:n.__cssVars})})}fre({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function Kue(){const{colorMode:e}=dy();return N.createElement(OS,{styles:t=>{const n=Vj(t,"styles.global"),r=Gj(n,{theme:t,colorMode:e});return r?xj(r)(t):void 0}})}var Xue=new Set([...Vte,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),Zue=new Set(["htmlWidth","htmlHeight","htmlSize"]);function Que(e){return Zue.has(e)||!Xue.has(e)}var Jue=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=Wj(a,(h,m)=>Ute(m)),l=Gj(e,t),u=Object.assign({},i,l,Uj(s),o),d=xj(u)(t.theme);return r?[d,r]:d};function u6(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=Que);const i=Jue({baseStyle:n}),o=l7(e,r)(i);return N.forwardRef(function(l,u){const{colorMode:d,forced:h}=dy();return N.createElement(o,{ref:u,"data-theme":h?d:void 0,...l})})}function Ae(e){return w.forwardRef(e)}function uB(e,t={}){const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=lB(),a=e?Vj(i,`components.${e}`):void 0,s=n||a,l=Wl({theme:i,colorMode:o},(s==null?void 0:s.defaultProps)??{},Uj(are(r,["children"]))),u=w.useRef({});if(s){const h=tne(s)(l);Vue(u.current,h)||(u.current=h)}return u.current}function Ao(e,t={}){return uB(e,t)}function Yi(e,t={}){return uB(e,t)}function ece(){const e=new Map;return new Proxy(u6,{apply(t,n,r){return u6(...r)},get(t,n){return e.has(n)||e.set(n,u6(n)),e.get(n)}})}var Ce=ece();function tce(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Mn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o}=e,a=w.createContext(void 0);a.displayName=t;function s(){var l;const u=w.useContext(a);if(!u&&n){const d=new Error(o??tce(r,i));throw d.name="ContextError",(l=Error.captureStackTrace)==null||l.call(Error,d,s),d}return u}return[a.Provider,s,a]}function nce(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function qn(...e){return t=>{e.forEach(n=>{nce(n,t)})}}function rce(...e){return w.useMemo(()=>qn(...e),e)}function lA(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var ice=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function uA(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function cA(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var p7=typeof window<"u"?w.useLayoutEffect:w.useEffect,Y4=e=>e,oce=class{constructor(){an(this,"descendants",new Map);an(this,"register",e=>{if(e!=null)return ice(e)?this.registerNode(e):t=>{this.registerNode(t,e)}});an(this,"unregister",e=>{this.descendants.delete(e);const t=lA(Array.from(this.descendants.keys()));this.assignIndex(t)});an(this,"destroy",()=>{this.descendants.clear()});an(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})});an(this,"count",()=>this.descendants.size);an(this,"enabledCount",()=>this.enabledValues().length);an(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index));an(this,"enabledValues",()=>this.values().filter(e=>!e.disabled));an(this,"item",e=>{if(this.count()!==0)return this.values()[e]});an(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]});an(this,"first",()=>this.item(0));an(this,"firstEnabled",()=>this.enabledItem(0));an(this,"last",()=>this.item(this.descendants.size-1));an(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)});an(this,"indexOf",e=>{var t;return e?((t=this.descendants.get(e))==null?void 0:t.index)??-1:-1});an(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e)));an(this,"next",(e,t=!0)=>{const n=uA(e,this.count(),t);return this.item(n)});an(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=uA(r,this.enabledCount(),t);return this.enabledItem(i)});an(this,"prev",(e,t=!0)=>{const n=cA(e,this.count()-1,t);return this.item(n)});an(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=cA(r,this.enabledCount()-1,t);return this.enabledItem(i)});an(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=lA(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function ace(){const e=w.useRef(new oce);return p7(()=>()=>e.current.destroy()),e.current}var[sce,cB]=Mn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function lce(e){const t=cB(),[n,r]=w.useState(-1),i=w.useRef(null);p7(()=>()=>{i.current&&t.unregister(i.current)},[]),p7(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=Y4(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:qn(o,i)}}function dB(){return[Y4(sce),()=>Y4(cB()),()=>ace(),i=>lce(i)]}var Qr=(...e)=>e.filter(Boolean).join(" "),dA={path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})),viewBox:"0 0 24 24"},Da=Ae((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,d=Qr("chakra-icon",s),h={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},m={ref:t,focusable:o,className:d,__css:h},v=r??dA.viewBox;if(n&&typeof n!="string")return N.createElement(Ce.svg,{as:n,...m,...u});const b=a??dA.path;return N.createElement(Ce.svg,{verticalAlign:"middle",viewBox:v,...m,...u},b)});Da.displayName="Icon";function yt(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=w.Children.toArray(e.path),a=Ae((s,l)=>N.createElement(Da,{ref:l,viewBox:t,...i,...s},o.length?o:N.createElement("path",{fill:"currentColor",d:n})));return a.displayName=r,a}function Er(e,t=[]){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function DS(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,v)=>m!==v}=e,o=Er(r),a=Er(i),[s,l]=w.useState(n),u=t!==void 0,d=u?t:s,h=Er(m=>{const b=typeof m=="function"?m(d):m;a(d,b)&&(u||l(b),o(b))},[u,o,d,a]);return[d,h]}const O_=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),NS=w.createContext({});function uce(){return w.useContext(NS).visualElement}const p0=w.createContext(null),np=typeof document<"u",K4=np?w.useLayoutEffect:w.useEffect,fB=w.createContext({strict:!1});function cce(e,t,n,r){const i=uce(),o=w.useContext(fB),a=w.useContext(p0),s=w.useContext(O_).reducedMotion,l=w.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return K4(()=>{u&&u.render()}),w.useEffect(()=>{u&&u.animationState&&u.animationState.animateChanges()}),K4(()=>()=>u&&u.notify("Unmount"),[]),u}function Hg(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function dce(e,t,n){return w.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Hg(n)&&(n.current=r))},[t])}function w2(e){return typeof e=="string"||Array.isArray(e)}function jS(e){return typeof e=="object"&&typeof e.start=="function"}const fce=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function BS(e){return jS(e.animate)||fce.some(t=>w2(e[t]))}function hB(e){return Boolean(BS(e)||e.variants)}function hce(e,t){if(BS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||w2(n)?n:void 0,animate:w2(r)?r:void 0}}return e.inherit!==!1?t:{}}function pce(e){const{initial:t,animate:n}=hce(e,w.useContext(NS));return w.useMemo(()=>({initial:t,animate:n}),[fA(t),fA(n)])}function fA(e){return Array.isArray(e)?e.join(" "):e}const Bu=e=>({isEnabled:t=>e.some(n=>!!t[n])}),C2={measureLayout:Bu(["layout","layoutId","drag"]),animation:Bu(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:Bu(["exit"]),drag:Bu(["drag","dragControls"]),focus:Bu(["whileFocus"]),hover:Bu(["whileHover","onHoverStart","onHoverEnd"]),tap:Bu(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Bu(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:Bu(["whileInView","onViewportEnter","onViewportLeave"])};function gce(e){for(const t in e)t==="projectionNodeConstructor"?C2.projectionNodeConstructor=e[t]:C2[t].Component=e[t]}function $S(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Fv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let mce=1;function vce(){return $S(()=>{if(Fv.hasEverUpdated)return mce++})}const M_=w.createContext({});class yce extends N.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const pB=w.createContext({}),bce=Symbol.for("motionComponentSymbol");function Sce({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&gce(e);function a(l,u){const d={...w.useContext(O_),...l,layoutId:xce(l)},{isStatic:h}=d;let m=null;const v=pce(l),b=h?void 0:vce(),S=i(l,h);if(!h&&np){v.visualElement=cce(o,S,d,t);const k=w.useContext(fB).strict,E=w.useContext(pB);v.visualElement&&(m=v.visualElement.loadFeatures(d,k,e,b,n||C2.projectionNodeConstructor,E))}return w.createElement(yce,{visualElement:v.visualElement,props:d},m,w.createElement(NS.Provider,{value:v},r(o,l,b,dce(S,v.visualElement,u),S,h,v.visualElement)))}const s=w.forwardRef(a);return s[bce]=o,s}function xce({layoutId:e}){const t=w.useContext(M_).id;return t&&e!==void 0?t+"-"+e:e}function wce(e){function t(r,i={}){return Sce(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const Cce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function I_(e){return typeof e!="string"||e.includes("-")?!1:!!(Cce.indexOf(e)>-1||/[A-Z]/.test(e))}const X4={};function _ce(e){Object.assign(X4,e)}const Z4=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],g0=new Set(Z4);function gB(e,{layout:t,layoutId:n}){return g0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!X4[e]||e==="opacity")}const ou=e=>!!(e!=null&&e.getVelocity),kce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ece=(e,t)=>Z4.indexOf(e)-Z4.indexOf(t);function Pce({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";t.sort(Ece);for(const s of t)a+=`${kce[s]||s}(${e[s]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}function mB(e){return e.startsWith("--")}const Tce=(e,t)=>t&&typeof e=="number"?t.transform(e):e,vB=(e,t)=>n=>Math.max(Math.min(n,t),e),zv=e=>e%1?Number(e.toFixed(5)):e,_2=/(-)?([\d]*\.?[\d])+/g,g7=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Lce=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function gy(e){return typeof e=="string"}const rp={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Hv=Object.assign(Object.assign({},rp),{transform:vB(0,1)}),Y3=Object.assign(Object.assign({},rp),{default:1}),my=e=>({test:t=>gy(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),cd=my("deg"),Xl=my("%"),Lt=my("px"),Ace=my("vh"),Oce=my("vw"),hA=Object.assign(Object.assign({},Xl),{parse:e=>Xl.parse(e)/100,transform:e=>Xl.transform(e*100)}),R_=(e,t)=>n=>Boolean(gy(n)&&Lce.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),yB=(e,t,n)=>r=>{if(!gy(r))return r;const[i,o,a,s]=r.match(_2);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},Ch={test:R_("hsl","hue"),parse:yB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Xl.transform(zv(t))+", "+Xl.transform(zv(n))+", "+zv(Hv.transform(r))+")"},Mce=vB(0,255),c6=Object.assign(Object.assign({},rp),{transform:e=>Math.round(Mce(e))}),wd={test:R_("rgb","red"),parse:yB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+c6.transform(e)+", "+c6.transform(t)+", "+c6.transform(n)+", "+zv(Hv.transform(r))+")"};function Ice(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const m7={test:R_("#"),parse:Ice,transform:wd.transform},xo={test:e=>wd.test(e)||m7.test(e)||Ch.test(e),parse:e=>wd.test(e)?wd.parse(e):Ch.test(e)?Ch.parse(e):m7.parse(e),transform:e=>gy(e)?e:e.hasOwnProperty("red")?wd.transform(e):Ch.transform(e)},bB="${c}",SB="${n}";function Rce(e){var t,n,r,i;return isNaN(e)&&gy(e)&&((n=(t=e.match(_2))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((i=(r=e.match(g7))===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0}function xB(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(g7);r&&(n=r.length,e=e.replace(g7,bB),t.push(...r.map(xo.parse)));const i=e.match(_2);return i&&(e=e.replace(_2,SB),t.push(...i.map(rp.parse))),{values:t,numColors:n,tokenised:e}}function wB(e){return xB(e).values}function CB(e){const{values:t,numColors:n,tokenised:r}=xB(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function Nce(e){const t=wB(e);return CB(e)(t.map(Dce))}const Ju={test:Rce,parse:wB,createTransformer:CB,getAnimatableNone:Nce},jce=new Set(["brightness","contrast","saturate","opacity"]);function Bce(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(_2)||[];if(!r)return e;const i=n.replace(r,"");let o=jce.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const $ce=/([a-z-]*)\(.*?\)/g,v7=Object.assign(Object.assign({},Ju),{getAnimatableNone:e=>{const t=e.match($ce);return t?t.map(Bce).join(" "):e}}),pA={...rp,transform:Math.round},_B={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,size:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,rotate:cd,rotateX:cd,rotateY:cd,rotateZ:cd,scale:Y3,scaleX:Y3,scaleY:Y3,scaleZ:Y3,skew:cd,skewX:cd,skewY:cd,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:Hv,originX:hA,originY:hA,originZ:Lt,zIndex:pA,fillOpacity:Hv,strokeOpacity:Hv,numOctaves:pA};function D_(e,t,n,r){const{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let u=!1,d=!1,h=!0;for(const m in t){const v=t[m];if(mB(m)){o[m]=v;continue}const b=_B[m],S=Tce(v,b);if(g0.has(m)){if(u=!0,a[m]=S,s.push(m),!h)continue;v!==(b.default||0)&&(h=!1)}else m.startsWith("origin")?(d=!0,l[m]=S):i[m]=S}if(t.transform||(u||r?i.transform=Pce(e,n,h,r):i.transform&&(i.transform="none")),d){const{originX:m="50%",originY:v="50%",originZ:b=0}=l;i.transformOrigin=`${m} ${v} ${b}`}}const N_=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function kB(e,t,n){for(const r in t)!ou(t[r])&&!gB(r,n)&&(e[r]=t[r])}function Fce({transformTemplate:e},t,n){return w.useMemo(()=>{const r=N_();return D_(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function zce(e,t,n){const r=e.style||{},i={};return kB(i,r,e),Object.assign(i,Fce(e,t,n)),e.transformValues?e.transformValues(i):i}function Hce(e,t,n){const r={},i=zce(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),r.style=i,r}const Vce=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],Wce=["whileTap","onTap","onTapStart","onTapCancel"],Uce=["onPan","onPanStart","onPanSessionStart","onPanEnd"],Gce=["whileInView","onViewportEnter","onViewportLeave","viewport"],qce=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...Gce,...Wce,...Vce,...Uce]);function Q4(e){return qce.has(e)}let EB=e=>!Q4(e);function Yce(e){e&&(EB=t=>t.startsWith("on")?!Q4(t):e(t))}try{Yce(require("@emotion/is-prop-valid").default)}catch{}function Kce(e,t,n){const r={};for(const i in e)(EB(i)||n===!0&&Q4(i)||!t&&!Q4(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function gA(e,t,n){return typeof e=="string"?e:Lt.transform(t+n*e)}function Xce(e,t,n){const r=gA(t,e.x,e.width),i=gA(n,e.y,e.height);return`${r} ${i}`}const Zce={offset:"stroke-dashoffset",array:"stroke-dasharray"},Qce={offset:"strokeDashoffset",array:"strokeDasharray"};function Jce(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?Zce:Qce;e[o.offset]=Lt.transform(-r);const a=Lt.transform(t),s=Lt.transform(n);e[o.array]=`${a} ${s}`}function j_(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,d){D_(e,l,u,d),e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Xce(v,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),o!==void 0&&Jce(h,o,a,s,!1)}const PB=()=>({...N_(),attrs:{}});function ede(e,t){const n=w.useMemo(()=>{const r=PB();return j_(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};kB(r,e.style,e),n.style={...r,...n.style}}return n}function tde(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=(I_(n)?ede:Hce)(r,a,s),h={...Kce(r,typeof n=="string",e),...u,ref:o};return i&&(h["data-projection-id"]=i),w.createElement(n,h)}}const TB=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function LB(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const AB=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function OB(e,t,n,r){LB(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(AB.has(i)?i:TB(i),t.attrs[i])}function B_(e){const{style:t}=e,n={};for(const r in t)(ou(t[r])||gB(r,e))&&(n[r]=t[r]);return n}function MB(e){const t=B_(e);for(const n in e)if(ou(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function $_(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const k2=e=>Array.isArray(e),nde=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),IB=e=>k2(e)?e[e.length-1]||0:e;function c4(e){const t=ou(e)?e.get():e;return nde(t)?t.toValue():t}function rde({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:ide(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const RB=e=>(t,n)=>{const r=w.useContext(NS),i=w.useContext(p0),o=()=>rde(e,t,r,i);return n?o():$S(o)};function ide(e,t,n,r){const i={},o=r(e);for(const m in o)i[m]=c4(o[m]);let{initial:a,animate:s}=e;const l=BS(e),u=hB(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?s:a;return h&&typeof h!="boolean"&&!jS(h)&&(Array.isArray(h)?h:[h]).forEach(v=>{const b=$_(e,v);if(!b)return;const{transitionEnd:S,transition:k,...E}=b;for(const _ in E){let T=E[_];if(Array.isArray(T)){const A=d?T.length-1:0;T=T[A]}T!==null&&(i[_]=T)}for(const _ in S)i[_]=S[_]}),i}const ode={useVisualState:RB({scrapeMotionValuesFromProps:MB,createRenderState:PB,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}j_(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),OB(t,n)}})},ade={useVisualState:RB({scrapeMotionValuesFromProps:B_,createRenderState:N_})};function sde(e,{forwardMotionProps:t=!1},n,r,i){return{...I_(e)?ode:ade,preloadedFeatures:n,useRender:tde(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}}var tr;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(tr||(tr={}));function FS(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function y7(e,t,n,r){w.useEffect(()=>{const i=e.current;if(n&&i)return FS(i,t,n,r)},[e,t,n,r])}function lde({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(tr.Focus,!0)},i=()=>{n&&n.setActive(tr.Focus,!1)};y7(t,"focus",e?r:void 0),y7(t,"blur",e?i:void 0)}function DB(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function NB(e){return!!e.touches}function ude(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const cde={pageX:0,pageY:0};function dde(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||cde;return{x:r[t+"X"],y:r[t+"Y"]}}function fde(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function F_(e,t="page"){return{point:NB(e)?dde(e,t):fde(e,t)}}const jB=(e,t=!1)=>{const n=r=>e(r,F_(r));return t?ude(n):n},hde=()=>np&&window.onpointerdown===null,pde=()=>np&&window.ontouchstart===null,gde=()=>np&&window.onmousedown===null,mde={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},vde={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function BB(e){return hde()?e:pde()?vde[e]:gde()?mde[e]:e}function Sm(e,t,n,r){return FS(e,BB(t),jB(n,t==="pointerdown"),r)}function J4(e,t,n,r){return y7(e,BB(t),n&&jB(n,t==="pointerdown"),r)}function $B(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const mA=$B("dragHorizontal"),vA=$B("dragVertical");function FB(e){let t=!1;if(e==="y")t=vA();else if(e==="x")t=mA();else{const n=mA(),r=vA();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function zB(){const e=FB(!0);return e?(e(),!1):!0}function yA(e,t,n){return(r,i)=>{!DB(r)||zB()||(e.animationState&&e.animationState.setActive(tr.Hover,t),n&&n(r,i))}}function yde({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){J4(r,"pointerenter",e||n?yA(r,!0,e):void 0,{passive:!e}),J4(r,"pointerleave",t||n?yA(r,!1,t):void 0,{passive:!t})}const HB=(e,t)=>t?e===t?!0:HB(e,t.parentElement):!1;function z_(e){return w.useEffect(()=>()=>e(),[])}function VB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),d6=.001,Sde=.01,bA=10,xde=.05,wde=1;function Cde({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;bde(e<=bA*1e3);let a=1-t;a=t5(xde,wde,a),e=t5(Sde,bA,e/1e3),a<1?(i=u=>{const d=u*a,h=d*e,m=d-n,v=b7(u,a),b=Math.exp(-h);return d6-m/v*b},o=u=>{const h=u*a*e,m=h*n+n,v=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-h),S=b7(Math.pow(u,2),a);return(-i(u)+d6>0?-1:1)*((m-v)*b)/S}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-d6+d*h},o=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const s=5/e,l=kde(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const _de=12;function kde(e,t,n){let r=n;for(let i=1;i<_de;i++)r=r-e(r)/t(r);return r}function b7(e,t){return e*Math.sqrt(1-t*t)}const Ede=["duration","bounce"],Pde=["stiffness","damping","mass"];function SA(e,t){return t.some(n=>e[n]!==void 0)}function Tde(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!SA(e,Pde)&&SA(e,Ede)){const n=Cde(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function H_(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=VB(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:s,damping:l,mass:u,velocity:d,duration:h,isResolvedFromDuration:m}=Tde(o),v=xA,b=xA;function S(){const k=d?-(d/1e3):0,E=n-t,_=l/(2*Math.sqrt(s*u)),T=Math.sqrt(s/u)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),_<1){const A=b7(T,_);v=I=>{const R=Math.exp(-_*T*I);return n-R*((k+_*T*E)/A*Math.sin(A*I)+E*Math.cos(A*I))},b=I=>{const R=Math.exp(-_*T*I);return _*T*R*(Math.sin(A*I)*(k+_*T*E)/A+E*Math.cos(A*I))-R*(Math.cos(A*I)*(k+_*T*E)-A*E*Math.sin(A*I))}}else if(_===1)v=A=>n-Math.exp(-T*A)*(E+(k+T*E)*A);else{const A=T*Math.sqrt(_*_-1);v=I=>{const R=Math.exp(-_*T*I),D=Math.min(A*I,300);return n-R*((k+_*T*E)*Math.sinh(D)+A*E*Math.cosh(D))/A}}}return S(),{next:k=>{const E=v(k);if(m)a.done=k>=h;else{const _=b(k)*1e3,T=Math.abs(_)<=r,A=Math.abs(n-E)<=i;a.done=T&&A}return a.value=a.done?n:E,a},flipTarget:()=>{d=-d,[t,n]=[n,t],S()}}}H_.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const xA=e=>0,E2=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Fr=(e,t,n)=>-n*e+n*t+e;function f6(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function wA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=f6(l,s,e+1/3),o=f6(l,s,e),a=f6(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const Lde=(e,t,n)=>{const r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},Ade=[m7,wd,Ch],CA=e=>Ade.find(t=>t.test(e)),WB=(e,t)=>{let n=CA(e),r=CA(t),i=n.parse(e),o=r.parse(t);n===Ch&&(i=wA(i),n=wd),r===Ch&&(o=wA(o),r=wd);const a=Object.assign({},i);return s=>{for(const l in a)l!=="alpha"&&(a[l]=Lde(i[l],o[l],s));return a.alpha=Fr(i.alpha,o.alpha,s),n.transform(a)}},S7=e=>typeof e=="number",Ode=(e,t)=>n=>t(e(n)),zS=(...e)=>e.reduce(Ode);function UB(e,t){return S7(e)?n=>Fr(e,t,n):xo.test(e)?WB(e,t):qB(e,t)}const GB=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>UB(o,t[a]));return o=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=UB(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}};function _A(e){const t=Ju.parse(e),n=t.length;let r=0,i=0,o=0;for(let a=0;a{const n=Ju.createTransformer(t),r=_A(e),i=_A(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?zS(GB(r.parsed,i.parsed),n):a=>`${a>0?t:e}`},Ide=(e,t)=>n=>Fr(e,t,n);function Rde(e){if(typeof e=="number")return Ide;if(typeof e=="string")return xo.test(e)?WB:qB;if(Array.isArray(e))return GB;if(typeof e=="object")return Mde}function Dde(e,t,n){const r=[],i=n||Rde(e[0]),o=e.length-1;for(let a=0;an(E2(e,t,r))}function jde(e,t){const n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let l=1;for(;li||l===r);l++);o=l-1}const s=E2(e[o],e[o+1],i);return t[o](s)}}function YB(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;e5(o===t.length),e5(!r||!Array.isArray(r)||r.length===o-1),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=Dde(t,r,i),s=o===2?Nde(e,a):jde(e,a);return n?l=>s(t5(e[0],e[o-1],l)):s}const HS=e=>t=>1-e(1-t),V_=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Bde=e=>t=>Math.pow(t,e),KB=e=>t=>t*t*((e+1)*t-e),$de=e=>{const t=KB(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},XB=1.525,Fde=4/11,zde=8/11,Hde=9/10,W_=e=>e,U_=Bde(2),Vde=HS(U_),ZB=V_(U_),QB=e=>1-Math.sin(Math.acos(e)),G_=HS(QB),Wde=V_(G_),q_=KB(XB),Ude=HS(q_),Gde=V_(q_),qde=$de(XB),Yde=4356/361,Kde=35442/1805,Xde=16061/1805,n5=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-n5(1-e*2)):.5*n5(e*2-1)+.5;function Jde(e,t){return e.map(()=>t||ZB).splice(0,e.length-1)}function efe(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function tfe(e,t){return e.map(n=>n*t)}function d4({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){const o={done:!1,value:e},a=Array.isArray(t)?t:[e,t],s=tfe(r&&r.length===a.length?r:efe(a),i);function l(){return YB(s,a,{ease:Array.isArray(n)?n:Jde(a,n)})}let u=l();return{next:d=>(o.value=u(d),o.done=d>=i,o),flipTarget:()=>{a.reverse(),u=l()}}}function nfe({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a={done:!1,value:t};let s=n*e;const l=t+s,u=o===void 0?l:o(l);return u!==l&&(s=u-t),{next:d=>{const h=-s*Math.exp(-d/r);return a.done=!(h>i||h<-i),a.value=a.done?u:u+h,a},flipTarget:()=>{}}}const kA={keyframes:d4,spring:H_,decay:nfe};function rfe(e){if(Array.isArray(e.to))return d4;if(kA[e.type])return kA[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?d4:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?H_:d4}const JB=1/60*1e3,ife=typeof performance<"u"?()=>performance.now():()=>Date.now(),e$=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(ife()),JB);function ofe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=ofe(()=>P2=!0),e),{}),sfe=vy.reduce((e,t)=>{const n=VS[t];return e[t]=(r,i=!1,o=!1)=>(P2||cfe(),n.schedule(r,i,o)),e},{}),lfe=vy.reduce((e,t)=>(e[t]=VS[t].cancel,e),{});vy.reduce((e,t)=>(e[t]=()=>VS[t].process(xm),e),{});const ufe=e=>VS[e].process(xm),t$=e=>{P2=!1,xm.delta=x7?JB:Math.max(Math.min(e-xm.timestamp,afe),1),xm.timestamp=e,w7=!0,vy.forEach(ufe),w7=!1,P2&&(x7=!1,e$(t$))},cfe=()=>{P2=!0,x7=!0,w7||e$(t$)},dfe=()=>xm;function n$(e,t,n=0){return e-t-n}function ffe(e,t,n=0,r=!0){return r?n$(t+-e,t,n):t-(e-t)+n}function hfe(e,t,n,r){return r?e>=t+n:e<=-n}const pfe=e=>{const t=({delta:n})=>e(n);return{start:()=>sfe.update(t,!0),stop:()=>lfe.update(t)}};function r$(e){var t,n,{from:r,autoplay:i=!0,driver:o=pfe,elapsed:a=0,repeat:s=0,repeatType:l="loop",repeatDelay:u=0,onPlay:d,onStop:h,onComplete:m,onRepeat:v,onUpdate:b}=e,S=VB(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:k}=S,E,_=0,T=S.duration,A,I=!1,R=!0,D;const j=rfe(S);!((n=(t=j).needsInterpolation)===null||n===void 0)&&n.call(t,r,k)&&(D=YB([0,100],[r,k],{clamp:!1}),r=0,k=100);const z=j(Object.assign(Object.assign({},S),{from:r,to:k}));function V(){_++,l==="reverse"?(R=_%2===0,a=ffe(a,T,u,R)):(a=n$(a,T,u),l==="mirror"&&z.flipTarget()),I=!1,v&&v()}function K(){E.stop(),m&&m()}function te($){if(R||($=-$),a+=$,!I){const U=z.next(Math.max(0,a));A=U.value,D&&(A=D(A)),I=R?U.done:a<=0}b==null||b(A),I&&(_===0&&(T??(T=a)),_{h==null||h(),E.stop()}}}function i$(e,t){return t?e*(1e3/t):0}function gfe({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:d,onUpdate:h,onComplete:m,onStop:v}){let b;function S(T){return n!==void 0&&Tr}function k(T){return n===void 0?r:r===void 0||Math.abs(n-T){var I;h==null||h(A),(I=T.onUpdate)===null||I===void 0||I.call(T,A)},onComplete:m,onStop:v}))}function _(T){E(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},T))}if(S(e))_({from:e,velocity:t,to:k(e)});else{let T=i*t+e;typeof u<"u"&&(T=u(T));const A=k(T),I=A===n?-1:1;let R,D;const j=z=>{R=D,D=z,t=i$(z-R,dfe().delta),(I===1&&z>A||I===-1&&zb==null?void 0:b.stop()}}const C7=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),EA=e=>C7(e)&&e.hasOwnProperty("z"),K3=(e,t)=>Math.abs(e-t);function Y_(e,t){if(S7(e)&&S7(t))return K3(e,t);if(C7(e)&&C7(t)){const n=K3(e.x,t.x),r=K3(e.y,t.y),i=EA(e)&&EA(t)?K3(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}const o$=(e,t)=>1-3*t+3*e,a$=(e,t)=>3*t-6*e,s$=e=>3*e,r5=(e,t,n)=>((o$(t,n)*e+a$(t,n))*e+s$(t))*e,l$=(e,t,n)=>3*o$(t,n)*e*e+2*a$(t,n)*e+s$(t),mfe=1e-7,vfe=10;function yfe(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=r5(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>mfe&&++s=Sfe?xfe(a,h,e,n):m===0?h:yfe(a,s,s+X3,e,n)}return a=>a===0||a===1?a:r5(o(a),t,r)}function Cfe({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(!1),s=w.useRef(null),l={passive:!(t||e||n||v)};function u(){s.current&&s.current(),s.current=null}function d(){return u(),a.current=!1,i.animationState&&i.animationState.setActive(tr.Tap,!1),!zB()}function h(b,S){d()&&(HB(i.current,b.target)?e&&e(b,S):n&&n(b,S))}function m(b,S){d()&&n&&n(b,S)}function v(b,S){u(),!a.current&&(a.current=!0,s.current=zS(Sm(window,"pointerup",h,l),Sm(window,"pointercancel",m,l)),i.animationState&&i.animationState.setActive(tr.Tap,!0),t&&t(b,S))}J4(i,"pointerdown",o?v:void 0,l),z_(u)}const _fe="production",u$=typeof process>"u"||process.env===void 0?_fe:"production",PA=new Set;function c$(e,t,n){e||PA.has(t)||(console.warn(t),n&&console.warn(n),PA.add(t))}const _7=new WeakMap,h6=new WeakMap,kfe=e=>{const t=_7.get(e.target);t&&t(e)},Efe=e=>{e.forEach(kfe)};function Pfe({root:e,...t}){const n=e||document;h6.has(n)||h6.set(n,{});const r=h6.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Efe,{root:e,...t})),r[i]}function Tfe(e,t,n){const r=Pfe(t);return _7.set(e,n),r.observe(e),()=>{_7.delete(e),r.unobserve(e)}}function Lfe({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){const o=w.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?Mfe:Ofe)(a,o.current,e,i)}const Afe={some:0,all:1};function Ofe(e,t,n,{root:r,margin:i,amount:o="some",once:a}){w.useEffect(()=>{if(!e||!n.current)return;const s={root:r==null?void 0:r.current,rootMargin:i,threshold:typeof o=="number"?o:Afe[o]},l=u=>{const{isIntersecting:d}=u;if(t.isInView===d||(t.isInView=d,a&&!d&&t.hasEnteredView))return;d&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(tr.InView,d);const h=n.getProps(),m=d?h.onViewportEnter:h.onViewportLeave;m&&m(u)};return Tfe(n.current,s,l)},[e,r,i,o])}function Mfe(e,t,n,{fallback:r=!0}){w.useEffect(()=>{!e||!r||(u$!=="production"&&c$(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:i}=n.getProps();i&&i(null),n.animationState&&n.animationState.setActive(tr.InView,!0)}))},[e])}const Cd=e=>t=>(e(t),null),Ife={inView:Cd(Lfe),tap:Cd(Cfe),focus:Cd(lde),hover:Cd(yde)};function K_(){const e=w.useContext(p0);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=w.useId();return w.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function Rfe(){return Dfe(w.useContext(p0))}function Dfe(e){return e===null?!0:e.isPresent}function d$(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,Nfe={linear:W_,easeIn:U_,easeInOut:ZB,easeOut:Vde,circIn:QB,circInOut:Wde,circOut:G_,backIn:q_,backInOut:Gde,backOut:Ude,anticipate:qde,bounceIn:Zde,bounceInOut:Qde,bounceOut:n5},TA=e=>{if(Array.isArray(e)){e5(e.length===4);const[t,n,r,i]=e;return wfe(t,n,r,i)}else if(typeof e=="string")return Nfe[e];return e},jfe=e=>Array.isArray(e)&&typeof e[0]!="number",LA=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&Ju.test(t)&&!t.startsWith("url(")),rh=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Z3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),p6=()=>({type:"keyframes",ease:"linear",duration:.3}),Bfe=e=>({type:"keyframes",duration:.8,values:e}),AA={x:rh,y:rh,z:rh,rotate:rh,rotateX:rh,rotateY:rh,rotateZ:rh,scaleX:Z3,scaleY:Z3,scale:Z3,opacity:p6,backgroundColor:p6,color:p6,default:Z3},$fe=(e,t)=>{let n;return k2(t)?n=Bfe:n=AA[e]||AA.default,{to:t,...n(t)}},Ffe={..._B,color:xo,backgroundColor:xo,outlineColor:xo,fill:xo,stroke:xo,borderColor:xo,borderTopColor:xo,borderRightColor:xo,borderBottomColor:xo,borderLeftColor:xo,filter:v7,WebkitFilter:v7},X_=e=>Ffe[e];function Z_(e,t){var n;let r=X_(e);return r!==v7&&(r=Ju),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const zfe={current:!1},f$=1/60*1e3,Hfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),h$=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Hfe()),f$);function Vfe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=Vfe(()=>T2=!0),e),{}),Gs=yy.reduce((e,t)=>{const n=WS[t];return e[t]=(r,i=!1,o=!1)=>(T2||Gfe(),n.schedule(r,i,o)),e},{}),Vh=yy.reduce((e,t)=>(e[t]=WS[t].cancel,e),{}),g6=yy.reduce((e,t)=>(e[t]=()=>WS[t].process(wm),e),{}),Ufe=e=>WS[e].process(wm),p$=e=>{T2=!1,wm.delta=k7?f$:Math.max(Math.min(e-wm.timestamp,Wfe),1),wm.timestamp=e,E7=!0,yy.forEach(Ufe),E7=!1,T2&&(k7=!1,h$(p$))},Gfe=()=>{T2=!0,k7=!0,E7||h$(p$)},P7=()=>wm;function g$(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Vh.read(r),e(o-t))};return Gs.read(r,!0),()=>Vh.read(r)}function qfe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...u}){return!!Object.keys(u).length}function Yfe({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){const a={...o};return t&&(a.offset=t),o.duration&&(a.duration=i5(o.duration)),o.repeatDelay&&(a.repeatDelay=i5(o.repeatDelay)),e&&(a.ease=jfe(e)?e.map(TA):TA(e)),o.type==="tween"&&(a.type="keyframes"),(n||i||r)&&(n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),o.type!=="spring"&&(a.type="keyframes"),a}function Kfe(e,t){var n,r;return(r=(n=(Q_(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function Xfe(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function Zfe(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),Xfe(t),qfe(e)||(e={...e,...$fe(n,t.to)}),{...t,...Yfe(e)}}function Qfe(e,t,n,r,i){const o=Q_(r,e)||{};let a=o.from!==void 0?o.from:t.get();const s=LA(e,n);a==="none"&&s&&typeof n=="string"?a=Z_(e,n):OA(a)&&typeof n=="string"?a=MA(n):!Array.isArray(n)&&OA(n)&&typeof a=="string"&&(n=MA(a));const l=LA(e,a);function u(){const h={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:m=>t.set(m)};return o.type==="inertia"||o.type==="decay"?gfe({...h,...o}):r$({...Zfe(o,h,e),onUpdate:m=>{h.onUpdate(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{h.onComplete(),o.onComplete&&o.onComplete()}})}function d(){const h=IB(n);return t.set(h),i(),o.onUpdate&&o.onUpdate(h),o.onComplete&&o.onComplete(),{stop:()=>{}}}return!l||!s||o.type===!1?d:u}function OA(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function MA(e){return typeof e=="number"?0:Z_("",e)}function Q_(e,t){return e[t]||e.default||e}function J_(e,t,n,r={}){return zfe.current&&(r={type:!1}),t.start(i=>{let o;const a=Qfe(e,t,n,r,i),s=Kfe(r,e),l=()=>o=a();let u;return s?u=g$(l,i5(s)):l(),()=>{u&&u(),o&&o.stop()}})}const Jfe=e=>/^\-?\d*\.?\d+$/.test(e),ehe=e=>/^0[^.\s]+$/.test(e);function ek(e,t){e.indexOf(t)===-1&&e.push(t)}function tk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Vv{constructor(){this.subscriptions=[]}add(t){return ek(this.subscriptions,t),()=>tk(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class nhe{constructor(t){this.version="7.6.9",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Vv,this.velocityUpdateSubscribers=new Vv,this.renderSubscribers=new Vv,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=P7();this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,Gs.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Gs.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=the(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?i$(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Vm(e){return new nhe(e)}const m$=e=>t=>t.test(e),rhe={test:e=>e==="auto",parse:e=>e},v$=[rp,Lt,Xl,cd,Oce,Ace,rhe],V1=e=>v$.find(m$(e)),ihe=[...v$,xo,Ju],ohe=e=>ihe.find(m$(e));function ahe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function she(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function US(e,t,n){const r=e.getProps();return $_(r,t,n!==void 0?n:r.custom,ahe(e),she(e))}function lhe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Vm(n))}function uhe(e,t){const n=US(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=IB(o[a]);lhe(e,a,s)}}function che(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;sT7(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=T7(e,t,n);else{const i=typeof t=="function"?US(e,t,n.custom):t;r=y$(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function T7(e,t,n={}){var r;const i=US(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const a=i?()=>y$(e,i,n):()=>Promise.resolve(),s=!((r=e.variantChildren)===null||r===void 0)&&r.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=o;return phe(e,t,d+u,h,m,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[a,s]:[s,a];return u().then(d)}else return Promise.all([a(),s(n.delay)])}function y$(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const u=e.getValue("willChange");r&&(a=r);const d=[],h=i&&((o=e.animationState)===null||o===void 0?void 0:o.getState()[i]);for(const m in l){const v=e.getValue(m),b=l[m];if(!v||b===void 0||h&&mhe(h,m))continue;let S={delay:n,...a};e.shouldReduceMotion&&g0.has(m)&&(S={...S,type:!1,delay:0});let k=J_(m,v,b,S);o5(u)&&(u.add(m),k=k.then(()=>u.remove(m))),d.push(k)}return Promise.all(d).then(()=>{s&&uhe(e,s)})}function phe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(ghe).forEach((u,d)=>{a.push(T7(u,t,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function ghe(e,t){return e.sortNodePosition(t)}function mhe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const nk=[tr.Animate,tr.InView,tr.Focus,tr.Hover,tr.Tap,tr.Drag,tr.Exit],vhe=[...nk].reverse(),yhe=nk.length;function bhe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>hhe(e,n,r)))}function She(e){let t=bhe(e);const n=whe();let r=!0;const i=(l,u)=>{const d=US(e,u);if(d){const{transition:h,transitionEnd:m,...v}=d;l={...l,...v,...m}}return l};function o(l){t=l(e)}function a(l,u){var d;const h=e.getProps(),m=e.getVariantContext(!0)||{},v=[],b=new Set;let S={},k=1/0;for(let _=0;_k&&R;const K=Array.isArray(I)?I:[I];let te=K.reduce(i,{});D===!1&&(te={});const{prevResolvedValues:q={}}=A,$={...q,...te},U=X=>{V=!0,b.delete(X),A.needsAnimating[X]=!0};for(const X in $){const Z=te[X],W=q[X];S.hasOwnProperty(X)||(Z!==W?k2(Z)&&k2(W)?!d$(Z,W)||z?U(X):A.protectedKeys[X]=!0:Z!==void 0?U(X):b.add(X):Z!==void 0&&b.has(X)?U(X):A.protectedKeys[X]=!0)}A.prevProp=I,A.prevResolvedValues=te,A.isActive&&(S={...S,...te}),r&&e.blockInitialAnimation&&(V=!1),V&&!j&&v.push(...K.map(X=>({animation:X,options:{type:T,...l}})))}if(b.size){const _={};b.forEach(T=>{const A=e.getBaseTarget(T);A!==void 0&&(_[T]=A)}),v.push({animation:_})}let E=Boolean(v.length);return r&&h.initial===!1&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,E?t(v):Promise.resolve()}function s(l,u,d){var h;if(n[l].isActive===u)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(v=>{var b;return(b=v.animationState)===null||b===void 0?void 0:b.setActive(l,u)}),n[l].isActive=u;const m=a(d,l);for(const v in n)n[v].protectedKeys={};return m}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function xhe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!d$(t,e):!1}function ih(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function whe(){return{[tr.Animate]:ih(!0),[tr.InView]:ih(),[tr.Hover]:ih(),[tr.Tap]:ih(),[tr.Drag]:ih(),[tr.Focus]:ih(),[tr.Exit]:ih()}}const Che={animation:Cd(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=She(e)),jS(t)&&w.useEffect(()=>t.subscribe(e),[t])}),exit:Cd(e=>{const{custom:t,visualElement:n}=e,[r,i]=K_(),o=w.useContext(p0);w.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(tr.Exit,!r,{custom:o&&o.custom||t});a&&!r&&a.then(i)},[r])})};class b${constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=v6(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=Y_(u.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:m}=u,{timestamp:v}=P7();this.history.push({...m,timestamp:v});const{onStart:b,onMove:S}=this.handlers;d||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{if(this.lastMoveEvent=u,this.lastMoveEventInfo=m6(d,this.transformPagePoint),DB(u)&&u.buttons===0){this.handlePointerUp(u,d);return}Gs.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{this.end();const{onEnd:h,onSessionEnd:m}=this.handlers,v=v6(m6(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,v),m&&m(u,v)},NB(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const i=F_(t),o=m6(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=P7();this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,v6(o,this.history)),this.removeListeners=zS(Sm(window,"pointermove",this.handlePointerMove),Sm(window,"pointerup",this.handlePointerUp),Sm(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Vh.update(this.updatePoint)}}function m6(e,t){return t?{point:t(e.point)}:e}function IA(e,t){return{x:e.x-t.x,y:e.y-t.y}}function v6({point:e},t){return{point:e,delta:IA(e,S$(t)),offset:IA(e,_he(t)),velocity:khe(t,.1)}}function _he(e){return e[0]}function S$(e){return e[e.length-1]}function khe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=S$(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>i5(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Oa(e){return e.max-e.min}function RA(e,t=0,n=.01){return Y_(e,t)n&&(e=r?Fr(n,e,r.max):Math.min(e,n)),e}function BA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function The(e,{top:t,left:n,bottom:r,right:i}){return{x:BA(e.x,n,i),y:BA(e.y,t,r)}}function $A(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=E2(t.min,t.max-r,e.min):r>i&&(n=E2(e.min,e.max-i,t.min)),t5(0,1,n)}function Ohe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const L7=.35;function Mhe(e=L7){return e===!1?e=0:e===!0&&(e=L7),{x:FA(e,"left","right"),y:FA(e,"top","bottom")}}function FA(e,t,n){return{min:zA(e,t),max:zA(e,n)}}function zA(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const HA=()=>({translate:0,scale:1,origin:0,originPoint:0}),Gv=()=>({x:HA(),y:HA()}),VA=()=>({min:0,max:0}),pi=()=>({x:VA(),y:VA()});function Rl(e){return[e("x"),e("y")]}function x$({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ihe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Rhe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function y6(e){return e===void 0||e===1}function A7({scale:e,scaleX:t,scaleY:n}){return!y6(e)||!y6(t)||!y6(n)}function ch(e){return A7(e)||w$(e)||e.z||e.rotate||e.rotateX||e.rotateY}function w$(e){return WA(e.x)||WA(e.y)}function WA(e){return e&&e!=="0%"}function a5(e,t,n){const r=e-n,i=t*r;return n+i}function UA(e,t,n,r,i){return i!==void 0&&(e=a5(e,i,r)),a5(e,n,r)+t}function O7(e,t=0,n=1,r,i){e.min=UA(e.min,t,n,r,i),e.max=UA(e.max,t,n,r,i)}function C$(e,{x:t,y:n}){O7(e.x,t.translate,t.scale,t.originPoint),O7(e.y,n.translate,n.scale,n.originPoint)}function Dhe(e,t,n,r=!1){var i,o;const a=n.length;if(!a)return;t.x=t.y=1;let s,l;for(let u=0;u{this.stopAnimation(),n&&this.snapToCursor(F_(s,"page").point)},i=(s,l)=>{var u;const{drag:d,dragPropagation:h,onDragStart:m}=this.getProps();d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=FB(d),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Rl(v=>{var b,S;let k=this.getAxisMotionValue(v).get()||0;if(Xl.test(k)){const E=(S=(b=this.visualElement.projection)===null||b===void 0?void 0:b.layout)===null||S===void 0?void 0:S.layoutBox[v];E&&(k=Oa(E)*(parseFloat(k)/100))}this.originPoint[v]=k}),m==null||m(s,l),(u=this.visualElement.animationState)===null||u===void 0||u.setActive(tr.Drag,!0))},o=(s,l)=>{const{dragPropagation:u,dragDirectionLock:d,onDirectionLock:h,onDrag:m}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:v}=l;if(d&&this.currentDirection===null){this.currentDirection=zhe(v),this.currentDirection!==null&&(h==null||h(this.currentDirection));return}this.updateAxis("x",l.point,v),this.updateAxis("y",l.point,v),this.visualElement.render(),m==null||m(s,l)},a=(s,l)=>this.stop(s,l);this.panSession=new b$(t,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o==null||o(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(tr.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Q3(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Phe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Hg(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=The(r.layoutBox,t):this.constraints=!1,this.elastic=Mhe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Rl(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Ohe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Hg(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Bhe(r,i.root,this.visualElement.getTransformPagePoint());let a=Lhe(i.layout.layoutBox,o);if(n){const s=n(Ihe(a));this.hasMutatedConstraints=!!s,s&&(a=x$(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Rl(d=>{var h;if(!Q3(d,n,this.currentDirection))return;let m=(h=l==null?void 0:l[d])!==null&&h!==void 0?h:{};a&&(m={min:0,max:0});const v=i?200:1e6,b=i?40:1e7,S={type:"inertia",velocity:r?t[d]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(d,S)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return J_(t,r,0,n)}stopAnimation(){Rl(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){Rl(n=>{const{drag:r}=this.getProps();if(!Q3(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-Fr(a,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!Hg(r)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Rl(s=>{const l=this.getAxisMotionValue(s);if(l){const u=l.get();o[s]=Ahe({min:u,max:u},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",(t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Rl(s=>{if(!Q3(s,n,null))return;const l=this.getAxisMotionValue(s),{min:u,max:d}=this.constraints[s];l.set(Fr(u,d,o[s]))})}addListeners(){var t;if(!this.visualElement.current)return;$he.set(this.visualElement,this);const n=this.visualElement.current,r=Sm(n,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps();d&&h&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();Hg(u)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",i);o&&!o.layout&&((t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout()),i();const s=FS(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Rl(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=u[h].translate,m.set(m.get()+u[h].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),l==null||l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=L7,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function Q3(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function zhe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function Hhe(e){const{dragControls:t,visualElement:n}=e,r=$S(()=>new Fhe(n));w.useEffect(()=>t&&t.subscribe(r),[r,t]),w.useEffect(()=>r.addListeners(),[r])}function Vhe({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(null),{transformPagePoint:s}=w.useContext(O_),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(d,h)=>{a.current=null,n&&n(d,h)}};w.useEffect(()=>{a.current!==null&&a.current.updateHandlers(l)});function u(d){a.current=new b$(d,l,{transformPagePoint:s})}J4(i,"pointerdown",o&&u),z_(()=>a.current&&a.current.end())}const Whe={pan:Cd(Vhe),drag:Cd(Hhe)};function M7(e){return typeof e=="string"&&e.startsWith("var(--")}const k$=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Uhe(e){const t=k$.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function I7(e,t,n=1){const[r,i]=Uhe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():M7(i)?I7(i,t,n+1):i}function Ghe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!M7(o))return;const a=I7(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!M7(o))continue;const a=I7(o,r);a&&(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const qhe=new Set(["width","height","top","left","right","bottom","x","y"]),E$=e=>qhe.has(e),Yhe=e=>Object.keys(e).some(E$),P$=(e,t)=>{e.set(t,!1),e.set(t)},qA=e=>e===rp||e===Lt;var YA;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(YA||(YA={}));const KA=(e,t)=>parseFloat(e.split(", ")[t]),XA=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return KA(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?KA(o[1],e):0}},Khe=new Set(["x","y","z"]),Xhe=Z4.filter(e=>!Khe.has(e));function Zhe(e){const t=[];return Xhe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const ZA={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:XA(4,13),y:XA(5,14)},Qhe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=ZA[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const d=t.getValue(u);P$(d,s[u]),e[u]=ZA[u](l,o)}),e},Jhe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(E$);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],h=V1(d);const m=t[l];let v;if(k2(m)){const b=m.length,S=m[0]===null?1:0;d=m[S],h=V1(d);for(let k=S;k=0?window.pageYOffset:null,u=Qhe(t,e,s);return o.length&&o.forEach(([d,h])=>{e.getValue(d).set(h)}),e.render(),np&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function epe(e,t,n,r){return Yhe(t)?Jhe(e,t,n,r):{target:t,transitionEnd:r}}const tpe=(e,t,n,r)=>{const i=Ghe(e,t,r);return t=i.target,r=i.transitionEnd,epe(e,t,n,r)},R7={current:null},T$={current:!1};function npe(){if(T$.current=!0,!!np)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>R7.current=e.matches;e.addListener(t),t()}else R7.current=!1}function rpe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(ou(o))e.addValue(i,o),o5(r)&&r.add(i);else if(ou(a))e.addValue(i,Vm(o)),o5(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,Vm(s!==void 0?s:o))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const L$=Object.keys(C2),ipe=L$.length,QA=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ope{constructor({parent:t,props:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Gs.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=s,this.parent=t,this.props=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=BS(n),this.isVariantNode=hB(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n);for(const d in u){const h=u[d];a[d]!==void 0&&ou(h)&&(h.set(a[d],!1),o5(l)&&l.add(d))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var n;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(n=this.parent)===null||n===void 0?void 0:n.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),T$.current||npe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:R7.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,n,r;(t=this.projection)===null||t===void 0||t.unmount(),Vh.update(this.notifyUpdate),Vh.render(this.render),this.valueSubscriptions.forEach(i=>i()),(n=this.removeFromVariantTree)===null||n===void 0||n.call(this),(r=this.parent)===null||r===void 0||r.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(t,n){const r=g0.has(t),i=n.onChange(a=>{this.latestValues[t]=a,this.props.onUpdate&&Gs.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isProjectionDirty=!0)}),o=n.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures(t,n,r,i,o,a){const s=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:m})}return s}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let n=0;nr.variantChildren.delete(t)}addValue(t,n){this.hasValue(t)&&this.removeValue(t),this.values.set(t,n),this.latestValues[t]=n.get(),this.bindToMotionValue(t,n)}removeValue(t){var n;this.values.delete(t),(n=this.valueSubscriptions.get(t))===null||n===void 0||n(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Vm(n),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=$_(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!ou(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Vv),this.events[t].add(n)}notify(t,...n){var r;(r=this.events[t])===null||r===void 0||r.notify(...n)}}const A$=["initial",...nk],ape=A$.length;class O$ extends ope{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){var r;return(r=t.style)===null||r===void 0?void 0:r[n]}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=fhe(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){che(this,r,a);const s=tpe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function spe(e){return window.getComputedStyle(e)}class lpe extends O${readValueFromInstance(t,n){if(g0.has(n)){const r=X_(n);return r&&r.default||0}else{const r=spe(t),i=(mB(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return _$(t,n)}build(t,n,r,i){D_(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t){return B_(t)}renderInstance(t,n,r,i){LB(t,n,r,i)}}class upe extends O${getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){var r;return g0.has(n)?((r=X_(n))===null||r===void 0?void 0:r.default)||0:(n=AB.has(n)?n:TB(n),t.getAttribute(n))}measureInstanceViewportBox(){return pi()}scrapeMotionValuesFromProps(t){return MB(t)}build(t,n,r,i){j_(t,n,r,i.transformTemplate)}renderInstance(t,n,r,i){OB(t,n,r,i)}}const cpe=(e,t)=>I_(e)?new upe(t,{enableHardwareAcceleration:!1}):new lpe(t,{enableHardwareAcceleration:!0});function JA(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const W1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Lt.test(e))e=parseFloat(e);else return e;const n=JA(e,t.target.x),r=JA(e,t.target.y);return`${n}% ${r}%`}},eO="_$css",dpe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(k$,v=>(o.push(v),eO)));const a=Ju.parse(e);if(a.length>5)return r;const s=Ju.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=d;const h=Fr(u,d,.5);typeof a[2+l]=="number"&&(a[2+l]/=h),typeof a[3+l]=="number"&&(a[3+l]/=h);let m=s(a);if(i){let v=0;m=m.replace(eO,()=>{const b=o[v];return v++,b})}return m}};class fpe extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;_ce(ppe),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Fv.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Gs.postRender(()=>{var s;!((s=a.getStack())===null||s===void 0)&&s.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(i),r!=null&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t==null||t()}render(){return null}}function hpe(e){const[t,n]=K_(),r=w.useContext(M_);return N.createElement(fpe,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(pB),isPresent:t,safeToRemove:n})}const ppe={borderRadius:{...W1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:W1,borderTopRightRadius:W1,borderBottomLeftRadius:W1,borderBottomRightRadius:W1,boxShadow:dpe},gpe={measureLayout:hpe};function mpe(e,t,n={}){const r=ou(e)?e:Vm(e);return J_("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const M$=["TopLeft","TopRight","BottomLeft","BottomRight"],vpe=M$.length,tO=e=>typeof e=="string"?parseFloat(e):e,nO=e=>typeof e=="number"||Lt.test(e);function ype(e,t,n,r,i,o){var a,s,l,u;i?(e.opacity=Fr(0,(a=n.opacity)!==null&&a!==void 0?a:1,bpe(r)),e.opacityExit=Fr((s=t.opacity)!==null&&s!==void 0?s:1,0,Spe(r))):o&&(e.opacity=Fr((l=t.opacity)!==null&&l!==void 0?l:1,(u=n.opacity)!==null&&u!==void 0?u:1,r));for(let d=0;drt?1:n(E2(e,t,r))}function iO(e,t){e.min=t.min,e.max=t.max}function Ms(e,t){iO(e.x,t.x),iO(e.y,t.y)}function oO(e,t,n,r,i){return e-=t,e=a5(e,1/n,r),i!==void 0&&(e=a5(e,1/i,r)),e}function xpe(e,t=0,n=1,r=.5,i,o=e,a=e){if(Xl.test(t)&&(t=parseFloat(t),t=Fr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=Fr(o.min,o.max,r);e===o&&(s-=t),e.min=oO(e.min,t,n,s,i),e.max=oO(e.max,t,n,s,i)}function aO(e,t,[n,r,i],o,a){xpe(e,t[n],t[r],t[i],t.scale,o,a)}const wpe=["x","scaleX","originX"],Cpe=["y","scaleY","originY"];function sO(e,t,n,r){aO(e.x,t,wpe,n==null?void 0:n.x,r==null?void 0:r.x),aO(e.y,t,Cpe,n==null?void 0:n.y,r==null?void 0:r.y)}function lO(e){return e.translate===0&&e.scale===1}function R$(e){return lO(e.x)&&lO(e.y)}function D$(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function uO(e){return Oa(e.x)/Oa(e.y)}function _pe(e,t,n=.1){return Y_(e,t)<=n}class kpe{constructor(){this.members=[]}add(t){ek(this.members,t),t.scheduleRender()}remove(t){if(tk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){var r;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(i=t.resumingFrom)===null||i===void 0?void 0:(o=i.options).onExitComplete)===null||a===void 0||a.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function cO(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),d&&(r+=`rotateY(${d}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const Epe=(e,t)=>e.depth-t.depth;class Ppe{constructor(){this.children=[],this.isDirty=!1}add(t){ek(this.children,t),this.isDirty=!0}remove(t){tk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Epe),this.isDirty=!1,this.children.forEach(t)}}const dO=["","X","Y","Z"],fO=1e3;let Tpe=0;function N$({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=Tpe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Ipe),this.nodes.forEach(Rpe)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=g$(v,250),Fv.hasAnimatedSinceResize&&(Fv.hasAnimatedSinceResize=!1,this.nodes.forEach(pO))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&h&&(u||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:v,hasRelativeTargetChanged:b,layout:S})=>{var k,E,_,T,A;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const I=(E=(k=this.options.transition)!==null&&k!==void 0?k:h.getDefaultTransition())!==null&&E!==void 0?E:$pe,{onLayoutAnimationStart:R,onLayoutAnimationComplete:D}=h.getProps(),j=!this.targetLayout||!D$(this.targetLayout,S)||b,z=!v&&b;if(!((_=this.resumeFrom)===null||_===void 0)&&_.instance||z||v&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,z);const V={...Q_(I,"layout"),onPlay:R,onComplete:D};h.shouldReduceMotion&&(V.delay=0,V.type=!1),this.startAnimation(V)}else!v&&this.animationProgress===0&&pO(this),this.isLead()&&((A=(T=this.options).onExitComplete)===null||A===void 0||A.call(T));this.targetLayout=S})}unmount(){var a,s;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(s=this.parent)===null||s===void 0||s.children.delete(this),this.instance=void 0,Vh.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(Dpe),this.animationId++)}willUpdate(a=!0){var s,l,u;if(this.root.isUpdateBlocked()){(l=(s=this.options).onExitComplete)===null||l===void 0||l.call(s);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var T;const A=_/1e3;gO(v.x,a.x,A),gO(v.y,a.y,A),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((T=this.relativeParent)===null||T===void 0)&&T.layout)&&(Uv(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jpe(this.relativeTarget,this.relativeTargetOrigin,b,A)),S&&(this.animationValues=m,ype(m,h,this.latestValues,A,E,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(0)}startAnimation(a){var s,l;this.notifyListeners("animationStart"),(s=this.currentAnimation)===null||s===void 0||s.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(Vh.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Gs.update(()=>{Fv.hasAnimatedSinceResize=!0,this.currentAnimation=mpe(0,fO,{...a,onUpdate:u=>{var d;this.mixTargetDelta(u),(d=a.onUpdate)===null||d===void 0||d.call(a,u)},onComplete:()=>{var u;(u=a.onComplete)===null||u===void 0||u.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,fO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:d}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&j$(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||pi();const h=Oa(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+h;const m=Oa(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}Ms(s,l),Vg(s,d),Wv(this.projectionDeltaWithTransform,this.layoutCorrected,s,d)}}registerSharedNode(a,s){var l,u,d;this.sharedNodes.has(a)||this.sharedNodes.set(a,new kpe),this.sharedNodes.get(a).add(s),s.promote({transition:(l=s.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(d=(u=s.options.initialPromotionConfig)===null||u===void 0?void 0:u.shouldPreserveFollowOpacity)===null||d===void 0?void 0:d.call(u,s)})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(hO),this.root.sharedNodes.clear()}}}function Lpe(e){e.updateLayout()}function Ape(e){var t,n,r;const i=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:a}=e.layout,{animationType:s}=e.options,l=i.source!==e.layout.source;s==="size"?Rl(v=>{const b=l?i.measuredBox[v]:i.layoutBox[v],S=Oa(b);b.min=o[v].min,b.max=b.min+S}):j$(s,i.layoutBox,o)&&Rl(v=>{const b=l?i.measuredBox[v]:i.layoutBox[v],S=Oa(o[v]);b.max=b.min+S});const u=Gv();Wv(u,o,i.layoutBox);const d=Gv();l?Wv(d,e.applyTransform(a,!0),i.measuredBox):Wv(d,o,i.layoutBox);const h=!R$(u);let m=!1;if(!e.resumeFrom){const v=e.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:b,layout:S}=v;if(b&&S){const k=pi();Uv(k,i.layoutBox,b.layoutBox);const E=pi();Uv(E,o,S.layoutBox),D$(k,E)||(m=!0)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:d,layoutDelta:u,hasLayoutChanged:h,hasRelativeTargetChanged:m})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function Ope(e){e.clearSnapshot()}function hO(e){e.clearMeasurements()}function Mpe(e){const{visualElement:t}=e.options;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function pO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Ipe(e){e.resolveTargetDelta()}function Rpe(e){e.calcProjection()}function Dpe(e){e.resetRotation()}function Npe(e){e.removeLeadSnapshot()}function gO(e,t,n){e.translate=Fr(t.translate,0,n),e.scale=Fr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function mO(e,t,n,r){e.min=Fr(t.min,n.min,r),e.max=Fr(t.max,n.max,r)}function jpe(e,t,n,r){mO(e.x,t.x,n.x,r),mO(e.y,t.y,n.y,r)}function Bpe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $pe={duration:.45,ease:[.4,0,.1,1]};function Fpe(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function vO(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function zpe(e){vO(e.x),vO(e.y)}function j$(e,t,n){return e==="position"||e==="preserve-aspect"&&!_pe(uO(t),uO(n),.2)}const Hpe=N$({attachResizeListener:(e,t)=>FS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),b6={current:void 0},Vpe=N$({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!b6.current){const e=new Hpe(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),b6.current=e}return b6.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),Wpe={...Che,...Ife,...Whe,...gpe},du=wce((e,t)=>sde(e,t,Wpe,cpe,Vpe));function B$(){const e=w.useRef(!1);return K4(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Upe(){const e=B$(),[t,n]=w.useState(0),r=w.useCallback(()=>{e.current&&n(t+1)},[t]);return[w.useCallback(()=>Gs.postRender(r),[r]),t]}class Gpe extends w.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function qpe({children:e,isPresent:t}){const n=w.useId(),r=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0});return w.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` - [data-motion-pop-id="${n}"] { - position: absolute !important; - width: ${o}px !important; - height: ${a}px !important; - top: ${s}px !important; - left: ${l}px !important; - } - `),()=>{document.head.removeChild(u)}},[t]),w.createElement(Gpe,{isPresent:t,childRef:r,sizeRef:i},w.cloneElement(e,{ref:r}))}const S6=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=$S(Ype),l=w.useId(),u=w.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:d=>{s.set(d,!0);for(const h of s.values())if(!h)return;r&&r()},register:d=>(s.set(d,!1),()=>s.delete(d))}),o?void 0:[n]);return w.useMemo(()=>{s.forEach((d,h)=>s.set(h,!1))},[n]),w.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=w.createElement(qpe,{isPresent:n},e)),w.createElement(p0.Provider,{value:u},e)};function Ype(){return new Map}const Bg=e=>e.key||"";function Kpe(e,t){e.forEach(n=>{const r=Bg(n);t.set(r,n)})}function Xpe(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const nf=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",c$(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=Upe();const l=w.useContext(M_).forceRender;l&&(s=l);const u=B$(),d=Xpe(e);let h=d;const m=new Set,v=w.useRef(h),b=w.useRef(new Map).current,S=w.useRef(!0);if(K4(()=>{S.current=!1,Kpe(d,b),v.current=h}),z_(()=>{S.current=!0,b.clear(),m.clear()}),S.current)return w.createElement(w.Fragment,null,h.map(T=>w.createElement(S6,{key:Bg(T),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},T)));h=[...h];const k=v.current.map(Bg),E=d.map(Bg),_=k.length;for(let T=0;T<_;T++){const A=k[T];E.indexOf(A)===-1&&m.add(A)}return a==="wait"&&m.size&&(h=[]),m.forEach(T=>{if(E.indexOf(T)!==-1)return;const A=b.get(T);if(!A)return;const I=k.indexOf(T),R=()=>{b.delete(T),m.delete(T);const D=v.current.findIndex(j=>j.key===T);if(v.current.splice(D,1),!m.size){if(v.current=d,u.current===!1)return;s(),r&&r()}};h.splice(I,0,w.createElement(S6,{key:Bg(A),isPresent:!1,onExitComplete:R,custom:t,presenceAffectsLayout:o,mode:a},A))}),h=h.map(T=>{const A=T.key;return m.has(A)?T:w.createElement(S6,{key:Bg(T),isPresent:!0,presenceAffectsLayout:o,mode:a},T)}),u$!=="production"&&a==="wait"&&h.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),w.createElement(w.Fragment,null,m.size?h:h.map(T=>w.cloneElement(T)))};var Fl=function(){return Fl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function D7(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function Zpe(){return!1}var Qpe=e=>{const{condition:t,message:n}=e;t&&Zpe()&&console.warn(n)},_h={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},U1={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function N7(e){switch((e==null?void 0:e.direction)??"right"){case"right":return U1.slideRight;case"left":return U1.slideLeft;case"bottom":return U1.slideDown;case"top":return U1.slideUp;default:return U1.slideRight}}var Ih={enter:{duration:.2,ease:_h.easeOut},exit:{duration:.1,ease:_h.easeIn}},qs={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},Jpe=e=>e!=null&&parseInt(e.toString(),10)>0,bO={exit:{height:{duration:.2,ease:_h.ease},opacity:{duration:.3,ease:_h.ease}},enter:{height:{duration:.3,ease:_h.ease},opacity:{duration:.4,ease:_h.ease}}},ege={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:Jpe(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(n==null?void 0:n.exit)??qs.exit(bO.exit,i)}),enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(n==null?void 0:n.enter)??qs.enter(bO.enter,i)})},F$=w.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:d,...h}=e,[m,v]=w.useState(!1);w.useEffect(()=>{const _=setTimeout(()=>{v(!0)});return()=>clearTimeout(_)},[]),Qpe({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,S={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:d==null?void 0:d.enter,exit:r?d==null?void 0:d.exit:{...d==null?void 0:d.exit,display:b?"block":"none"}}},k=r?n:!0,E=n||r?"enter":"exit";return N.createElement(nf,{initial:!1,custom:S},k&&N.createElement(du.div,{ref:t,...h,className:by("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:S,variants:ege,initial:r?"exit":!1,animate:E,exit:"exit"}))});F$.displayName="Collapse";var tge={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??qs.enter(Ih.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??qs.exit(Ih.exit,n),transitionEnd:t==null?void 0:t.exit})},z$={initial:"exit",animate:"enter",exit:"exit",variants:tge},nge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,d=i||r?"enter":"exit",h=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return N.createElement(nf,{custom:m},h&&N.createElement(du.div,{ref:n,className:by("chakra-fade",o),custom:m,...z$,animate:d,...u}))});nge.displayName="Fade";var rge={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(n==null?void 0:n.exit)??qs.exit(Ih.exit,i)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??qs.enter(Ih.enter,n),transitionEnd:e==null?void 0:e.enter})},H$={initial:"exit",animate:"enter",exit:"exit",variants:rge},ige=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:d,...h}=t,m=r?i&&r:!0,v=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:d};return N.createElement(nf,{custom:b},m&&N.createElement(du.div,{ref:n,className:by("chakra-offset-slide",s),...H$,animate:v,custom:b,...h}))});ige.displayName="ScaleFade";var SO={exit:{duration:.15,ease:_h.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},oge={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{const{exit:i}=N7({direction:e});return{...i,transition:(t==null?void 0:t.exit)??qs.exit(SO.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{const{enter:i}=N7({direction:e});return{...i,transition:(n==null?void 0:n.enter)??qs.enter(SO.enter,r),transitionEnd:t==null?void 0:t.enter}}},V$=w.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:d,motionProps:h,...m}=t,v=N7({direction:r}),b=Object.assign({position:"fixed"},v.position,i),S=o?a&&o:!0,k=a||o?"enter":"exit",E={transitionEnd:u,transition:l,direction:r,delay:d};return N.createElement(nf,{custom:E},S&&N.createElement(du.div,{...m,ref:n,initial:"exit",className:by("chakra-slide",s),animate:k,exit:"exit",custom:E,variants:oge,style:b,...h}))});V$.displayName="Slide";var age={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,x:e,y:t,transition:(n==null?void 0:n.exit)??qs.exit(Ih.exit,i),transitionEnd:r==null?void 0:r.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??qs.enter(Ih.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{const a={x:t,y:e};return{opacity:0,transition:(n==null?void 0:n.exit)??qs.exit(Ih.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},j7={initial:"initial",animate:"enter",exit:"exit",variants:age},sge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:d,delay:h,...m}=t,v=r?i&&r:!0,b=i||r?"enter":"exit",S={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:d,delay:h};return N.createElement(nf,{custom:S},v&&N.createElement(du.div,{ref:n,className:by("chakra-offset-slide",a),custom:S,...j7,animate:b,...m}))});sge.displayName="SlideFade";var Sy=(...e)=>e.filter(Boolean).join(" ");function lge(){return!1}var GS=e=>{const{condition:t,message:n}=e;t&&lge()&&console.warn(n)};function x6(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[uge,qS]=Mn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[cge,rk]=Mn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[dge,XFe,fge,hge]=dB(),Wg=Ae(function(t,n){const{getButtonProps:r}=rk(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...qS().button};return N.createElement(Ce.button,{...i,className:Sy("chakra-accordion__button",t.className),__css:a})});Wg.displayName="AccordionButton";function pge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;vge(e),yge(e);const s=fge(),[l,u]=w.useState(-1);w.useEffect(()=>()=>{u(-1)},[]);const[d,h]=DS({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:d,setIndex:h,htmlProps:a,getAccordionItemProps:v=>{let b=!1;return v!==null&&(b=Array.isArray(d)?d.includes(v):d===v),{isOpen:b,onChange:k=>{if(v!==null)if(i&&Array.isArray(d)){const E=k?d.concat(v):d.filter(_=>_!==v);h(E)}else k?h(v):o&&h(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[gge,ik]=Mn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function mge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=ik(),s=w.useRef(null),l=w.useId(),u=r??l,d=`accordion-button-${u}`,h=`accordion-panel-${u}`;bge(e);const{register:m,index:v,descendants:b}=hge({disabled:t&&!n}),{isOpen:S,onChange:k}=o(v===-1?null:v);Sge({isOpen:S,isDisabled:t});const E=()=>{k==null||k(!0)},_=()=>{k==null||k(!1)},T=w.useCallback(()=>{k==null||k(!S),a(v)},[v,a,S,k]),A=w.useCallback(j=>{const V={ArrowDown:()=>{const K=b.nextEnabled(v);K==null||K.node.focus()},ArrowUp:()=>{const K=b.prevEnabled(v);K==null||K.node.focus()},Home:()=>{const K=b.firstEnabled();K==null||K.node.focus()},End:()=>{const K=b.lastEnabled();K==null||K.node.focus()}}[j.key];V&&(j.preventDefault(),V(j))},[b,v]),I=w.useCallback(()=>{a(v)},[a,v]),R=w.useCallback(function(z={},V=null){return{...z,type:"button",ref:qn(m,s,V),id:d,disabled:!!t,"aria-expanded":!!S,"aria-controls":h,onClick:x6(z.onClick,T),onFocus:x6(z.onFocus,I),onKeyDown:x6(z.onKeyDown,A)}},[d,t,S,T,I,A,h,m]),D=w.useCallback(function(z={},V=null){return{...z,ref:V,role:"region",id:h,"aria-labelledby":d,hidden:!S}},[d,S,h]);return{isOpen:S,isDisabled:t,isFocusable:n,onOpen:E,onClose:_,getButtonProps:R,getPanelProps:D,htmlProps:i}}function vge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;GS({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function yge(e){GS({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function bge(e){GS({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. - `})}function Sge(e){GS({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Ug(e){const{isOpen:t,isDisabled:n}=rk(),{reduceMotion:r}=ik(),i=Sy("chakra-accordion__icon",e.className),o=qS(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return N.createElement(Da,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))}Ug.displayName="AccordionIcon";var Gg=Ae(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=mge(t),l={...qS().container,overflowAnchor:"none"},u=w.useMemo(()=>a,[a]);return N.createElement(cge,{value:u},N.createElement(Ce.div,{ref:n,...o,className:Sy("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});Gg.displayName="AccordionItem";var qg=Ae(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=ik(),{getPanelProps:s,isOpen:l}=rk(),u=s(o,n),d=Sy("chakra-accordion__panel",r),h=qS();a||delete u.hidden;const m=N.createElement(Ce.div,{...u,__css:h.panel,className:d});return a?m:N.createElement(F$,{in:l,...i},m)});qg.displayName="AccordionPanel";var ok=Ae(function({children:t,reduceMotion:n,...r},i){const o=Yi("Accordion",r),a=En(r),{htmlProps:s,descendants:l,...u}=pge(a),d=w.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return N.createElement(dge,{value:l},N.createElement(gge,{value:d},N.createElement(uge,{value:o},N.createElement(Ce.div,{ref:i,...s,className:Sy("chakra-accordion",r.className),__css:o.root},t))))});ok.displayName="Accordion";var xge=(...e)=>e.filter(Boolean).join(" "),wge=tf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),xy=Ae((e,t)=>{const n=Ao("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=En(e),u=xge("chakra-spinner",s),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${wge} ${o} linear infinite`,...n};return N.createElement(Ce.div,{ref:t,__css:d,className:u,...l},r&&N.createElement(Ce.span,{srOnly:!0},r))});xy.displayName="Spinner";var YS=(...e)=>e.filter(Boolean).join(" ");function Cge(e){return N.createElement(Da,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}))}function _ge(e){return N.createElement(Da,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}))}function xO(e){return N.createElement(Da,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))}var[kge,Ege]=Mn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[Pge,ak]=Mn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),W$={info:{icon:_ge,colorScheme:"blue"},warning:{icon:xO,colorScheme:"orange"},success:{icon:Cge,colorScheme:"green"},error:{icon:xO,colorScheme:"red"},loading:{icon:xy,colorScheme:"blue"}};function Tge(e){return W$[e].colorScheme}function Lge(e){return W$[e].icon}var U$=Ae(function(t,n){const{status:r="info",addRole:i=!0,...o}=En(t),a=t.colorScheme??Tge(r),s=Yi("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return N.createElement(kge,{value:{status:r}},N.createElement(Pge,{value:s},N.createElement(Ce.div,{role:i?"alert":void 0,ref:n,...o,className:YS("chakra-alert",t.className),__css:l})))});U$.displayName="Alert";var G$=Ae(function(t,n){const i={display:"inline",...ak().description};return N.createElement(Ce.div,{ref:n,...t,className:YS("chakra-alert__desc",t.className),__css:i})});G$.displayName="AlertDescription";function q$(e){const{status:t}=Ege(),n=Lge(t),r=ak(),i=t==="loading"?r.spinner:r.icon;return N.createElement(Ce.span,{display:"inherit",...e,className:YS("chakra-alert__icon",e.className),__css:i},e.children||N.createElement(n,{h:"100%",w:"100%"}))}q$.displayName="AlertIcon";var Y$=Ae(function(t,n){const r=ak();return N.createElement(Ce.div,{ref:n,...t,className:YS("chakra-alert__title",t.className),__css:r.title})});Y$.displayName="AlertTitle";function Age(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Oge(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,d]=w.useState("pending");w.useEffect(()=>{d(n?"loading":"pending")},[n]);const h=w.useRef(),m=w.useCallback(()=>{if(!n)return;v();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=S=>{v(),d("loaded"),i==null||i(S)},b.onerror=S=>{v(),d("failed"),o==null||o(S)},h.current=b},[n,a,r,s,i,o,t]),v=()=>{h.current&&(h.current.onload=null,h.current.onerror=null,h.current=null)};return Ws(()=>{if(!l)return u==="loading"&&m(),()=>{v()}},[u,m,l]),l?"loaded":u}var Mge=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",s5=Ae(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return N.createElement("img",{width:r,height:i,ref:n,alt:o,...a})});s5.displayName="NativeImage";var KS=Ae(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:d,crossOrigin:h,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:v,...b}=t,S=r!==void 0||i!==void 0,k=u!=null||d||!S,E=Oge({...t,ignoreFallback:k}),_=Mge(E,m),T={ref:n,objectFit:l,objectPosition:s,...k?b:Age(b,["onError","onLoad"])};return _?i||N.createElement(Ce.img,{as:s5,className:"chakra-image__placeholder",src:r,...T}):N.createElement(Ce.img,{as:s5,src:o,srcSet:a,crossOrigin:h,loading:u,referrerPolicy:v,className:"chakra-image",...T})});KS.displayName="Image";Ae((e,t)=>N.createElement(Ce.img,{ref:t,as:s5,className:"chakra-image",...e}));function XS(e){return w.Children.toArray(e).filter(t=>w.isValidElement(t))}var ZS=(...e)=>e.filter(Boolean).join(" "),wO=e=>e?"":void 0,[Ige,Rge]=Mn({strict:!1,name:"ButtonGroupContext"});function B7(e){const{children:t,className:n,...r}=e,i=w.isValidElement(t)?w.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=ZS("chakra-button__icon",n);return N.createElement(Ce.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}B7.displayName="ButtonIcon";function $7(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=N.createElement(xy,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=ZS("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",d=w.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return N.createElement(Ce.div,{className:l,...s,__css:d},i)}$7.displayName="ButtonSpinner";function Dge(e){const[t,n]=w.useState(!e);return{ref:w.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var as=Ae((e,t)=>{const n=Rge(),r=Ao("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:d,iconSpacing:h="0.5rem",type:m,spinner:v,spinnerPlacement:b="start",className:S,as:k,...E}=En(e),_=w.useMemo(()=>{const R={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:R}}},[r,n]),{ref:T,type:A}=Dge(k),I={rightIcon:u,leftIcon:l,iconSpacing:h,children:s};return N.createElement(Ce.button,{disabled:i||o,ref:rce(t,T),as:k,type:m??A,"data-active":wO(a),"data-loading":wO(o),__css:_,className:ZS("chakra-button",S),...E},o&&b==="start"&&N.createElement($7,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:h},v),o?d||N.createElement(Ce.span,{opacity:0},N.createElement(CO,{...I})):N.createElement(CO,{...I}),o&&b==="end"&&N.createElement($7,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:h},v))});as.displayName="Button";function CO(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return N.createElement(N.Fragment,null,t&&N.createElement(B7,{marginEnd:i},t),r,n&&N.createElement(B7,{marginStart:i},n))}var oo=Ae(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...d}=t,h=ZS("chakra-button__group",a),m=w.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let v={display:"inline-flex"};return l?v={...v,"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}}:v={...v,"& > *:not(style) ~ *:not(style)":{marginStart:s}},N.createElement(Ige,{value:m},N.createElement(Ce.div,{ref:n,role:"group",__css:v,className:h,"data-attached":l?"":void 0,...d}))});oo.displayName="ButtonGroup";var ss=Ae((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=w.isValidElement(s)?w.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return N.createElement(as,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a},l)});ss.displayName="IconButton";var y0=(...e)=>e.filter(Boolean).join(" "),J3=e=>e?"":void 0,w6=e=>e?!0:void 0;function _O(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Nge,K$]=Mn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[jge,b0]=Mn({strict:!1,name:"FormControlContext"});function Bge(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=w.useId(),l=t||`field-${s}`,u=`${l}-label`,d=`${l}-feedback`,h=`${l}-helptext`,[m,v]=w.useState(!1),[b,S]=w.useState(!1),[k,E]=w.useState(!1),_=w.useCallback((D={},j=null)=>({id:h,...D,ref:qn(j,z=>{z&&S(!0)})}),[h]),T=w.useCallback((D={},j=null)=>({...D,ref:j,"data-focus":J3(k),"data-disabled":J3(i),"data-invalid":J3(r),"data-readonly":J3(o),id:D.id??u,htmlFor:D.htmlFor??l}),[l,i,k,r,o,u]),A=w.useCallback((D={},j=null)=>({id:d,...D,ref:qn(j,z=>{z&&v(!0)}),"aria-live":"polite"}),[d]),I=w.useCallback((D={},j=null)=>({...D,...a,ref:j,role:"group"}),[a]),R=w.useCallback((D={},j=null)=>({...D,ref:j,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!k,onFocus:()=>E(!0),onBlur:()=>E(!1),hasFeedbackText:m,setHasFeedbackText:v,hasHelpText:b,setHasHelpText:S,id:l,labelId:u,feedbackId:d,helpTextId:h,htmlProps:a,getHelpTextProps:_,getErrorMessageProps:A,getRootProps:I,getLabelProps:T,getRequiredIndicatorProps:R}}var dn=Ae(function(t,n){const r=Yi("Form",t),i=En(t),{getRootProps:o,htmlProps:a,...s}=Bge(i),l=y0("chakra-form-control",t.className);return N.createElement(jge,{value:s},N.createElement(Nge,{value:r},N.createElement(Ce.div,{...o({},n),className:l,__css:r.container})))});dn.displayName="FormControl";var lr=Ae(function(t,n){const r=b0(),i=K$(),o=y0("chakra-form__helper-text",t.className);return N.createElement(Ce.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});lr.displayName="FormHelperText";function sk(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=lk(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":w6(n),"aria-required":w6(i),"aria-readonly":w6(r)}}function lk(e){const t=b0(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:d,onBlur:h,...m}=e,v=e["aria-describedby"]?[e["aria-describedby"]]:[];return t!=null&&t.hasFeedbackText&&(t!=null&&t.isInvalid)&&v.push(t.feedbackId),t!=null&&t.hasHelpText&&v.push(t.helpTextId),{...m,"aria-describedby":v.join(" ")||void 0,id:n??(t==null?void 0:t.id),isDisabled:r??u??(t==null?void 0:t.isDisabled),isReadOnly:i??l??(t==null?void 0:t.isReadOnly),isRequired:o??a??(t==null?void 0:t.isRequired),isInvalid:s??(t==null?void 0:t.isInvalid),onFocus:_O(t==null?void 0:t.onFocus,d),onBlur:_O(t==null?void 0:t.onBlur,h)}}var[$ge,Fge]=Mn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),ur=Ae((e,t)=>{const n=Yi("FormError",e),r=En(e),i=b0();return i!=null&&i.isInvalid?N.createElement($ge,{value:n},N.createElement(Ce.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:y0("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});ur.displayName="FormErrorMessage";var zge=Ae((e,t)=>{const n=Fge(),r=b0();if(!(r!=null&&r.isInvalid))return null;const i=y0("chakra-form__error-icon",e.className);return N.createElement(Da,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))});zge.displayName="FormErrorIcon";var kn=Ae(function(t,n){const r=Ao("FormLabel",t),i=En(t),{className:o,children:a,requiredIndicator:s=N.createElement(X$,null),optionalIndicator:l=null,...u}=i,d=b0(),h=(d==null?void 0:d.getLabelProps(u,n))??{ref:n,...u};return N.createElement(Ce.label,{...h,className:y0("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,d!=null&&d.isRequired?s:l)});kn.displayName="FormLabel";var X$=Ae(function(t,n){const r=b0(),i=K$();if(!(r!=null&&r.isRequired))return null;const o=y0("chakra-form__required-indicator",t.className);return N.createElement(Ce.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});X$.displayName="RequiredIndicator";function Vd(e,t){const n=w.useRef(!1),r=w.useRef(!1);w.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var uk={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},Hge=Ce("span",{baseStyle:uk});Hge.displayName="VisuallyHidden";var Vge=Ce("input",{baseStyle:uk});Vge.displayName="VisuallyHiddenInput";var kO=!1,QS=null,Wm=!1,F7=new Set,Wge=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function Uge(e){return!(e.metaKey||!Wge&&e.altKey||e.ctrlKey)}function ck(e,t){F7.forEach(n=>n(e,t))}function EO(e){Wm=!0,Uge(e)&&(QS="keyboard",ck("keyboard",e))}function wg(e){QS="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Wm=!0,ck("pointer",e))}function Gge(e){e.target===window||e.target===document||(Wm||(QS="keyboard",ck("keyboard",e)),Wm=!1)}function qge(){Wm=!1}function PO(){return QS!=="pointer"}function Yge(){if(typeof window>"u"||kO)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Wm=!0,e.apply(this,n)},document.addEventListener("keydown",EO,!0),document.addEventListener("keyup",EO,!0),window.addEventListener("focus",Gge,!0),window.addEventListener("blur",qge,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",wg,!0),document.addEventListener("pointermove",wg,!0),document.addEventListener("pointerup",wg,!0)):(document.addEventListener("mousedown",wg,!0),document.addEventListener("mousemove",wg,!0),document.addEventListener("mouseup",wg,!0)),kO=!0}function Kge(e){Yge(),e(PO());const t=()=>e(PO());return F7.add(t),()=>{F7.delete(t)}}var[ZFe,Xge]=Mn({name:"CheckboxGroupContext",strict:!1}),Zge=(...e)=>e.filter(Boolean).join(" "),bo=e=>e?"":void 0;function Ya(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Qge(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function Jge(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},N.createElement("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function eme(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},N.createElement("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function tme(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?eme:Jge;return n||t?N.createElement(Ce.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},N.createElement(i,{...r})):null}function nme(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Z$(e={}){const t=lk(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:d,isChecked:h,isFocusable:m,onChange:v,isIndeterminate:b,name:S,value:k,tabIndex:E=void 0,"aria-label":_,"aria-labelledby":T,"aria-invalid":A,...I}=e,R=nme(I,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=Er(v),j=Er(s),z=Er(l),[V,K]=w.useState(!1),[te,q]=w.useState(!1),[$,U]=w.useState(!1),[X,Z]=w.useState(!1);w.useEffect(()=>Kge(K),[]);const W=w.useRef(null),[Q,ie]=w.useState(!0),[fe,Se]=w.useState(!!d),Pe=h!==void 0,ye=Pe?h:fe,We=w.useCallback(Le=>{if(r||n){Le.preventDefault();return}Pe||Se(ye?Le.target.checked:b?!0:Le.target.checked),D==null||D(Le)},[r,n,ye,Pe,b,D]);Ws(()=>{W.current&&(W.current.indeterminate=Boolean(b))},[b]),Vd(()=>{n&&q(!1)},[n,q]),Ws(()=>{const Le=W.current;Le!=null&&Le.form&&(Le.form.onreset=()=>{Se(!!d)})},[]);const De=n&&!m,ot=w.useCallback(Le=>{Le.key===" "&&Z(!0)},[Z]),He=w.useCallback(Le=>{Le.key===" "&&Z(!1)},[Z]);Ws(()=>{if(!W.current)return;W.current.checked!==ye&&Se(W.current.checked)},[W.current]);const Be=w.useCallback((Le={},lt=null)=>{const Mt=ut=>{te&&ut.preventDefault(),Z(!0)};return{...Le,ref:lt,"data-active":bo(X),"data-hover":bo($),"data-checked":bo(ye),"data-focus":bo(te),"data-focus-visible":bo(te&&V),"data-indeterminate":bo(b),"data-disabled":bo(n),"data-invalid":bo(o),"data-readonly":bo(r),"aria-hidden":!0,onMouseDown:Ya(Le.onMouseDown,Mt),onMouseUp:Ya(Le.onMouseUp,()=>Z(!1)),onMouseEnter:Ya(Le.onMouseEnter,()=>U(!0)),onMouseLeave:Ya(Le.onMouseLeave,()=>U(!1))}},[X,ye,n,te,V,$,b,o,r]),wt=w.useCallback((Le={},lt=null)=>({...R,...Le,ref:qn(lt,Mt=>{Mt&&ie(Mt.tagName==="LABEL")}),onClick:Ya(Le.onClick,()=>{var Mt;Q||((Mt=W.current)==null||Mt.click(),requestAnimationFrame(()=>{var ut;(ut=W.current)==null||ut.focus()}))}),"data-disabled":bo(n),"data-checked":bo(ye),"data-invalid":bo(o)}),[R,n,ye,o,Q]),st=w.useCallback((Le={},lt=null)=>({...Le,ref:qn(W,lt),type:"checkbox",name:S,value:k,id:a,tabIndex:E,onChange:Ya(Le.onChange,We),onBlur:Ya(Le.onBlur,j,()=>q(!1)),onFocus:Ya(Le.onFocus,z,()=>q(!0)),onKeyDown:Ya(Le.onKeyDown,ot),onKeyUp:Ya(Le.onKeyUp,He),required:i,checked:ye,disabled:De,readOnly:r,"aria-label":_,"aria-labelledby":T,"aria-invalid":A?Boolean(A):o,"aria-describedby":u,"aria-disabled":n,style:uk}),[S,k,a,We,j,z,ot,He,i,ye,De,r,_,T,A,o,u,n,E]),mt=w.useCallback((Le={},lt=null)=>({...Le,ref:lt,onMouseDown:Ya(Le.onMouseDown,TO),onTouchStart:Ya(Le.onTouchStart,TO),"data-disabled":bo(n),"data-checked":bo(ye),"data-invalid":bo(o)}),[ye,n,o]);return{state:{isInvalid:o,isFocused:te,isChecked:ye,isActive:X,isHovered:$,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:wt,getCheckboxProps:Be,getInputProps:st,getLabelProps:mt,htmlProps:R}}function TO(e){e.preventDefault(),e.stopPropagation()}var rme={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},ime={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},ome=tf({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),ame=tf({from:{opacity:0},to:{opacity:1}}),sme=tf({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Q$=Ae(function(t,n){const r=Xge(),i={...r,...t},o=Yi("Checkbox",i),a=En(t),{spacing:s="0.5rem",className:l,children:u,iconColor:d,iconSize:h,icon:m=N.createElement(tme,null),isChecked:v,isDisabled:b=r==null?void 0:r.isDisabled,onChange:S,inputProps:k,...E}=a;let _=v;r!=null&&r.value&&a.value&&(_=r.value.includes(a.value));let T=S;r!=null&&r.onChange&&a.value&&(T=Qge(r.onChange,S));const{state:A,getInputProps:I,getCheckboxProps:R,getLabelProps:D,getRootProps:j}=Z$({...E,isDisabled:b,isChecked:_,onChange:T}),z=w.useMemo(()=>({animation:A.isIndeterminate?`${ame} 20ms linear, ${sme} 200ms linear`:`${ome} 200ms linear`,fontSize:h,color:d,...o.icon}),[d,h,,A.isIndeterminate,o.icon]),V=w.cloneElement(m,{__css:z,isIndeterminate:A.isIndeterminate,isChecked:A.isChecked});return N.createElement(Ce.label,{__css:{...ime,...o.container},className:Zge("chakra-checkbox",l),...j()},N.createElement("input",{className:"chakra-checkbox__input",...I(k,n)}),N.createElement(Ce.span,{__css:{...rme,...o.control},className:"chakra-checkbox__control",...R()},V),u&&N.createElement(Ce.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:s,...o.label}},u))});Q$.displayName="Checkbox";function lme(e){return N.createElement(Da,{focusable:"false","aria-hidden":!0,...e},N.createElement("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}))}var JS=Ae(function(t,n){const r=Ao("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=En(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return N.createElement(Ce.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||N.createElement(lme,{width:"1em",height:"1em"}))});JS.displayName="CloseButton";function ume(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function dk(e,t){let n=ume(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function z7(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function l5(e,t,n){return(e-t)*100/(n-t)}function J$(e,t,n){return(n-t)*e+t}function H7(e,t,n){const r=Math.round((e-t)/n)*n+t,i=z7(n);return dk(r,i)}function Cm(e,t,n){return e==null?e:(nr==null?"":C6(r,o,n)??""),m=typeof i<"u",v=m?i:d,b=eF(dd(v),o),S=n??b,k=w.useCallback(V=>{V!==v&&(m||h(V.toString()),u==null||u(V.toString(),dd(V)))},[u,m,v]),E=w.useCallback(V=>{let K=V;return l&&(K=Cm(K,a,s)),dk(K,S)},[S,l,s,a]),_=w.useCallback((V=o)=>{let K;v===""?K=dd(V):K=dd(v)+V,K=E(K),k(K)},[E,o,k,v]),T=w.useCallback((V=o)=>{let K;v===""?K=dd(-V):K=dd(v)-V,K=E(K),k(K)},[E,o,k,v]),A=w.useCallback(()=>{let V;r==null?V="":V=C6(r,o,n)??a,k(V)},[r,n,o,k,a]),I=w.useCallback(V=>{const K=C6(V,o,S)??a;k(K)},[S,o,k,a]),R=dd(v);return{isOutOfRange:R>s||RN.createElement(OS,{styles:tF}),fme=()=>N.createElement(OS,{styles:` - html { - line-height: 1.5; - -webkit-text-size-adjust: 100%; - font-family: system-ui, sans-serif; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; - -moz-osx-font-smoothing: grayscale; - touch-action: manipulation; - } - - body { - position: relative; - min-height: 100%; - font-feature-settings: 'kern'; - } - - *, - *::before, - *::after { - border-width: 0; - border-style: solid; - box-sizing: border-box; - } - - main { - display: block; - } - - hr { - border-top-width: 1px; - box-sizing: content-box; - height: 0; - overflow: visible; - } - - pre, - code, - kbd, - samp { - font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; - font-size: 1em; - } - - a { - background-color: transparent; - color: inherit; - text-decoration: inherit; - } - - abbr[title] { - border-bottom: none; - text-decoration: underline; - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; - } - - b, - strong { - font-weight: bold; - } - - small { - font-size: 80%; - } - - sub, - sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; - } - - sub { - bottom: -0.25em; - } - - sup { - top: -0.5em; - } - - img { - border-style: none; - } - - button, - input, - optgroup, - select, - textarea { - font-family: inherit; - font-size: 100%; - line-height: 1.15; - margin: 0; - } - - button, - input { - overflow: visible; - } - - button, - select { - text-transform: none; - } - - button::-moz-focus-inner, - [type="button"]::-moz-focus-inner, - [type="reset"]::-moz-focus-inner, - [type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0; - } - - fieldset { - padding: 0.35em 0.75em 0.625em; - } - - legend { - box-sizing: border-box; - color: inherit; - display: table; - max-width: 100%; - padding: 0; - white-space: normal; - } - - progress { - vertical-align: baseline; - } - - textarea { - overflow: auto; - } - - [type="checkbox"], - [type="radio"] { - box-sizing: border-box; - padding: 0; - } - - [type="number"]::-webkit-inner-spin-button, - [type="number"]::-webkit-outer-spin-button { - -webkit-appearance: none !important; - } - - input[type="number"] { - -moz-appearance: textfield; - } - - [type="search"] { - -webkit-appearance: textfield; - outline-offset: -2px; - } - - [type="search"]::-webkit-search-decoration { - -webkit-appearance: none !important; - } - - ::-webkit-file-upload-button { - -webkit-appearance: button; - font: inherit; - } - - details { - display: block; - } - - summary { - display: list-item; - } - - template { - display: none; - } - - [hidden] { - display: none !important; - } - - body, - blockquote, - dl, - dd, - h1, - h2, - h3, - h4, - h5, - h6, - hr, - figure, - p, - pre { - margin: 0; - } - - button { - background: transparent; - padding: 0; - } - - fieldset { - margin: 0; - padding: 0; - } - - ol, - ul { - margin: 0; - padding: 0; - } - - textarea { - resize: vertical; - } - - button, - [role="button"] { - cursor: pointer; - } - - button::-moz-focus-inner { - border: 0 !important; - } - - table { - border-collapse: collapse; - } - - h1, - h2, - h3, - h4, - h5, - h6 { - font-size: inherit; - font-weight: inherit; - } - - button, - input, - optgroup, - select, - textarea { - padding: 0; - line-height: inherit; - color: inherit; - } - - img, - svg, - video, - canvas, - audio, - iframe, - embed, - object { - display: block; - } - - img, - video { - max-width: 100%; - height: auto; - } - - [data-js-focus-visible] :focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) { - outline: none; - box-shadow: none; - } - - select::-ms-expand { - display: none; - } - - ${tF} - `});function Rh(e,t,n,r){const i=Er(n);return w.useEffect(()=>{const o=typeof e=="function"?e():e??document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e??document;o==null||o.removeEventListener(t,i,r)}}function hme(e){return"current"in e}var nF=()=>typeof window<"u";function pme(){const e=navigator.userAgentData;return(e==null?void 0:e.platform)??navigator.platform}var gme=e=>nF()&&e.test(navigator.vendor),mme=e=>nF()&&e.test(pme()),vme=()=>mme(/mac|iphone|ipad|ipod/i),yme=()=>vme()&&gme(/apple/i);function bme(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var o;return((o=t.current)==null?void 0:o.ownerDocument)??document};Rh(i,"pointerdown",o=>{if(!yme()||!r)return;const a=o.target,l=(n??[t]).some(u=>{const d=hme(u)?u.current:u;return(d==null?void 0:d.contains(a))||d===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}var Sme=cre?w.useLayoutEffect:w.useEffect;function LO(e,t=[]){const n=w.useRef(e);return Sme(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function xme(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function wme(e,t){const n=w.useId();return w.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Wh(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=LO(n),a=LO(t),[s,l]=w.useState(e.defaultIsOpen||!1),[u,d]=xme(r,s),h=wme(i,"disclosure"),m=w.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),v=w.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),b=w.useCallback(()=>{(d?m:v)()},[d,v,m]);return{isOpen:!!d,onOpen:v,onClose:m,onToggle:b,isControlled:u,getButtonProps:(S={})=>({...S,"aria-expanded":d,"aria-controls":h,onClick:dre(S.onClick,b)}),getDisclosureProps:(S={})=>({...S,hidden:!d,id:h})}}function fk(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var hk=Ae(function(t,n){const{htmlSize:r,...i}=t,o=Yi("Input",i),a=En(i),s=sk(a),l=Qr("chakra-input",t.className);return N.createElement(Ce.input,{size:r,...s,__css:o.field,ref:n,className:l})});hk.displayName="Input";hk.id="Input";var[Cme,rF]=Mn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),_me=Ae(function(t,n){const r=Yi("Input",t),{children:i,className:o,...a}=En(t),s=Qr("chakra-input__group",o),l={},u=XS(i),d=r.field;u.forEach(m=>{r&&(d&&m.type.id==="InputLeftElement"&&(l.paddingStart=d.height??d.h),d&&m.type.id==="InputRightElement"&&(l.paddingEnd=d.height??d.h),m.type.id==="InputRightAddon"&&(l.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const h=u.map(m=>{var v,b;const S=fk({size:((v=m.props)==null?void 0:v.size)||t.size,variant:((b=m.props)==null?void 0:b.variant)||t.variant});return m.type.id!=="Input"?w.cloneElement(m,S):w.cloneElement(m,Object.assign(S,l,m.props))});return N.createElement(Ce.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},N.createElement(Cme,{value:r},h))});_me.displayName="InputGroup";var kme={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},Eme=Ce("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),pk=Ae(function(t,n){const{placement:r="left",...i}=t,o=kme[r]??{},a=rF();return N.createElement(Eme,{ref:n,...i,__css:{...a.addon,...o}})});pk.displayName="InputAddon";var iF=Ae(function(t,n){return N.createElement(pk,{ref:n,placement:"left",...t,className:Qr("chakra-input__left-addon",t.className)})});iF.displayName="InputLeftAddon";iF.id="InputLeftAddon";var oF=Ae(function(t,n){return N.createElement(pk,{ref:n,placement:"right",...t,className:Qr("chakra-input__right-addon",t.className)})});oF.displayName="InputRightAddon";oF.id="InputRightAddon";var Pme=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),ex=Ae(function(t,n){const{placement:r="left",...i}=t,o=rF(),a=o.field,l={[r==="left"?"insetStart":"insetEnd"]:"0",width:(a==null?void 0:a.height)??(a==null?void 0:a.h),height:(a==null?void 0:a.height)??(a==null?void 0:a.h),fontSize:a==null?void 0:a.fontSize,...o.element};return N.createElement(Pme,{ref:n,__css:l,...i})});ex.id="InputElement";ex.displayName="InputElement";var aF=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__left-element",r);return N.createElement(ex,{ref:n,placement:"left",className:o,...i})});aF.id="InputLeftElement";aF.displayName="InputLeftElement";var sF=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__right-element",r);return N.createElement(ex,{ref:n,placement:"right",className:o,...i})});sF.id="InputRightElement";sF.displayName="InputRightElement";function Tme(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Wd(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Tme(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Lme=Ae(function(e,t){const{ratio:n=4/3,children:r,className:i,...o}=e,a=w.Children.only(r),s=Qr("chakra-aspect-ratio",i);return N.createElement(Ce.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:Wd(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o},a)});Lme.displayName="AspectRatio";var Ame=Ae(function(t,n){const r=Ao("Badge",t),{className:i,...o}=En(t);return N.createElement(Ce.span,{ref:n,className:Qr("chakra-badge",t.className),...o,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Ame.displayName="Badge";var ko=Ce("div");ko.displayName="Box";var lF=Ae(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return N.createElement(ko,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});lF.displayName="Square";var Ome=Ae(function(t,n){const{size:r,...i}=t;return N.createElement(lF,{size:r,ref:n,borderRadius:"9999px",...i})});Ome.displayName="Circle";var uF=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});uF.displayName="Center";var Mme={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Ae(function(t,n){const{axis:r="both",...i}=t;return N.createElement(Ce.div,{ref:n,__css:Mme[r],...i,position:"absolute"})});var Ime=Ae(function(t,n){const r=Ao("Code",t),{className:i,...o}=En(t);return N.createElement(Ce.code,{ref:n,className:Qr("chakra-code",t.className),...o,__css:{display:"inline-block",...r}})});Ime.displayName="Code";var Rme=Ae(function(t,n){const{className:r,centerContent:i,...o}=En(t),a=Ao("Container",t);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-container",r),...o,__css:{...a,...i&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});Rme.displayName="Container";var Dme=Ae(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:o,borderRightWidth:a,borderWidth:s,borderStyle:l,borderColor:u,...d}=Ao("Divider",t),{className:h,orientation:m="horizontal",__css:v,...b}=En(t),S={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:i||o||s||"1px",width:"100%"}};return N.createElement(Ce.hr,{ref:n,"aria-orientation":m,...b,__css:{...d,border:"0",borderColor:u,borderStyle:l,...S[m],...v},className:Qr("chakra-divider",h)})});Dme.displayName="Divider";var Ge=Ae(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...d}=t,h={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return N.createElement(Ce.div,{ref:n,__css:h,...d})});Ge.displayName="Flex";var cF=Ae(function(t,n){const{templateAreas:r,gap:i,rowGap:o,columnGap:a,column:s,row:l,autoFlow:u,autoRows:d,templateRows:h,autoColumns:m,templateColumns:v,...b}=t,S={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:o,gridColumnGap:a,gridAutoColumns:m,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:d,gridTemplateRows:h,gridTemplateColumns:v};return N.createElement(Ce.div,{ref:n,__css:S,...b})});cF.displayName="Grid";function AO(e){return Wd(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Nme=Ae(function(t,n){const{area:r,colSpan:i,colStart:o,colEnd:a,rowEnd:s,rowSpan:l,rowStart:u,...d}=t,h=fk({gridArea:r,gridColumn:AO(i),gridRow:AO(l),gridColumnStart:o,gridColumnEnd:a,gridRowStart:u,gridRowEnd:s});return N.createElement(Ce.div,{ref:n,__css:h,...d})});Nme.displayName="GridItem";var Dh=Ae(function(t,n){const r=Ao("Heading",t),{className:i,...o}=En(t);return N.createElement(Ce.h2,{ref:n,className:Qr("chakra-heading",t.className),...o,__css:r})});Dh.displayName="Heading";Ae(function(t,n){const r=Ao("Mark",t),i=En(t);return N.createElement(ko,{ref:n,...i,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var jme=Ae(function(t,n){const r=Ao("Kbd",t),{className:i,...o}=En(t);return N.createElement(Ce.kbd,{ref:n,className:Qr("chakra-kbd",i),...o,__css:{fontFamily:"mono",...r}})});jme.displayName="Kbd";var Nh=Ae(function(t,n){const r=Ao("Link",t),{className:i,isExternal:o,...a}=En(t);return N.createElement(Ce.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:Qr("chakra-link",i),...a,__css:r})});Nh.displayName="Link";Ae(function(t,n){const{isExternal:r,target:i,rel:o,className:a,...s}=t;return N.createElement(Ce.a,{...s,ref:n,className:Qr("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":o,target:r?"_blank":i,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});Ae(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.div,{ref:n,position:"relative",...i,className:Qr("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[Bme,dF]=Mn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),gk=Ae(function(t,n){const r=Yi("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=En(t),u=XS(i),h=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return N.createElement(Bme,{value:r},N.createElement(Ce.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...h},...l},u))});gk.displayName="List";var $me=Ae((e,t)=>{const{as:n,...r}=e;return N.createElement(gk,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});$me.displayName="OrderedList";var Fme=Ae(function(t,n){const{as:r,...i}=t;return N.createElement(gk,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});Fme.displayName="UnorderedList";var zme=Ae(function(t,n){const r=dF();return N.createElement(Ce.li,{ref:n,...t,__css:r.item})});zme.displayName="ListItem";var Hme=Ae(function(t,n){const r=dF();return N.createElement(Da,{ref:n,role:"presentation",...t,__css:r.icon})});Hme.displayName="ListIcon";var Vme=Ae(function(t,n){const{columns:r,spacingX:i,spacingY:o,spacing:a,minChildWidth:s,...l}=t,u=h0(),d=s?Ume(s,u):Gme(r);return N.createElement(cF,{ref:n,gap:a,columnGap:i,rowGap:o,templateColumns:d,...l})});Vme.displayName="SimpleGrid";function Wme(e){return typeof e=="number"?`${e}px`:e}function Ume(e,t){return Wd(e,n=>{const r=Gue("sizes",n,Wme(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function Gme(e){return Wd(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var fF=Ce("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});fF.displayName="Spacer";var V7="& > *:not(style) ~ *:not(style)";function qme(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[V7]:Wd(n,i=>r[i])}}function Yme(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":Wd(n,i=>r[i])}}var hF=e=>N.createElement(Ce.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});hF.displayName="StackItem";var mk=Ae((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:d,shouldWrapChildren:h,...m}=e,v=n?"row":r??"column",b=w.useMemo(()=>qme({direction:v,spacing:a}),[v,a]),S=w.useMemo(()=>Yme({spacing:a,direction:v}),[a,v]),k=!!u,E=!h&&!k,_=w.useMemo(()=>{const A=XS(l);return E?A:A.map((I,R)=>{const D=typeof I.key<"u"?I.key:R,j=R+1===A.length,V=h?N.createElement(hF,{key:D},I):I;if(!k)return V;const K=w.cloneElement(u,{__css:S}),te=j?null:K;return N.createElement(w.Fragment,{key:D},V,te)})},[u,S,k,E,h,l]),T=Qr("chakra-stack",d);return N.createElement(Ce.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:b.flexDirection,flexWrap:s,className:T,__css:k?{}:{[V7]:b[V7]},...m},_)});mk.displayName="Stack";var wy=Ae((e,t)=>N.createElement(mk,{align:"center",...e,direction:"row",ref:t}));wy.displayName="HStack";var yn=Ae((e,t)=>N.createElement(mk,{align:"center",...e,direction:"column",ref:t}));yn.displayName="VStack";var fn=Ae(function(t,n){const r=Ao("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=En(t),u=fk({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return N.createElement(Ce.p,{ref:n,className:Qr("chakra-text",t.className),...u,...l,__css:r})});fn.displayName="Text";function OO(e){return typeof e=="number"?`${e}px`:e}var Kme=Ae(function(t,n){const{spacing:r="0.5rem",spacingX:i,spacingY:o,children:a,justify:s,direction:l,align:u,className:d,shouldWrapChildren:h,...m}=t,v=w.useMemo(()=>{const{spacingX:S=r,spacingY:k=r}={spacingX:i,spacingY:o};return{"--chakra-wrap-x-spacing":E=>Wd(S,_=>OO(ZC("space",_)(E))),"--chakra-wrap-y-spacing":E=>Wd(k,_=>OO(ZC("space",_)(E))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,i,o,s,u,l]),b=w.useMemo(()=>h?w.Children.map(a,(S,k)=>N.createElement(pF,{key:k},S)):a,[a,h]);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-wrap",d),overflow:"hidden",...m},N.createElement(Ce.ul,{className:"chakra-wrap__list",__css:v},b))});Kme.displayName="Wrap";var pF=Ae(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:Qr("chakra-wrap__listitem",r),...i})});pF.displayName="WrapItem";var Xme={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},gF=Xme,Cg=()=>{},Zme={document:gF,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:Cg,removeEventListener:Cg,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:Cg,removeListener:Cg}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:Cg,setInterval:()=>0,clearInterval:Cg},Qme=Zme,Jme={window:Qme,document:gF},mF=typeof window<"u"?{window,document}:Jme,vF=w.createContext(mF);vF.displayName="EnvironmentContext";function yF(e){const{children:t,environment:n}=e,[r,i]=w.useState(null),[o,a]=w.useState(!1);w.useEffect(()=>a(!0),[]);const s=w.useMemo(()=>{if(n)return n;const l=r==null?void 0:r.ownerDocument,u=r==null?void 0:r.ownerDocument.defaultView;return l?{document:l,window:u}:mF},[r,n]);return N.createElement(vF.Provider,{value:s},t,!n&&o&&N.createElement("span",{id:"__chakra_env",hidden:!0,ref:l=>{w.startTransition(()=>{l&&i(l)})}}))}yF.displayName="EnvironmentProvider";var e0e=e=>e?"":void 0;function t0e(){const e=w.useRef(new Map),t=e.current,n=w.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=w.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return w.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function _6(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function n0e(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:d,tabIndex:h,onMouseOver:m,onMouseLeave:v,...b}=e,[S,k]=w.useState(!0),[E,_]=w.useState(!1),T=t0e(),A=Z=>{Z&&Z.tagName!=="BUTTON"&&k(!1)},I=S?h:h||0,R=n&&!r,D=w.useCallback(Z=>{if(n){Z.stopPropagation(),Z.preventDefault();return}Z.currentTarget.focus(),l==null||l(Z)},[n,l]),j=w.useCallback(Z=>{E&&_6(Z)&&(Z.preventDefault(),Z.stopPropagation(),_(!1),T.remove(document,"keyup",j,!1))},[E,T]),z=w.useCallback(Z=>{if(u==null||u(Z),n||Z.defaultPrevented||Z.metaKey||!_6(Z.nativeEvent)||S)return;const W=i&&Z.key==="Enter";o&&Z.key===" "&&(Z.preventDefault(),_(!0)),W&&(Z.preventDefault(),Z.currentTarget.click()),T.add(document,"keyup",j,!1)},[n,S,u,i,o,T,j]),V=w.useCallback(Z=>{if(d==null||d(Z),n||Z.defaultPrevented||Z.metaKey||!_6(Z.nativeEvent)||S)return;o&&Z.key===" "&&(Z.preventDefault(),_(!1),Z.currentTarget.click())},[o,S,n,d]),K=w.useCallback(Z=>{Z.button===0&&(_(!1),T.remove(document,"mouseup",K,!1))},[T]),te=w.useCallback(Z=>{if(Z.button!==0)return;if(n){Z.stopPropagation(),Z.preventDefault();return}S||_(!0),Z.currentTarget.focus({preventScroll:!0}),T.add(document,"mouseup",K,!1),a==null||a(Z)},[n,S,a,T,K]),q=w.useCallback(Z=>{Z.button===0&&(S||_(!1),s==null||s(Z))},[s,S]),$=w.useCallback(Z=>{if(n){Z.preventDefault();return}m==null||m(Z)},[n,m]),U=w.useCallback(Z=>{E&&(Z.preventDefault(),_(!1)),v==null||v(Z)},[E,v]),X=qn(t,A);return S?{...b,ref:X,type:"button","aria-disabled":R?void 0:n,disabled:R,onClick:D,onMouseDown:a,onMouseUp:s,onKeyUp:d,onKeyDown:u,onMouseOver:m,onMouseLeave:v}:{...b,ref:X,role:"button","data-active":e0e(E),"aria-disabled":n?"true":void 0,tabIndex:R?void 0:I,onClick:D,onMouseDown:te,onMouseUp:q,onKeyUp:V,onKeyDown:z,onMouseOver:$,onMouseLeave:U}}function bF(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function SF(e){if(!bF(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function r0e(e){var t;return((t=xF(e))==null?void 0:t.defaultView)??window}function xF(e){return bF(e)?e.ownerDocument:document}function i0e(e){return xF(e).activeElement}var wF=e=>e.hasAttribute("tabindex"),o0e=e=>wF(e)&&e.tabIndex===-1;function a0e(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function CF(e){return e.parentElement&&CF(e.parentElement)?!0:e.hidden}function s0e(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function _F(e){if(!SF(e)||CF(e)||a0e(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():s0e(e)?!0:wF(e)}function l0e(e){return e?SF(e)&&_F(e)&&!o0e(e):!1}var u0e=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],c0e=u0e.join(),d0e=e=>e.offsetWidth>0&&e.offsetHeight>0;function kF(e){const t=Array.from(e.querySelectorAll(c0e));return t.unshift(e),t.filter(n=>_F(n)&&d0e(n))}function f0e(e){const t=e.current;if(!t)return!1;const n=i0e(t);return!n||t.contains(n)?!1:!!l0e(n)}function h0e(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;Vd(()=>{if(!o||f0e(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var p0e={preventScroll:!0,shouldFocus:!1};function g0e(e,t=p0e){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=m0e(e)?e.current:e,s=i&&o,l=w.useRef(s),u=w.useRef(o);Ws(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const d=w.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=kF(a);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[o,r,a,n]);Vd(()=>{d()},[d]),Rh(a,"transitionend",d)}function m0e(e){return"current"in e}var Zo="top",ls="bottom",us="right",Qo="left",vk="auto",Cy=[Zo,ls,us,Qo],Um="start",L2="end",v0e="clippingParents",EF="viewport",G1="popper",y0e="reference",MO=Cy.reduce(function(e,t){return e.concat([t+"-"+Um,t+"-"+L2])},[]),PF=[].concat(Cy,[vk]).reduce(function(e,t){return e.concat([t,t+"-"+Um,t+"-"+L2])},[]),b0e="beforeRead",S0e="read",x0e="afterRead",w0e="beforeMain",C0e="main",_0e="afterMain",k0e="beforeWrite",E0e="write",P0e="afterWrite",T0e=[b0e,S0e,x0e,w0e,C0e,_0e,k0e,E0e,P0e];function au(e){return e?(e.nodeName||"").toLowerCase():null}function hs(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Uh(e){var t=hs(e).Element;return e instanceof t||e instanceof Element}function is(e){var t=hs(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function yk(e){if(typeof ShadowRoot>"u")return!1;var t=hs(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function L0e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!is(o)||!au(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function A0e(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!is(i)||!au(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const O0e={name:"applyStyles",enabled:!0,phase:"write",fn:L0e,effect:A0e,requires:["computeStyles"]};function Zl(e){return e.split("-")[0]}var jh=Math.max,u5=Math.min,Gm=Math.round;function W7(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function TF(){return!/^((?!chrome|android).)*safari/i.test(W7())}function qm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&is(e)&&(i=e.offsetWidth>0&&Gm(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Gm(r.height)/e.offsetHeight||1);var a=Uh(e)?hs(e):window,s=a.visualViewport,l=!TF()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,d=(r.top+(l&&s?s.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:d,right:u+h,bottom:d+m,left:u,x:u,y:d}}function bk(e){var t=qm(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function LF(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&yk(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ec(e){return hs(e).getComputedStyle(e)}function M0e(e){return["table","td","th"].indexOf(au(e))>=0}function rf(e){return((Uh(e)?e.ownerDocument:e.document)||window.document).documentElement}function tx(e){return au(e)==="html"?e:e.assignedSlot||e.parentNode||(yk(e)?e.host:null)||rf(e)}function IO(e){return!is(e)||ec(e).position==="fixed"?null:e.offsetParent}function I0e(e){var t=/firefox/i.test(W7()),n=/Trident/i.test(W7());if(n&&is(e)){var r=ec(e);if(r.position==="fixed")return null}var i=tx(e);for(yk(i)&&(i=i.host);is(i)&&["html","body"].indexOf(au(i))<0;){var o=ec(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function _y(e){for(var t=hs(e),n=IO(e);n&&M0e(n)&&ec(n).position==="static";)n=IO(n);return n&&(au(n)==="html"||au(n)==="body"&&ec(n).position==="static")?t:n||I0e(e)||t}function Sk(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qv(e,t,n){return jh(e,u5(t,n))}function R0e(e,t,n){var r=qv(e,t,n);return r>n?n:r}function AF(){return{top:0,right:0,bottom:0,left:0}}function OF(e){return Object.assign({},AF(),e)}function MF(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var D0e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,OF(typeof t!="number"?t:MF(t,Cy))};function N0e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Zl(n.placement),l=Sk(s),u=[Qo,us].indexOf(s)>=0,d=u?"height":"width";if(!(!o||!a)){var h=D0e(i.padding,n),m=bk(o),v=l==="y"?Zo:Qo,b=l==="y"?ls:us,S=n.rects.reference[d]+n.rects.reference[l]-a[l]-n.rects.popper[d],k=a[l]-n.rects.reference[l],E=_y(o),_=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,T=S/2-k/2,A=h[v],I=_-m[d]-h[b],R=_/2-m[d]/2+T,D=qv(A,R,I),j=l;n.modifiersData[r]=(t={},t[j]=D,t.centerOffset=D-R,t)}}function j0e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||LF(t.elements.popper,i)&&(t.elements.arrow=i))}const B0e={name:"arrow",enabled:!0,phase:"main",fn:N0e,effect:j0e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ym(e){return e.split("-")[1]}var $0e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function F0e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Gm(t*i)/i||0,y:Gm(n*i)/i||0}}function RO(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,m=a.x,v=m===void 0?0:m,b=a.y,S=b===void 0?0:b,k=typeof d=="function"?d({x:v,y:S}):{x:v,y:S};v=k.x,S=k.y;var E=a.hasOwnProperty("x"),_=a.hasOwnProperty("y"),T=Qo,A=Zo,I=window;if(u){var R=_y(n),D="clientHeight",j="clientWidth";if(R===hs(n)&&(R=rf(n),ec(R).position!=="static"&&s==="absolute"&&(D="scrollHeight",j="scrollWidth")),R=R,i===Zo||(i===Qo||i===us)&&o===L2){A=ls;var z=h&&R===I&&I.visualViewport?I.visualViewport.height:R[D];S-=z-r.height,S*=l?1:-1}if(i===Qo||(i===Zo||i===ls)&&o===L2){T=us;var V=h&&R===I&&I.visualViewport?I.visualViewport.width:R[j];v-=V-r.width,v*=l?1:-1}}var K=Object.assign({position:s},u&&$0e),te=d===!0?F0e({x:v,y:S}):{x:v,y:S};if(v=te.x,S=te.y,l){var q;return Object.assign({},K,(q={},q[A]=_?"0":"",q[T]=E?"0":"",q.transform=(I.devicePixelRatio||1)<=1?"translate("+v+"px, "+S+"px)":"translate3d("+v+"px, "+S+"px, 0)",q))}return Object.assign({},K,(t={},t[A]=_?S+"px":"",t[T]=E?v+"px":"",t.transform="",t))}function z0e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Zl(t.placement),variation:Ym(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,RO(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,RO(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const H0e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:z0e,data:{}};var eb={passive:!0};function V0e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=hs(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,eb)}),s&&l.addEventListener("resize",n.update,eb),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,eb)}),s&&l.removeEventListener("resize",n.update,eb)}}const W0e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:V0e,data:{}};var U0e={left:"right",right:"left",bottom:"top",top:"bottom"};function h4(e){return e.replace(/left|right|bottom|top/g,function(t){return U0e[t]})}var G0e={start:"end",end:"start"};function DO(e){return e.replace(/start|end/g,function(t){return G0e[t]})}function xk(e){var t=hs(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function wk(e){return qm(rf(e)).left+xk(e).scrollLeft}function q0e(e,t){var n=hs(e),r=rf(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=TF();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+wk(e),y:l}}function Y0e(e){var t,n=rf(e),r=xk(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=jh(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=jh(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+wk(e),l=-r.scrollTop;return ec(i||n).direction==="rtl"&&(s+=jh(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function Ck(e){var t=ec(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function IF(e){return["html","body","#document"].indexOf(au(e))>=0?e.ownerDocument.body:is(e)&&Ck(e)?e:IF(tx(e))}function Yv(e,t){var n;t===void 0&&(t=[]);var r=IF(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=hs(r),a=i?[o].concat(o.visualViewport||[],Ck(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Yv(tx(a)))}function U7(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function K0e(e,t){var n=qm(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function NO(e,t,n){return t===EF?U7(q0e(e,n)):Uh(t)?K0e(t,n):U7(Y0e(rf(e)))}function X0e(e){var t=Yv(tx(e)),n=["absolute","fixed"].indexOf(ec(e).position)>=0,r=n&&is(e)?_y(e):e;return Uh(r)?t.filter(function(i){return Uh(i)&&LF(i,r)&&au(i)!=="body"}):[]}function Z0e(e,t,n,r){var i=t==="clippingParents"?X0e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var d=NO(e,u,r);return l.top=jh(d.top,l.top),l.right=u5(d.right,l.right),l.bottom=u5(d.bottom,l.bottom),l.left=jh(d.left,l.left),l},NO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function RF(e){var t=e.reference,n=e.element,r=e.placement,i=r?Zl(r):null,o=r?Ym(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Zo:l={x:a,y:t.y-n.height};break;case ls:l={x:a,y:t.y+t.height};break;case us:l={x:t.x+t.width,y:s};break;case Qo:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?Sk(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case Um:l[u]=l[u]-(t[d]/2-n[d]/2);break;case L2:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function A2(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?v0e:s,u=n.rootBoundary,d=u===void 0?EF:u,h=n.elementContext,m=h===void 0?G1:h,v=n.altBoundary,b=v===void 0?!1:v,S=n.padding,k=S===void 0?0:S,E=OF(typeof k!="number"?k:MF(k,Cy)),_=m===G1?y0e:G1,T=e.rects.popper,A=e.elements[b?_:m],I=Z0e(Uh(A)?A:A.contextElement||rf(e.elements.popper),l,d,a),R=qm(e.elements.reference),D=RF({reference:R,element:T,strategy:"absolute",placement:i}),j=U7(Object.assign({},T,D)),z=m===G1?j:R,V={top:I.top-z.top+E.top,bottom:z.bottom-I.bottom+E.bottom,left:I.left-z.left+E.left,right:z.right-I.right+E.right},K=e.modifiersData.offset;if(m===G1&&K){var te=K[i];Object.keys(V).forEach(function(q){var $=[us,ls].indexOf(q)>=0?1:-1,U=[Zo,ls].indexOf(q)>=0?"y":"x";V[q]+=te[U]*$})}return V}function Q0e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?PF:l,d=Ym(r),h=d?s?MO:MO.filter(function(b){return Ym(b)===d}):Cy,m=h.filter(function(b){return u.indexOf(b)>=0});m.length===0&&(m=h);var v=m.reduce(function(b,S){return b[S]=A2(e,{placement:S,boundary:i,rootBoundary:o,padding:a})[Zl(S)],b},{});return Object.keys(v).sort(function(b,S){return v[b]-v[S]})}function J0e(e){if(Zl(e)===vk)return[];var t=h4(e);return[DO(e),t,DO(t)]}function e1e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,v=n.flipVariations,b=v===void 0?!0:v,S=n.allowedAutoPlacements,k=t.options.placement,E=Zl(k),_=E===k,T=l||(_||!b?[h4(k)]:J0e(k)),A=[k].concat(T).reduce(function(ye,We){return ye.concat(Zl(We)===vk?Q0e(t,{placement:We,boundary:d,rootBoundary:h,padding:u,flipVariations:b,allowedAutoPlacements:S}):We)},[]),I=t.rects.reference,R=t.rects.popper,D=new Map,j=!0,z=A[0],V=0;V=0,U=$?"width":"height",X=A2(t,{placement:K,boundary:d,rootBoundary:h,altBoundary:m,padding:u}),Z=$?q?us:Qo:q?ls:Zo;I[U]>R[U]&&(Z=h4(Z));var W=h4(Z),Q=[];if(o&&Q.push(X[te]<=0),s&&Q.push(X[Z]<=0,X[W]<=0),Q.every(function(ye){return ye})){z=K,j=!1;break}D.set(K,Q)}if(j)for(var ie=b?3:1,fe=function(We){var De=A.find(function(ot){var He=D.get(ot);if(He)return He.slice(0,We).every(function(Be){return Be})});if(De)return z=De,"break"},Se=ie;Se>0;Se--){var Pe=fe(Se);if(Pe==="break")break}t.placement!==z&&(t.modifiersData[r]._skip=!0,t.placement=z,t.reset=!0)}}const t1e={name:"flip",enabled:!0,phase:"main",fn:e1e,requiresIfExists:["offset"],data:{_skip:!1}};function jO(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function BO(e){return[Zo,us,ls,Qo].some(function(t){return e[t]>=0})}function n1e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=A2(t,{elementContext:"reference"}),s=A2(t,{altBoundary:!0}),l=jO(a,r),u=jO(s,i,o),d=BO(l),h=BO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const r1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:n1e};function i1e(e,t,n){var r=Zl(e),i=[Qo,Zo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Qo,us].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function o1e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=PF.reduce(function(d,h){return d[h]=i1e(h,t.rects,o),d},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const a1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:o1e};function s1e(e){var t=e.state,n=e.name;t.modifiersData[n]=RF({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const l1e={name:"popperOffsets",enabled:!0,phase:"read",fn:s1e,data:{}};function u1e(e){return e==="x"?"y":"x"}function c1e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,m=n.tether,v=m===void 0?!0:m,b=n.tetherOffset,S=b===void 0?0:b,k=A2(t,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),E=Zl(t.placement),_=Ym(t.placement),T=!_,A=Sk(E),I=u1e(A),R=t.modifiersData.popperOffsets,D=t.rects.reference,j=t.rects.popper,z=typeof S=="function"?S(Object.assign({},t.rects,{placement:t.placement})):S,V=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,te={x:0,y:0};if(R){if(o){var q,$=A==="y"?Zo:Qo,U=A==="y"?ls:us,X=A==="y"?"height":"width",Z=R[A],W=Z+k[$],Q=Z-k[U],ie=v?-j[X]/2:0,fe=_===Um?D[X]:j[X],Se=_===Um?-j[X]:-D[X],Pe=t.elements.arrow,ye=v&&Pe?bk(Pe):{width:0,height:0},We=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:AF(),De=We[$],ot=We[U],He=qv(0,D[X],ye[X]),Be=T?D[X]/2-ie-He-De-V.mainAxis:fe-He-De-V.mainAxis,wt=T?-D[X]/2+ie+He+ot+V.mainAxis:Se+He+ot+V.mainAxis,st=t.elements.arrow&&_y(t.elements.arrow),mt=st?A==="y"?st.clientTop||0:st.clientLeft||0:0,St=(q=K==null?void 0:K[A])!=null?q:0,Le=Z+Be-St-mt,lt=Z+wt-St,Mt=qv(v?u5(W,Le):W,Z,v?jh(Q,lt):Q);R[A]=Mt,te[A]=Mt-Z}if(s){var ut,_t=A==="x"?Zo:Qo,ln=A==="x"?ls:us,ae=R[I],Re=I==="y"?"height":"width",Ye=ae+k[_t],Ke=ae-k[ln],xe=[Zo,Qo].indexOf(E)!==-1,Ne=(ut=K==null?void 0:K[I])!=null?ut:0,Ct=xe?Ye:ae-D[Re]-j[Re]-Ne+V.altAxis,Dt=xe?ae+D[Re]+j[Re]-Ne-V.altAxis:Ke,Te=v&&xe?R0e(Ct,ae,Dt):qv(v?Ct:Ye,ae,v?Dt:Ke);R[I]=Te,te[I]=Te-ae}t.modifiersData[r]=te}}const d1e={name:"preventOverflow",enabled:!0,phase:"main",fn:c1e,requiresIfExists:["offset"]};function f1e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function h1e(e){return e===hs(e)||!is(e)?xk(e):f1e(e)}function p1e(e){var t=e.getBoundingClientRect(),n=Gm(t.width)/e.offsetWidth||1,r=Gm(t.height)/e.offsetHeight||1;return n!==1||r!==1}function g1e(e,t,n){n===void 0&&(n=!1);var r=is(t),i=is(t)&&p1e(t),o=rf(t),a=qm(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((au(t)!=="body"||Ck(o))&&(s=h1e(t)),is(t)?(l=qm(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=wk(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function m1e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function v1e(e){var t=m1e(e);return T0e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function y1e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function b1e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var $O={placement:"bottom",modifiers:[],strategy:"absolute"};function FO(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),oi={arrowShadowColor:_g("--popper-arrow-shadow-color"),arrowSize:_g("--popper-arrow-size","8px"),arrowSizeHalf:_g("--popper-arrow-size-half"),arrowBg:_g("--popper-arrow-bg"),transformOrigin:_g("--popper-transform-origin"),arrowOffset:_g("--popper-arrow-offset")};function C1e(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var _1e={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},k1e=e=>_1e[e],zO={scroll:!0,resize:!0};function E1e(e){let t;return typeof e=="object"?t={enabled:!0,options:{...zO,...e}}:t={enabled:e,options:zO},t}var P1e={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},T1e={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{HO(e)},effect:({state:e})=>()=>{HO(e)}},HO=e=>{e.elements.popper.style.setProperty(oi.transformOrigin.var,k1e(e.placement))},L1e={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{A1e(e)}},A1e=e=>{var t;if(!e.placement)return;const n=O1e(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:oi.arrowSize.varRef,height:oi.arrowSize.varRef,zIndex:-1});const r={[oi.arrowSizeHalf.var]:`calc(${oi.arrowSize.varRef} / 2)`,[oi.arrowOffset.var]:`calc(${oi.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},O1e=e=>{if(e.startsWith("top"))return{property:"bottom",value:oi.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:oi.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:oi.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:oi.arrowOffset.varRef}},M1e={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{VO(e)},effect:({state:e})=>()=>{VO(e)}},VO=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");t&&Object.assign(t.style,{transform:"rotate(45deg)",background:oi.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:C1e(e.placement)})},I1e={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},R1e={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function D1e(e,t="ltr"){var n;const r=((n=I1e[e])==null?void 0:n[t])||e;return t==="ltr"?r:R1e[e]??r}function DF(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:s,gutter:l=8,flip:u=!0,boundary:d="clippingParents",preventOverflow:h=!0,matchWidth:m,direction:v="ltr"}=e,b=w.useRef(null),S=w.useRef(null),k=w.useRef(null),E=D1e(r,v),_=w.useRef(()=>{}),T=w.useCallback(()=>{var V;!t||!b.current||!S.current||((V=_.current)==null||V.call(_),k.current=w1e(b.current,S.current,{placement:E,modifiers:[M1e,L1e,T1e,{...P1e,enabled:!!m},{name:"eventListeners",...E1e(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:d}},...n??[]],strategy:i}),k.current.forceUpdate(),_.current=k.current.destroy)},[E,t,n,m,a,o,s,l,u,h,d,i]);w.useEffect(()=>()=>{var V;!b.current&&!S.current&&((V=k.current)==null||V.destroy(),k.current=null)},[]);const A=w.useCallback(V=>{b.current=V,T()},[T]),I=w.useCallback((V={},K=null)=>({...V,ref:qn(A,K)}),[A]),R=w.useCallback(V=>{S.current=V,T()},[T]),D=w.useCallback((V={},K=null)=>({...V,ref:qn(R,K),style:{...V.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,R,m]),j=w.useCallback((V={},K=null)=>{const{size:te,shadowColor:q,bg:$,style:U,...X}=V;return{...X,ref:K,"data-popper-arrow":"",style:N1e(V)}},[]),z=w.useCallback((V={},K=null)=>({...V,ref:K,"data-popper-arrow-inner":""}),[]);return{update(){var V;(V=k.current)==null||V.update()},forceUpdate(){var V;(V=k.current)==null||V.forceUpdate()},transformOrigin:oi.transformOrigin.varRef,referenceRef:A,popperRef:R,getPopperProps:D,getArrowProps:j,getArrowInnerProps:z,getReferenceProps:I}}function N1e(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function NF(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=Er(n),a=Er(t),[s,l]=w.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,d=r!==void 0,h=w.useId(),m=i??`disclosure-${h}`,v=w.useCallback(()=>{d||l(!1),a==null||a()},[d,a]),b=w.useCallback(()=>{d||l(!0),o==null||o()},[d,o]),S=w.useCallback(()=>{u?v():b()},[u,b,v]);function k(_={}){return{..._,"aria-expanded":u,"aria-controls":m,onClick(T){var A;(A=_.onClick)==null||A.call(_,T),S()}}}function E(_={}){return{..._,hidden:!u,id:m}}return{isOpen:u,onOpen:b,onClose:v,onToggle:S,isControlled:d,getButtonProps:k,getDisclosureProps:E}}function j1e(e){const{isOpen:t,ref:n}=e,[r,i]=w.useState(t),[o,a]=w.useState(!1);return w.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),Rh(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=r0e(n.current),d=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(d)}}}function jF(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var Qs={},B1e={get exports(){return Qs},set exports(e){Qs=e}},Na={},Bh={},$1e={get exports(){return Bh},set exports(e){Bh=e}},BF={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(W,Q){var ie=W.length;W.push(Q);e:for(;0>>1,Se=W[fe];if(0>>1;fei(We,ie))Dei(ot,We)?(W[fe]=ot,W[De]=ie,fe=De):(W[fe]=We,W[ye]=ie,fe=ye);else if(Dei(ot,ie))W[fe]=ot,W[De]=ie,fe=De;else break e}}return Q}function i(W,Q){var ie=W.sortIndex-Q.sortIndex;return ie!==0?ie:W.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],d=1,h=null,m=3,v=!1,b=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(W){for(var Q=n(u);Q!==null;){if(Q.callback===null)r(u);else if(Q.startTime<=W)r(u),Q.sortIndex=Q.expirationTime,t(l,Q);else break;Q=n(u)}}function A(W){if(S=!1,T(W),!b)if(n(l)!==null)b=!0,X(I);else{var Q=n(u);Q!==null&&Z(A,Q.startTime-W)}}function I(W,Q){b=!1,S&&(S=!1,E(j),j=-1),v=!0;var ie=m;try{for(T(Q),h=n(l);h!==null&&(!(h.expirationTime>Q)||W&&!K());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,m=h.priorityLevel;var Se=fe(h.expirationTime<=Q);Q=e.unstable_now(),typeof Se=="function"?h.callback=Se:h===n(l)&&r(l),T(Q)}else r(l);h=n(l)}if(h!==null)var Pe=!0;else{var ye=n(u);ye!==null&&Z(A,ye.startTime-Q),Pe=!1}return Pe}finally{h=null,m=ie,v=!1}}var R=!1,D=null,j=-1,z=5,V=-1;function K(){return!(e.unstable_now()-VW||125fe?(W.sortIndex=ie,t(u,W),n(l)===null&&W===n(u)&&(S?(E(j),j=-1):S=!0,Z(A,ie-fe))):(W.sortIndex=Se,t(l,W),b||v||(b=!0,X(I))),W},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(W){var Q=m;return function(){var ie=m;m=Q;try{return W.apply(this,arguments)}finally{m=ie}}}})(BF);(function(e){e.exports=BF})($1e);/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var $F=w,Ma=Bh;function Fe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),G7=Object.prototype.hasOwnProperty,F1e=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,WO={},UO={};function z1e(e){return G7.call(UO,e)?!0:G7.call(WO,e)?!1:F1e.test(e)?UO[e]=!0:(WO[e]=!0,!1)}function H1e(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function V1e(e,t,n,r){if(t===null||typeof t>"u"||H1e(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Oo(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var qi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qi[e]=new Oo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qi[t]=new Oo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qi[e]=new Oo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qi[e]=new Oo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){qi[e]=new Oo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qi[e]=new Oo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qi[e]=new Oo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qi[e]=new Oo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qi[e]=new Oo(e,5,!1,e.toLowerCase(),null,!1,!1)});var _k=/[\-:]([a-z])/g;function kk(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(_k,kk);qi[t]=new Oo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(_k,kk);qi[t]=new Oo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(_k,kk);qi[t]=new Oo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qi[e]=new Oo(e,1,!1,e.toLowerCase(),null,!1,!1)});qi.xlinkHref=new Oo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qi[e]=new Oo(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ek(e,t,n,r){var i=qi.hasOwnProperty(t)?qi[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` -`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{E6=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yv(e):""}function W1e(e){switch(e.tag){case 5:return yv(e.type);case 16:return yv("Lazy");case 13:return yv("Suspense");case 19:return yv("SuspenseList");case 0:case 2:case 15:return e=P6(e.type,!1),e;case 11:return e=P6(e.type.render,!1),e;case 1:return e=P6(e.type,!0),e;default:return""}}function X7(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Kg:return"Fragment";case Yg:return"Portal";case q7:return"Profiler";case Pk:return"StrictMode";case Y7:return"Suspense";case K7:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case HF:return(e.displayName||"Context")+".Consumer";case zF:return(e._context.displayName||"Context")+".Provider";case Tk:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Lk:return t=e.displayName||null,t!==null?t:X7(e.type)||"Memo";case pd:t=e._payload,e=e._init;try{return X7(e(t))}catch{}}return null}function U1e(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X7(t);case 8:return t===Pk?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ud(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function WF(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function G1e(e){var t=WF(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nb(e){e._valueTracker||(e._valueTracker=G1e(e))}function UF(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=WF(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function c5(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Z7(e,t){var n=t.checked;return Tr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qO(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ud(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function GF(e,t){t=t.checked,t!=null&&Ek(e,"checked",t,!1)}function Q7(e,t){GF(e,t);var n=Ud(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?J7(e,t.type,n):t.hasOwnProperty("defaultValue")&&J7(e,t.type,Ud(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function YO(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function J7(e,t,n){(t!=="number"||c5(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bv=Array.isArray;function _m(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=rb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function M2(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kv={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},q1e=["Webkit","ms","Moz","O"];Object.keys(Kv).forEach(function(e){q1e.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kv[t]=Kv[e]})});function XF(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Kv.hasOwnProperty(e)&&Kv[e]?(""+t).trim():t+"px"}function ZF(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=XF(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Y1e=Tr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function n9(e,t){if(t){if(Y1e[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Fe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Fe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Fe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Fe(62))}}function r9(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var i9=null;function Ak(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var o9=null,km=null,Em=null;function ZO(e){if(e=Py(e)){if(typeof o9!="function")throw Error(Fe(280));var t=e.stateNode;t&&(t=ax(t),o9(e.stateNode,e.type,t))}}function QF(e){km?Em?Em.push(e):Em=[e]:km=e}function JF(){if(km){var e=km,t=Em;if(Em=km=null,ZO(e),t)for(e=0;e>>=0,e===0?32:31-(ove(e)/ave|0)|0}var ib=64,ob=4194304;function Sv(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function p5(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Sv(s):(o&=a,o!==0&&(r=Sv(o)))}else a=n&~i,a!==0?r=Sv(a):o!==0&&(r=Sv(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ky(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ys(t),e[t]=n}function cve(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Zv),aM=String.fromCharCode(32),sM=!1;function bz(e,t){switch(e){case"keyup":return Bve.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xg=!1;function Fve(e,t){switch(e){case"compositionend":return Sz(t);case"keypress":return t.which!==32?null:(sM=!0,aM);case"textInput":return e=t.data,e===aM&&sM?null:e;default:return null}}function zve(e,t){if(Xg)return e==="compositionend"||!Bk&&bz(e,t)?(e=vz(),g4=Dk=_d=null,Xg=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dM(n)}}function _z(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_z(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kz(){for(var e=window,t=c5();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=c5(e.document)}return t}function $k(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Xve(e){var t=kz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_z(n.ownerDocument.documentElement,n)){if(r!==null&&$k(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=fM(n,o);var a=fM(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Zg=null,d9=null,Jv=null,f9=!1;function hM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;f9||Zg==null||Zg!==c5(r)||(r=Zg,"selectionStart"in r&&$k(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Jv&&B2(Jv,r)||(Jv=r,r=v5(d9,"onSelect"),0em||(e.current=y9[em],y9[em]=null,em--)}function nr(e,t){em++,y9[em]=e.current,e.current=t}var Gd={},lo=af(Gd),Jo=af(!1),Gh=Gd;function Xm(e,t){var n=e.type.contextTypes;if(!n)return Gd;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ea(e){return e=e.childContextTypes,e!=null}function b5(){fr(Jo),fr(lo)}function SM(e,t,n){if(lo.current!==Gd)throw Error(Fe(168));nr(lo,t),nr(Jo,n)}function Rz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Fe(108,U1e(e)||"Unknown",i));return Tr({},n,r)}function S5(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gd,Gh=lo.current,nr(lo,e),nr(Jo,Jo.current),!0}function xM(e,t,n){var r=e.stateNode;if(!r)throw Error(Fe(169));n?(e=Rz(e,t,Gh),r.__reactInternalMemoizedMergedChildContext=e,fr(Jo),fr(lo),nr(lo,e)):fr(Jo),nr(Jo,n)}var Hu=null,sx=!1,z6=!1;function Dz(e){Hu===null?Hu=[e]:Hu.push(e)}function l2e(e){sx=!0,Dz(e)}function sf(){if(!z6&&Hu!==null){z6=!0;var e=0,t=Bn;try{var n=Hu;for(Bn=1;e>=a,i-=a,Uu=1<<32-Ys(t)+i|n<j?(z=D,D=null):z=D.sibling;var V=m(E,D,T[j],A);if(V===null){D===null&&(D=z);break}e&&D&&V.alternate===null&&t(E,D),_=o(V,_,j),R===null?I=V:R.sibling=V,R=V,D=z}if(j===T.length)return n(E,D),yr&&dh(E,j),I;if(D===null){for(;jj?(z=D,D=null):z=D.sibling;var K=m(E,D,V.value,A);if(K===null){D===null&&(D=z);break}e&&D&&K.alternate===null&&t(E,D),_=o(K,_,j),R===null?I=K:R.sibling=K,R=K,D=z}if(V.done)return n(E,D),yr&&dh(E,j),I;if(D===null){for(;!V.done;j++,V=T.next())V=h(E,V.value,A),V!==null&&(_=o(V,_,j),R===null?I=V:R.sibling=V,R=V);return yr&&dh(E,j),I}for(D=r(E,D);!V.done;j++,V=T.next())V=v(D,E,j,V.value,A),V!==null&&(e&&V.alternate!==null&&D.delete(V.key===null?j:V.key),_=o(V,_,j),R===null?I=V:R.sibling=V,R=V);return e&&D.forEach(function(te){return t(E,te)}),yr&&dh(E,j),I}function k(E,_,T,A){if(typeof T=="object"&&T!==null&&T.type===Kg&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case tb:e:{for(var I=T.key,R=_;R!==null;){if(R.key===I){if(I=T.type,I===Kg){if(R.tag===7){n(E,R.sibling),_=i(R,T.props.children),_.return=E,E=_;break e}}else if(R.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===pd&&TM(I)===R.type){n(E,R.sibling),_=i(R,T.props),_.ref=Q1(E,R,T),_.return=E,E=_;break e}n(E,R);break}else t(E,R);R=R.sibling}T.type===Kg?(_=Fh(T.props.children,E.mode,A,T.key),_.return=E,E=_):(A=C4(T.type,T.key,T.props,null,E.mode,A),A.ref=Q1(E,_,T),A.return=E,E=A)}return a(E);case Yg:e:{for(R=T.key;_!==null;){if(_.key===R)if(_.tag===4&&_.stateNode.containerInfo===T.containerInfo&&_.stateNode.implementation===T.implementation){n(E,_.sibling),_=i(_,T.children||[]),_.return=E,E=_;break e}else{n(E,_);break}else t(E,_);_=_.sibling}_=K6(T,E.mode,A),_.return=E,E=_}return a(E);case pd:return R=T._init,k(E,_,R(T._payload),A)}if(bv(T))return b(E,_,T,A);if(q1(T))return S(E,_,T,A);fb(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,_!==null&&_.tag===6?(n(E,_.sibling),_=i(_,T),_.return=E,E=_):(n(E,_),_=Y6(T,E.mode,A),_.return=E,E=_),a(E)):n(E,_)}return k}var Qm=Vz(!0),Wz=Vz(!1),Ty={},Jl=af(Ty),H2=af(Ty),V2=af(Ty);function Ph(e){if(e===Ty)throw Error(Fe(174));return e}function Yk(e,t){switch(nr(V2,t),nr(H2,e),nr(Jl,Ty),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:t9(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=t9(t,e)}fr(Jl),nr(Jl,t)}function Jm(){fr(Jl),fr(H2),fr(V2)}function Uz(e){Ph(V2.current);var t=Ph(Jl.current),n=t9(t,e.type);t!==n&&(nr(H2,e),nr(Jl,n))}function Kk(e){H2.current===e&&(fr(Jl),fr(H2))}var _r=af(0);function E5(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var H6=[];function Xk(){for(var e=0;en?n:4,e(!0);var r=V6.transition;V6.transition={};try{e(!1),t()}finally{Bn=n,V6.transition=r}}function sH(){return ds().memoizedState}function f2e(e,t,n){var r=Dd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lH(e))uH(t,n);else if(n=$z(e,t,n,r),n!==null){var i=To();Ks(n,e,r,i),cH(n,t,r)}}function h2e(e,t,n){var r=Dd(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lH(e))uH(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Js(s,a)){var l=t.interleaved;l===null?(i.next=i,Gk(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=$z(e,t,i,r),n!==null&&(i=To(),Ks(n,e,r,i),cH(n,t,r))}}function lH(e){var t=e.alternate;return e===Pr||t!==null&&t===Pr}function uH(e,t){e2=P5=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cH(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mk(e,n)}}var T5={readContext:cs,useCallback:Qi,useContext:Qi,useEffect:Qi,useImperativeHandle:Qi,useInsertionEffect:Qi,useLayoutEffect:Qi,useMemo:Qi,useReducer:Qi,useRef:Qi,useState:Qi,useDebugValue:Qi,useDeferredValue:Qi,useTransition:Qi,useMutableSource:Qi,useSyncExternalStore:Qi,useId:Qi,unstable_isNewReconciler:!1},p2e={readContext:cs,useCallback:function(e,t){return Dl().memoizedState=[e,t===void 0?null:t],e},useContext:cs,useEffect:AM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,b4(4194308,4,nH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return b4(4194308,4,e,t)},useInsertionEffect:function(e,t){return b4(4,2,e,t)},useMemo:function(e,t){var n=Dl();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Dl();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=f2e.bind(null,Pr,e),[r.memoizedState,e]},useRef:function(e){var t=Dl();return e={current:e},t.memoizedState=e},useState:LM,useDebugValue:tE,useDeferredValue:function(e){return Dl().memoizedState=e},useTransition:function(){var e=LM(!1),t=e[0];return e=d2e.bind(null,e[1]),Dl().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pr,i=Dl();if(yr){if(n===void 0)throw Error(Fe(407));n=n()}else{if(n=t(),Li===null)throw Error(Fe(349));Yh&30||Yz(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,AM(Xz.bind(null,r,o,e),[e]),r.flags|=2048,G2(9,Kz.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Dl(),t=Li.identifierPrefix;if(yr){var n=Gu,r=Uu;n=(r&~(1<<32-Ys(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=W2++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[zl]=t,e[z2]=r,bH(e,t,!1,!1),t.stateNode=e;e:{switch(a=r9(n,r),n){case"dialog":or("cancel",e),or("close",e),i=r;break;case"iframe":case"object":case"embed":or("load",e),i=r;break;case"video":case"audio":for(i=0;it0&&(t.flags|=128,r=!0,J1(o,!1),t.lanes=4194304)}else{if(!r)if(e=E5(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),J1(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!yr)return Ji(t),null}else 2*Zr()-o.renderingStartTime>t0&&n!==1073741824&&(t.flags|=128,r=!0,J1(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Zr(),t.sibling=null,n=_r.current,nr(_r,r?n&1|2:n&1),t):(Ji(t),null);case 22:case 23:return sE(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?_a&1073741824&&(Ji(t),t.subtreeFlags&6&&(t.flags|=8192)):Ji(t),null;case 24:return null;case 25:return null}throw Error(Fe(156,t.tag))}function w2e(e,t){switch(zk(t),t.tag){case 1:return ea(t.type)&&b5(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jm(),fr(Jo),fr(lo),Xk(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Kk(t),null;case 13:if(fr(_r),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Fe(340));Zm()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fr(_r),null;case 4:return Jm(),null;case 10:return Uk(t.type._context),null;case 22:case 23:return sE(),null;case 24:return null;default:return null}}var pb=!1,io=!1,C2e=typeof WeakSet=="function"?WeakSet:Set,ht=null;function im(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$r(e,t,r)}else n.current=null}function A9(e,t,n){try{n()}catch(r){$r(e,t,r)}}var $M=!1;function _2e(e,t){if(h9=g5,e=kz(),$k(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,d=0,h=e,m=null;t:for(;;){for(var v;h!==n||i!==0&&h.nodeType!==3||(s=a+i),h!==o||r!==0&&h.nodeType!==3||(l=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(v=h.firstChild)!==null;)m=h,h=v;for(;;){if(h===e)break t;if(m===n&&++u===i&&(s=a),m===o&&++d===r&&(l=a),(v=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=v}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(p9={focusedElem:e,selectionRange:n},g5=!1,ht=t;ht!==null;)if(t=ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ht=e;else for(;ht!==null;){t=ht;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var S=b.memoizedProps,k=b.memoizedState,E=t.stateNode,_=E.getSnapshotBeforeUpdate(t.elementType===t.type?S:Ns(t.type,S),k);E.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Fe(163))}}catch(A){$r(t,t.return,A)}if(e=t.sibling,e!==null){e.return=t.return,ht=e;break}ht=t.return}return b=$M,$M=!1,b}function t2(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&A9(t,n,o)}i=i.next}while(i!==r)}}function cx(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function O9(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wH(e){var t=e.alternate;t!==null&&(e.alternate=null,wH(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zl],delete t[z2],delete t[v9],delete t[a2e],delete t[s2e])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function CH(e){return e.tag===5||e.tag===3||e.tag===4}function FM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||CH(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function M9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=y5));else if(r!==4&&(e=e.child,e!==null))for(M9(e,t,n),e=e.sibling;e!==null;)M9(e,t,n),e=e.sibling}function I9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(I9(e,t,n),e=e.sibling;e!==null;)I9(e,t,n),e=e.sibling}var Hi=null,js=!1;function sd(e,t,n){for(n=n.child;n!==null;)_H(e,t,n),n=n.sibling}function _H(e,t,n){if(Ql&&typeof Ql.onCommitFiberUnmount=="function")try{Ql.onCommitFiberUnmount(nx,n)}catch{}switch(n.tag){case 5:io||im(n,t);case 6:var r=Hi,i=js;Hi=null,sd(e,t,n),Hi=r,js=i,Hi!==null&&(js?(e=Hi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Hi.removeChild(n.stateNode));break;case 18:Hi!==null&&(js?(e=Hi,n=n.stateNode,e.nodeType===8?F6(e.parentNode,n):e.nodeType===1&&F6(e,n),N2(e)):F6(Hi,n.stateNode));break;case 4:r=Hi,i=js,Hi=n.stateNode.containerInfo,js=!0,sd(e,t,n),Hi=r,js=i;break;case 0:case 11:case 14:case 15:if(!io&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&A9(n,t,a),i=i.next}while(i!==r)}sd(e,t,n);break;case 1:if(!io&&(im(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){$r(n,t,s)}sd(e,t,n);break;case 21:sd(e,t,n);break;case 22:n.mode&1?(io=(r=io)||n.memoizedState!==null,sd(e,t,n),io=r):sd(e,t,n);break;default:sd(e,t,n)}}function zM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new C2e),t.forEach(function(r){var i=I2e.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Is(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Zr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*E2e(r/1960))-r,10e?16:e,kd===null)var r=!1;else{if(e=kd,kd=null,O5=0,pn&6)throw Error(Fe(331));var i=pn;for(pn|=4,ht=e.current;ht!==null;){var o=ht,a=o.child;if(ht.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lZr()-oE?$h(e,0):iE|=n),ta(e,t)}function MH(e,t){t===0&&(e.mode&1?(t=ob,ob<<=1,!(ob&130023424)&&(ob=4194304)):t=1);var n=To();e=rc(e,t),e!==null&&(ky(e,t,n),ta(e,n))}function M2e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),MH(e,n)}function I2e(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Fe(314))}r!==null&&r.delete(t),MH(e,n)}var IH;IH=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Jo.current)Xo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xo=!1,S2e(e,t,n);Xo=!!(e.flags&131072)}else Xo=!1,yr&&t.flags&1048576&&Nz(t,w5,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;S4(e,t),e=t.pendingProps;var i=Xm(t,lo.current);Tm(t,n),i=Qk(null,t,r,e,i,n);var o=Jk();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ea(r)?(o=!0,S5(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qk(t),i.updater=lx,t.stateNode=i,i._reactInternals=t,C9(t,r,e,n),t=E9(null,t,r,!0,o,n)):(t.tag=0,yr&&o&&Fk(t),wo(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(S4(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=D2e(r),e=Ns(r,e),i){case 0:t=k9(null,t,r,e,n);break e;case 1:t=NM(null,t,r,e,n);break e;case 11:t=RM(null,t,r,e,n);break e;case 14:t=DM(null,t,r,Ns(r.type,e),n);break e}throw Error(Fe(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ns(r,i),k9(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ns(r,i),NM(e,t,r,i,n);case 3:e:{if(mH(t),e===null)throw Error(Fe(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Fz(e,t),k5(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=e0(Error(Fe(423)),t),t=jM(e,t,r,n,i);break e}else if(r!==i){i=e0(Error(Fe(424)),t),t=jM(e,t,r,n,i);break e}else for(Ea=Md(t.stateNode.containerInfo.firstChild),La=t,yr=!0,$s=null,n=Wz(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Zm(),r===i){t=ic(e,t,n);break e}wo(e,t,r,n)}t=t.child}return t;case 5:return Uz(t),e===null&&S9(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,g9(r,i)?a=null:o!==null&&g9(r,o)&&(t.flags|=32),gH(e,t),wo(e,t,a,n),t.child;case 6:return e===null&&S9(t),null;case 13:return vH(e,t,n);case 4:return Yk(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qm(t,null,r,n):wo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ns(r,i),RM(e,t,r,i,n);case 7:return wo(e,t,t.pendingProps,n),t.child;case 8:return wo(e,t,t.pendingProps.children,n),t.child;case 12:return wo(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,nr(C5,r._currentValue),r._currentValue=a,o!==null)if(Js(o.value,a)){if(o.children===i.children&&!Jo.current){t=ic(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=qu(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),x9(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Fe(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),x9(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}wo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Tm(t,n),i=cs(i),r=r(i),t.flags|=1,wo(e,t,r,n),t.child;case 14:return r=t.type,i=Ns(r,t.pendingProps),i=Ns(r.type,i),DM(e,t,r,i,n);case 15:return hH(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ns(r,i),S4(e,t),t.tag=1,ea(r)?(e=!0,S5(t)):e=!1,Tm(t,n),Hz(t,r,i),C9(t,r,i,n),E9(null,t,r,!0,e,n);case 19:return yH(e,t,n);case 22:return pH(e,t,n)}throw Error(Fe(156,t.tag))};function RH(e,t){return az(e,t)}function R2e(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ns(e,t,n,r){return new R2e(e,t,n,r)}function uE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function D2e(e){if(typeof e=="function")return uE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Tk)return 11;if(e===Lk)return 14}return 2}function Nd(e,t){var n=e.alternate;return n===null?(n=ns(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function C4(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")uE(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Kg:return Fh(n.children,i,o,t);case Pk:a=8,i|=8;break;case q7:return e=ns(12,n,t,i|2),e.elementType=q7,e.lanes=o,e;case Y7:return e=ns(13,n,t,i),e.elementType=Y7,e.lanes=o,e;case K7:return e=ns(19,n,t,i),e.elementType=K7,e.lanes=o,e;case VF:return fx(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case zF:a=10;break e;case HF:a=9;break e;case Tk:a=11;break e;case Lk:a=14;break e;case pd:a=16,r=null;break e}throw Error(Fe(130,e==null?e:typeof e,""))}return t=ns(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Fh(e,t,n,r){return e=ns(7,e,r,t),e.lanes=n,e}function fx(e,t,n,r){return e=ns(22,e,r,t),e.elementType=VF,e.lanes=n,e.stateNode={isHidden:!1},e}function Y6(e,t,n){return e=ns(6,e,null,t),e.lanes=n,e}function K6(e,t,n){return t=ns(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function N2e(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=L6(0),this.expirationTimes=L6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=L6(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function cE(e,t,n,r,i,o,a,s,l){return e=new N2e(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ns(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qk(o),e}function j2e(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Na})(B1e);const vb=d_(Qs);var[H2e,V2e]=Mn({strict:!1,name:"PortalManagerContext"});function BH(e){const{children:t,zIndex:n}=e;return N.createElement(H2e,{value:{zIndex:n}},t)}BH.displayName="PortalManager";var[$H,W2e]=Mn({strict:!1,name:"PortalContext"}),pE="chakra-portal",U2e=".chakra-portal",G2e=e=>N.createElement("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0}},e.children),q2e=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=w.useState(null),o=w.useRef(null),[,a]=w.useState({});w.useEffect(()=>a({}),[]);const s=W2e(),l=V2e();Ws(()=>{if(!r)return;const d=r.ownerDocument,h=t?s??d.body:d.body;if(!h)return;o.current=d.createElement("div"),o.current.className=pE,h.appendChild(o.current),a({});const m=o.current;return()=>{h.contains(m)&&h.removeChild(m)}},[r]);const u=l!=null&&l.zIndex?N.createElement(G2e,{zIndex:l==null?void 0:l.zIndex},n):n;return o.current?Qs.createPortal(N.createElement($H,{value:o.current},u),o.current):N.createElement("span",{ref:d=>{d&&i(d)}})},Y2e=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=w.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=pE),l},[i]),[,s]=w.useState({});return Ws(()=>s({}),[]),Ws(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?Qs.createPortal(N.createElement($H,{value:r?a:null},t),a):null};function ap(e){const{containerRef:t,...n}=e;return t?N.createElement(Y2e,{containerRef:t,...n}):N.createElement(q2e,{...n})}ap.defaultProps={appendToParentPortal:!0};ap.className=pE;ap.selector=U2e;ap.displayName="Portal";var K2e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Eg=new WeakMap,yb=new WeakMap,bb={},X6=0,FH=function(e){return e&&(e.host||FH(e.parentNode))},X2e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=FH(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},Z2e=function(e,t,n,r){var i=X2e(t,Array.isArray(e)?e:[e]);bb[n]||(bb[n]=new WeakMap);var o=bb[n],a=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(s.has(m))d(m);else{var v=m.getAttribute(r),b=v!==null&&v!=="false",S=(Eg.get(m)||0)+1,k=(o.get(m)||0)+1;Eg.set(m,S),o.set(m,k),a.push(m),S===1&&b&&yb.set(m,!0),k===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}})};return d(t),s.clear(),X6++,function(){a.forEach(function(h){var m=Eg.get(h)-1,v=o.get(h)-1;Eg.set(h,m),o.set(h,v),m||(yb.has(h)||h.removeAttribute(r),yb.delete(h)),v||h.removeAttribute(n)}),X6--,X6||(Eg=new WeakMap,Eg=new WeakMap,yb=new WeakMap,bb={})}},zH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||K2e(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Z2e(r,i,n,"aria-hidden")):function(){return null}};function gE(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var jn={},Q2e={get exports(){return jn},set exports(e){jn=e}},J2e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",eye=J2e,tye=eye;function HH(){}function VH(){}VH.resetWarningCache=HH;var nye=function(){function e(r,i,o,a,s,l){if(l!==tye){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:VH,resetWarningCache:HH};return n.PropTypes=n,n};Q2e.exports=nye();var B9="data-focus-lock",WH="data-focus-lock-disabled",rye="data-no-focus-lock",iye="data-autofocus-inside",oye="data-no-autofocus";function aye(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function sye(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function UH(e,t){return sye(t||null,function(n){return e.forEach(function(r){return aye(r,n)})})}var Z6={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function GH(e){return e}function qH(e,t){t===void 0&&(t=GH);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function mE(e,t){return t===void 0&&(t=GH),qH(e,t)}function YH(e){e===void 0&&(e={});var t=qH(null);return t.options=Fl({async:!0,ssr:!1},e),t}var KH=function(e){var t=e.sideCar,n=$$(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Fl({},n))};KH.isSideCarExport=!0;function lye(e,t){return e.useMedium(t),KH}var XH=mE({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),ZH=mE(),uye=mE(),cye=YH({async:!0}),dye=[],vE=w.forwardRef(function(t,n){var r,i=w.useState(),o=i[0],a=i[1],s=w.useRef(),l=w.useRef(!1),u=w.useRef(null),d=t.children,h=t.disabled,m=t.noFocusGuards,v=t.persistentFocus,b=t.crossFrame,S=t.autoFocus;t.allowTextSelection;var k=t.group,E=t.className,_=t.whiteList,T=t.hasPositiveIndices,A=t.shards,I=A===void 0?dye:A,R=t.as,D=R===void 0?"div":R,j=t.lockProps,z=j===void 0?{}:j,V=t.sideCar,K=t.returnFocus,te=t.focusOptions,q=t.onActivation,$=t.onDeactivation,U=w.useState({}),X=U[0],Z=w.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&q&&q(s.current),l.current=!0},[q]),W=w.useCallback(function(){l.current=!1,$&&$(s.current)},[$]);w.useEffect(function(){h||(u.current=null)},[]);var Q=w.useCallback(function(ot){var He=u.current;if(He&&He.focus){var Be=typeof K=="function"?K(He):K;if(Be){var wt=typeof Be=="object"?Be:void 0;u.current=null,ot?Promise.resolve().then(function(){return He.focus(wt)}):He.focus(wt)}}},[K]),ie=w.useCallback(function(ot){l.current&&XH.useMedium(ot)},[]),fe=ZH.useMedium,Se=w.useCallback(function(ot){s.current!==ot&&(s.current=ot,a(ot))},[]),Pe=bn((r={},r[WH]=h&&"disabled",r[B9]=k,r),z),ye=m!==!0,We=ye&&m!=="tail",De=UH([n,Se]);return w.createElement(w.Fragment,null,ye&&[w.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:Z6}),T?w.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:Z6}):null],!h&&w.createElement(V,{id:X,sideCar:cye,observed:o,disabled:h,persistentFocus:v,crossFrame:b,autoFocus:S,whiteList:_,shards:I,onActivation:Z,onDeactivation:W,returnFocus:Q,focusOptions:te}),w.createElement(D,bn({ref:De},Pe,{className:E,onBlur:fe,onFocus:ie}),d),We&&w.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:Z6}))});vE.propTypes={};vE.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const QH=vE;function $9(e,t){return $9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$9(e,t)}function yE(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$9(e,t)}function JH(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fye(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){yE(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return a};var h=d.prototype;return h.componentDidMount=function(){o.push(this),s()},h.componentDidUpdate=function(){s()},h.componentWillUnmount=function(){var v=o.indexOf(this);o.splice(v,1),s()},h.render=function(){return N.createElement(i,this.props)},d}(w.PureComponent);return JH(l,"displayName","SideEffect("+n(i)+")"),l}}var fu=function(e){for(var t=Array(e.length),n=0;n=0}).sort(Sye)},xye=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],SE=xye.join(","),wye="".concat(SE,", [data-focus-guard]"),lV=function(e,t){var n;return fu(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,i){return r.concat(i.matches(t?wye:SE)?[i]:[],lV(i))},[])},xE=function(e,t){return e.reduce(function(n,r){return n.concat(lV(r,t),r.parentNode?fu(r.parentNode.querySelectorAll(SE)).filter(function(i){return i===r}):[])},[])},Cye=function(e){var t=e.querySelectorAll("[".concat(iye,"]"));return fu(t).map(function(n){return xE([n])}).reduce(function(n,r){return n.concat(r)},[])},wE=function(e,t){return fu(e).filter(function(n){return nV(t,n)}).filter(function(n){return vye(n)})},KM=function(e,t){return t===void 0&&(t=new Map),fu(e).filter(function(n){return rV(t,n)})},z9=function(e,t,n){return sV(wE(xE(e,n),t),!0,n)},XM=function(e,t){return sV(wE(xE(e),t),!1)},_ye=function(e,t){return wE(Cye(e),t)},Y2=function(e,t){return e.shadowRoot?Y2(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:fu(e.children).some(function(n){return Y2(n,t)})},kye=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},uV=function(e){return e.parentNode?uV(e.parentNode):e},CE=function(e){var t=F9(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(B9);return n.push.apply(n,i?kye(fu(uV(r).querySelectorAll("[".concat(B9,'="').concat(i,'"]:not([').concat(WH,'="disabled"])')))):[r]),n},[])},cV=function(e){return e.activeElement?e.activeElement.shadowRoot?cV(e.activeElement.shadowRoot):e.activeElement:void 0},_E=function(){return document.activeElement?document.activeElement.shadowRoot?cV(document.activeElement.shadowRoot):document.activeElement:void 0},Eye=function(e){return e===document.activeElement},Pye=function(e){return Boolean(fu(e.querySelectorAll("iframe")).some(function(t){return Eye(t)}))},dV=function(e){var t=document&&_E();return!t||t.dataset&&t.dataset.focusGuard?!1:CE(e).some(function(n){return Y2(n,t)||Pye(n)})},Tye=function(){var e=document&&_E();return e?fu(document.querySelectorAll("[".concat(rye,"]"))).some(function(t){return Y2(t,e)}):!1},Lye=function(e,t){return t.filter(aV).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},kE=function(e,t){return aV(e)&&e.name?Lye(e,t):e},Aye=function(e){var t=new Set;return e.forEach(function(n){return t.add(kE(n,e))}),e.filter(function(n){return t.has(n)})},ZM=function(e){return e[0]&&e.length>1?kE(e[0],e):e[0]},QM=function(e,t){return e.length>1?e.indexOf(kE(e[t],e)):t},fV="NEW_FOCUS",Oye=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=bE(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,d=r?e.indexOf(r):-1,h=l-u,m=t.indexOf(o),v=t.indexOf(a),b=Aye(t),S=n!==void 0?b.indexOf(n):-1,k=S-(r?b.indexOf(r):l),E=QM(e,0),_=QM(e,i-1);if(l===-1||d===-1)return fV;if(!h&&d>=0)return d;if(l<=m&&s&&Math.abs(h)>1)return _;if(l>=v&&s&&Math.abs(h)>1)return E;if(h&&Math.abs(k)>1)return d;if(l<=m)return _;if(l>v)return E;if(h)return Math.abs(h)>1?d:(i+d+h)%i}},Mye=function(e){return function(t){var n,r=(n=iV(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},Iye=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=KM(r.filter(Mye(n)));return i&&i.length?ZM(i):ZM(KM(t))},H9=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&H9(e.parentNode.host||e.parentNode,t),t},Q6=function(e,t){for(var n=H9(e),r=H9(t),i=0;i=0)return o}return!1},hV=function(e,t,n){var r=F9(e),i=F9(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=Q6(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=Q6(o,l);u&&(!a||Y2(u,a)?a=u:a=Q6(u,a))})}),a},Rye=function(e,t){return e.reduce(function(n,r){return n.concat(_ye(r,t))},[])},Dye=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(bye)},Nye=function(e,t){var n=document&&_E(),r=CE(e).filter(R5),i=hV(n||e,e,r),o=new Map,a=XM(r,o),s=z9(r,o).filter(function(m){var v=m.node;return R5(v)});if(!(!s[0]&&(s=a,!s[0]))){var l=XM([i],o).map(function(m){var v=m.node;return v}),u=Dye(l,s),d=u.map(function(m){var v=m.node;return v}),h=Oye(d,l,n,t);return h===fV?{node:Iye(a,d,Rye(r,o))}:h===void 0?h:u[h]}},jye=function(e){var t=CE(e).filter(R5),n=hV(e,e,t),r=new Map,i=z9([n],r,!0),o=z9(t,r).filter(function(a){var s=a.node;return R5(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:bE(s)}})},Bye=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},J6=0,eC=!1,$ye=function(e,t,n){n===void 0&&(n={});var r=Nye(e,t);if(!eC&&r){if(J6>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),eC=!0,setTimeout(function(){eC=!1},1);return}J6++,Bye(r.node,n.focusOptions),J6--}};const pV=$ye;function gV(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var Fye=function(){return document&&document.activeElement===document.body},zye=function(){return Fye()||Tye()},Am=null,am=null,Om=null,K2=!1,Hye=function(){return!0},Vye=function(t){return(Am.whiteList||Hye)(t)},Wye=function(t,n){Om={observerNode:t,portaledElement:n}},Uye=function(t){return Om&&Om.portaledElement===t};function JM(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var Gye=function(t){return t&&"current"in t?t.current:t},qye=function(t){return t?Boolean(K2):K2==="meanwhile"},Yye=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},Kye=function(t,n){return n.some(function(r){return Yye(t,r,r)})},D5=function(){var t=!1;if(Am){var n=Am,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||Om&&Om.portaledElement,d=document&&document.activeElement;if(u){var h=[u].concat(a.map(Gye).filter(Boolean));if((!d||Vye(d))&&(i||qye(s)||!zye()||!am&&o)&&(u&&!(dV(h)||d&&Kye(d,h)||Uye(d))&&(document&&!am&&d&&!o?(d.blur&&d.blur(),document.body.focus()):(t=pV(h,am,{focusOptions:l}),Om={})),K2=!1,am=document&&document.activeElement),document){var m=document&&document.activeElement,v=jye(h),b=v.map(function(S){var k=S.node;return k}).indexOf(m);b>-1&&(v.filter(function(S){var k=S.guard,E=S.node;return k&&E.dataset.focusAutoGuard}).forEach(function(S){var k=S.node;return k.removeAttribute("tabIndex")}),JM(b,v.length,1,v),JM(b,-1,-1,v))}}}return t},mV=function(t){D5()&&t&&(t.stopPropagation(),t.preventDefault())},EE=function(){return gV(D5)},Xye=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Wye(r,n)},Zye=function(){return null},vV=function(){K2="just",setTimeout(function(){K2="meanwhile"},0)},Qye=function(){document.addEventListener("focusin",mV),document.addEventListener("focusout",EE),window.addEventListener("blur",vV)},Jye=function(){document.removeEventListener("focusin",mV),document.removeEventListener("focusout",EE),window.removeEventListener("blur",vV)};function e3e(e){return e.filter(function(t){var n=t.disabled;return!n})}function t3e(e){var t=e.slice(-1)[0];t&&!Am&&Qye();var n=Am,r=n&&t&&t.id===n.id;Am=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(am=null,(!r||n.observed!==t.observed)&&t.onActivation(),D5(),gV(D5)):(Jye(),am=null)}XH.assignSyncMedium(Xye);ZH.assignMedium(EE);uye.assignMedium(function(e){return e({moveFocusInside:pV,focusInside:dV})});const n3e=fye(e3e,t3e)(Zye);var yV=w.forwardRef(function(t,n){return w.createElement(QH,bn({sideCar:n3e,ref:n},t))}),bV=QH.propTypes||{};bV.sideCar;gE(bV,["sideCar"]);yV.propTypes={};const r3e=yV;var SV=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,d=w.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&kF(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),h=w.useCallback(()=>{var v;(v=n==null?void 0:n.current)==null||v.focus()},[n]),m=i&&!n;return N.createElement(r3e,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:d,onDeactivation:h,returnFocus:m},o)};SV.displayName="FocusLock";var _4="right-scroll-bar-position",k4="width-before-scroll-bar",i3e="with-scroll-bars-hidden",o3e="--removed-body-scroll-bar-size",xV=YH(),tC=function(){},vx=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:tC,onWheelCapture:tC,onTouchMoveCapture:tC}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,m=e.sideCar,v=e.noIsolation,b=e.inert,S=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,_=$$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),T=m,A=UH([n,t]),I=Fl(Fl({},_),i);return w.createElement(w.Fragment,null,d&&w.createElement(T,{sideCar:xV,removeScrollBar:u,shards:h,noIsolation:v,inert:b,setCallbacks:o,allowPinchZoom:!!S,lockRef:n}),a?w.cloneElement(w.Children.only(s),Fl(Fl({},I),{ref:A})):w.createElement(E,Fl({},I,{className:l,ref:A}),s))});vx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vx.classNames={fullWidth:k4,zeroRight:_4};var a3e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function s3e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=a3e();return t&&e.setAttribute("nonce",t),e}function l3e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function u3e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var c3e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=s3e())&&(l3e(t,n),u3e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},d3e=function(){var e=c3e();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},wV=function(){var e=d3e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},f3e={left:0,top:0,right:0,gap:0},nC=function(e){return parseInt(e||"",10)||0},h3e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[nC(n),nC(r),nC(i)]},p3e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return f3e;var t=h3e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},g3e=wV(),m3e=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` - .`.concat(i3e,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(s,"px ").concat(r,`; - } - body { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(i,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(a,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(s,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(_4,` { - right: `).concat(s,"px ").concat(r,`; - } - - .`).concat(k4,` { - margin-right: `).concat(s,"px ").concat(r,`; - } - - .`).concat(_4," .").concat(_4,` { - right: 0 `).concat(r,`; - } - - .`).concat(k4," .").concat(k4,` { - margin-right: 0 `).concat(r,`; - } - - body { - `).concat(o3e,": ").concat(s,`px; - } -`)},v3e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=w.useMemo(function(){return p3e(i)},[i]);return w.createElement(g3e,{styles:m3e(o,!t,i,n?"":"!important")})},V9=!1;if(typeof window<"u")try{var Sb=Object.defineProperty({},"passive",{get:function(){return V9=!0,!0}});window.addEventListener("test",Sb,Sb),window.removeEventListener("test",Sb,Sb)}catch{V9=!1}var Pg=V9?{passive:!1}:!1,y3e=function(e){return e.tagName==="TEXTAREA"},CV=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!y3e(e)&&n[t]==="visible")},b3e=function(e){return CV(e,"overflowY")},S3e=function(e){return CV(e,"overflowX")},eI=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=_V(e,n);if(r){var i=kV(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},x3e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},w3e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},_V=function(e,t){return e==="v"?b3e(t):S3e(t)},kV=function(e,t){return e==="v"?x3e(t):w3e(t)},C3e=function(e,t){return e==="h"&&t==="rtl"?-1:1},_3e=function(e,t,n,r,i){var o=C3e(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,d=a>0,h=0,m=0;do{var v=kV(e,s),b=v[0],S=v[1],k=v[2],E=S-k-o*b;(b||E)&&_V(e,s)&&(h+=E,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(i&&h===0||!i&&a>h)||!d&&(i&&m===0||!i&&-a>m))&&(u=!0),u},xb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tI=function(e){return[e.deltaX,e.deltaY]},nI=function(e){return e&&"current"in e?e.current:e},k3e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},E3e=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},P3e=0,Tg=[];function T3e(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(P3e++)[0],o=w.useState(function(){return wV()})[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=D7([e.lockRef.current],(e.shards||[]).map(nI),!0).filter(Boolean);return S.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(S,k){if("touches"in S&&S.touches.length===2)return!a.current.allowPinchZoom;var E=xb(S),_=n.current,T="deltaX"in S?S.deltaX:_[0]-E[0],A="deltaY"in S?S.deltaY:_[1]-E[1],I,R=S.target,D=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in S&&D==="h"&&R.type==="range")return!1;var j=eI(D,R);if(!j)return!0;if(j?I=D:(I=D==="v"?"h":"v",j=eI(D,R)),!j)return!1;if(!r.current&&"changedTouches"in S&&(T||A)&&(r.current=I),!I)return!0;var z=r.current||I;return _3e(z,k,S,z==="h"?T:A,!0)},[]),l=w.useCallback(function(S){var k=S;if(!(!Tg.length||Tg[Tg.length-1]!==o)){var E="deltaY"in k?tI(k):xb(k),_=t.current.filter(function(I){return I.name===k.type&&I.target===k.target&&k3e(I.delta,E)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var T=(a.current.shards||[]).map(nI).filter(Boolean).filter(function(I){return I.contains(k.target)}),A=T.length>0?s(k,T[0]):!a.current.noIsolation;A&&k.cancelable&&k.preventDefault()}}},[]),u=w.useCallback(function(S,k,E,_){var T={name:S,delta:k,target:E,should:_};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(A){return A!==T})},1)},[]),d=w.useCallback(function(S){n.current=xb(S),r.current=void 0},[]),h=w.useCallback(function(S){u(S.type,tI(S),S.target,s(S,e.lockRef.current))},[]),m=w.useCallback(function(S){u(S.type,xb(S),S.target,s(S,e.lockRef.current))},[]);w.useEffect(function(){return Tg.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Pg),document.addEventListener("touchmove",l,Pg),document.addEventListener("touchstart",d,Pg),function(){Tg=Tg.filter(function(S){return S!==o}),document.removeEventListener("wheel",l,Pg),document.removeEventListener("touchmove",l,Pg),document.removeEventListener("touchstart",d,Pg)}},[]);var v=e.removeScrollBar,b=e.inert;return w.createElement(w.Fragment,null,b?w.createElement(o,{styles:E3e(i)}):null,v?w.createElement(v3e,{gapMode:"margin"}):null)}const L3e=lye(xV,T3e);var EV=w.forwardRef(function(e,t){return w.createElement(vx,Fl({},e,{ref:t,sideCar:L3e}))});EV.classNames=vx.classNames;const PV=EV;var sp=(...e)=>e.filter(Boolean).join(" ");function wv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var A3e=class{constructor(){an(this,"modals");this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},W9=new A3e;function O3e(e,t){w.useEffect(()=>(t&&W9.add(e),()=>{W9.remove(e)}),[t,e])}function M3e(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=w.useRef(null),d=w.useRef(null),[h,m,v]=R3e(r,"chakra-modal","chakra-modal--header","chakra-modal--body");I3e(u,t&&a),O3e(u,t);const b=w.useRef(null),S=w.useCallback(j=>{b.current=j.target},[]),k=w.useCallback(j=>{j.key==="Escape"&&(j.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[E,_]=w.useState(!1),[T,A]=w.useState(!1),I=w.useCallback((j={},z=null)=>({role:"dialog",...j,ref:qn(z,u),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":E?m:void 0,"aria-describedby":T?v:void 0,onClick:wv(j.onClick,V=>V.stopPropagation())}),[v,T,h,m,E]),R=w.useCallback(j=>{j.stopPropagation(),b.current===j.target&&W9.isTopModal(u)&&(i&&(n==null||n()),s==null||s())},[n,i,s]),D=w.useCallback((j={},z=null)=>({...j,ref:qn(z,d),onClick:wv(j.onClick,R),onKeyDown:wv(j.onKeyDown,k),onMouseDown:wv(j.onMouseDown,S)}),[k,S,R]);return{isOpen:t,onClose:n,headerId:m,bodyId:v,setBodyMounted:A,setHeaderMounted:_,dialogRef:u,overlayRef:d,getDialogProps:I,getDialogContainerProps:D}}function I3e(e,t){const n=e.current;w.useEffect(()=>{if(!(!e.current||!t))return zH(e.current)},[t,e,n])}function R3e(e,...t){const n=w.useId(),r=e||n;return w.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[D3e,lp]=Mn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[N3e,qd]=Mn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Yd=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m,onCloseComplete:v}=e,b=Yi("Modal",e),k={...M3e(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m};return N.createElement(N3e,{value:k},N.createElement(D3e,{value:b},N.createElement(nf,{onExitComplete:v},k.isOpen&&N.createElement(ap,{...t},n))))};Yd.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};Yd.displayName="Modal";var n0=Ae((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=qd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=sp("chakra-modal__body",n),s=lp();return N.createElement(Ce.div,{ref:t,className:a,id:i,...r,__css:s.body})});n0.displayName="ModalBody";var Ly=Ae((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=qd(),a=sp("chakra-modal__close-btn",r),s=lp();return N.createElement(JS,{ref:t,__css:s.closeButton,className:a,onClick:wv(n,l=>{l.stopPropagation(),o()}),...i})});Ly.displayName="ModalCloseButton";function TV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:d}=qd(),[h,m]=K_();return w.useEffect(()=>{!h&&m&&setTimeout(m)},[h,m]),N.createElement(SV,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:d},N.createElement(PV,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0},e.children))}var j3e={slideInBottom:{...j7,custom:{offsetY:16,reverse:!0}},slideInRight:{...j7,custom:{offsetX:16,reverse:!0}},scale:{...H$,custom:{initialScale:.95,reverse:!0}},none:{}},B3e=Ce(du.section),$3e=e=>j3e[e||"none"],LV=w.forwardRef((e,t)=>{const{preset:n,motionProps:r=$3e(n),...i}=e;return N.createElement(B3e,{ref:t,...r,...i})});LV.displayName="ModalTransition";var Zh=Ae((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=qd(),u=s(a,t),d=l(i),h=sp("chakra-modal__content",n),m=lp(),v={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:S}=qd();return N.createElement(TV,null,N.createElement(Ce.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:b},N.createElement(LV,{preset:S,motionProps:o,className:h,...u,__css:v},r)))});Zh.displayName="ModalContent";var yx=Ae((e,t)=>{const{className:n,...r}=e,i=sp("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...lp().footer};return N.createElement(Ce.footer,{ref:t,...r,__css:a,className:i})});yx.displayName="ModalFooter";var w0=Ae((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=qd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=sp("chakra-modal__header",n),l={flex:0,...lp().header};return N.createElement(Ce.header,{ref:t,className:a,id:i,...r,__css:l})});w0.displayName="ModalHeader";var F3e=Ce(du.div),Kd=Ae((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=sp("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...lp().overlay},{motionPreset:u}=qd(),h=i||(u==="none"?{}:z$);return N.createElement(F3e,{...h,__css:l,ref:t,className:a,...o})});Kd.displayName="ModalOverlay";function AV(e){const{leastDestructiveRef:t,...n}=e;return N.createElement(Yd,{...n,initialFocusRef:t})}var OV=Ae((e,t)=>N.createElement(Zh,{ref:t,role:"alertdialog",...e})),[QFe,z3e]=Mn(),H3e=Ce(V$),V3e=Ae((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=qd(),d=s(a,t),h=l(o),m=sp("chakra-modal__content",n),v=lp(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},S={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{placement:k}=z3e();return N.createElement(TV,null,N.createElement(Ce.div,{...h,className:"chakra-modal__content-container",__css:S},N.createElement(H3e,{motionProps:i,direction:k,in:u,className:m,...d,__css:b},r)))});V3e.displayName="DrawerContent";function W3e(e,t){const n=Er(e);w.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var MV=(...e)=>e.filter(Boolean).join(" "),rC=e=>e?!0:void 0;function Al(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var U3e=e=>N.createElement(Da,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})),G3e=e=>N.createElement(Da,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"}));function rI(e,t,n,r){w.useEffect(()=>{if(!e.current||!r)return;const i=e.current.ownerDocument.defaultView??window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(s=>{for(const l of s)l.type==="attributes"&&l.attributeName&&o.includes(l.attributeName)&&n(l)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var q3e=50,iI=300;function Y3e(e,t){const[n,r]=w.useState(!1),[i,o]=w.useState(null),[a,s]=w.useState(!0),l=w.useRef(null),u=()=>clearTimeout(l.current);W3e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?q3e:null);const d=w.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},iI)},[e,a]),h=w.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},iI)},[t,a]),m=w.useCallback(()=>{s(!0),r(!1),u()},[]);return w.useEffect(()=>()=>u(),[]),{up:d,down:h,stop:m,isSpinning:n}}var K3e=/^[Ee0-9+\-.]$/;function X3e(e){return K3e.test(e)}function Z3e(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function Q3e(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:d,pattern:h="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:v,id:b,onChange:S,precision:k,name:E,"aria-describedby":_,"aria-label":T,"aria-labelledby":A,onFocus:I,onBlur:R,onInvalid:D,getAriaValueText:j,isValidCharacter:z,format:V,parse:K,...te}=e,q=Er(I),$=Er(R),U=Er(D),X=Er(z??X3e),Z=Er(j),W=cme(e),{update:Q,increment:ie,decrement:fe}=W,[Se,Pe]=w.useState(!1),ye=!(s||l),We=w.useRef(null),De=w.useRef(null),ot=w.useRef(null),He=w.useRef(null),Be=w.useCallback(Te=>Te.split("").filter(X).join(""),[X]),wt=w.useCallback(Te=>(K==null?void 0:K(Te))??Te,[K]),st=w.useCallback(Te=>((V==null?void 0:V(Te))??Te).toString(),[V]);Vd(()=>{(W.valueAsNumber>o||W.valueAsNumber{if(!We.current)return;if(We.current.value!=W.value){const At=wt(We.current.value);W.setValue(Be(At))}},[wt,Be]);const mt=w.useCallback((Te=a)=>{ye&&ie(Te)},[ie,ye,a]),St=w.useCallback((Te=a)=>{ye&&fe(Te)},[fe,ye,a]),Le=Y3e(mt,St);rI(ot,"disabled",Le.stop,Le.isSpinning),rI(He,"disabled",Le.stop,Le.isSpinning);const lt=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;const $e=wt(Te.currentTarget.value);Q(Be($e)),De.current={start:Te.currentTarget.selectionStart,end:Te.currentTarget.selectionEnd}},[Q,Be,wt]),Mt=w.useCallback(Te=>{var At;q==null||q(Te),De.current&&(Te.target.selectionStart=De.current.start??((At=Te.currentTarget.value)==null?void 0:At.length),Te.currentTarget.selectionEnd=De.current.end??Te.currentTarget.selectionStart)},[q]),ut=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;Z3e(Te,X)||Te.preventDefault();const At=_t(Te)*a,$e=Te.key,tn={ArrowUp:()=>mt(At),ArrowDown:()=>St(At),Home:()=>Q(i),End:()=>Q(o)}[$e];tn&&(Te.preventDefault(),tn(Te))},[X,a,mt,St,Q,i,o]),_t=Te=>{let At=1;return(Te.metaKey||Te.ctrlKey)&&(At=.1),Te.shiftKey&&(At=10),At},ln=w.useMemo(()=>{const Te=Z==null?void 0:Z(W.value);if(Te!=null)return Te;const At=W.value.toString();return At||void 0},[W.value,Z]),ae=w.useCallback(()=>{let Te=W.value;if(W.value==="")return;/^[eE]/.test(W.value.toString())?W.setValue(""):(W.valueAsNumbero&&(Te=o),W.cast(Te))},[W,o,i]),Re=w.useCallback(()=>{Pe(!1),n&&ae()},[n,Pe,ae]),Ye=w.useCallback(()=>{t&&requestAnimationFrame(()=>{var Te;(Te=We.current)==null||Te.focus()})},[t]),Ke=w.useCallback(Te=>{Te.preventDefault(),Le.up(),Ye()},[Ye,Le]),xe=w.useCallback(Te=>{Te.preventDefault(),Le.down(),Ye()},[Ye,Le]);Rh(()=>We.current,"wheel",Te=>{var At;const vt=(((At=We.current)==null?void 0:At.ownerDocument)??document).activeElement===We.current;if(!v||!vt)return;Te.preventDefault();const tn=_t(Te)*a,Rn=Math.sign(Te.deltaY);Rn===-1?mt(tn):Rn===1&&St(tn)},{passive:!1});const Ne=w.useCallback((Te={},At=null)=>{const $e=l||r&&W.isAtMax;return{...Te,ref:qn(At,ot),role:"button",tabIndex:-1,onPointerDown:Al(Te.onPointerDown,vt=>{vt.button!==0||$e||Ke(vt)}),onPointerLeave:Al(Te.onPointerLeave,Le.stop),onPointerUp:Al(Te.onPointerUp,Le.stop),disabled:$e,"aria-disabled":rC($e)}},[W.isAtMax,r,Ke,Le.stop,l]),Ct=w.useCallback((Te={},At=null)=>{const $e=l||r&&W.isAtMin;return{...Te,ref:qn(At,He),role:"button",tabIndex:-1,onPointerDown:Al(Te.onPointerDown,vt=>{vt.button!==0||$e||xe(vt)}),onPointerLeave:Al(Te.onPointerLeave,Le.stop),onPointerUp:Al(Te.onPointerUp,Le.stop),disabled:$e,"aria-disabled":rC($e)}},[W.isAtMin,r,xe,Le.stop,l]),Dt=w.useCallback((Te={},At=null)=>({name:E,inputMode:m,type:"text",pattern:h,"aria-labelledby":A,"aria-label":T,"aria-describedby":_,id:b,disabled:l,...Te,readOnly:Te.readOnly??s,"aria-readonly":Te.readOnly??s,"aria-required":Te.required??u,required:Te.required??u,ref:qn(We,At),value:st(W.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(W.valueAsNumber)?void 0:W.valueAsNumber,"aria-invalid":rC(d??W.isOutOfRange),"aria-valuetext":ln,autoComplete:"off",autoCorrect:"off",onChange:Al(Te.onChange,lt),onKeyDown:Al(Te.onKeyDown,ut),onFocus:Al(Te.onFocus,Mt,()=>Pe(!0)),onBlur:Al(Te.onBlur,$,Re)}),[E,m,h,A,T,st,_,b,l,u,s,d,W.value,W.valueAsNumber,W.isOutOfRange,i,o,ln,lt,ut,Mt,$,Re]);return{value:st(W.value),valueAsNumber:W.valueAsNumber,isFocused:Se,isDisabled:l,isReadOnly:s,getIncrementButtonProps:Ne,getDecrementButtonProps:Ct,getInputProps:Dt,htmlProps:te}}var[J3e,bx]=Mn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[ebe,PE]=Mn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),TE=Ae(function(t,n){const r=Yi("NumberInput",t),i=En(t),o=lk(i),{htmlProps:a,...s}=Q3e(o),l=w.useMemo(()=>s,[s]);return N.createElement(ebe,{value:l},N.createElement(J3e,{value:r},N.createElement(Ce.div,{...a,ref:n,className:MV("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});TE.displayName="NumberInput";var IV=Ae(function(t,n){const r=bx();return N.createElement(Ce.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});IV.displayName="NumberInputStepper";var LE=Ae(function(t,n){const{getInputProps:r}=PE(),i=r(t,n),o=bx();return N.createElement(Ce.input,{...i,className:MV("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});LE.displayName="NumberInputField";var RV=Ce("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),AE=Ae(function(t,n){const r=bx(),{getDecrementButtonProps:i}=PE(),o=i(t,n);return N.createElement(RV,{...o,__css:r.stepper},t.children??N.createElement(U3e,null))});AE.displayName="NumberDecrementStepper";var OE=Ae(function(t,n){const{getIncrementButtonProps:r}=PE(),i=r(t,n),o=bx();return N.createElement(RV,{...i,__css:o.stepper},t.children??N.createElement(G3e,null))});OE.displayName="NumberIncrementStepper";var Ay=(...e)=>e.filter(Boolean).join(" ");function tbe(e,...t){return nbe(e)?e(...t):e}var nbe=e=>typeof e=="function";function Ol(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function rbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[ibe,up]=Mn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[obe,Oy]=Mn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Lg={click:"click",hover:"hover"};function abe(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=Lg.click,openDelay:d=200,closeDelay:h=200,isLazy:m,lazyBehavior:v="unmount",computePositionOnMount:b,...S}=e,{isOpen:k,onClose:E,onOpen:_,onToggle:T}=NF(e),A=w.useRef(null),I=w.useRef(null),R=w.useRef(null),D=w.useRef(!1),j=w.useRef(!1);k&&(j.current=!0);const[z,V]=w.useState(!1),[K,te]=w.useState(!1),q=w.useId(),$=i??q,[U,X,Z,W]=["popover-trigger","popover-content","popover-header","popover-body"].map(lt=>`${lt}-${$}`),{referenceRef:Q,getArrowProps:ie,getPopperProps:fe,getArrowInnerProps:Se,forceUpdate:Pe}=DF({...S,enabled:k||!!b}),ye=j1e({isOpen:k,ref:R});bme({enabled:k,ref:I}),h0e(R,{focusRef:I,visible:k,shouldFocus:o&&u===Lg.click}),g0e(R,{focusRef:r,visible:k,shouldFocus:a&&u===Lg.click});const We=jF({wasSelected:j.current,enabled:m,mode:v,isSelected:ye.present}),De=w.useCallback((lt={},Mt=null)=>{const ut={...lt,style:{...lt.style,transformOrigin:oi.transformOrigin.varRef,[oi.arrowSize.var]:s?`${s}px`:void 0,[oi.arrowShadowColor.var]:l},ref:qn(R,Mt),children:We?lt.children:null,id:X,tabIndex:-1,role:"dialog",onKeyDown:Ol(lt.onKeyDown,_t=>{n&&_t.key==="Escape"&&E()}),onBlur:Ol(lt.onBlur,_t=>{const ln=oI(_t),ae=iC(R.current,ln),Re=iC(I.current,ln);k&&t&&(!ae&&!Re)&&E()}),"aria-labelledby":z?Z:void 0,"aria-describedby":K?W:void 0};return u===Lg.hover&&(ut.role="tooltip",ut.onMouseEnter=Ol(lt.onMouseEnter,()=>{D.current=!0}),ut.onMouseLeave=Ol(lt.onMouseLeave,_t=>{_t.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>E(),h))})),ut},[We,X,z,Z,K,W,u,n,E,k,t,h,l,s]),ot=w.useCallback((lt={},Mt=null)=>fe({...lt,style:{visibility:k?"visible":"hidden",...lt.style}},Mt),[k,fe]),He=w.useCallback((lt,Mt=null)=>({...lt,ref:qn(Mt,A,Q)}),[A,Q]),Be=w.useRef(),wt=w.useRef(),st=w.useCallback(lt=>{A.current==null&&Q(lt)},[Q]),mt=w.useCallback((lt={},Mt=null)=>{const ut={...lt,ref:qn(I,Mt,st),id:U,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":X};return u===Lg.click&&(ut.onClick=Ol(lt.onClick,T)),u===Lg.hover&&(ut.onFocus=Ol(lt.onFocus,()=>{Be.current===void 0&&_()}),ut.onBlur=Ol(lt.onBlur,_t=>{const ln=oI(_t),ae=!iC(R.current,ln);k&&t&&ae&&E()}),ut.onKeyDown=Ol(lt.onKeyDown,_t=>{_t.key==="Escape"&&E()}),ut.onMouseEnter=Ol(lt.onMouseEnter,()=>{D.current=!0,Be.current=window.setTimeout(()=>_(),d)}),ut.onMouseLeave=Ol(lt.onMouseLeave,()=>{D.current=!1,Be.current&&(clearTimeout(Be.current),Be.current=void 0),wt.current=window.setTimeout(()=>{D.current===!1&&E()},h)})),ut},[U,k,X,u,st,T,_,t,E,d,h]);w.useEffect(()=>()=>{Be.current&&clearTimeout(Be.current),wt.current&&clearTimeout(wt.current)},[]);const St=w.useCallback((lt={},Mt=null)=>({...lt,id:Z,ref:qn(Mt,ut=>{V(!!ut)})}),[Z]),Le=w.useCallback((lt={},Mt=null)=>({...lt,id:W,ref:qn(Mt,ut=>{te(!!ut)})}),[W]);return{forceUpdate:Pe,isOpen:k,onAnimationComplete:ye.onComplete,onClose:E,getAnchorProps:He,getArrowProps:ie,getArrowInnerProps:Se,getPopoverPositionerProps:ot,getPopoverProps:De,getTriggerProps:mt,getHeaderProps:St,getBodyProps:Le}}function iC(e,t){return e===t||(e==null?void 0:e.contains(t))}function oI(e){const t=e.currentTarget.ownerDocument.activeElement;return e.relatedTarget??t}function ME(e){const t=Yi("Popover",e),{children:n,...r}=En(e),i=h0(),o=abe({...r,direction:i.direction});return N.createElement(ibe,{value:o},N.createElement(obe,{value:t},tbe(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})))}ME.displayName="Popover";function IE(e){const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=up(),a=Oy(),s=t??n??r;return N.createElement(Ce.div,{...i(),className:"chakra-popover__arrow-positioner"},N.createElement(Ce.div,{className:Ay("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}IE.displayName="PopoverArrow";var sbe=Ae(function(t,n){const{getBodyProps:r}=up(),i=Oy();return N.createElement(Ce.div,{...r(t,n),className:Ay("chakra-popover__body",t.className),__css:i.body})});sbe.displayName="PopoverBody";var lbe=Ae(function(t,n){const{onClose:r}=up(),i=Oy();return N.createElement(JS,{size:"sm",onClick:r,className:Ay("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});lbe.displayName="PopoverCloseButton";function ube(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var cbe={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},dbe=Ce(du.section),DV=Ae(function(t,n){const{variants:r=cbe,...i}=t,{isOpen:o}=up();return N.createElement(dbe,{ref:n,variants:ube(r),initial:!1,animate:o?"enter":"exit",...i})});DV.displayName="PopoverTransition";var RE=Ae(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=up(),u=Oy(),d={position:"relative",display:"flex",flexDirection:"column",...u.content};return N.createElement(Ce.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},N.createElement(DV,{...i,...a(o,n),onAnimationComplete:rbe(l,o.onAnimationComplete),className:Ay("chakra-popover__content",t.className),__css:d}))});RE.displayName="PopoverContent";var fbe=Ae(function(t,n){const{getHeaderProps:r}=up(),i=Oy();return N.createElement(Ce.header,{...r(t,n),className:Ay("chakra-popover__header",t.className),__css:i.header})});fbe.displayName="PopoverHeader";function DE(e){const t=w.Children.only(e.children),{getTriggerProps:n}=up();return w.cloneElement(t,n(t.props,t.ref))}DE.displayName="PopoverTrigger";function hbe(e,t,n){return(e-t)*100/(n-t)}var pbe=tf({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),gbe=tf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),mbe=tf({"0%":{left:"-40%"},"100%":{left:"100%"}}),vbe=tf({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function NV(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=hbe(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var jV=e=>{const{size:t,isIndeterminate:n,...r}=e;return N.createElement(Ce.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${gbe} 2s linear infinite`:void 0},...r})};jV.displayName="Shape";var U9=e=>N.createElement(Ce.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});U9.displayName="Circle";var ybe=Ae((e,t)=>{const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:d="10px",color:h="#0078d4",trackColor:m="#edebe9",isIndeterminate:v,...b}=e,S=NV({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:v}),k=v?void 0:(S.percent??0)*2.64,E=k==null?void 0:`${k} ${264-k}`,_=v?{css:{animation:`${pbe} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:E,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},T={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return N.createElement(Ce.div,{ref:t,className:"chakra-progress",...S.bind,...b,__css:T},N.createElement(jV,{size:n,isIndeterminate:v},N.createElement(U9,{stroke:m,strokeWidth:d,className:"chakra-progress__track"}),N.createElement(U9,{stroke:h,strokeWidth:d,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:S.value===0&&!v?0:void 0,..._})),u)});ybe.displayName="CircularProgress";var[bbe,Sbe]=Mn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),xbe=Ae((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=NV({value:i,min:n,max:r,isIndeterminate:o,role:a}),d={height:"100%",...Sbe().filledTrack};return N.createElement(Ce.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:d})}),BV=Ae((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:d,"aria-label":h,"aria-labelledby":m,title:v,role:b,...S}=En(e),k=Yi("Progress",e),E=u??((n=k.track)==null?void 0:n.borderRadius),_={animation:`${vbe} 1s linear infinite`},I={...!d&&a&&s&&_,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${mbe} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",...k.track};return N.createElement(Ce.div,{ref:t,borderRadius:E,__css:R,...S},N.createElement(bbe,{value:k},N.createElement(xbe,{"aria-label":h,"aria-labelledby":m,min:i,max:o,value:r,isIndeterminate:d,css:I,borderRadius:E,title:v,role:b}),l))});BV.displayName="Progress";var wbe=Ce("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});wbe.displayName="CircularProgressLabel";var Cbe=(...e)=>e.filter(Boolean).join(" "),_be=e=>e?"":void 0;function kbe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var $V=Ae(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return N.createElement(Ce.select,{...a,ref:n,className:Cbe("chakra-select",o)},i&&N.createElement("option",{value:""},i),r)});$V.displayName="SelectField";var FV=Ae((e,t)=>{var n;const r=Yi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:d,minHeight:h,iconColor:m,iconSize:v,...b}=En(e),[S,k]=kbe(b,Hte),E=sk(k),_={width:"100%",height:"fit-content",position:"relative",color:s},T={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return N.createElement(Ce.div,{className:"chakra-select__wrapper",__css:_,...S,...i},N.createElement($V,{ref:t,height:u??l,minH:d??h,placeholder:o,...E,__css:T},e.children),N.createElement(zV,{"data-disabled":_be(E.disabled),...(m||s)&&{color:m||s},__css:r.icon,...v&&{fontSize:v}},a))});FV.displayName="Select";var Ebe=e=>N.createElement("svg",{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Pbe=Ce("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),zV=e=>{const{children:t=N.createElement(Ebe,null),...n}=e,r=w.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return N.createElement(Pbe,{...n,className:"chakra-select__icon-wrapper"},w.isValidElement(t)?r:null)};zV.displayName="SelectIcon";function Tbe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Lbe(e){const t=Obe(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function HV(e){return!!e.touches}function Abe(e){return HV(e)&&e.touches.length>1}function Obe(e){return e.view??window}function Mbe(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Ibe(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function VV(e,t="page"){return HV(e)?Mbe(e,t):Ibe(e,t)}function Rbe(e){return t=>{const n=Lbe(t);(!n||n&&t.button===0)&&e(t)}}function Dbe(e,t=!1){function n(i){e(i,{point:VV(i)})}return t?Rbe(n):n}function E4(e,t,n,r){return Tbe(e,t,Dbe(n,t==="pointerdown"),r)}function WV(e){const t=w.useRef(null);return t.current=e,t}var Nbe=class{constructor(e,t,n){an(this,"history",[]);an(this,"startEvent",null);an(this,"lastEvent",null);an(this,"lastEventInfo",null);an(this,"handlers",{});an(this,"removeListeners",()=>{});an(this,"threshold",3);an(this,"win");an(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=oC(this.lastEventInfo,this.history),t=this.startEvent!==null,n=Fbe(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=OL();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});an(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,tre.update(this.updatePoint,!0)});an(this,"onPointerUp",(e,t)=>{const n=oC(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});if(this.win=e.view??window,Abe(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:VV(e)},{timestamp:i}=OL();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,oC(r,this.history)),this.removeListeners=$be(E4(this.win,"pointermove",this.onPointerMove),E4(this.win,"pointerup",this.onPointerUp),E4(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),nre.update(this.updatePoint)}};function aI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oC(e,t){return{point:e.point,delta:aI(e.point,t[t.length-1]),offset:aI(e.point,t[0]),velocity:Bbe(t,.1)}}var jbe=e=>e*1e3;function Bbe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>jbe(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function $be(...e){return t=>e.reduce((n,r)=>r(n),t)}function aC(e,t){return Math.abs(e-t)}function sI(e){return"x"in e&&"y"in e}function Fbe(e,t){if(typeof e=="number"&&typeof t=="number")return aC(e,t);if(sI(e)&&sI(t)){const n=aC(e.x,t.x),r=aC(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function UV(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=w.useRef(null),d=WV({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(h,m){u.current=null,i==null||i(h,m)}});w.useEffect(()=>{var h;(h=u.current)==null||h.updateHandlers(d.current)}),w.useEffect(()=>{const h=e.current;if(!h||!l)return;function m(v){u.current=new Nbe(v,d.current,s)}return E4(h,"pointerdown",m)},[e,l,d,s]),w.useEffect(()=>()=>{var h;(h=u.current)==null||h.end(),u.current=null},[])}function zbe(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const[o]=i;let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;t({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var Hbe=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:w.useEffect;function Vbe(e,t){var n;if(!e||!e.parentElement)return;const r=((n=e.ownerDocument)==null?void 0:n.defaultView)??window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function GV({getNodes:e,observeMutation:t=!0}){const[n,r]=w.useState([]),[i,o]=w.useState(0);return Hbe(()=>{const a=e(),s=a.map((l,u)=>zbe(l,d=>{r(h=>[...h.slice(0,u),d,...h.slice(u+1)])}));if(t){const l=a[0];s.push(Vbe(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function Wbe(e){return typeof e=="object"&&e!==null&&"current"in e}function Ube(e){const[t]=GV({observeMutation:!1,getNodes(){return[Wbe(e)?e.current:e]}});return t}var Gbe=Object.getOwnPropertyNames,qbe=(e,t)=>function(){return e&&(t=(0,e[Gbe(e)[0]])(e=0)),t},lf=qbe({"../../../react-shim.js"(){}});lf();lf();lf();var Ja=e=>e?"":void 0,Mm=e=>e?!0:void 0,uf=(...e)=>e.filter(Boolean).join(" ");lf();function Im(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}lf();lf();function Ybe(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Cv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var P4={width:0,height:0},wb=e=>e||P4;function qV(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=S=>{const k=r[S]??P4;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Cv({orientation:t,vertical:{bottom:`calc(${n[S]}% - ${k.height/2}px)`},horizontal:{left:`calc(${n[S]}% - ${k.width/2}px)`}})}},a=t==="vertical"?r.reduce((S,k)=>wb(S).height>wb(k).height?S:k,P4):r.reduce((S,k)=>wb(S).width>wb(k).width?S:k,P4),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Cv({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Cv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,d=[0,i?100-n[0]:n[0]],h=u?d:n;let m=h[0];!u&&i&&(m=100-m);const v=Math.abs(h[h.length-1]-h[0]),b={...l,...Cv({orientation:t,vertical:i?{height:`${v}%`,top:`${m}%`}:{height:`${v}%`,bottom:`${m}%`},horizontal:i?{width:`${v}%`,right:`${m}%`}:{width:`${v}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function YV(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function Kbe(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:S,"aria-valuetext":k,"aria-label":E,"aria-labelledby":_,name:T,focusThumbOnChange:A=!0,minStepsBetweenThumbs:I=0,...R}=e,D=Er(m),j=Er(v),z=Er(S),V=YV({isReversed:a,direction:s,orientation:l}),[K,te]=DS({value:i,defaultValue:o??[25,75],onChange:r});if(!Array.isArray(K))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof K}\``);const[q,$]=w.useState(!1),[U,X]=w.useState(!1),[Z,W]=w.useState(-1),Q=!(d||h),ie=w.useRef(K),fe=K.map(Xe=>Cm(Xe,t,n)),Se=I*b,Pe=Xbe(fe,t,n,Se),ye=w.useRef({eventSource:null,value:[],valueBounds:[]});ye.current.value=fe,ye.current.valueBounds=Pe;const We=fe.map(Xe=>n-Xe+t),ot=(V?We:fe).map(Xe=>l5(Xe,t,n)),He=l==="vertical",Be=w.useRef(null),wt=w.useRef(null),st=GV({getNodes(){const Xe=wt.current,xt=Xe==null?void 0:Xe.querySelectorAll("[role=slider]");return xt?Array.from(xt):[]}}),mt=w.useId(),Le=Ybe(u??mt),lt=w.useCallback(Xe=>{var xt;if(!Be.current)return;ye.current.eventSource="pointer";const ft=Be.current.getBoundingClientRect(),{clientX:Ht,clientY:nn}=((xt=Xe.touches)==null?void 0:xt[0])??Xe,pr=He?ft.bottom-nn:Ht-ft.left,Mo=He?ft.height:ft.width;let Oi=pr/Mo;return V&&(Oi=1-Oi),J$(Oi,t,n)},[He,V,n,t]),Mt=(n-t)/10,ut=b||(n-t)/100,_t=w.useMemo(()=>({setValueAtIndex(Xe,xt){if(!Q)return;const ft=ye.current.valueBounds[Xe];xt=parseFloat(H7(xt,ft.min,ut)),xt=Cm(xt,ft.min,ft.max);const Ht=[...ye.current.value];Ht[Xe]=xt,te(Ht)},setActiveIndex:W,stepUp(Xe,xt=ut){const ft=ye.current.value[Xe],Ht=V?ft-xt:ft+xt;_t.setValueAtIndex(Xe,Ht)},stepDown(Xe,xt=ut){const ft=ye.current.value[Xe],Ht=V?ft+xt:ft-xt;_t.setValueAtIndex(Xe,Ht)},reset(){te(ie.current)}}),[ut,V,te,Q]),ln=w.useCallback(Xe=>{const xt=Xe.key,Ht={ArrowRight:()=>_t.stepUp(Z),ArrowUp:()=>_t.stepUp(Z),ArrowLeft:()=>_t.stepDown(Z),ArrowDown:()=>_t.stepDown(Z),PageUp:()=>_t.stepUp(Z,Mt),PageDown:()=>_t.stepDown(Z,Mt),Home:()=>{const{min:nn}=Pe[Z];_t.setValueAtIndex(Z,nn)},End:()=>{const{max:nn}=Pe[Z];_t.setValueAtIndex(Z,nn)}}[xt];Ht&&(Xe.preventDefault(),Xe.stopPropagation(),Ht(Xe),ye.current.eventSource="keyboard")},[_t,Z,Mt,Pe]),{getThumbStyle:ae,rootStyle:Re,trackStyle:Ye,innerTrackStyle:Ke}=w.useMemo(()=>qV({isReversed:V,orientation:l,thumbRects:st,thumbPercents:ot}),[V,l,ot,st]),xe=w.useCallback(Xe=>{var xt;const ft=Xe??Z;if(ft!==-1&&A){const Ht=Le.getThumb(ft),nn=(xt=wt.current)==null?void 0:xt.ownerDocument.getElementById(Ht);nn&&setTimeout(()=>nn.focus())}},[A,Z,Le]);Vd(()=>{ye.current.eventSource==="keyboard"&&(j==null||j(ye.current.value))},[fe,j]);const Ne=Xe=>{const xt=lt(Xe)||0,ft=ye.current.value.map(Oi=>Math.abs(Oi-xt)),Ht=Math.min(...ft);let nn=ft.indexOf(Ht);const pr=ft.filter(Oi=>Oi===Ht);pr.length>1&&xt>ye.current.value[nn]&&(nn=nn+pr.length-1),W(nn),_t.setValueAtIndex(nn,xt),xe(nn)},Ct=Xe=>{if(Z==-1)return;const xt=lt(Xe)||0;W(Z),_t.setValueAtIndex(Z,xt),xe(Z)};UV(wt,{onPanSessionStart(Xe){Q&&($(!0),Ne(Xe),D==null||D(ye.current.value))},onPanSessionEnd(){Q&&($(!1),j==null||j(ye.current.value))},onPan(Xe){Q&&Ct(Xe)}});const Dt=w.useCallback((Xe={},xt=null)=>({...Xe,...R,id:Le.root,ref:qn(xt,wt),tabIndex:-1,"aria-disabled":Mm(d),"data-focused":Ja(U),style:{...Xe.style,...Re}}),[R,d,U,Re,Le]),Te=w.useCallback((Xe={},xt=null)=>({...Xe,ref:qn(xt,Be),id:Le.track,"data-disabled":Ja(d),style:{...Xe.style,...Ye}}),[d,Ye,Le]),At=w.useCallback((Xe={},xt=null)=>({...Xe,ref:xt,id:Le.innerTrack,style:{...Xe.style,...Ke}}),[Ke,Le]),$e=w.useCallback((Xe,xt=null)=>{const{index:ft,...Ht}=Xe,nn=fe[ft];if(nn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ft}\`. The \`value\` or \`defaultValue\` length is : ${fe.length}`);const pr=Pe[ft];return{...Ht,ref:xt,role:"slider",tabIndex:Q?0:void 0,id:Le.getThumb(ft),"data-active":Ja(q&&Z===ft),"aria-valuetext":(z==null?void 0:z(nn))??(k==null?void 0:k[ft]),"aria-valuemin":pr.min,"aria-valuemax":pr.max,"aria-valuenow":nn,"aria-orientation":l,"aria-disabled":Mm(d),"aria-readonly":Mm(h),"aria-label":E==null?void 0:E[ft],"aria-labelledby":E!=null&&E[ft]||_==null?void 0:_[ft],style:{...Xe.style,...ae(ft)},onKeyDown:Im(Xe.onKeyDown,ln),onFocus:Im(Xe.onFocus,()=>{X(!0),W(ft)}),onBlur:Im(Xe.onBlur,()=>{X(!1),W(-1)})}},[Le,fe,Pe,Q,q,Z,z,k,l,d,h,E,_,ae,ln,X]),vt=w.useCallback((Xe={},xt=null)=>({...Xe,ref:xt,id:Le.output,htmlFor:fe.map((ft,Ht)=>Le.getThumb(Ht)).join(" "),"aria-live":"off"}),[Le,fe]),tn=w.useCallback((Xe,xt=null)=>{const{value:ft,...Ht}=Xe,nn=!(ftn),pr=ft>=fe[0]&&ft<=fe[fe.length-1];let Mo=l5(ft,t,n);Mo=V?100-Mo:Mo;const Oi={position:"absolute",pointerEvents:"none",...Cv({orientation:l,vertical:{bottom:`${Mo}%`},horizontal:{left:`${Mo}%`}})};return{...Ht,ref:xt,id:Le.getMarker(Xe.value),role:"presentation","aria-hidden":!0,"data-disabled":Ja(d),"data-invalid":Ja(!nn),"data-highlighted":Ja(pr),style:{...Xe.style,...Oi}}},[d,V,n,t,l,fe,Le]),Rn=w.useCallback((Xe,xt=null)=>{const{index:ft,...Ht}=Xe;return{...Ht,ref:xt,id:Le.getInput(ft),type:"hidden",value:fe[ft],name:Array.isArray(T)?T[ft]:`${T}-${ft}`}},[T,fe,Le]);return{state:{value:fe,isFocused:U,isDragging:q,getThumbPercent:Xe=>ot[Xe],getThumbMinValue:Xe=>Pe[Xe].min,getThumbMaxValue:Xe=>Pe[Xe].max},actions:_t,getRootProps:Dt,getTrackProps:Te,getInnerTrackProps:At,getThumbProps:$e,getMarkerProps:tn,getInputProps:Rn,getOutputProps:vt}}function Xbe(e,t,n,r){return e.map((i,o)=>{const a=o===0?t:e[o-1]+r,s=o===e.length-1?n:e[o+1]-r;return{min:a,max:s}})}var[Zbe,Sx]=Mn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[Qbe,NE]=Mn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),KV=Ae(function(t,n){const r=Yi("Slider",t),i=En(t),{direction:o}=h0();i.direction=o;const{getRootProps:a,...s}=Kbe(i),l=w.useMemo(()=>({...s,name:t.name}),[s,t.name]);return N.createElement(Zbe,{value:l},N.createElement(Qbe,{value:r},N.createElement(Ce.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});KV.defaultProps={orientation:"horizontal"};KV.displayName="RangeSlider";var Jbe=Ae(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=Sx(),a=NE(),s=r(t,n);return N.createElement(Ce.div,{...s,className:uf("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&N.createElement("input",{...i({index:t.index})}))});Jbe.displayName="RangeSliderThumb";var e4e=Ae(function(t,n){const{getTrackProps:r}=Sx(),i=NE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:uf("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});e4e.displayName="RangeSliderTrack";var t4e=Ae(function(t,n){const{getInnerTrackProps:r}=Sx(),i=NE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});t4e.displayName="RangeSliderFilledTrack";var n4e=Ae(function(t,n){const{getMarkerProps:r}=Sx(),i=r(t,n);return N.createElement(Ce.div,{...i,className:uf("chakra-slider__marker",t.className)})});n4e.displayName="RangeSliderMark";lf();lf();function r4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:S,"aria-valuetext":k,"aria-label":E,"aria-labelledby":_,name:T,focusThumbOnChange:A=!0,...I}=e,R=Er(m),D=Er(v),j=Er(S),z=YV({isReversed:a,direction:s,orientation:l}),[V,K]=DS({value:i,defaultValue:o??o4e(t,n),onChange:r}),[te,q]=w.useState(!1),[$,U]=w.useState(!1),X=!(d||h),Z=(n-t)/10,W=b||(n-t)/100,Q=Cm(V,t,n),ie=n-Q+t,Se=l5(z?ie:Q,t,n),Pe=l==="vertical",ye=WV({min:t,max:n,step:b,isDisabled:d,value:Q,isInteractive:X,isReversed:z,isVertical:Pe,eventSource:null,focusThumbOnChange:A,orientation:l}),We=w.useRef(null),De=w.useRef(null),ot=w.useRef(null),He=w.useId(),Be=u??He,[wt,st]=[`slider-thumb-${Be}`,`slider-track-${Be}`],mt=w.useCallback($e=>{var vt;if(!We.current)return;const tn=ye.current;tn.eventSource="pointer";const Rn=We.current.getBoundingClientRect(),{clientX:Xe,clientY:xt}=((vt=$e.touches)==null?void 0:vt[0])??$e,ft=Pe?Rn.bottom-xt:Xe-Rn.left,Ht=Pe?Rn.height:Rn.width;let nn=ft/Ht;z&&(nn=1-nn);let pr=J$(nn,tn.min,tn.max);return tn.step&&(pr=parseFloat(H7(pr,tn.min,tn.step))),pr=Cm(pr,tn.min,tn.max),pr},[Pe,z,ye]),St=w.useCallback($e=>{const vt=ye.current;vt.isInteractive&&($e=parseFloat(H7($e,vt.min,W)),$e=Cm($e,vt.min,vt.max),K($e))},[W,K,ye]),Le=w.useMemo(()=>({stepUp($e=W){const vt=z?Q-$e:Q+$e;St(vt)},stepDown($e=W){const vt=z?Q+$e:Q-$e;St(vt)},reset(){St(o||0)},stepTo($e){St($e)}}),[St,z,Q,W,o]),lt=w.useCallback($e=>{const vt=ye.current,Rn={ArrowRight:()=>Le.stepUp(),ArrowUp:()=>Le.stepUp(),ArrowLeft:()=>Le.stepDown(),ArrowDown:()=>Le.stepDown(),PageUp:()=>Le.stepUp(Z),PageDown:()=>Le.stepDown(Z),Home:()=>St(vt.min),End:()=>St(vt.max)}[$e.key];Rn&&($e.preventDefault(),$e.stopPropagation(),Rn($e),vt.eventSource="keyboard")},[Le,St,Z,ye]),Mt=(j==null?void 0:j(Q))??k,ut=Ube(De),{getThumbStyle:_t,rootStyle:ln,trackStyle:ae,innerTrackStyle:Re}=w.useMemo(()=>{const $e=ye.current,vt=ut??{width:0,height:0};return qV({isReversed:z,orientation:$e.orientation,thumbRects:[vt],thumbPercents:[Se]})},[z,ut,Se,ye]),Ye=w.useCallback(()=>{ye.current.focusThumbOnChange&&setTimeout(()=>{var vt;return(vt=De.current)==null?void 0:vt.focus()})},[ye]);Vd(()=>{const $e=ye.current;Ye(),$e.eventSource==="keyboard"&&(D==null||D($e.value))},[Q,D]);function Ke($e){const vt=mt($e);vt!=null&&vt!==ye.current.value&&K(vt)}UV(ot,{onPanSessionStart($e){const vt=ye.current;vt.isInteractive&&(q(!0),Ye(),Ke($e),R==null||R(vt.value))},onPanSessionEnd(){const $e=ye.current;$e.isInteractive&&(q(!1),D==null||D($e.value))},onPan($e){ye.current.isInteractive&&Ke($e)}});const xe=w.useCallback(($e={},vt=null)=>({...$e,...I,ref:qn(vt,ot),tabIndex:-1,"aria-disabled":Mm(d),"data-focused":Ja($),style:{...$e.style,...ln}}),[I,d,$,ln]),Ne=w.useCallback(($e={},vt=null)=>({...$e,ref:qn(vt,We),id:st,"data-disabled":Ja(d),style:{...$e.style,...ae}}),[d,st,ae]),Ct=w.useCallback(($e={},vt=null)=>({...$e,ref:vt,style:{...$e.style,...Re}}),[Re]),Dt=w.useCallback(($e={},vt=null)=>({...$e,ref:qn(vt,De),role:"slider",tabIndex:X?0:void 0,id:wt,"data-active":Ja(te),"aria-valuetext":Mt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":Q,"aria-orientation":l,"aria-disabled":Mm(d),"aria-readonly":Mm(h),"aria-label":E,"aria-labelledby":E?void 0:_,style:{...$e.style,..._t(0)},onKeyDown:Im($e.onKeyDown,lt),onFocus:Im($e.onFocus,()=>U(!0)),onBlur:Im($e.onBlur,()=>U(!1))}),[X,wt,te,Mt,t,n,Q,l,d,h,E,_,_t,lt]),Te=w.useCallback(($e,vt=null)=>{const tn=!($e.valuen),Rn=Q>=$e.value,Xe=l5($e.value,t,n),xt={position:"absolute",pointerEvents:"none",...i4e({orientation:l,vertical:{bottom:z?`${100-Xe}%`:`${Xe}%`},horizontal:{left:z?`${100-Xe}%`:`${Xe}%`}})};return{...$e,ref:vt,role:"presentation","aria-hidden":!0,"data-disabled":Ja(d),"data-invalid":Ja(!tn),"data-highlighted":Ja(Rn),style:{...$e.style,...xt}}},[d,z,n,t,l,Q]),At=w.useCallback(($e={},vt=null)=>({...$e,ref:vt,type:"hidden",value:Q,name:T}),[T,Q]);return{state:{value:Q,isFocused:$,isDragging:te},actions:Le,getRootProps:xe,getTrackProps:Ne,getInnerTrackProps:Ct,getThumbProps:Dt,getMarkerProps:Te,getInputProps:At}}function i4e(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function o4e(e,t){return t"}),[s4e,wx]=Mn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),jE=Ae((e,t)=>{const n=Yi("Slider",e),r=En(e),{direction:i}=h0();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=r4e(r),l=a(),u=o({},t);return N.createElement(a4e,{value:s},N.createElement(s4e,{value:n},N.createElement(Ce.div,{...l,className:uf("chakra-slider",e.className),__css:n.container},e.children,N.createElement("input",{...u}))))});jE.defaultProps={orientation:"horizontal"};jE.displayName="Slider";var XV=Ae((e,t)=>{const{getThumbProps:n}=xx(),r=wx(),i=n(e,t);return N.createElement(Ce.div,{...i,className:uf("chakra-slider__thumb",e.className),__css:r.thumb})});XV.displayName="SliderThumb";var ZV=Ae((e,t)=>{const{getTrackProps:n}=xx(),r=wx(),i=n(e,t);return N.createElement(Ce.div,{...i,className:uf("chakra-slider__track",e.className),__css:r.track})});ZV.displayName="SliderTrack";var QV=Ae((e,t)=>{const{getInnerTrackProps:n}=xx(),r=wx(),i=n(e,t);return N.createElement(Ce.div,{...i,className:uf("chakra-slider__filled-track",e.className),__css:r.filledTrack})});QV.displayName="SliderFilledTrack";var G9=Ae((e,t)=>{const{getMarkerProps:n}=xx(),r=wx(),i=n(e,t);return N.createElement(Ce.div,{...i,className:uf("chakra-slider__marker",e.className),__css:r.mark})});G9.displayName="SliderMark";var l4e=(...e)=>e.filter(Boolean).join(" "),lI=e=>e?"":void 0,BE=Ae(function(t,n){const r=Yi("Switch",t),{spacing:i="0.5rem",children:o,...a}=En(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:d,getLabelProps:h}=Z$(a),m=w.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),v=w.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=w.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return N.createElement(Ce.label,{...d(),className:l4e("chakra-switch",t.className),__css:m},N.createElement("input",{className:"chakra-switch__input",...l({},n)}),N.createElement(Ce.span,{...u(),className:"chakra-switch__track",__css:v},N.createElement(Ce.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":lI(s.isChecked),"data-hover":lI(s.isHovered)})),o&&N.createElement(Ce.span,{className:"chakra-switch__label",...h(),__css:b},o))});BE.displayName="Switch";var C0=(...e)=>e.filter(Boolean).join(" ");function q9(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[u4e,JV,c4e,d4e]=dB();function f4e(e){const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[d,h]=w.useState(t??0),[m,v]=DS({defaultValue:t??0,value:r,onChange:n});w.useEffect(()=>{r!=null&&h(r)},[r]);const b=c4e(),S=w.useId();return{id:`tabs-${e.id??S}`,selectedIndex:m,focusedIndex:d,setSelectedIndex:v,setFocusedIndex:h,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:b,direction:l,htmlProps:u}}var[h4e,My]=Mn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function p4e(e){const{focusedIndex:t,orientation:n,direction:r}=My(),i=JV(),o=w.useCallback(a=>{const s=()=>{var _;const T=i.nextEnabled(t);T&&((_=T.node)==null||_.focus())},l=()=>{var _;const T=i.prevEnabled(t);T&&((_=T.node)==null||_.focus())},u=()=>{var _;const T=i.firstEnabled();T&&((_=T.node)==null||_.focus())},d=()=>{var _;const T=i.lastEnabled();T&&((_=T.node)==null||_.focus())},h=n==="horizontal",m=n==="vertical",v=a.key,b=r==="ltr"?"ArrowLeft":"ArrowRight",S=r==="ltr"?"ArrowRight":"ArrowLeft",E={[b]:()=>h&&l(),[S]:()=>h&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:u,End:d}[v];E&&(a.preventDefault(),E(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:q9(e.onKeyDown,o)}}function g4e(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=My(),{index:u,register:d}=d4e({disabled:t&&!n}),h=u===l,m=()=>{i(u)},v=()=>{s(u),!o&&!(t&&n)&&i(u)},b=n0e({...r,ref:qn(d,e.ref),isDisabled:t,isFocusable:n,onClick:q9(e.onClick,m)}),S="button";return{...b,id:eW(a,u),role:"tab",tabIndex:h?0:-1,type:S,"aria-selected":h,"aria-controls":tW(a,u),onFocus:t?void 0:q9(e.onFocus,v)}}var[m4e,v4e]=Mn({});function y4e(e){const t=My(),{id:n,selectedIndex:r}=t,o=XS(e.children).map((a,s)=>w.createElement(m4e,{key:s,value:{isSelected:s===r,id:tW(n,s),tabId:eW(n,s),selectedIndex:r}},a));return{...e,children:o}}function b4e(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=My(),{isSelected:o,id:a,tabId:s}=v4e(),l=w.useRef(!1);o&&(l.current=!0);const u=jF({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function S4e(){const e=My(),t=JV(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=w.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=w.useState(!1);return Ws(()=>{if(n==null)return;const d=t.item(n);if(d==null)return;i&&s({left:d.node.offsetLeft,width:d.node.offsetWidth}),o&&s({top:d.node.offsetTop,height:d.node.offsetHeight});const h=requestAnimationFrame(()=>{u(!0)});return()=>{h&&cancelAnimationFrame(h)}},[n,i,o,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:l?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function eW(e,t){return`${e}--tab-${t}`}function tW(e,t){return`${e}--tabpanel-${t}`}var[x4e,Iy]=Mn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),nW=Ae(function(t,n){const r=Yi("Tabs",t),{children:i,className:o,...a}=En(t),{htmlProps:s,descendants:l,...u}=f4e(a),d=w.useMemo(()=>u,[u]),{isFitted:h,...m}=s;return N.createElement(u4e,{value:l},N.createElement(h4e,{value:d},N.createElement(x4e,{value:r},N.createElement(Ce.div,{className:C0("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});nW.displayName="Tabs";var w4e=Ae(function(t,n){const r=S4e(),i={...t.style,...r},o=Iy();return N.createElement(Ce.div,{ref:n,...t,className:C0("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});w4e.displayName="TabIndicator";var C4e=Ae(function(t,n){const r=p4e({...t,ref:n}),o={display:"flex",...Iy().tablist};return N.createElement(Ce.div,{...r,className:C0("chakra-tabs__tablist",t.className),__css:o})});C4e.displayName="TabList";var rW=Ae(function(t,n){const r=b4e({...t,ref:n}),i=Iy();return N.createElement(Ce.div,{outline:"0",...r,className:C0("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});rW.displayName="TabPanel";var iW=Ae(function(t,n){const r=y4e(t),i=Iy();return N.createElement(Ce.div,{...r,width:"100%",ref:n,className:C0("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});iW.displayName="TabPanels";var oW=Ae(function(t,n){const r=Iy(),i=g4e({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return N.createElement(Ce.button,{...i,className:C0("chakra-tabs__tab",t.className),__css:o})});oW.displayName="Tab";var _4e=(...e)=>e.filter(Boolean).join(" ");function k4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var E4e=["h","minH","height","minHeight"],$E=Ae((e,t)=>{const n=Ao("Textarea",e),{className:r,rows:i,...o}=En(e),a=sk(o),s=i?k4e(n,E4e):n;return N.createElement(Ce.textarea,{ref:t,rows:i,...a,className:_4e("chakra-textarea",r),__css:s})});$E.displayName="Textarea";function P4e(e,t){const n=Er(e);w.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function Y9(e,...t){return T4e(e)?e(...t):e}var T4e=e=>typeof e=="function";function L4e(e,t){const n=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(i==null?void 0:i[t])??n}var A4e=(e,t)=>e.find(n=>n.id===t);function uI(e,t){const n=aW(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function aW(e,t){for(const[n,r]of Object.entries(e))if(A4e(r,t))return n}function O4e(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function M4e(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}var I4e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Hl=R4e(I4e);function R4e(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=D4e(i,o),{position:s,id:l}=a;return r(u=>{const h=s.includes("top")?[a,...u[s]??[]]:[...u[s]??[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=uI(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:sW(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(d=>({...d,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=aW(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(uI(Hl.getState(),i).position)}}var cI=0;function D4e(e,t={}){cI+=1;const n=t.id??cI,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Hl.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var N4e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return N.createElement(U$,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},N.createElement(q$,null,l),N.createElement(Ce.div,{flex:"1",maxWidth:"100%"},i&&N.createElement(Y$,{id:u==null?void 0:u.title},i),s&&N.createElement(G$,{id:u==null?void 0:u.description,display:"block"},s)),o&&N.createElement(JS,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function sW(e={}){const{render:t,toastComponent:n=N4e}=e;return i=>typeof t=="function"?t({...i,...e}):N.createElement(n,{...i,...e})}function j4e(e,t){const n=i=>({...t,...i,position:L4e((i==null?void 0:i.position)??(t==null?void 0:t.position),e)}),r=i=>{const o=n(i),a=sW(o);return Hl.notify(a,o)};return r.update=(i,o)=>{Hl.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...Y9(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...Y9(o.error,s)}))},r.closeAll=Hl.closeAll,r.close=Hl.close,r.isActive=Hl.isActive,r}function Ry(e){const{theme:t}=lB();return w.useMemo(()=>j4e(t.direction,e),[e,t.direction])}var B4e={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},lW=w.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=B4e,toastSpacing:d="0.5rem"}=e,[h,m]=w.useState(s),v=Rfe();Vd(()=>{v||r==null||r()},[v]),Vd(()=>{m(s)},[s]);const b=()=>m(null),S=()=>m(s),k=()=>{v&&i()};w.useEffect(()=>{v&&o&&i()},[v,o,i]),P4e(k,h);const E=w.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:d,...l}),[l,d]),_=w.useMemo(()=>O4e(a),[a]);return N.createElement(du.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:S,custom:{position:a},style:_},N.createElement(Ce.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:E},Y9(n,{id:t,onClose:k})))});lW.displayName="ToastComponent";var $4e=e=>{const t=w.useSyncExternalStore(Hl.subscribe,Hl.getState,Hl.getState),{children:n,motionVariants:r,component:i=lW,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return N.createElement("ul",{role:"region","aria-live":"polite",key:l,id:`chakra-toast-manager-${l}`,style:M4e(l)},N.createElement(nf,{initial:!1},u.map(d=>N.createElement(i,{key:d.id,motionVariants:r,...d}))))});return N.createElement(N.Fragment,null,n,N.createElement(ap,{...o},s))};function F4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function z4e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var H4e={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};function tv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var N5=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},K9=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function V4e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:d,id:h,isOpen:m,defaultIsOpen:v,arrowSize:b=10,arrowShadowColor:S,arrowPadding:k,modifiers:E,isDisabled:_,gutter:T,offset:A,direction:I,...R}=e,{isOpen:D,onOpen:j,onClose:z}=NF({isOpen:m,defaultIsOpen:v,onOpen:l,onClose:u}),{referenceRef:V,getPopperProps:K,getArrowInnerProps:te,getArrowProps:q}=DF({enabled:D,placement:d,arrowPadding:k,modifiers:E,gutter:T,offset:A,direction:I}),$=w.useId(),X=`tooltip-${h??$}`,Z=w.useRef(null),W=w.useRef(),Q=w.useCallback(()=>{W.current&&(clearTimeout(W.current),W.current=void 0)},[]),ie=w.useRef(),fe=w.useCallback(()=>{ie.current&&(clearTimeout(ie.current),ie.current=void 0)},[]),Se=w.useCallback(()=>{fe(),z()},[z,fe]),Pe=W4e(Z,Se),ye=w.useCallback(()=>{if(!_&&!W.current){Pe();const mt=K9(Z);W.current=mt.setTimeout(j,t)}},[Pe,_,j,t]),We=w.useCallback(()=>{Q();const mt=K9(Z);ie.current=mt.setTimeout(Se,n)},[n,Se,Q]),De=w.useCallback(()=>{D&&r&&We()},[r,We,D]),ot=w.useCallback(()=>{D&&a&&We()},[a,We,D]),He=w.useCallback(mt=>{D&&mt.key==="Escape"&&We()},[D,We]);Rh(()=>N5(Z),"keydown",s?He:void 0),Rh(()=>N5(Z),"scroll",()=>{D&&o&&Se()}),w.useEffect(()=>{_&&(Q(),D&&z())},[_,D,z,Q]),w.useEffect(()=>()=>{Q(),fe()},[Q,fe]),Rh(()=>Z.current,"pointerleave",We);const Be=w.useCallback((mt={},St=null)=>({...mt,ref:qn(Z,St,V),onPointerEnter:tv(mt.onPointerEnter,lt=>{lt.pointerType!=="touch"&&ye()}),onClick:tv(mt.onClick,De),onPointerDown:tv(mt.onPointerDown,ot),onFocus:tv(mt.onFocus,ye),onBlur:tv(mt.onBlur,We),"aria-describedby":D?X:void 0}),[ye,We,ot,D,X,De,V]),wt=w.useCallback((mt={},St=null)=>K({...mt,style:{...mt.style,[oi.arrowSize.var]:b?`${b}px`:void 0,[oi.arrowShadowColor.var]:S}},St),[K,b,S]),st=w.useCallback((mt={},St=null)=>{const Le={...mt.style,position:"relative",transformOrigin:oi.transformOrigin.varRef};return{ref:St,...R,...mt,id:X,role:"tooltip",style:Le}},[R,X]);return{isOpen:D,show:ye,hide:We,getTriggerProps:Be,getTooltipProps:st,getTooltipPositionerProps:wt,getArrowProps:q,getArrowInnerProps:te}}var sC="chakra-ui:close-tooltip";function W4e(e,t){return w.useEffect(()=>{const n=N5(e);return n.addEventListener(sC,t),()=>n.removeEventListener(sC,t)},[t,e]),()=>{const n=N5(e),r=K9(e);n.dispatchEvent(new r.CustomEvent(sC))}}var U4e=Ce(du.div),uo=Ae((e,t)=>{const n=Ao("Tooltip",e),r=En(e),i=h0(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:d,portalProps:h,background:m,backgroundColor:v,bgColor:b,motionProps:S,...k}=r,E=m??v??d??b;if(E){n.bg=E;const z=nne(i,"colors",E);n[oi.arrowBg.var]=z}const _=V4e({...k,direction:i.direction}),T=typeof o=="string"||s;let A;if(T)A=N.createElement(Ce.span,{display:"inline-block",tabIndex:0,..._.getTriggerProps()},o);else{const z=w.Children.only(o);A=w.cloneElement(z,_.getTriggerProps(z.props,z.ref))}const I=!!l,R=_.getTooltipProps({},t),D=I?F4e(R,["role","id"]):R,j=z4e(R,["role","id"]);return a?N.createElement(N.Fragment,null,A,N.createElement(nf,null,_.isOpen&&N.createElement(ap,{...h},N.createElement(Ce.div,{..._.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},N.createElement(U4e,{variants:H4e,initial:"exit",animate:"enter",exit:"exit",...S,...D,__css:n},a,I&&N.createElement(Ce.span,{srOnly:!0,...j},l),u&&N.createElement(Ce.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},N.createElement(Ce.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))))))):N.createElement(N.Fragment,null,o)});uo.displayName="Tooltip";var G4e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=N.createElement(yF,{environment:a},t);return N.createElement(que,{theme:o,cssVarsRoot:s},N.createElement(fj,{colorModeManager:n,options:o.config},i?N.createElement(fme,null):N.createElement(dme,null),N.createElement(Kue,null),r?N.createElement(BH,{zIndex:r},l):l))};function q4e({children:e,theme:t=Bue,toastOptions:n,...r}){return N.createElement(G4e,{theme:t,...r},e,N.createElement($4e,{...n}))}var X9={},dI=Qs;X9.createRoot=dI.createRoot,X9.hydrateRoot=dI.hydrateRoot;var Z9={},Y4e={get exports(){return Z9},set exports(e){Z9=e}},uW={};/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var r0=w;function K4e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var X4e=typeof Object.is=="function"?Object.is:K4e,Z4e=r0.useState,Q4e=r0.useEffect,J4e=r0.useLayoutEffect,e5e=r0.useDebugValue;function t5e(e,t){var n=t(),r=Z4e({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return J4e(function(){i.value=n,i.getSnapshot=t,lC(i)&&o({inst:i})},[e,n,t]),Q4e(function(){return lC(i)&&o({inst:i}),e(function(){lC(i)&&o({inst:i})})},[e]),e5e(n),n}function lC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!X4e(e,n)}catch{return!0}}function n5e(e,t){return t()}var r5e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n5e:t5e;uW.useSyncExternalStore=r0.useSyncExternalStore!==void 0?r0.useSyncExternalStore:r5e;(function(e){e.exports=uW})(Y4e);var Q9={},i5e={get exports(){return Q9},set exports(e){Q9=e}},cW={};/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Cx=w,o5e=Z9;function a5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var s5e=typeof Object.is=="function"?Object.is:a5e,l5e=o5e.useSyncExternalStore,u5e=Cx.useRef,c5e=Cx.useEffect,d5e=Cx.useMemo,f5e=Cx.useDebugValue;cW.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=u5e(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=d5e(function(){function l(v){if(!u){if(u=!0,d=v,v=r(v),i!==void 0&&a.hasValue){var b=a.value;if(i(b,v))return h=b}return h=v}if(b=h,s5e(d,v))return b;var S=r(v);return i!==void 0&&i(b,S)?b:(d=v,h=S)}var u=!1,d,h,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=l5e(e,o[0],o[1]);return c5e(function(){a.hasValue=!0,a.value=s},[s]),f5e(s),s};(function(e){e.exports=cW})(i5e);function h5e(e){e()}let dW=h5e;const p5e=e=>dW=e,g5e=()=>dW,Xd=w.createContext(null);function fW(){return w.useContext(Xd)}const m5e=()=>{throw new Error("uSES not initialized!")};let hW=m5e;const v5e=e=>{hW=e},y5e=(e,t)=>e===t;function b5e(e=Xd){const t=e===Xd?fW:()=>w.useContext(e);return function(r,i=y5e){const{store:o,subscription:a,getServerState:s}=t(),l=hW(a.addNestedSub,o.getState,s||o.getState,r,i);return w.useDebugValue(l),l}}const S5e=b5e();var fI={},x5e={get exports(){return fI},set exports(e){fI=e}},Fn={};/** - * @license React - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var FE=Symbol.for("react.element"),zE=Symbol.for("react.portal"),_x=Symbol.for("react.fragment"),kx=Symbol.for("react.strict_mode"),Ex=Symbol.for("react.profiler"),Px=Symbol.for("react.provider"),Tx=Symbol.for("react.context"),w5e=Symbol.for("react.server_context"),Lx=Symbol.for("react.forward_ref"),Ax=Symbol.for("react.suspense"),Ox=Symbol.for("react.suspense_list"),Mx=Symbol.for("react.memo"),Ix=Symbol.for("react.lazy"),C5e=Symbol.for("react.offscreen"),pW;pW=Symbol.for("react.module.reference");function ps(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case FE:switch(e=e.type,e){case _x:case Ex:case kx:case Ax:case Ox:return e;default:switch(e=e&&e.$$typeof,e){case w5e:case Tx:case Lx:case Ix:case Mx:case Px:return e;default:return t}}case zE:return t}}}Fn.ContextConsumer=Tx;Fn.ContextProvider=Px;Fn.Element=FE;Fn.ForwardRef=Lx;Fn.Fragment=_x;Fn.Lazy=Ix;Fn.Memo=Mx;Fn.Portal=zE;Fn.Profiler=Ex;Fn.StrictMode=kx;Fn.Suspense=Ax;Fn.SuspenseList=Ox;Fn.isAsyncMode=function(){return!1};Fn.isConcurrentMode=function(){return!1};Fn.isContextConsumer=function(e){return ps(e)===Tx};Fn.isContextProvider=function(e){return ps(e)===Px};Fn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===FE};Fn.isForwardRef=function(e){return ps(e)===Lx};Fn.isFragment=function(e){return ps(e)===_x};Fn.isLazy=function(e){return ps(e)===Ix};Fn.isMemo=function(e){return ps(e)===Mx};Fn.isPortal=function(e){return ps(e)===zE};Fn.isProfiler=function(e){return ps(e)===Ex};Fn.isStrictMode=function(e){return ps(e)===kx};Fn.isSuspense=function(e){return ps(e)===Ax};Fn.isSuspenseList=function(e){return ps(e)===Ox};Fn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===_x||e===Ex||e===kx||e===Ax||e===Ox||e===C5e||typeof e=="object"&&e!==null&&(e.$$typeof===Ix||e.$$typeof===Mx||e.$$typeof===Px||e.$$typeof===Tx||e.$$typeof===Lx||e.$$typeof===pW||e.getModuleId!==void 0)};Fn.typeOf=ps;(function(e){e.exports=Fn})(x5e);function _5e(){const e=g5e();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const hI={notify(){},get:()=>[]};function k5e(e,t){let n,r=hI;function i(h){return l(),r.subscribe(h)}function o(){r.notify()}function a(){d.onStateChange&&d.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=_5e())}function u(){n&&(n(),n=void 0,r.clear(),r=hI)}const d={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return d}const E5e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",P5e=E5e?w.useLayoutEffect:w.useEffect;function T5e({store:e,context:t,children:n,serverState:r}){const i=w.useMemo(()=>{const s=k5e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=w.useMemo(()=>e.getState(),[e]);P5e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]);const a=t||Xd;return N.createElement(a.Provider,{value:i},n)}function gW(e=Xd){const t=e===Xd?fW:()=>w.useContext(e);return function(){const{store:r}=t();return r}}const L5e=gW();function A5e(e=Xd){const t=e===Xd?L5e:gW(e);return function(){return t().dispatch}}const O5e=A5e();v5e(Q9.useSyncExternalStoreWithSelector);p5e(Qs.unstable_batchedUpdates);function T4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?T4=function(n){return typeof n}:T4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},T4(e)}function M5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pI(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:HE(e)?2:VE(e)?3:0}function Rm(e,t){return _0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function N5e(e,t){return _0(e)===2?e.get(t):e[t]}function vW(e,t,n){var r=_0(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function yW(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function HE(e){return H5e&&e instanceof Map}function VE(e){return V5e&&e instanceof Set}function hh(e){return e.o||e.t}function WE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=SW(e);delete t[vr];for(var n=Dm(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=j5e),Object.freeze(e),t&&Qh(e,function(n,r){return UE(r,!0)},!0)),e}function j5e(){zs(2)}function GE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function eu(e){var t=i8[e];return t||zs(18,e),t}function B5e(e,t){i8[e]||(i8[e]=t)}function t8(){return X2}function uC(e,t){t&&(eu("Patches"),e.u=[],e.s=[],e.v=t)}function j5(e){n8(e),e.p.forEach($5e),e.p=null}function n8(e){e===X2&&(X2=e.l)}function gI(e){return X2={p:[],l:X2,h:e,m:!0,_:0}}function $5e(e){var t=e[vr];t.i===0||t.i===1?t.j():t.O=!0}function cC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||eu("ES5").S(t,e,r),r?(n[vr].P&&(j5(t),zs(4)),oc(e)&&(e=B5(t,e),t.l||$5(t,e)),t.u&&eu("Patches").M(n[vr].t,e,t.u,t.s)):e=B5(t,n,[]),j5(t),t.u&&t.v(t.u,t.s),e!==bW?e:void 0}function B5(e,t,n){if(GE(t))return t;var r=t[vr];if(!r)return Qh(t,function(o,a){return mI(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return $5(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=WE(r.k):r.o;Qh(r.i===3?new Set(i):i,function(o,a){return mI(e,r,i,o,a,n)}),$5(e,i,!1),n&&e.u&&eu("Patches").R(r,n,e.u,e.s)}return r.o}function mI(e,t,n,r,i,o){if(Zd(i)){var a=B5(e,i,o&&t&&t.i!==3&&!Rm(t.D,r)?o.concat(r):void 0);if(vW(n,r,a),!Zd(a))return;e.m=!1}if(oc(i)&&!GE(i)){if(!e.h.F&&e._<1)return;B5(e,i),t&&t.A.l||$5(e,i)}}function $5(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&UE(t,n)}function dC(e,t){var n=e[vr];return(n?hh(n):e)[t]}function vI(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Sd(e){e.P||(e.P=!0,e.l&&Sd(e.l))}function fC(e){e.o||(e.o=WE(e.t))}function r8(e,t,n){var r=HE(t)?eu("MapSet").N(t,n):VE(t)?eu("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:t8(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=Z2;a&&(l=[s],u=_v);var d=Proxy.revocable(l,u),h=d.revoke,m=d.proxy;return s.k=m,s.j=h,m}(t,n):eu("ES5").J(t,n);return(n?n.A:t8()).p.push(r),r}function F5e(e){return Zd(e)||zs(22,e),function t(n){if(!oc(n))return n;var r,i=n[vr],o=_0(n);if(i){if(!i.P&&(i.i<4||!eu("ES5").K(i)))return i.t;i.I=!0,r=yI(n,o),i.I=!1}else r=yI(n,o);return Qh(r,function(a,s){i&&N5e(i.t,a)===s||vW(r,a,t(s))}),o===3?new Set(r):r}(e)}function yI(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return WE(e)}function z5e(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[vr];return Z2.get(l,o)},set:function(l){var u=this[vr];Z2.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][vr];if(!s.P)switch(s.i){case 5:r(s)&&Sd(s);break;case 4:n(s)&&Sd(s)}}}function n(o){for(var a=o.t,s=o.k,l=Dm(s),u=l.length-1;u>=0;u--){var d=l[u];if(d!==vr){var h=a[d];if(h===void 0&&!Rm(a,d))return!0;var m=s[d],v=m&&m[vr];if(v?v.t!==h:!yW(m,h))return!0}}var b=!!a[vr];return l.length!==Dm(a).length+(b?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?E-1:0),T=1;T1?d-1:0),m=1;m=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=eu("Patches").$;return Zd(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Ia=new U5e,xW=Ia.produce;Ia.produceWithPatches.bind(Ia);Ia.setAutoFreeze.bind(Ia);Ia.setUseProxies.bind(Ia);Ia.applyPatches.bind(Ia);Ia.createDraft.bind(Ia);Ia.finishDraft.bind(Ia);function wI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CI(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ro(1));return n(YE)(e,t)}if(typeof e!="function")throw new Error(ro(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function d(){if(l)throw new Error(ro(3));return o}function h(S){if(typeof S!="function")throw new Error(ro(4));if(l)throw new Error(ro(5));var k=!0;return u(),s.push(S),function(){if(k){if(l)throw new Error(ro(6));k=!1,u();var _=s.indexOf(S);s.splice(_,1),a=null}}}function m(S){if(!G5e(S))throw new Error(ro(7));if(typeof S.type>"u")throw new Error(ro(8));if(l)throw new Error(ro(9));try{l=!0,o=i(o,S)}finally{l=!1}for(var k=a=s,E=0;E"u")throw new Error(ro(12));if(typeof n(void 0,{type:F5.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ro(13))})}function wW(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(ro(14));h[v]=k,d=d||k!==S}return d=d||o.length!==Object.keys(l).length,d?h:l}}function z5(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return H5}function i(s,l){r(s)===H5&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var Z5e=function(t,n){return t===n};function Q5e(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(R).forEach(function(D){T(D)&&d[D]!==R[D]&&m.indexOf(D)===-1&&m.push(D)}),Object.keys(d).forEach(function(D){R[D]===void 0&&T(D)&&m.indexOf(D)===-1&&d[D]!==void 0&&m.push(D)}),v===null&&(v=setInterval(E,i)),d=R},o)}function E(){if(m.length===0){v&&clearInterval(v),v=null;return}var R=m.shift(),D=r.reduce(function(j,z){return z.in(j,R,d)},d[R]);if(D!==void 0)try{h[R]=l(D)}catch(j){console.error("redux-persist/createPersistoid: error serializing state",j)}else delete h[R];m.length===0&&_()}function _(){Object.keys(h).forEach(function(R){d[R]===void 0&&delete h[R]}),b=s.setItem(a,l(h)).catch(A)}function T(R){return!(n&&n.indexOf(R)===-1&&R!=="_persist"||t&&t.indexOf(R)!==-1)}function A(R){u&&u(R)}var I=function(){for(;m.length!==0;)E();return b||Promise.resolve()};return{update:k,flush:I}}function MSe(e){return JSON.stringify(e)}function ISe(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:XE).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=RSe,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,d){return d.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function RSe(e){return JSON.parse(e)}function DSe(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:XE).concat(e.key);return t.removeItem(n,NSe)}function NSe(e){}function OI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $u(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $Se(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var FSe=5e3;function zSe(e,t){var n=e.version!==void 0?e.version:PSe;e.debug;var r=e.stateReconciler===void 0?ASe:e.stateReconciler,i=e.getStoredState||ISe,o=e.timeout!==void 0?e.timeout:FSe,a=null,s=!1,l=!0,u=function(h){return h._persist.rehydrated&&a&&!l&&a.update(h),h};return function(d,h){var m=d||{},v=m._persist,b=BSe(m,["_persist"]),S=b;if(h.type===TW){var k=!1,E=function(j,z){k||(h.rehydrate(e.key,j,z),k=!0)};if(o&&setTimeout(function(){!k&&E(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=OSe(e)),v)return $u({},t(S,h),{_persist:v});if(typeof h.rehydrate!="function"||typeof h.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return h.register(e.key),i(e).then(function(D){var j=e.migrate||function(z,V){return Promise.resolve(z)};j(D,n).then(function(z){E(z)},function(z){E(void 0,z)})},function(D){E(void 0,D)}),$u({},t(S,h),{_persist:{version:n,rehydrated:!1}})}else{if(h.type===LW)return s=!0,h.result(DSe(e)),$u({},t(S,h),{_persist:v});if(h.type===EW)return h.result(a&&a.flush()),$u({},t(S,h),{_persist:v});if(h.type===PW)l=!0;else if(h.type===ZE){if(s)return $u({},S,{_persist:$u({},v,{rehydrated:!0})});if(h.key===e.key){var _=t(S,h),T=h.payload,A=r!==!1&&T!==void 0?r(T,d,_,e):_,I=$u({},A,{_persist:$u({},v,{rehydrated:!0})});return u(I)}}}if(!v)return t(d,h);var R=t(S,h);return R===S?d:u($u({},R,{_persist:v}))}}function MI(e){return WSe(e)||VSe(e)||HSe()}function HSe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function VSe(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function WSe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:OW,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case AW:return a8({},t,{registry:[].concat(MI(t.registry),[n.key])});case ZE:var r=t.registry.indexOf(n.key),i=MI(t.registry);return i.splice(r,1),a8({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function qSe(e,t,n){var r=n||!1,i=YE(GSe,OW,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:AW,key:u})},a=function(u,d,h){var m={type:ZE,payload:d,err:h,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=a8({},i,{purge:function(){var u=[];return e.dispatch({type:LW,result:function(h){u.push(h)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:EW,result:function(h){u.push(h)}}),Promise.all(u)},pause:function(){e.dispatch({type:PW})},persist:function(){e.dispatch({type:TW,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var QE={},JE={};JE.__esModule=!0;JE.default=XSe;function M4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?M4=function(n){return typeof n}:M4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},M4(e)}function mC(){}var YSe={getItem:mC,setItem:mC,removeItem:mC};function KSe(e){if((typeof self>"u"?"undefined":M4(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function XSe(e){var t="".concat(e,"Storage");return KSe(t)?self[t]:YSe}QE.__esModule=!0;QE.default=JSe;var ZSe=QSe(JE);function QSe(e){return e&&e.__esModule?e:{default:e}}function JSe(e){var t=(0,ZSe.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var MW=void 0,exe=txe(QE);function txe(e){return e&&e.__esModule?e:{default:e}}var nxe=(0,exe.default)("local");MW=nxe;var IW={},RW={},Jh={};Object.defineProperty(Jh,"__esModule",{value:!0});Jh.PLACEHOLDER_UNDEFINED=Jh.PACKAGE_NAME=void 0;Jh.PACKAGE_NAME="redux-deep-persist";Jh.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var eP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(eP);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=Jh,n=eP,r=function(q){return typeof q=="object"&&q!==null};e.isObjectLike=r;const i=function(q){return typeof q=="number"&&q>-1&&q%1==0&&q<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(q){return(0,e.isLength)(q&&q.length)&&Object.prototype.toString.call(q)==="[object Array]"};const o=function(q){return!!q&&typeof q=="object"&&!(0,e.isArray)(q)};e.isPlainObject=o;const a=function(q){return String(~~q)===q&&Number(q)>=0};e.isIntegerString=a;const s=function(q){return Object.prototype.toString.call(q)==="[object String]"};e.isString=s;const l=function(q){return Object.prototype.toString.call(q)==="[object Date]"};e.isDate=l;const u=function(q){return Object.keys(q).length===0};e.isEmpty=u;const d=Object.prototype.hasOwnProperty,h=function(q,$,U){U||(U=new Set([q])),$||($="");for(const X in q){const Z=$?`${$}.${X}`:X,W=q[X];if((0,e.isObjectLike)(W))return U.has(W)?`${$}.${X}:`:(U.add(W),(0,e.getCircularPath)(W,Z,U))}return null};e.getCircularPath=h;const m=function(q){if(!(0,e.isObjectLike)(q))return q;if((0,e.isDate)(q))return new Date(+q);const $=(0,e.isArray)(q)?[]:{};for(const U in q){const X=q[U];$[U]=(0,e._cloneDeep)(X)}return $};e._cloneDeep=m;const v=function(q){const $=(0,e.getCircularPath)(q);if($)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${$}' of object you're trying to persist: ${q}`);return(0,e._cloneDeep)(q)};e.cloneDeep=v;const b=function(q,$){if(q===$)return{};if(!(0,e.isObjectLike)(q)||!(0,e.isObjectLike)($))return $;const U=(0,e.cloneDeep)(q),X=(0,e.cloneDeep)($),Z=Object.keys(U).reduce((Q,ie)=>(d.call(X,ie)||(Q[ie]=void 0),Q),{});if((0,e.isDate)(U)||(0,e.isDate)(X))return U.valueOf()===X.valueOf()?{}:X;const W=Object.keys(X).reduce((Q,ie)=>{if(!d.call(U,ie))return Q[ie]=X[ie],Q;const fe=(0,e.difference)(U[ie],X[ie]);return(0,e.isObjectLike)(fe)&&(0,e.isEmpty)(fe)&&!(0,e.isDate)(fe)?(0,e.isArray)(U)&&!(0,e.isArray)(X)||!(0,e.isArray)(U)&&(0,e.isArray)(X)?X:Q:(Q[ie]=fe,Q)},Z);return delete W._persist,W};e.difference=b;const S=function(q,$){return $.reduce((U,X)=>{if(U){const Z=parseInt(X,10),W=(0,e.isIntegerString)(X)&&Z<0?U.length+Z:X;return(0,e.isString)(U)?U.charAt(W):U[W]}},q)};e.path=S;const k=function(q,$){return[...q].reverse().reduce((Z,W,Q)=>{const ie=(0,e.isIntegerString)(W)?[]:{};return ie[W]=Q===0?$:Z,ie},{})};e.assocPath=k;const E=function(q,$){const U=(0,e.cloneDeep)(q);return $.reduce((X,Z,W)=>(W===$.length-1&&X&&(0,e.isObjectLike)(X)&&delete X[Z],X&&X[Z]),U),U};e.dissocPath=E;const _=function(q,$,...U){if(!U||!U.length)return $;const X=U.shift(),{preservePlaceholder:Z,preserveUndefined:W}=q;if((0,e.isObjectLike)($)&&(0,e.isObjectLike)(X))for(const Q in X)if((0,e.isObjectLike)(X[Q])&&(0,e.isObjectLike)($[Q]))$[Q]||($[Q]={}),_(q,$[Q],X[Q]);else if((0,e.isArray)($)){let ie=X[Q];const fe=Z?t.PLACEHOLDER_UNDEFINED:void 0;W||(ie=typeof ie<"u"?ie:$[parseInt(Q,10)]),ie=ie!==t.PLACEHOLDER_UNDEFINED?ie:fe,$[parseInt(Q,10)]=ie}else{const ie=X[Q]!==t.PLACEHOLDER_UNDEFINED?X[Q]:void 0;$[Q]=ie}return _(q,$,...U)},T=function(q,$,U){return _({preservePlaceholder:U==null?void 0:U.preservePlaceholder,preserveUndefined:U==null?void 0:U.preserveUndefined},(0,e.cloneDeep)(q),(0,e.cloneDeep)($))};e.mergeDeep=T;const A=function(q,$=[],U,X,Z){if(!(0,e.isObjectLike)(q))return q;for(const W in q){const Q=q[W],ie=(0,e.isArray)(q),fe=X?X+"."+W:W;Q===null&&(U===n.ConfigType.WHITELIST&&$.indexOf(fe)===-1||U===n.ConfigType.BLACKLIST&&$.indexOf(fe)!==-1)&&ie&&(q[parseInt(W,10)]=void 0),Q===void 0&&Z&&U===n.ConfigType.BLACKLIST&&$.indexOf(fe)===-1&&ie&&(q[parseInt(W,10)]=t.PLACEHOLDER_UNDEFINED),A(Q,$,U,fe,Z)}},I=function(q,$,U,X){const Z=(0,e.cloneDeep)(q);return A(Z,$,U,"",X),Z};e.preserveUndefined=I;const R=function(q,$,U){return U.indexOf(q)===$};e.unique=R;const D=function(q){return q.reduce(($,U)=>{const X=q.filter(Se=>Se===U),Z=q.filter(Se=>(U+".").indexOf(Se+".")===0),{duplicates:W,subsets:Q}=$,ie=X.length>1&&W.indexOf(U)===-1,fe=Z.length>1;return{duplicates:[...W,...ie?X:[]],subsets:[...Q,...fe?Z:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=D;const j=function(q,$,U){const X=U===n.ConfigType.WHITELIST?"whitelist":"blacklist",Z=`${t.PACKAGE_NAME}: incorrect ${X} configuration.`,W=`Check your create${U===n.ConfigType.WHITELIST?"White":"Black"}list arguments. - -`;if(!(0,e.isString)($)||$.length<1)throw new Error(`${Z} Name (key) of reducer is required. ${W}`);if(!q||!q.length)return;const{duplicates:Q,subsets:ie}=(0,e.findDuplicatesAndSubsets)(q);if(Q.length>1)throw new Error(`${Z} Duplicated paths. - - ${JSON.stringify(Q)} - - ${W}`);if(ie.length>1)throw new Error(`${Z} You are trying to persist an entire property and also some of its subset. - -${JSON.stringify(ie)} - - ${W}`)};e.singleTransformValidator=j;const z=function(q){if(!(0,e.isArray)(q))return;const $=(q==null?void 0:q.map(U=>U.deepPersistKey).filter(U=>U))||[];if($.length){const U=$.filter((X,Z)=>$.indexOf(X)!==Z);if(U.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. - - Duplicates: ${JSON.stringify(U)}`)}};e.transformsValidator=z;const V=function({whitelist:q,blacklist:$}){if(q&&q.length&&$&&$.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(q){const{duplicates:U,subsets:X}=(0,e.findDuplicatesAndSubsets)(q);(0,e.throwError)({duplicates:U,subsets:X},"whitelist")}if($){const{duplicates:U,subsets:X}=(0,e.findDuplicatesAndSubsets)($);(0,e.throwError)({duplicates:U,subsets:X},"blacklist")}};e.configValidator=V;const K=function({duplicates:q,subsets:$},U){if(q.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${U}. - - ${JSON.stringify(q)}`);if($.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${U}. You must decide if you want to persist an entire path or its specific subset. - - ${JSON.stringify($)}`)};e.throwError=K;const te=function(q){return(0,e.isArray)(q)?q.filter(e.unique).reduce(($,U)=>{const X=U.split("."),Z=X[0],W=X.slice(1).join(".")||void 0,Q=$.filter(fe=>Object.keys(fe)[0]===Z)[0],ie=Q?Object.values(Q)[0]:void 0;return Q||$.push({[Z]:W?[W]:void 0}),Q&&!ie&&W&&(Q[Z]=[W]),Q&&ie&&W&&ie.push(W),$},[]):[]};e.getRootKeysGroup=te})(RW);(function(e){var t=Co&&Co.__rest||function(h,m){var v={};for(var b in h)Object.prototype.hasOwnProperty.call(h,b)&&m.indexOf(b)<0&&(v[b]=h[b]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var S=0,b=Object.getOwnPropertySymbols(h);S!k(_)&&h?h(E,_,T):E,out:(E,_,T)=>!k(_)&&m?m(E,_,T):E,deepPersistKey:b&&b[0]}},a=(h,m,v,{debug:b,whitelist:S,blacklist:k,transforms:E})=>{if(S||k)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(E);const _=(0,n.cloneDeep)(v);let T=h;if(T&&(0,n.isObjectLike)(T)){const A=(0,n.difference)(m,v);(0,n.isEmpty)(A)||(T=(0,n.mergeDeep)(h,A,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(A)}`)),Object.keys(T).forEach(I=>{if(I!=="_persist"){if((0,n.isObjectLike)(_[I])){_[I]=(0,n.mergeDeep)(_[I],T[I]);return}_[I]=T[I]}})}return b&&T&&(0,n.isObjectLike)(T)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(T)}`),_};e.autoMergeDeep=a;const s=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.WHITELIST),o(v=>{if(!m||!m.length)return v;let b=null,S;return m.forEach(k=>{const E=k.split(".");S=(0,n.path)(v,E),typeof S>"u"&&(0,n.isIntegerString)(E[E.length-1])&&(S=r.PLACEHOLDER_UNDEFINED);const _=(0,n.assocPath)(E,S),T=(0,n.isArray)(_)?[]:{};b=(0,n.mergeDeep)(b||T,_,{preservePlaceholder:!0})}),b||v},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.WHITELIST),{whitelist:[h]}));e.createWhitelist=s;const l=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.BLACKLIST),o(v=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST,!0);return m.map(k=>k.split(".")).reduce((k,E)=>(0,n.dissocPath)(k,E),b)},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST),{whitelist:[h]}));e.createBlacklist=l;const u=function(h,m){return m.map(v=>{const b=Object.keys(v)[0],S=v[b];return h===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,S):(0,e.createBlacklist)(b,S)})};e.getTransforms=u;const d=h=>{var{key:m,whitelist:v,blacklist:b,storage:S,transforms:k,rootReducer:E}=h,_=t(h,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:v,blacklist:b});const T=(0,n.getRootKeysGroup)(v),A=(0,n.getRootKeysGroup)(b),I=Object.keys(E(void 0,{type:""})),R=T.map(te=>Object.keys(te)[0]),D=A.map(te=>Object.keys(te)[0]),j=I.filter(te=>R.indexOf(te)===-1&&D.indexOf(te)===-1),z=(0,e.getTransforms)(i.ConfigType.WHITELIST,T),V=(0,e.getTransforms)(i.ConfigType.BLACKLIST,A),K=(0,n.isArray)(v)?j.map(te=>(0,e.createBlacklist)(te)):[];return Object.assign(Object.assign({},_),{key:m,storage:S,transforms:[...z,...V,...K,...k||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=d})(IW);const Ed=(e,t)=>Math.floor(e/t)*t,Gl=(e,t)=>Math.round(e/t)*t;var ke={},rxe={get exports(){return ke},set exports(e){ke=e}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,m=2,v=4,b=1,S=2,k=1,E=2,_=4,T=8,A=16,I=32,R=64,D=128,j=256,z=512,V=30,K="...",te=800,q=16,$=1,U=2,X=3,Z=1/0,W=9007199254740991,Q=17976931348623157e292,ie=0/0,fe=4294967295,Se=fe-1,Pe=fe>>>1,ye=[["ary",D],["bind",k],["bindKey",E],["curry",T],["curryRight",A],["flip",z],["partial",I],["partialRight",R],["rearg",j]],We="[object Arguments]",De="[object Array]",ot="[object AsyncFunction]",He="[object Boolean]",Be="[object Date]",wt="[object DOMException]",st="[object Error]",mt="[object Function]",St="[object GeneratorFunction]",Le="[object Map]",lt="[object Number]",Mt="[object Null]",ut="[object Object]",_t="[object Promise]",ln="[object Proxy]",ae="[object RegExp]",Re="[object Set]",Ye="[object String]",Ke="[object Symbol]",xe="[object Undefined]",Ne="[object WeakMap]",Ct="[object WeakSet]",Dt="[object ArrayBuffer]",Te="[object DataView]",At="[object Float32Array]",$e="[object Float64Array]",vt="[object Int8Array]",tn="[object Int16Array]",Rn="[object Int32Array]",Xe="[object Uint8Array]",xt="[object Uint8ClampedArray]",ft="[object Uint16Array]",Ht="[object Uint32Array]",nn=/\b__p \+= '';/g,pr=/\b(__p \+=) '' \+/g,Mo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oi=/&(?:amp|lt|gt|quot|#39);/g,rl=/[&<>"']/g,I0=RegExp(Oi.source),Ba=RegExp(rl.source),kp=/<%-([\s\S]+?)%>/g,R0=/<%([\s\S]+?)%>/g,yc=/<%=([\s\S]+?)%>/g,Ep=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pp=/^\w*$/,ia=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vf=/[\\^$.*+?()[\]{}|]/g,D0=RegExp(vf.source),bc=/^\s+/,yf=/\s/,N0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,il=/\{\n\/\* \[wrapped with (.+)\] \*/,Sc=/,? & /,j0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,B0=/[()=,{}\[\]\/\s]/,$0=/\\(\\)?/g,F0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,gs=/\w*$/,z0=/^[-+]0x[0-9a-f]+$/i,H0=/^0b[01]+$/i,V0=/^\[object .+?Constructor\]$/,W0=/^0o[0-7]+$/i,U0=/^(?:0|[1-9]\d*)$/,G0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ol=/($^)/,q0=/['\n\r\u2028\u2029\\]/g,ms="\\ud800-\\udfff",vu="\\u0300-\\u036f",yu="\\ufe20-\\ufe2f",al="\\u20d0-\\u20ff",bu=vu+yu+al,Tp="\\u2700-\\u27bf",xc="a-z\\xdf-\\xf6\\xf8-\\xff",sl="\\xac\\xb1\\xd7\\xf7",oa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dn="\\u2000-\\u206f",Pn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",aa="A-Z\\xc0-\\xd6\\xd8-\\xde",Hr="\\ufe0e\\ufe0f",li=sl+oa+Dn+Pn,sa="['’]",ll="["+ms+"]",ui="["+li+"]",vs="["+bu+"]",bf="\\d+",Su="["+Tp+"]",ys="["+xc+"]",Sf="[^"+ms+li+bf+Tp+xc+aa+"]",Mi="\\ud83c[\\udffb-\\udfff]",Lp="(?:"+vs+"|"+Mi+")",Ap="[^"+ms+"]",xf="(?:\\ud83c[\\udde6-\\uddff]){2}",ul="[\\ud800-\\udbff][\\udc00-\\udfff]",Io="["+aa+"]",cl="\\u200d",xu="(?:"+ys+"|"+Sf+")",Y0="(?:"+Io+"|"+Sf+")",wc="(?:"+sa+"(?:d|ll|m|re|s|t|ve))?",Cc="(?:"+sa+"(?:D|LL|M|RE|S|T|VE))?",wf=Lp+"?",_c="["+Hr+"]?",$a="(?:"+cl+"(?:"+[Ap,xf,ul].join("|")+")"+_c+wf+")*",Cf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yt=_c+wf+$a,Op="(?:"+[Su,xf,ul].join("|")+")"+Yt,kc="(?:"+[Ap+vs+"?",vs,xf,ul,ll].join("|")+")",Ec=RegExp(sa,"g"),Mp=RegExp(vs,"g"),la=RegExp(Mi+"(?="+Mi+")|"+kc+Yt,"g"),Kn=RegExp([Io+"?"+ys+"+"+wc+"(?="+[ui,Io,"$"].join("|")+")",Y0+"+"+Cc+"(?="+[ui,Io+xu,"$"].join("|")+")",Io+"?"+xu+"+"+wc,Io+"+"+Cc,wu,Cf,bf,Op].join("|"),"g"),_f=RegExp("["+cl+ms+bu+Hr+"]"),Ip=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,kf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rp=-1,gn={};gn[At]=gn[$e]=gn[vt]=gn[tn]=gn[Rn]=gn[Xe]=gn[xt]=gn[ft]=gn[Ht]=!0,gn[We]=gn[De]=gn[Dt]=gn[He]=gn[Te]=gn[Be]=gn[st]=gn[mt]=gn[Le]=gn[lt]=gn[ut]=gn[ae]=gn[Re]=gn[Ye]=gn[Ne]=!1;var Kt={};Kt[We]=Kt[De]=Kt[Dt]=Kt[Te]=Kt[He]=Kt[Be]=Kt[At]=Kt[$e]=Kt[vt]=Kt[tn]=Kt[Rn]=Kt[Le]=Kt[lt]=Kt[ut]=Kt[ae]=Kt[Re]=Kt[Ye]=Kt[Ke]=Kt[Xe]=Kt[xt]=Kt[ft]=Kt[Ht]=!0,Kt[st]=Kt[mt]=Kt[Ne]=!1;var Dp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},K0={"&":"&","<":"<",">":">",'"':""","'":"'"},Y={"&":"&","<":"<",">":">",""":'"',"'":"'"},re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ge=parseFloat,it=parseInt,Wt=typeof Co=="object"&&Co&&Co.Object===Object&&Co,Sn=typeof self=="object"&&self&&self.Object===Object&&self,kt=Wt||Sn||Function("return this")(),Nt=t&&!t.nodeType&&t,Xt=Nt&&!0&&e&&!e.nodeType&&e,Jr=Xt&&Xt.exports===Nt,Ir=Jr&&Wt.process,xn=function(){try{var oe=Xt&&Xt.require&&Xt.require("util").types;return oe||Ir&&Ir.binding&&Ir.binding("util")}catch{}}(),ci=xn&&xn.isArrayBuffer,Ro=xn&&xn.isDate,co=xn&&xn.isMap,Fa=xn&&xn.isRegExp,dl=xn&&xn.isSet,X0=xn&&xn.isTypedArray;function Ii(oe,we,ve){switch(ve.length){case 0:return oe.call(we);case 1:return oe.call(we,ve[0]);case 2:return oe.call(we,ve[0],ve[1]);case 3:return oe.call(we,ve[0],ve[1],ve[2])}return oe.apply(we,ve)}function Z0(oe,we,ve,nt){for(var It=-1,rn=oe==null?0:oe.length;++It-1}function Np(oe,we,ve){for(var nt=-1,It=oe==null?0:oe.length;++nt-1;);return ve}function bs(oe,we){for(var ve=oe.length;ve--&&Lc(we,oe[ve],0)>-1;);return ve}function J0(oe,we){for(var ve=oe.length,nt=0;ve--;)oe[ve]===we&&++nt;return nt}var Jy=Lf(Dp),Ss=Lf(K0);function hl(oe){return"\\"+re[oe]}function Bp(oe,we){return oe==null?n:oe[we]}function _u(oe){return _f.test(oe)}function $p(oe){return Ip.test(oe)}function e3(oe){for(var we,ve=[];!(we=oe.next()).done;)ve.push(we.value);return ve}function Fp(oe){var we=-1,ve=Array(oe.size);return oe.forEach(function(nt,It){ve[++we]=[It,nt]}),ve}function zp(oe,we){return function(ve){return oe(we(ve))}}function da(oe,we){for(var ve=-1,nt=oe.length,It=0,rn=[];++ve-1}function b3(c,g){var C=this.__data__,O=Wr(C,c);return O<0?(++this.size,C.push([c,g])):C[O][1]=g,this}fa.prototype.clear=v3,fa.prototype.delete=y3,fa.prototype.get=p1,fa.prototype.has=g1,fa.prototype.set=b3;function ha(c){var g=-1,C=c==null?0:c.length;for(this.clear();++g=g?c:g)),c}function wi(c,g,C,O,B,H){var J,ne=g&h,ce=g&m,_e=g&v;if(C&&(J=B?C(c,O,B,H):C(c)),J!==n)return J;if(!wr(c))return c;var Ee=Ft(c);if(Ee){if(J=$K(c),!ne)return $i(c,J)}else{var Ie=ki(c),tt=Ie==mt||Ie==St;if(rd(c))return _l(c,ne);if(Ie==ut||Ie==We||tt&&!B){if(J=ce||tt?{}:ST(c),!ne)return ce?I1(c,qc(J,c)):zo(c,ct(J,c))}else{if(!Kt[Ie])return B?c:{};J=FK(c,Ie,ne)}}H||(H=new Dr);var bt=H.get(c);if(bt)return bt;H.set(c,J),KT(c)?c.forEach(function(Tt){J.add(wi(Tt,g,C,Tt,c,H))}):qT(c)&&c.forEach(function(Tt,Qt){J.set(Qt,wi(Tt,g,C,Qt,c,H))});var Pt=_e?ce?me:ya:ce?Vo:Ei,qt=Ee?n:Pt(c);return Xn(qt||c,function(Tt,Qt){qt&&(Qt=Tt,Tt=c[Qt]),ml(J,Qt,wi(Tt,g,C,Qt,c,H))}),J}function Kp(c){var g=Ei(c);return function(C){return Xp(C,c,g)}}function Xp(c,g,C){var O=C.length;if(c==null)return!O;for(c=mn(c);O--;){var B=C[O],H=g[B],J=c[B];if(J===n&&!(B in c)||!H(J))return!1}return!0}function b1(c,g,C){if(typeof c!="function")throw new Ri(a);return B1(function(){c.apply(n,C)},g)}function Yc(c,g,C,O){var B=-1,H=Ki,J=!0,ne=c.length,ce=[],_e=g.length;if(!ne)return ce;C&&(g=Wn(g,Vr(C))),O?(H=Np,J=!1):g.length>=i&&(H=Oc,J=!1,g=new Wa(g));e:for(;++BB?0:B+C),O=O===n||O>B?B:Vt(O),O<0&&(O+=B),O=C>O?0:ZT(O);C0&&C(ne)?g>1?Ur(ne,g-1,C,O,B):za(B,ne):O||(B[B.length]=ne)}return B}var Qp=kl(),Bo=kl(!0);function va(c,g){return c&&Qp(c,g,Ei)}function $o(c,g){return c&&Bo(c,g,Ei)}function Jp(c,g){return No(g,function(C){return Iu(c[C])})}function vl(c,g){g=Cl(g,c);for(var C=0,O=g.length;c!=null&&Cg}function tg(c,g){return c!=null&&un.call(c,g)}function ng(c,g){return c!=null&&g in mn(c)}function rg(c,g,C){return c>=fi(g,C)&&c=120&&Ee.length>=120)?new Wa(J&&Ee):n}Ee=c[0];var Ie=-1,tt=ne[0];e:for(;++Ie-1;)ne!==c&&jf.call(ne,ce,1),jf.call(c,ce,1);return c}function Gf(c,g){for(var C=c?g.length:0,O=C-1;C--;){var B=g[C];if(C==O||B!==H){var H=B;Mu(B)?jf.call(c,B,1):hg(c,B)}}return c}function qf(c,g){return c+Eu(l1()*(g-c+1))}function xl(c,g,C,O){for(var B=-1,H=Rr(Ff((g-c)/(C||1)),0),J=ve(H);H--;)J[O?H:++B]=c,c+=C;return J}function ed(c,g){var C="";if(!c||g<1||g>W)return C;do g%2&&(C+=c),g=Eu(g/2),g&&(c+=c);while(g);return C}function Ot(c,g){return Tw(CT(c,g,Wo),c+"")}function lg(c){return Gc(Sg(c))}function Yf(c,g){var C=Sg(c);return P3(C,Tu(g,0,C.length))}function Au(c,g,C,O){if(!wr(c))return c;g=Cl(g,c);for(var B=-1,H=g.length,J=H-1,ne=c;ne!=null&&++BB?0:B+g),C=C>B?B:C,C<0&&(C+=B),B=g>C?0:C-g>>>0,g>>>=0;for(var H=ve(B);++O>>1,J=c[H];J!==null&&!ba(J)&&(C?J<=g:J=i){var _e=g?null:G(c);if(_e)return If(_e);J=!1,B=Oc,ce=new Wa}else ce=g?[]:ne;e:for(;++O=O?c:qr(c,g,C)}var L1=o3||function(c){return kt.clearTimeout(c)};function _l(c,g){if(g)return c.slice();var C=c.length,O=Nc?Nc(C):new c.constructor(C);return c.copy(O),O}function A1(c){var g=new c.constructor(c.byteLength);return new Di(g).set(new Di(c)),g}function Ou(c,g){var C=g?A1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.byteLength)}function C3(c){var g=new c.constructor(c.source,gs.exec(c));return g.lastIndex=c.lastIndex,g}function Zn(c){return Hf?mn(Hf.call(c)):{}}function _3(c,g){var C=g?A1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.length)}function O1(c,g){if(c!==g){var C=c!==n,O=c===null,B=c===c,H=ba(c),J=g!==n,ne=g===null,ce=g===g,_e=ba(g);if(!ne&&!_e&&!H&&c>g||H&&J&&ce&&!ne&&!_e||O&&J&&ce||!C&&ce||!B)return 1;if(!O&&!H&&!_e&&c=ne)return ce;var _e=C[O];return ce*(_e=="desc"?-1:1)}}return c.index-g.index}function k3(c,g,C,O){for(var B=-1,H=c.length,J=C.length,ne=-1,ce=g.length,_e=Rr(H-J,0),Ee=ve(ce+_e),Ie=!O;++ne1?C[B-1]:n,J=B>2?C[2]:n;for(H=c.length>3&&typeof H=="function"?(B--,H):n,J&&vo(C[0],C[1],J)&&(H=B<3?n:H,B=1),g=mn(g);++O-1?B[H?g[J]:J]:n}}function D1(c){return mr(function(g){var C=g.length,O=C,B=ho.prototype.thru;for(c&&g.reverse();O--;){var H=g[O];if(typeof H!="function")throw new Ri(a);if(B&&!J&&be(H)=="wrapper")var J=new ho([],!0)}for(O=J?O:C;++O1&&on.reverse(),Ee&&cene))return!1;var _e=H.get(c),Ee=H.get(g);if(_e&&Ee)return _e==g&&Ee==c;var Ie=-1,tt=!0,bt=C&S?new Wa:n;for(H.set(c,g),H.set(g,c);++Ie1?"& ":"")+g[O],g=g.join(C>2?", ":" "),c.replace(N0,`{ -/* [wrapped with `+g+`] */ -`)}function HK(c){return Ft(c)||nh(c)||!!(a1&&c&&c[a1])}function Mu(c,g){var C=typeof c;return g=g??W,!!g&&(C=="number"||C!="symbol"&&U0.test(c))&&c>-1&&c%1==0&&c0){if(++g>=te)return arguments[0]}else g=0;return c.apply(n,arguments)}}function P3(c,g){var C=-1,O=c.length,B=O-1;for(g=g===n?O:g;++C1?c[g-1]:n;return C=typeof C=="function"?(c.pop(),C):n,DT(c,C)});function NT(c){var g=F(c);return g.__chain__=!0,g}function JX(c,g){return g(c),c}function T3(c,g){return g(c)}var eZ=mr(function(c){var g=c.length,C=g?c[0]:0,O=this.__wrapped__,B=function(H){return Yp(H,c)};return g>1||this.__actions__.length||!(O instanceof Zt)||!Mu(C)?this.thru(B):(O=O.slice(C,+C+(g?1:0)),O.__actions__.push({func:T3,args:[B],thisArg:n}),new ho(O,this.__chain__).thru(function(H){return g&&!H.length&&H.push(n),H}))});function tZ(){return NT(this)}function nZ(){return new ho(this.value(),this.__chain__)}function rZ(){this.__values__===n&&(this.__values__=XT(this.value()));var c=this.__index__>=this.__values__.length,g=c?n:this.__values__[this.__index__++];return{done:c,value:g}}function iZ(){return this}function oZ(c){for(var g,C=this;C instanceof Vf;){var O=LT(C);O.__index__=0,O.__values__=n,g?B.__wrapped__=O:g=O;var B=O;C=C.__wrapped__}return B.__wrapped__=c,g}function aZ(){var c=this.__wrapped__;if(c instanceof Zt){var g=c;return this.__actions__.length&&(g=new Zt(this)),g=g.reverse(),g.__actions__.push({func:T3,args:[Lw],thisArg:n}),new ho(g,this.__chain__)}return this.thru(Lw)}function sZ(){return wl(this.__wrapped__,this.__actions__)}var lZ=gg(function(c,g,C){un.call(c,C)?++c[C]:pa(c,C,1)});function uZ(c,g,C){var O=Ft(c)?Vn:S1;return C&&vo(c,g,C)&&(g=n),O(c,Oe(g,3))}function cZ(c,g){var C=Ft(c)?No:ma;return C(c,Oe(g,3))}var dZ=R1(AT),fZ=R1(OT);function hZ(c,g){return Ur(L3(c,g),1)}function pZ(c,g){return Ur(L3(c,g),Z)}function gZ(c,g,C){return C=C===n?1:Vt(C),Ur(L3(c,g),C)}function jT(c,g){var C=Ft(c)?Xn:Cs;return C(c,Oe(g,3))}function BT(c,g){var C=Ft(c)?Do:Zp;return C(c,Oe(g,3))}var mZ=gg(function(c,g,C){un.call(c,C)?c[C].push(g):pa(c,C,[g])});function vZ(c,g,C,O){c=Ho(c)?c:Sg(c),C=C&&!O?Vt(C):0;var B=c.length;return C<0&&(C=Rr(B+C,0)),R3(c)?C<=B&&c.indexOf(g,C)>-1:!!B&&Lc(c,g,C)>-1}var yZ=Ot(function(c,g,C){var O=-1,B=typeof g=="function",H=Ho(c)?ve(c.length):[];return Cs(c,function(J){H[++O]=B?Ii(g,J,C):_s(J,g,C)}),H}),bZ=gg(function(c,g,C){pa(c,C,g)});function L3(c,g){var C=Ft(c)?Wn:jr;return C(c,Oe(g,3))}function SZ(c,g,C,O){return c==null?[]:(Ft(g)||(g=g==null?[]:[g]),C=O?n:C,Ft(C)||(C=C==null?[]:[C]),ji(c,g,C))}var xZ=gg(function(c,g,C){c[C?0:1].push(g)},function(){return[[],[]]});function wZ(c,g,C){var O=Ft(c)?Ef:jp,B=arguments.length<3;return O(c,Oe(g,4),C,B,Cs)}function CZ(c,g,C){var O=Ft(c)?Ky:jp,B=arguments.length<3;return O(c,Oe(g,4),C,B,Zp)}function _Z(c,g){var C=Ft(c)?No:ma;return C(c,M3(Oe(g,3)))}function kZ(c){var g=Ft(c)?Gc:lg;return g(c)}function EZ(c,g,C){(C?vo(c,g,C):g===n)?g=1:g=Vt(g);var O=Ft(c)?xi:Yf;return O(c,g)}function PZ(c){var g=Ft(c)?Sw:_i;return g(c)}function TZ(c){if(c==null)return 0;if(Ho(c))return R3(c)?Ha(c):c.length;var g=ki(c);return g==Le||g==Re?c.size:Gr(c).length}function LZ(c,g,C){var O=Ft(c)?Pc:Fo;return C&&vo(c,g,C)&&(g=n),O(c,Oe(g,3))}var AZ=Ot(function(c,g){if(c==null)return[];var C=g.length;return C>1&&vo(c,g[0],g[1])?g=[]:C>2&&vo(g[0],g[1],g[2])&&(g=[g[0]]),ji(c,Ur(g,1),[])}),A3=a3||function(){return kt.Date.now()};function OZ(c,g){if(typeof g!="function")throw new Ri(a);return c=Vt(c),function(){if(--c<1)return g.apply(this,arguments)}}function $T(c,g,C){return g=C?n:g,g=c&&g==null?c.length:g,pe(c,D,n,n,n,n,g)}function FT(c,g){var C;if(typeof g!="function")throw new Ri(a);return c=Vt(c),function(){return--c>0&&(C=g.apply(this,arguments)),c<=1&&(g=n),C}}var Ow=Ot(function(c,g,C){var O=k;if(C.length){var B=da(C,et(Ow));O|=I}return pe(c,O,g,C,B)}),zT=Ot(function(c,g,C){var O=k|E;if(C.length){var B=da(C,et(zT));O|=I}return pe(g,O,c,C,B)});function HT(c,g,C){g=C?n:g;var O=pe(c,T,n,n,n,n,n,g);return O.placeholder=HT.placeholder,O}function VT(c,g,C){g=C?n:g;var O=pe(c,A,n,n,n,n,n,g);return O.placeholder=VT.placeholder,O}function WT(c,g,C){var O,B,H,J,ne,ce,_e=0,Ee=!1,Ie=!1,tt=!0;if(typeof c!="function")throw new Ri(a);g=qa(g)||0,wr(C)&&(Ee=!!C.leading,Ie="maxWait"in C,H=Ie?Rr(qa(C.maxWait)||0,g):H,tt="trailing"in C?!!C.trailing:tt);function bt(Kr){var Ls=O,Du=B;return O=B=n,_e=Kr,J=c.apply(Du,Ls),J}function Pt(Kr){return _e=Kr,ne=B1(Qt,g),Ee?bt(Kr):J}function qt(Kr){var Ls=Kr-ce,Du=Kr-_e,uL=g-Ls;return Ie?fi(uL,H-Du):uL}function Tt(Kr){var Ls=Kr-ce,Du=Kr-_e;return ce===n||Ls>=g||Ls<0||Ie&&Du>=H}function Qt(){var Kr=A3();if(Tt(Kr))return on(Kr);ne=B1(Qt,qt(Kr))}function on(Kr){return ne=n,tt&&O?bt(Kr):(O=B=n,J)}function Sa(){ne!==n&&L1(ne),_e=0,O=ce=B=ne=n}function yo(){return ne===n?J:on(A3())}function xa(){var Kr=A3(),Ls=Tt(Kr);if(O=arguments,B=this,ce=Kr,Ls){if(ne===n)return Pt(ce);if(Ie)return L1(ne),ne=B1(Qt,g),bt(ce)}return ne===n&&(ne=B1(Qt,g)),J}return xa.cancel=Sa,xa.flush=yo,xa}var MZ=Ot(function(c,g){return b1(c,1,g)}),IZ=Ot(function(c,g,C){return b1(c,qa(g)||0,C)});function RZ(c){return pe(c,z)}function O3(c,g){if(typeof c!="function"||g!=null&&typeof g!="function")throw new Ri(a);var C=function(){var O=arguments,B=g?g.apply(this,O):O[0],H=C.cache;if(H.has(B))return H.get(B);var J=c.apply(this,O);return C.cache=H.set(B,J)||H,J};return C.cache=new(O3.Cache||ha),C}O3.Cache=ha;function M3(c){if(typeof c!="function")throw new Ri(a);return function(){var g=arguments;switch(g.length){case 0:return!c.call(this);case 1:return!c.call(this,g[0]);case 2:return!c.call(this,g[0],g[1]);case 3:return!c.call(this,g[0],g[1],g[2])}return!c.apply(this,g)}}function DZ(c){return FT(2,c)}var NZ=Cw(function(c,g){g=g.length==1&&Ft(g[0])?Wn(g[0],Vr(Oe())):Wn(Ur(g,1),Vr(Oe()));var C=g.length;return Ot(function(O){for(var B=-1,H=fi(O.length,C);++B=g}),nh=og(function(){return arguments}())?og:function(c){return Br(c)&&un.call(c,"callee")&&!o1.call(c,"callee")},Ft=ve.isArray,ZZ=ci?Vr(ci):w1;function Ho(c){return c!=null&&I3(c.length)&&!Iu(c)}function Yr(c){return Br(c)&&Ho(c)}function QZ(c){return c===!0||c===!1||Br(c)&&Ci(c)==He}var rd=s3||Vw,JZ=Ro?Vr(Ro):C1;function eQ(c){return Br(c)&&c.nodeType===1&&!$1(c)}function tQ(c){if(c==null)return!0;if(Ho(c)&&(Ft(c)||typeof c=="string"||typeof c.splice=="function"||rd(c)||bg(c)||nh(c)))return!c.length;var g=ki(c);if(g==Le||g==Re)return!c.size;if(j1(c))return!Gr(c).length;for(var C in c)if(un.call(c,C))return!1;return!0}function nQ(c,g){return Xc(c,g)}function rQ(c,g,C){C=typeof C=="function"?C:n;var O=C?C(c,g):n;return O===n?Xc(c,g,n,C):!!O}function Iw(c){if(!Br(c))return!1;var g=Ci(c);return g==st||g==wt||typeof c.message=="string"&&typeof c.name=="string"&&!$1(c)}function iQ(c){return typeof c=="number"&&Wp(c)}function Iu(c){if(!wr(c))return!1;var g=Ci(c);return g==mt||g==St||g==ot||g==ln}function GT(c){return typeof c=="number"&&c==Vt(c)}function I3(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=W}function wr(c){var g=typeof c;return c!=null&&(g=="object"||g=="function")}function Br(c){return c!=null&&typeof c=="object"}var qT=co?Vr(co):ww;function oQ(c,g){return c===g||Zc(c,g,Rt(g))}function aQ(c,g,C){return C=typeof C=="function"?C:n,Zc(c,g,Rt(g),C)}function sQ(c){return YT(c)&&c!=+c}function lQ(c){if(UK(c))throw new It(o);return ag(c)}function uQ(c){return c===null}function cQ(c){return c==null}function YT(c){return typeof c=="number"||Br(c)&&Ci(c)==lt}function $1(c){if(!Br(c)||Ci(c)!=ut)return!1;var g=jc(c);if(g===null)return!0;var C=un.call(g,"constructor")&&g.constructor;return typeof C=="function"&&C instanceof C&&br.call(C)==Si}var Rw=Fa?Vr(Fa):Sr;function dQ(c){return GT(c)&&c>=-W&&c<=W}var KT=dl?Vr(dl):Ut;function R3(c){return typeof c=="string"||!Ft(c)&&Br(c)&&Ci(c)==Ye}function ba(c){return typeof c=="symbol"||Br(c)&&Ci(c)==Ke}var bg=X0?Vr(X0):ei;function fQ(c){return c===n}function hQ(c){return Br(c)&&ki(c)==Ne}function pQ(c){return Br(c)&&Ci(c)==Ct}var gQ=P(yl),mQ=P(function(c,g){return c<=g});function XT(c){if(!c)return[];if(Ho(c))return R3(c)?Xi(c):$i(c);if(Bc&&c[Bc])return e3(c[Bc]());var g=ki(c),C=g==Le?Fp:g==Re?If:Sg;return C(c)}function Ru(c){if(!c)return c===0?c:0;if(c=qa(c),c===Z||c===-Z){var g=c<0?-1:1;return g*Q}return c===c?c:0}function Vt(c){var g=Ru(c),C=g%1;return g===g?C?g-C:g:0}function ZT(c){return c?Tu(Vt(c),0,fe):0}function qa(c){if(typeof c=="number")return c;if(ba(c))return ie;if(wr(c)){var g=typeof c.valueOf=="function"?c.valueOf():c;c=wr(g)?g+"":g}if(typeof c!="string")return c===0?c:+c;c=fo(c);var C=H0.test(c);return C||W0.test(c)?it(c.slice(2),C?2:8):z0.test(c)?ie:+c}function QT(c){return Ua(c,Vo(c))}function vQ(c){return c?Tu(Vt(c),-W,W):c===0?c:0}function Ln(c){return c==null?"":go(c)}var yQ=mo(function(c,g){if(j1(g)||Ho(g)){Ua(g,Ei(g),c);return}for(var C in g)un.call(g,C)&&ml(c,C,g[C])}),JT=mo(function(c,g){Ua(g,Vo(g),c)}),D3=mo(function(c,g,C,O){Ua(g,Vo(g),c,O)}),bQ=mo(function(c,g,C,O){Ua(g,Ei(g),c,O)}),SQ=mr(Yp);function xQ(c,g){var C=Pu(c);return g==null?C:ct(C,g)}var wQ=Ot(function(c,g){c=mn(c);var C=-1,O=g.length,B=O>2?g[2]:n;for(B&&vo(g[0],g[1],B)&&(O=1);++C1),H}),Ua(c,me(c),C),O&&(C=wi(C,h|m|v,jt));for(var B=g.length;B--;)hg(C,g[B]);return C});function FQ(c,g){return tL(c,M3(Oe(g)))}var zQ=mr(function(c,g){return c==null?{}:E1(c,g)});function tL(c,g){if(c==null)return{};var C=Wn(me(c),function(O){return[O]});return g=Oe(g),sg(c,C,function(O,B){return g(O,B[0])})}function HQ(c,g,C){g=Cl(g,c);var O=-1,B=g.length;for(B||(B=1,c=n);++Og){var O=c;c=g,g=O}if(C||c%1||g%1){var B=l1();return fi(c+B*(g-c+ge("1e-"+((B+"").length-1))),g)}return qf(c,g)}var JQ=El(function(c,g,C){return g=g.toLowerCase(),c+(C?iL(g):g)});function iL(c){return jw(Ln(c).toLowerCase())}function oL(c){return c=Ln(c),c&&c.replace(G0,Jy).replace(Mp,"")}function eJ(c,g,C){c=Ln(c),g=go(g);var O=c.length;C=C===n?O:Tu(Vt(C),0,O);var B=C;return C-=g.length,C>=0&&c.slice(C,B)==g}function tJ(c){return c=Ln(c),c&&Ba.test(c)?c.replace(rl,Ss):c}function nJ(c){return c=Ln(c),c&&D0.test(c)?c.replace(vf,"\\$&"):c}var rJ=El(function(c,g,C){return c+(C?"-":"")+g.toLowerCase()}),iJ=El(function(c,g,C){return c+(C?" ":"")+g.toLowerCase()}),oJ=vg("toLowerCase");function aJ(c,g,C){c=Ln(c),g=Vt(g);var O=g?Ha(c):0;if(!g||O>=g)return c;var B=(g-O)/2;return f(Eu(B),C)+c+f(Ff(B),C)}function sJ(c,g,C){c=Ln(c),g=Vt(g);var O=g?Ha(c):0;return g&&O>>0,C?(c=Ln(c),c&&(typeof g=="string"||g!=null&&!Rw(g))&&(g=go(g),!g&&_u(c))?Es(Xi(c),0,C):c.split(g,C)):[]}var pJ=El(function(c,g,C){return c+(C?" ":"")+jw(g)});function gJ(c,g,C){return c=Ln(c),C=C==null?0:Tu(Vt(C),0,c.length),g=go(g),c.slice(C,C+g.length)==g}function mJ(c,g,C){var O=F.templateSettings;C&&vo(c,g,C)&&(g=n),c=Ln(c),g=D3({},g,O,ze);var B=D3({},g.imports,O.imports,ze),H=Ei(B),J=Mf(B,H),ne,ce,_e=0,Ee=g.interpolate||ol,Ie="__p += '",tt=Df((g.escape||ol).source+"|"+Ee.source+"|"+(Ee===yc?F0:ol).source+"|"+(g.evaluate||ol).source+"|$","g"),bt="//# sourceURL="+(un.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rp+"]")+` -`;c.replace(tt,function(Tt,Qt,on,Sa,yo,xa){return on||(on=Sa),Ie+=c.slice(_e,xa).replace(q0,hl),Qt&&(ne=!0,Ie+=`' + -__e(`+Qt+`) + -'`),yo&&(ce=!0,Ie+=`'; -`+yo+`; -__p += '`),on&&(Ie+=`' + -((__t = (`+on+`)) == null ? '' : __t) + -'`),_e=xa+Tt.length,Tt}),Ie+=`'; -`;var Pt=un.call(g,"variable")&&g.variable;if(!Pt)Ie=`with (obj) { -`+Ie+` -} -`;else if(B0.test(Pt))throw new It(s);Ie=(ce?Ie.replace(nn,""):Ie).replace(pr,"$1").replace(Mo,"$1;"),Ie="function("+(Pt||"obj")+`) { -`+(Pt?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(ne?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+Ie+`return __p -}`;var qt=sL(function(){return rn(H,bt+"return "+Ie).apply(n,J)});if(qt.source=Ie,Iw(qt))throw qt;return qt}function vJ(c){return Ln(c).toLowerCase()}function yJ(c){return Ln(c).toUpperCase()}function bJ(c,g,C){if(c=Ln(c),c&&(C||g===n))return fo(c);if(!c||!(g=go(g)))return c;var O=Xi(c),B=Xi(g),H=ca(O,B),J=bs(O,B)+1;return Es(O,H,J).join("")}function SJ(c,g,C){if(c=Ln(c),c&&(C||g===n))return c.slice(0,t1(c)+1);if(!c||!(g=go(g)))return c;var O=Xi(c),B=bs(O,Xi(g))+1;return Es(O,0,B).join("")}function xJ(c,g,C){if(c=Ln(c),c&&(C||g===n))return c.replace(bc,"");if(!c||!(g=go(g)))return c;var O=Xi(c),B=ca(O,Xi(g));return Es(O,B).join("")}function wJ(c,g){var C=V,O=K;if(wr(g)){var B="separator"in g?g.separator:B;C="length"in g?Vt(g.length):C,O="omission"in g?go(g.omission):O}c=Ln(c);var H=c.length;if(_u(c)){var J=Xi(c);H=J.length}if(C>=H)return c;var ne=C-Ha(O);if(ne<1)return O;var ce=J?Es(J,0,ne).join(""):c.slice(0,ne);if(B===n)return ce+O;if(J&&(ne+=ce.length-ne),Rw(B)){if(c.slice(ne).search(B)){var _e,Ee=ce;for(B.global||(B=Df(B.source,Ln(gs.exec(B))+"g")),B.lastIndex=0;_e=B.exec(Ee);)var Ie=_e.index;ce=ce.slice(0,Ie===n?ne:Ie)}}else if(c.indexOf(go(B),ne)!=ne){var tt=ce.lastIndexOf(B);tt>-1&&(ce=ce.slice(0,tt))}return ce+O}function CJ(c){return c=Ln(c),c&&I0.test(c)?c.replace(Oi,r3):c}var _J=El(function(c,g,C){return c+(C?" ":"")+g.toUpperCase()}),jw=vg("toUpperCase");function aL(c,g,C){return c=Ln(c),g=C?n:g,g===n?$p(c)?Rf(c):Q0(c):c.match(g)||[]}var sL=Ot(function(c,g){try{return Ii(c,n,g)}catch(C){return Iw(C)?C:new It(C)}}),kJ=mr(function(c,g){return Xn(g,function(C){C=Pl(C),pa(c,C,Ow(c[C],c))}),c});function EJ(c){var g=c==null?0:c.length,C=Oe();return c=g?Wn(c,function(O){if(typeof O[1]!="function")throw new Ri(a);return[C(O[0]),O[1]]}):[],Ot(function(O){for(var B=-1;++BW)return[];var C=fe,O=fi(c,fe);g=Oe(g),c-=fe;for(var B=Of(O,g);++C0||g<0)?new Zt(C):(c<0?C=C.takeRight(-c):c&&(C=C.drop(c)),g!==n&&(g=Vt(g),C=g<0?C.dropRight(-g):C.take(g-c)),C)},Zt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Zt.prototype.toArray=function(){return this.take(fe)},va(Zt.prototype,function(c,g){var C=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),B=F[O?"take"+(g=="last"?"Right":""):g],H=O||/^find/.test(g);B&&(F.prototype[g]=function(){var J=this.__wrapped__,ne=O?[1]:arguments,ce=J instanceof Zt,_e=ne[0],Ee=ce||Ft(J),Ie=function(Qt){var on=B.apply(F,za([Qt],ne));return O&&tt?on[0]:on};Ee&&C&&typeof _e=="function"&&_e.length!=1&&(ce=Ee=!1);var tt=this.__chain__,bt=!!this.__actions__.length,Pt=H&&!tt,qt=ce&&!bt;if(!H&&Ee){J=qt?J:new Zt(this);var Tt=c.apply(J,ne);return Tt.__actions__.push({func:T3,args:[Ie],thisArg:n}),new ho(Tt,tt)}return Pt&&qt?c.apply(this,ne):(Tt=this.thru(Ie),Pt?O?Tt.value()[0]:Tt.value():Tt)})}),Xn(["pop","push","shift","sort","splice","unshift"],function(c){var g=Ic[c],C=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",O=/^(?:pop|shift)$/.test(c);F.prototype[c]=function(){var B=arguments;if(O&&!this.__chain__){var H=this.value();return g.apply(Ft(H)?H:[],B)}return this[C](function(J){return g.apply(Ft(J)?J:[],B)})}}),va(Zt.prototype,function(c,g){var C=F[g];if(C){var O=C.name+"";un.call(xs,O)||(xs[O]=[]),xs[O].push({name:g,func:C})}}),xs[Jf(n,E).name]=[{name:"wrapper",func:n}],Zt.prototype.clone=Zi,Zt.prototype.reverse=Ni,Zt.prototype.value=f3,F.prototype.at=eZ,F.prototype.chain=tZ,F.prototype.commit=nZ,F.prototype.next=rZ,F.prototype.plant=oZ,F.prototype.reverse=aZ,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=sZ,F.prototype.first=F.prototype.head,Bc&&(F.prototype[Bc]=iZ),F},Va=jo();Xt?((Xt.exports=Va)._=Va,Nt._=Va):kt._=Va}).call(Co)})(rxe,ke);const Ag=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Og=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},ixe=.999,oxe=.1,axe=20,nv=.95,RI=30,s8=10,DI=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),oh=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Gl(s/o,64)):o<1&&(r.height=s,r.width=Gl(s*o,64)),a=r.width*r.height;return r},sxe=e=>({width:Gl(e.width,64),height:Gl(e.height,64)}),DW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],lxe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],tP=e=>e.kind==="line"&&e.layer==="mask",uxe=e=>e.kind==="line"&&e.layer==="base",W5=e=>e.kind==="image"&&e.layer==="base",cxe=e=>e.kind==="fillRect"&&e.layer==="base",dxe=e=>e.kind==="eraseRect"&&e.layer==="base",fxe=e=>e.kind==="line",kv={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},hxe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:kv,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},NW=cp({name:"canvas",initialState:hxe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!tP(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Ed(ke.clamp(n.width,64,512),64),height:Ed(ke.clamp(n.height,64,512),64)},o={x:Gl(n.width/2-i.width/2,64),y:Gl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=oh(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState={...kv,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Og(r.width,r.height,n.width,n.height,nv),s=Ag(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=sxe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=oh(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=DI(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...kv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(fxe);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(ke.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState=kv,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(W5),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const d=Og(i.width,i.height,512,512,nv),h=Ag(i.width,i.height,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=oh(m);e.scaledBoundingBoxDimensions=v}return}const{width:o,height:a}=r,l=Og(t,n,o,a,.95),u=Ag(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=DI(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(W5)){const i=Og(r.width,r.height,512,512,nv),o=Ag(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=oh(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const d=r?1:Og(i,o,l,u,nv),h=Ag(i,o,a,s,l,u,d);e.stageScale=d,e.stageCoordinates=h}else{const d=Og(i,o,512,512,nv),h=Ag(i,o,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=oh(m);e.scaledBoundingBoxDimensions=v}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...kv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Ed(ke.clamp(o,64,512),64),height:Ed(ke.clamp(a,64,512),64)},l={x:Gl(o/2-s.width/2,64),y:Gl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=oh(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=oh(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:jW,addFillRect:BW,addImageToStagingArea:pxe,addLine:gxe,addPointToCurrentLine:$W,clearCanvasHistory:FW,clearMask:nP,commitColorPickerColor:mxe,commitStagingAreaImage:vxe,discardStagedImages:yxe,fitBoundingBoxToStage:JFe,mouseLeftCanvas:bxe,nextStagingAreaImage:Sxe,prevStagingAreaImage:xxe,redo:wxe,resetCanvas:rP,resetCanvasInteractionState:Cxe,resetCanvasView:zW,resizeAndScaleCanvas:Rx,resizeCanvas:_xe,setBoundingBoxCoordinates:vC,setBoundingBoxDimensions:Ev,setBoundingBoxPreviewFill:eze,setBoundingBoxScaleMethod:kxe,setBrushColor:Nm,setBrushSize:jm,setCanvasContainerDimensions:Exe,setColorPickerColor:Pxe,setCursorPosition:Txe,setDoesCanvasNeedScaling:vi,setInitialCanvasImage:Dx,setIsDrawing:HW,setIsMaskEnabled:Dy,setIsMouseOverBoundingBox:Cb,setIsMoveBoundingBoxKeyHeld:tze,setIsMoveStageKeyHeld:nze,setIsMovingBoundingBox:yC,setIsMovingStage:U5,setIsTransformingBoundingBox:bC,setLayer:G5,setMaskColor:VW,setMergedCanvas:Lxe,setShouldAutoSave:WW,setShouldCropToBoundingBoxOnSave:UW,setShouldDarkenOutsideBoundingBox:GW,setShouldLockBoundingBox:rze,setShouldPreserveMaskedArea:qW,setShouldShowBoundingBox:Axe,setShouldShowBrush:ize,setShouldShowBrushPreview:oze,setShouldShowCanvasDebugInfo:YW,setShouldShowCheckboardTransparency:aze,setShouldShowGrid:KW,setShouldShowIntermediates:XW,setShouldShowStagingImage:Oxe,setShouldShowStagingOutline:NI,setShouldSnapToGrid:q5,setStageCoordinates:ZW,setStageScale:Mxe,setTool:tu,toggleShouldLockBoundingBox:sze,toggleTool:lze,undo:Ixe,setScaledBoundingBoxDimensions:_b,setShouldRestrictStrokesToBox:QW}=NW.actions,Rxe=NW.reducer,Dxe={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},JW=cp({name:"gallery",initialState:Dxe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=ke.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:sm,clearIntermediateImage:SC,removeImage:eU,setCurrentImage:jI,addGalleryImages:Nxe,setIntermediateImage:jxe,selectNextImage:iP,selectPrevImage:oP,setShouldPinGallery:Bxe,setShouldShowGallery:Bd,setGalleryScrollPosition:$xe,setGalleryImageMinimumWidth:rv,setGalleryImageObjectFit:Fxe,setShouldHoldGalleryOpen:tU,setShouldAutoSwitchToNewImages:zxe,setCurrentCategory:kb,setGalleryWidth:Hxe,setShouldUseSingleGalleryColumn:Vxe}=JW.actions,Wxe=JW.reducer,Uxe={isLightboxOpen:!1},Gxe=Uxe,nU=cp({name:"lightbox",initialState:Gxe,reducers:{setIsLightboxOpen:(e,t)=>{e.isLightboxOpen=t.payload}}}),{setIsLightboxOpen:Bm}=nU.actions,qxe=nU.reducer,i2=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" ");function aP(e){let t=i2(e),n=null;const r=new RegExp(/\[([^\][]*)]/,"gi"),i=[...t.matchAll(r)].map(o=>o[1]);return i.length&&(n=i.join(" "),i.forEach(o=>{t=t.replace(`[${o}]`,"").replaceAll("[]","").trim()})),[t,n]}const Yxe=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return sP(r)?r:!1},sP=e=>Boolean(typeof e=="string"?Yxe(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),Y5=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),Kxe=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),rU={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512},Xxe=rU,iU=cp({name:"generation",initialState:Xxe,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=i2(n)},setNegativePrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.negativePrompt=n:e.negativePrompt=i2(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:d,hires_fix:h,width:m,height:v}=t.payload.image;o&&o.length>0?(e.seedWeights=Y5(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=i2(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,typeof u>"u"?e.perlin=0:e.perlin=u,typeof d=="boolean"&&(e.seamless=d),m&&(e.width=m),v&&(e.height=v)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:d,seamless:h,hires_fix:m,width:v,height:b,strength:S,fit:k,init_image_path:E,mask_image_path:_}=t.payload.image;if(n==="img2img"&&(E&&(e.initialImage=E),_&&(e.maskPath=_),S&&(e.img2imgStrength=S),typeof k=="boolean"&&(e.shouldFitToWidthHeight=k)),a&&a.length>0?(e.seedWeights=Y5(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i){const[T,A]=aP(i);T&&(e.prompt=T),A?e.negativePrompt=A:e.negativePrompt=""}r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),typeof u>"u"?e.threshold=0:e.threshold=u,typeof d>"u"?e.perlin=0:e.perlin=d,typeof h=="boolean"&&(e.seamless=h),v&&(e.width=v),b&&(e.height=b)},resetParametersState:e=>({...e,...rU}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload}}}),{clearInitialImage:oU,resetParametersState:uze,resetSeed:cze,setAllImageToImageParameters:Zxe,setAllParameters:aU,setAllTextToImageParameters:dze,setCfgScale:sU,setHeight:lU,setImg2imgStrength:l8,setInfillMethod:uU,setInitialImage:k0,setIterations:Qxe,setMaskPath:cU,setParameter:fze,setPerlin:dU,setPrompt:Nx,setNegativePrompt:Q2,setSampler:fU,setSeamBlur:BI,setSeamless:hU,setSeamSize:$I,setSeamSteps:FI,setSeamStrength:zI,setSeed:Ny,setSeedWeights:pU,setShouldFitToWidthHeight:gU,setShouldGenerateVariations:Jxe,setShouldRandomizeSeed:ewe,setSteps:mU,setThreshold:vU,setTileSize:HI,setVariationAmount:twe,setWidth:yU}=iU.actions,nwe=iU.reducer,bU={codeformerFidelity:.75,facetoolStrength:.8,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingDenoising:.75,upscalingStrength:.75},rwe=bU,SU=cp({name:"postprocessing",initialState:rwe,reducers:{setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingDenoising:(e,t)=>{e.upscalingDenoising=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setHiresStrength:(e,t)=>{e.hiresStrength=t.payload},resetPostprocessingState:e=>({...e,...bU}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload}}}),{resetPostprocessingState:hze,setCodeformerFidelity:xU,setFacetoolStrength:u8,setFacetoolType:I4,setHiresFix:lP,setHiresStrength:VI,setShouldLoopback:iwe,setShouldRunESRGAN:owe,setShouldRunFacetool:awe,setUpscalingLevel:wU,setUpscalingDenoising:c8,setUpscalingStrength:d8}=SU.actions,swe=SU.reducer;function Xs(e){return Xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xs(e)}function hu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lwe(e,t){if(Xs(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xs(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CU(e){var t=lwe(e,"string");return Xs(t)==="symbol"?t:String(t)}function WI(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};hu(this,e),this.init(t,n)}return pu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||pwe,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function KI(e,t,n){var r=uP(e,t,Object),i=r.obj,o=r.k;i[o]=n}function vwe(e,t,n,r){var i=uP(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function K5(e,t){var n=uP(e,t),r=n.obj,i=n.k;if(r)return r[i]}function XI(e,t,n){var r=K5(e,n);return r!==void 0?r:K5(t,n)}function _U(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):_U(e[r],t[r],n):e[r]=t[r]);return e}function Mg(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var ywe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function bwe(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return ywe[t]}):e}var Bx=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Swe=[" ",",","?","!",";"];function xwe(e,t,n){t=t||"",n=n||"";var r=Swe.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function ZI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Eb(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function kU(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?kU(l,u,n):void 0}i=i[r[o]]}return i}}var _we=function(e){jx(n,e);var t=wwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return hu(this,n),i=t.call(this),Bx&&Qd.call($d(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return pu(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[i,o];a&&typeof a!="string"&&(d=d.concat(a)),a&&typeof a=="string"&&(d=d.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(d=i.split("."));var h=K5(this.data,d);return h||!u||typeof a!="string"?h:kU(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var d=[i,o];a&&(d=d.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(d=i.split("."),s=o,o=d[1]),this.addNamespaces(o),KI(this.data,d,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[i,o];i.indexOf(".")>-1&&(d=i.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);var h=K5(this.data,d)||{};s?_U(h,a,l):h=Eb(Eb({},h),a),KI(this.data,d,h),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Eb(Eb({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Qd),EU={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function QI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function So(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var JI={},eR=function(e){jx(n,e);var t=kwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return hu(this,n),i=t.call(this),Bx&&Qd.call($d(i)),mwe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,$d(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=ql.create("translator"),i}return pu(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!xwe(i,a,s);if(u&&!d){var h=i.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:i,namespaces:l};var m=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),i=m.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(Xs(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,d=this.extractFromKey(i[i.length-1],o),h=d.key,m=d.namespaces,v=m[m.length-1],b=o.lng||this.language,S=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(S){var k=o.nsSeparator||this.options.nsSeparator;return l?(E.res="".concat(v).concat(k).concat(h),E):"".concat(v).concat(k).concat(h)}return l?(E.res=h,E):h}var E=this.resolve(i,o),_=E&&E.res,T=E&&E.usedKey||h,A=E&&E.exactUsedKey||h,I=Object.prototype.toString.apply(_),R=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,z=typeof _!="string"&&typeof _!="boolean"&&typeof _!="number";if(j&&_&&z&&R.indexOf(I)<0&&!(typeof D=="string"&&I==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,_,So(So({},o),{},{ns:m})):"key '".concat(h," (").concat(this.language,")' returned an object instead of string.");return l?(E.res=V,E):V}if(u){var K=I==="[object Array]",te=K?[]:{},q=K?A:T;for(var $ in _)if(Object.prototype.hasOwnProperty.call(_,$)){var U="".concat(q).concat(u).concat($);te[$]=this.translate(U,So(So({},o),{joinArrays:!1,ns:m})),te[$]===U&&(te[$]=_[$])}_=te}}else if(j&&typeof D=="string"&&I==="[object Array]")_=_.join(D),_&&(_=this.extendTranslation(_,i,o,a));else{var X=!1,Z=!1,W=o.count!==void 0&&typeof o.count!="string",Q=n.hasDefaultValue(o),ie=W?this.pluralResolver.getSuffix(b,o.count,o):"",fe=o["defaultValue".concat(ie)]||o.defaultValue;!this.isValidLookup(_)&&Q&&(X=!0,_=fe),this.isValidLookup(_)||(Z=!0,_=h);var Se=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Pe=Se&&Z?void 0:_,ye=Q&&fe!==_&&this.options.updateMissing;if(Z||X||ye){if(this.logger.log(ye?"updateKey":"missingKey",b,v,h,ye?fe:_),u){var We=this.resolve(h,So(So({},o),{},{keySeparator:!1}));We&&We.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var De=[],ot=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ot&&ot[0])for(var He=0;He1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,d,h;return typeof i=="string"&&(i=[i]),i.forEach(function(m){if(!o.isValidLookup(s)){var v=o.extractFromKey(m,a),b=v.key;l=b;var S=v.namespaces;o.options.fallbackNS&&(S=S.concat(o.options.fallbackNS));var k=a.count!==void 0&&typeof a.count!="string",E=k&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),_=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);S.forEach(function(A){o.isValidLookup(s)||(h=A,!JI["".concat(T[0],"-").concat(A)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(h)&&(JI["".concat(T[0],"-").concat(A)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(T.join(", "),`" won't get resolved as namespace "`).concat(h,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(function(I){if(!o.isValidLookup(s)){d=I;var R=[b];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(R,b,I,A,a);else{var D;k&&(D=o.pluralResolver.getSuffix(I,a.count,a));var j="".concat(o.options.pluralSeparator,"zero");if(k&&(R.push(b+D),E&&R.push(b+j)),_){var z="".concat(b).concat(o.options.contextSeparator).concat(a.context);R.push(z),k&&(R.push(z+D),E&&R.push(z+j))}}for(var V;V=R.pop();)o.isValidLookup(s)||(u=V,s=o.getResource(I,A,V,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:d,usedNS:h}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(Qd);function xC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var tR=function(){function e(t){hu(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ql.create("languageUtils")}return pu(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=xC(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=xC(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=xC(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){u&&(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),Pwe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Twe={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Lwe=["v1","v2","v3"],nR={zero:0,one:1,two:2,few:3,many:4,other:5};function Awe(){var e={};return Pwe.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Twe[t.fc]}})}),e}var Owe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};hu(this,e),this.languageUtils=t,this.options=n,this.logger=ql.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Awe()}return pu(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return nR[a]-nR[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!Lwe.includes(this.options.compatibilityJSON)}}]),e}();function rR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rs(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};hu(this,e),this.logger=ql.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return pu(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:bwe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Mg(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Mg(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Mg(r.nestingPrefix):r.nestingPrefixEscaped||Mg("$t("),this.nestingSuffix=r.nestingSuffix?Mg(r.nestingSuffix):r.nestingSuffixEscaped||Mg(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(k){return k.replace(/\$/g,"$$$$")}var m=function(E){if(E.indexOf(a.formatSeparator)<0){var _=XI(r,d,E);return a.alwaysFormat?a.format(_,void 0,i,Rs(Rs(Rs({},o),r),{},{interpolationkey:E})):_}var T=E.split(a.formatSeparator),A=T.shift().trim(),I=T.join(a.formatSeparator).trim();return a.format(XI(r,d,A),I,i,Rs(Rs(Rs({},o),r),{},{interpolationkey:A}))};this.resetRegExp();var v=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,S=[{regex:this.regexpUnescape,safeValue:function(E){return h(E)}},{regex:this.regexp,safeValue:function(E){return a.escapeValue?h(a.escape(E)):h(E)}}];return S.forEach(function(k){for(u=0;s=k.regex.exec(n);){var E=s[1].trim();if(l=m(E),l===void 0)if(typeof v=="function"){var _=v(n,s,o);l=typeof _=="string"?_:""}else if(o&&o.hasOwnProperty(E))l="";else if(b){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(E," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=YI(l));var T=k.safeValue(l);if(n=n.replace(s[0],T),b?(k.regex.lastIndex+=l.length,k.regex.lastIndex-=s[0].length):k.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(v,b){var S=this.nestingOptionsSeparator;if(v.indexOf(S)<0)return v;var k=v.split(new RegExp("".concat(S,"[ ]*{"))),E="{".concat(k[1]);v=k[0],E=this.interpolate(E,l);var _=E.match(/'/g),T=E.match(/"/g);(_&&_.length%2===0&&!T||T.length%2!==0)&&(E=E.replace(/'/g,'"'));try{l=JSON.parse(E),b&&(l=Rs(Rs({},b),l))}catch(A){return this.logger.warn("failed parsing options string in nesting for key ".concat(v),A),"".concat(v).concat(S).concat(E)}return delete l.defaultValue,v}for(;a=this.nestingRegexp.exec(n);){var d=[];l=Rs({},o),l.applyPostProcessor=!1,delete l.defaultValue;var h=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var m=a[1].split(this.formatSeparator).map(function(v){return v.trim()});a[1]=m.shift(),d=m,h=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=YI(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),h&&(s=d.reduce(function(v,b){return i.format(v,b,o.lng,Rs(Rs({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function iR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ld(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(a){var s=a.split(":"),l=hwe(s),u=l[0],d=l.slice(1),h=d.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=h),h==="false"&&(n[u.trim()]=!1),h==="true"&&(n[u.trim()]=!0),isNaN(h)||(n[u.trim()]=parseInt(h,10))}})}}return{formatName:t,formatOptions:n}}function Ig(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var Rwe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hu(this,e),this.logger=ql.create("formatter"),this.options=t,this.formats={number:Ig(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:Ig(function(n,r){var i=new Intl.NumberFormat(n,ld(ld({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:Ig(function(n,r){var i=new Intl.DateTimeFormat(n,ld({},r));return function(o){return i.format(o)}}),relativetime:Ig(function(n,r){var i=new Intl.RelativeTimeFormat(n,ld({},r));return function(o){return i.format(o,r.range||"day")}}),list:Ig(function(n,r){var i=new Intl.ListFormat(n,ld({},r));return function(o){return i.format(o)}})},this.init(t)}return pu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Ig(r)}},{key:"format",value:function(n,r,i,o){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,d){var h=Iwe(d),m=h.formatName,v=h.formatOptions;if(a.formats[m]){var b=u;try{var S=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},k=S.locale||S.lng||o.locale||o.lng||i;b=a.formats[m](u,k,ld(ld(ld({},v),o),S))}catch(E){a.logger.warn(E)}return b}else a.logger.warn("there was no format function for ".concat(m));return u},n);return l}}]),e}();function oR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aR(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jwe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var Bwe=function(e){jx(n,e);var t=Dwe(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return hu(this,n),a=t.call(this),Bx&&Qd.call($d(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=ql.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return pu(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},d={},h={},m={};return i.forEach(function(v){var b=!0;o.forEach(function(S){var k="".concat(v,"|").concat(S);!a.reload&&l.store.hasResourceBundle(v,S)?l.state[k]=2:l.state[k]<0||(l.state[k]===1?d[k]===void 0&&(d[k]=!0):(l.state[k]=1,b=!1,d[k]===void 0&&(d[k]=!0),u[k]===void 0&&(u[k]=!0),m[S]===void 0&&(m[S]=!0)))}),b||(h[v]=!0)}),(Object.keys(u).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(d),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var d={};this.queue.forEach(function(h){vwe(h.loaded,[l],u),jwe(h,i),o&&h.errors.push(o),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(function(m){d[m]||(d[m]={});var v=h.loaded[m];v.length&&v.forEach(function(b){d[m][b]===void 0&&(d[m][b]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(h){return!h.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!i.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:d});return}this.readingCalls++;var h=function(S,k){if(s.readingCalls--,s.waitingReads.length>0){var E=s.waitingReads.shift();s.read(E.lng,E.ns,E.fcName,E.tried,E.wait,E.callback)}if(S&&k&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(d){a.loadOne(d)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(d,h){d&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),d),!d&&h&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),h),o.loaded(i,d,h)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var h=aR(aR({},u),{},{isUpdate:l}),m=this.backend.create.bind(this.backend);if(m.length<6)try{var v;m.length===5?v=m(i,o,a,s,h):v=m(i,o,a,s),v&&typeof v.then=="function"?v.then(function(b){return d(null,b)}).catch(d):d(null,v)}catch(b){d(b)}else m(i,o,a,s,d,h)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(Qd);function sR(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Xs(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Xs(t[2])==="object"||Xs(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function lR(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function uR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ml(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Pb(){}function zwe(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var X5=function(e){jx(n,e);var t=$we(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(hu(this,n),r=t.call(this),Bx&&Qd.call($d(r)),r.options=lR(i),r.services={},r.logger=ql,r.modules={external:[]},zwe($d(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),jy(r,$d(r));setTimeout(function(){r.init(i,o)},0)}return r}return pu(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=sR();this.options=Ml(Ml(Ml({},s),this.options),lR(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Ml(Ml({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(E){return E?typeof E=="function"?new E:E:null}if(!this.options.isClone){this.modules.logger?ql.init(l(this.modules.logger),this.options):ql.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Rwe);var d=new tR(this.options);this.store=new _we(this.options.resources,this.options);var h=this.services;h.logger=ql,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new Owe(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=l(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Mwe(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new Bwe(l(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(E){for(var _=arguments.length,T=new Array(_>1?_-1:0),A=1;A<_;A++)T[A-1]=arguments[A];i.emit.apply(i,[E].concat(T))}),this.modules.languageDetector&&(h.languageDetector=l(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=l(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new eR(this.services,this.options),this.translator.on("*",function(E){for(var _=arguments.length,T=new Array(_>1?_-1:0),A=1;A<_;A++)T[A-1]=arguments[A];i.emit.apply(i,[E].concat(T))}),this.modules.external.forEach(function(E){E.init&&E.init(i)})}if(this.format=this.options.interpolation.format,a||(a=Pb),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var v=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];v.forEach(function(E){i[E]=function(){var _;return(_=i.store)[E].apply(_,arguments)}});var b=["addResource","addResources","addResourceBundle","removeResourceBundle"];b.forEach(function(E){i[E]=function(){var _;return(_=i.store)[E].apply(_,arguments),i}});var S=iv(),k=function(){var _=function(A,I){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),S.resolve(I),a(A,I)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return _(null,i.t.bind(i));i.changeLanguage(i.options.lng,_)};return this.options.resources||!this.options.initImmediate?k():setTimeout(k,0),S}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pb,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],d=function(v){if(v){var b=o.services.languageUtils.toResolveHierarchy(v);b.forEach(function(S){u.indexOf(S)<0&&u.push(S)})}};if(l)d(l);else{var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.forEach(function(m){return d(m)})}this.options.preload&&this.options.preload.forEach(function(m){return d(m)}),this.services.backendConnector.load(u,this.options.ns,function(m){!m&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=iv();return i||(i=this.languages),o||(o=this.options.ns),a||(a=Pb),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&EU.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=iv();this.emit("languageChanging",i);var l=function(m){a.language=m,a.languages=a.services.languageUtils.toResolveHierarchy(m),a.resolvedLanguage=void 0,a.setResolvedLanguage(m)},u=function(m,v){v?(l(v),a.translator.changeLanguage(v),a.isLanguageChangingTo=void 0,a.emit("languageChanged",v),a.logger.log("languageChanged",v)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(m,function(){return a.t.apply(a,arguments)})},d=function(m){!i&&!m&&a.services.languageDetector&&(m=[]);var v=typeof m=="string"?m:a.services.languageUtils.getBestMatchFromCodes(m);v&&(a.language||l(v),a.translator.language||a.translator.changeLanguage(v),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(v)),a.loadResources(v,function(b){u(b,v)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(d,h){var m;if(Xs(h)!=="object"){for(var v=arguments.length,b=new Array(v>2?v-2:0),S=2;S1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var d=function(v,b){var S=o.services.backendConnector.state["".concat(v,"|").concat(b)];return S===-1||S===2};if(a.precheck){var h=a.precheck(this,d);if(h!==void 0)return h}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,i)&&(!l||d(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=iv();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=iv();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new tR(sR());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pb,s=Ml(Ml(Ml({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(d){l[d]=i[d]}),l.services=Ml({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new eR(l.services,l.options),l.translator.on("*",function(d){for(var h=arguments.length,m=new Array(h>1?h-1:0),v=1;v0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new X5(e,t)});var zt=X5.createInstance();zt.createInstance=X5.createInstance;zt.createInstance;zt.dir;zt.init;zt.loadResources;zt.reloadResources;zt.use;zt.changeLanguage;zt.getFixedT;zt.t;zt.exists;zt.setDefaultNamespace;zt.hasLoadedNamespace;zt.loadNamespaces;zt.loadLanguages;function Hwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J2(e){return J2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J2(e)}function Vwe(e,t){if(J2(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(J2(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wwe(e){var t=Vwe(e,"string");return J2(t)==="symbol"?t:String(t)}function cR(e,t){for(var n=0;n0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!dR.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!dR.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},fR={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=Kwe(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},ov=null,hR=function(){if(ov!==null)return ov;try{ov=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{ov=!1}return ov},Qwe={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&hR()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&hR()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},av=null,pR=function(){if(av!==null)return av;try{av=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{av=!1}return av},Jwe={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&pR()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&pR()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},e6e={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},t6e={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},n6e={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},r6e={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function i6e(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var TU=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Hwe(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return Uwe(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Ywe(r,this.options||{},i6e()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Xwe),this.addDetector(Zwe),this.addDetector(Qwe),this.addDetector(Jwe),this.addDetector(e6e),this.addDetector(t6e),this.addDetector(n6e),this.addDetector(r6e)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();TU.type="languageDetector";function h8(e){return h8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h8(e)}var LU=[],o6e=LU.forEach,a6e=LU.slice;function p8(e){return o6e.call(a6e.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function AU(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":h8(XMLHttpRequest))==="object"}function s6e(e){return!!e&&typeof e.then=="function"}function l6e(e){return s6e(e)?e:Promise.resolve(e)}function u6e(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ey={},c6e={get exports(){return ey},set exports(e){ey=e}},o2={},d6e={get exports(){return o2},set exports(e){o2=e}},gR;function f6e(){return gR||(gR=1,function(e,t){var n=typeof self<"u"?self:Co,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l($){return $&&DataView.prototype.isPrototypeOf($)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function($){return $&&u.indexOf(Object.prototype.toString.call($))>-1};function h($){if(typeof $!="string"&&($=String($)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test($))throw new TypeError("Invalid character in header field name");return $.toLowerCase()}function m($){return typeof $!="string"&&($=String($)),$}function v($){var U={next:function(){var X=$.shift();return{done:X===void 0,value:X}}};return s.iterable&&(U[Symbol.iterator]=function(){return U}),U}function b($){this.map={},$ instanceof b?$.forEach(function(U,X){this.append(X,U)},this):Array.isArray($)?$.forEach(function(U){this.append(U[0],U[1])},this):$&&Object.getOwnPropertyNames($).forEach(function(U){this.append(U,$[U])},this)}b.prototype.append=function($,U){$=h($),U=m(U);var X=this.map[$];this.map[$]=X?X+", "+U:U},b.prototype.delete=function($){delete this.map[h($)]},b.prototype.get=function($){return $=h($),this.has($)?this.map[$]:null},b.prototype.has=function($){return this.map.hasOwnProperty(h($))},b.prototype.set=function($,U){this.map[h($)]=m(U)},b.prototype.forEach=function($,U){for(var X in this.map)this.map.hasOwnProperty(X)&&$.call(U,this.map[X],X,this)},b.prototype.keys=function(){var $=[];return this.forEach(function(U,X){$.push(X)}),v($)},b.prototype.values=function(){var $=[];return this.forEach(function(U){$.push(U)}),v($)},b.prototype.entries=function(){var $=[];return this.forEach(function(U,X){$.push([X,U])}),v($)},s.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function S($){if($.bodyUsed)return Promise.reject(new TypeError("Already read"));$.bodyUsed=!0}function k($){return new Promise(function(U,X){$.onload=function(){U($.result)},$.onerror=function(){X($.error)}})}function E($){var U=new FileReader,X=k(U);return U.readAsArrayBuffer($),X}function _($){var U=new FileReader,X=k(U);return U.readAsText($),X}function T($){for(var U=new Uint8Array($),X=new Array(U.length),Z=0;Z-1?U:$}function j($,U){U=U||{};var X=U.body;if($ instanceof j){if($.bodyUsed)throw new TypeError("Already read");this.url=$.url,this.credentials=$.credentials,U.headers||(this.headers=new b($.headers)),this.method=$.method,this.mode=$.mode,this.signal=$.signal,!X&&$._bodyInit!=null&&(X=$._bodyInit,$.bodyUsed=!0)}else this.url=String($);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new b(U.headers)),this.method=D(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function z($){var U=new FormData;return $.trim().split("&").forEach(function(X){if(X){var Z=X.split("="),W=Z.shift().replace(/\+/g," "),Q=Z.join("=").replace(/\+/g," ");U.append(decodeURIComponent(W),decodeURIComponent(Q))}}),U}function V($){var U=new b,X=$.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(Z){var W=Z.split(":"),Q=W.shift().trim();if(Q){var ie=W.join(":").trim();U.append(Q,ie)}}),U}I.call(j.prototype);function K($,U){U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in U?U.statusText:"OK",this.headers=new b(U.headers),this.url=U.url||"",this._initBody($)}I.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},K.error=function(){var $=new K(null,{status:0,statusText:""});return $.type="error",$};var te=[301,302,303,307,308];K.redirect=function($,U){if(te.indexOf(U)===-1)throw new RangeError("Invalid status code");return new K(null,{status:U,headers:{location:$}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(U,X){this.message=U,this.name=X;var Z=Error(U);this.stack=Z.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function q($,U){return new Promise(function(X,Z){var W=new j($,U);if(W.signal&&W.signal.aborted)return Z(new a.DOMException("Aborted","AbortError"));var Q=new XMLHttpRequest;function ie(){Q.abort()}Q.onload=function(){var fe={status:Q.status,statusText:Q.statusText,headers:V(Q.getAllResponseHeaders()||"")};fe.url="responseURL"in Q?Q.responseURL:fe.headers.get("X-Request-URL");var Se="response"in Q?Q.response:Q.responseText;X(new K(Se,fe))},Q.onerror=function(){Z(new TypeError("Network request failed"))},Q.ontimeout=function(){Z(new TypeError("Network request failed"))},Q.onabort=function(){Z(new a.DOMException("Aborted","AbortError"))},Q.open(W.method,W.url,!0),W.credentials==="include"?Q.withCredentials=!0:W.credentials==="omit"&&(Q.withCredentials=!1),"responseType"in Q&&s.blob&&(Q.responseType="blob"),W.headers.forEach(function(fe,Se){Q.setRequestHeader(Se,fe)}),W.signal&&(W.signal.addEventListener("abort",ie),Q.onreadystatechange=function(){Q.readyState===4&&W.signal.removeEventListener("abort",ie)}),Q.send(typeof W._bodyInit>"u"?null:W._bodyInit)})}return q.polyfill=!0,o.fetch||(o.fetch=q,o.Headers=b,o.Request=j,o.Response=K),a.Headers=b,a.Request=j,a.Response=K,a.fetch=q,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(d6e,o2)),o2}(function(e,t){var n;if(typeof fetch=="function"&&(typeof Co<"u"&&Co.fetch?n=Co.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof u6e<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||f6e();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(c6e,ey);const OU=ey,mR=rj({__proto__:null,default:OU},[ey]);function Z5(e){return Z5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z5(e)}var Yu;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Yu=global.fetch:typeof window<"u"&&window.fetch?Yu=window.fetch:Yu=fetch);var ty;AU()&&(typeof global<"u"&&global.XMLHttpRequest?ty=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ty=window.XMLHttpRequest));var Q5;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Q5=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Q5=window.ActiveXObject));!Yu&&mR&&!ty&&!Q5&&(Yu=OU||mR);typeof Yu!="function"&&(Yu=void 0);var g8=function(t,n){if(n&&Z5(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},vR=function(t,n,r){Yu(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},yR=!1,h6e=function(t,n,r,i){t.queryStringParams&&(n=g8(n,t.queryStringParams));var o=p8({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=p8({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},yR?{}:a);try{vR(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),vR(n,s,i),yR=!0}catch(u){i(u)}}},p6e=function(t,n,r,i){r&&Z5(r)==="object"&&(r=g8("",r).slice(1)),t.queryStringParams&&(n=g8(n,t.queryStringParams));try{var o;ty?o=new ty:o=new Q5("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},g6e=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Yu&&n.indexOf("file:")!==0)return h6e(t,n,r,i);if(AU()||typeof ActiveXObject=="function")return p6e(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function ny(e){return ny=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ny(e)}function m6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bR(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};m6e(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return v6e(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=p8(i,this.options||{},S6e()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=l6e(l),l.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(d,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,d;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch{d="failed parsing "+n+" to json"}if(d)return r(d,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,d=[],h=[];n.forEach(function(m){var v=s.options.addPath;typeof s.options.addPath=="function"&&(v=s.options.addPath(m,r));var b=s.services.interpolator.interpolate(v,{lng:m,ns:r});s.options.request(s.options,b,l,function(S,k){u+=1,d.push(S),h.push(k),u===n.length&&a&&a(d,h)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(h){var m=o.toResolveHierarchy(h);m.forEach(function(v){l.indexOf(v)<0&&l.push(v)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),l.forEach(function(d){n.allOptions.ns.forEach(function(h){i.read(d,h,"read",null,null,function(m,v){m&&a.warn("loading namespace ".concat(h," for language ").concat(d," failed"),m),!m&&v&&a.log("loaded namespace ".concat(h," for language ").concat(d),v),i.loaded("".concat(d,"|").concat(h),m,v)})})})}}}]),e}();IU.type="backend";function ry(e){return ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ry(e)}function x6e(e,t){if(ry(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ry(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RU(e){var t=x6e(e,"string");return ry(t)==="symbol"?t:String(t)}function DU(e,t,n){return t=RU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w6e(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var d=t.services.backendConnector.state["".concat(l,"|").concat(u)];return d===-1||d===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function _6e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return m8("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):C6e(e,t,n)}var k6e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,E6e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},P6e=function(t){return E6e[t]},T6e=function(t){return t.replace(k6e,P6e)};function wR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CR(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};v8=CR(CR({},v8),e)}function A6e(){return v8}var NU;function O6e(e){NU=e}function M6e(){return NU}function I6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _R(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=w.useContext(N6e)||{},i=r.i18n,o=r.defaultNS,a=n||i||M6e();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new j6e),!a){m8("You will need to pass in an i18next instance by using initReactI18next");var s=function(z){return Array.isArray(z)?z[z.length-1]:z},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&m8("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=wC(wC(wC({},A6e()),a.options.react),t),d=u.useSuspense,h=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var v=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(j){return _6e(j,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],h)}var S=w.useState(b),k=H6e(S,2),E=k[0],_=k[1],T=m.join(),A=V6e(T),I=w.useRef(!0);w.useEffect(function(){var j=u.bindI18n,z=u.bindI18nStore;I.current=!0,!v&&!d&&xR(a,m,function(){I.current&&_(b)}),v&&A&&A!==T&&I.current&&_(b);function V(){I.current&&_(b)}return j&&a&&a.on(j,V),z&&a&&a.store.on(z,V),function(){I.current=!1,j&&a&&j.split(" ").forEach(function(K){return a.off(K,V)}),z&&a&&z.split(" ").forEach(function(K){return a.store.off(K,V)})}},[a,T]);var R=w.useRef(!0);w.useEffect(function(){I.current&&!R.current&&_(b),R.current=!1},[a,h]);var D=[E,a,v];if(D.t=E,D.i18n=a,D.ready=v,v||!v&&!d)return D;throw new Promise(function(j){xR(a,m,function(){j()})})}zt.use(IU).use(TU).use(D6e).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","parameters","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const W6e={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:zt.isInitialized?zt.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},jU=cp({name:"system",initialState:W6e,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?zt.t("common:statusConnected"):zt.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=zt.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:U6e,setIsProcessing:Hs,addLogEntry:to,setShouldShowLogViewer:CC,setIsConnected:PR,setSocketId:pze,setShouldConfirmOnDelete:BU,setOpenAccordions:G6e,setSystemStatus:q6e,setCurrentStatus:R4,setSystemConfig:Y6e,setShouldDisplayGuides:K6e,processingCanceled:X6e,errorOccurred:TR,errorSeen:$U,setModelList:Tb,setIsCancelable:lm,modelChangeRequested:Z6e,setSaveIntermediatesInterval:Q6e,setEnableImageDebugging:J6e,generationRequested:eCe,addToast:Th,clearToastQueue:tCe,setProcessingIndeterminateTask:nCe,setSearchFolder:FU,setFoundModels:zU,setOpenModel:LR}=jU.actions,rCe=jU.reducer,cP=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],iCe={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,addNewModelUIOption:null},oCe=iCe,HU=cp({name:"ui",initialState:oCe,reducers:{setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=cP.indexOf(t.payload)},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setParametersPanelScrollPosition:(e,t)=>{e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:(e,t)=>{e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:(e,t)=>{e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setAddNewModelUIOption:(e,t)=>{e.addNewModelUIOption=t.payload}}}),{setActiveTab:qo,setCurrentTheme:aCe,setParametersPanelScrollPosition:sCe,setShouldHoldParametersPanelOpen:lCe,setShouldPinParametersPanel:uCe,setShouldShowParametersPanel:Ku,setShouldShowDualDisplay:cCe,setShouldShowImageDetails:VU,setShouldUseCanvasBetaLayout:dCe,setShouldShowExistingModelsInSearch:fCe,setAddNewModelUIOption:zh}=HU.actions,hCe=HU.reducer,lu=Object.create(null);lu.open="0";lu.close="1";lu.ping="2";lu.pong="3";lu.message="4";lu.upgrade="5";lu.noop="6";const D4=Object.create(null);Object.keys(lu).forEach(e=>{D4[lu[e]]=e});const pCe={type:"error",data:"parser error"},gCe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",mCe=typeof ArrayBuffer=="function",vCe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,WU=({type:e,data:t},n,r)=>gCe&&t instanceof Blob?n?r(t):AR(t,r):mCe&&(t instanceof ArrayBuffer||vCe(t))?n?r(t):AR(new Blob([t]),r):r(lu[e]+(t||"")),AR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},OR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pv=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(a&15)<<4|s>>2,d[i++]=(s&3)<<6|l&63;return u},bCe=typeof ArrayBuffer=="function",UU=(e,t)=>{if(typeof e!="string")return{type:"message",data:GU(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:SCe(e.substring(1),t)}:D4[n]?e.length>1?{type:D4[n],data:e.substring(1)}:{type:D4[n]}:pCe},SCe=(e,t)=>{if(bCe){const n=yCe(e);return GU(n,t)}else return{base64:!0,data:e}},GU=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},qU=String.fromCharCode(30),xCe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{WU(o,!1,s=>{r[a]=s,++i===n&&t(r.join(qU))})})},wCe=(e,t)=>{const n=e.split(qU),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function KU(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const _Ce=setTimeout,kCe=clearTimeout;function $x(e,t){t.useNativeTimers?(e.setTimeoutFn=_Ce.bind(Pd),e.clearTimeoutFn=kCe.bind(Pd)):(e.setTimeoutFn=setTimeout.bind(Pd),e.clearTimeoutFn=clearTimeout.bind(Pd))}const ECe=1.33;function PCe(e){return typeof e=="string"?TCe(e):Math.ceil((e.byteLength||e.size)*ECe)}function TCe(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class LCe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class XU extends si{constructor(t){super(),this.writable=!1,$x(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new LCe(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=UU(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const ZU="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),y8=64,ACe={};let MR=0,Lb=0,IR;function RR(e){let t="";do t=ZU[e%y8]+t,e=Math.floor(e/y8);while(e>0);return t}function QU(){const e=RR(+new Date);return e!==IR?(MR=0,IR=e):e+"."+RR(MR++)}for(;Lb{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};wCe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,xCe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=QU()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=JU(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new nu(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class nu extends si{constructor(t,n){super(),$x(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=KU(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new tG(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=nu.requestsCount++,nu.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=ICe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete nu.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}nu.requestsCount=0;nu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",DR);else if(typeof addEventListener=="function"){const e="onpagehide"in Pd?"pagehide":"unload";addEventListener(e,DR,!1)}}function DR(){for(let e in nu.requests)nu.requests.hasOwnProperty(e)&&nu.requests[e].abort()}const nG=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Ab=Pd.WebSocket||Pd.MozWebSocket,NR=!0,NCe="arraybuffer",jR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class jCe extends XU{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=jR?{}:KU(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=NR&&!jR?n?new Ab(t,n):new Ab(t):new Ab(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||NCe,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{NR&&this.ws.send(o)}catch{}i&&nG(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=QU()),this.supportsBinary||(t.b64=1);const i=JU(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Ab}}const BCe={websocket:jCe,polling:DCe},$Ce=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,FCe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function b8(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=$Ce.exec(e||""),o={},a=14;for(;a--;)o[FCe[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=zCe(o,o.path),o.queryKey=HCe(o,o.query),o}function zCe(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function HCe(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let rG=class $g extends si{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=b8(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=b8(n.host).host),$x(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=OCe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=YU,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new BCe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&$g.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;$g.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;$g.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=h=>{const m=new Error("probe error: "+h);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(h){n&&h.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",$g.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){$g.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,iG=Object.prototype.toString,GCe=typeof Blob=="function"||typeof Blob<"u"&&iG.call(Blob)==="[object BlobConstructor]",qCe=typeof File=="function"||typeof File<"u"&&iG.call(File)==="[object FileConstructor]";function dP(e){return WCe&&(e instanceof ArrayBuffer||UCe(e))||GCe&&e instanceof Blob||qCe&&e instanceof File}function N4(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case cn.ACK:case cn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class QCe{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=KCe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const JCe=Object.freeze(Object.defineProperty({__proto__:null,Decoder:fP,Encoder:ZCe,get PacketType(){return cn},protocol:XCe},Symbol.toStringTag,{value:"Module"}));function Bs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const e7e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class oG extends si{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Bs(t,"open",this.onopen.bind(this)),Bs(t,"packet",this.onpacket.bind(this)),Bs(t,"error",this.onerror.bind(this)),Bs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(e7e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:cn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:cn.CONNECT,data:t})}):this.packet({type:cn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case cn.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case cn.EVENT:case cn.BINARY_EVENT:this.onevent(t);break;case cn.ACK:case cn.BINARY_ACK:this.onack(t);break;case cn.DISCONNECT:this.ondisconnect();break;case cn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:cn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:cn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}E0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};E0.prototype.reset=function(){this.attempts=0};E0.prototype.setMin=function(e){this.ms=e};E0.prototype.setMax=function(e){this.max=e};E0.prototype.setJitter=function(e){this.jitter=e};class w8 extends si{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,$x(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new E0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||JCe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new rG(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Bs(n,"open",function(){r.onopen(),t&&t()}),o=Bs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Bs(t,"ping",this.onping.bind(this)),Bs(t,"data",this.ondata.bind(this)),Bs(t,"error",this.onerror.bind(this)),Bs(t,"close",this.onclose.bind(this)),Bs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){nG(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new oG(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const sv={};function j4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=VCe(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=sv[i]&&o in sv[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new w8(r,t):(sv[i]||(sv[i]=new w8(r,t)),l=sv[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(j4,{Manager:w8,Socket:oG,io:j4,connect:j4});const t7e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],n7e=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],r7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],i7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],o7e=[{key:"2x",value:2},{key:"4x",value:4}],hP=0,pP=4294967295,a7e=["gfpgan","codeformer"],s7e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var l7e=Math.PI/180;function u7e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const $m=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},pt={_global:$m,version:"8.3.14",isBrowser:u7e(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return pt.angleDeg?e*l7e:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return pt.DD.isDragging},isDragReady(){return!!pt.DD.node},releaseCanvasOnDestroy:!0,document:$m.document,_injectGlobal(e){$m.Konva=e}},Ar=e=>{pt[e.prototype.getClassName()]=e};pt._injectGlobal(pt);class ka{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new ka(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var d=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/d):-Math.acos(r/d)),l.scaleX=s/d,l.scaleY=d,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=de._getRotation(l.rotation),l}}var c7e="[object Array]",d7e="[object Number]",f7e="[object String]",h7e="[object Boolean]",p7e=Math.PI/180,g7e=180/Math.PI,_C="#",m7e="",v7e="0",y7e="Konva warning: ",BR="Konva error: ",b7e="rgb(",kC={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},S7e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Ob=[];const x7e=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},de={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===c7e},_isNumber(e){return Object.prototype.toString.call(e)===d7e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===f7e},_isBoolean(e){return Object.prototype.toString.call(e)===h7e},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){Ob.push(e),Ob.length===1&&x7e(function(){const t=Ob;Ob=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=de.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(_C,m7e);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=v7e+e;return _C+e},getRGB(e){var t;return e in kC?(t=kC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===_C?this._hexToRgb(e.substring(1)):e.substr(0,4)===b7e?(t=S7e.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",de._namedColorToRBA(e)||de._hex3ColorToRGBA(e)||de._hex6ColorToRGBA(e)||de._rgbColorToRGBA(e)||de._rgbaColorToRGBA(e)||de._hslColorToRGBA(e)},_namedColorToRBA(e){var t=kC[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,d=[0,0,0];for(let h=0;h<3;h++)s=r+1/3*-(h-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,d[h]=l*255;return{r:Math.round(d[0]),g:Math.round(d[1]),b:Math.round(d[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+d*(n-e),s=t+d*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=de.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=de._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],d=l[1],h=l[2];ht.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function df(e){return de._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||de._isBoolean(e)?e:Object.prototype.toString.call(e)}function aG(e){return e>255?255:e<0?0:Math.round(e)}function qe(){if(pt.isUnminified)return function(e,t){return de._isNumber(e)||de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function sG(e){if(pt.isUnminified)return function(t,n){let r=de._isNumber(t),i=de._isArray(t)&&t.length==e;return!r&&!i&&de.warn(df(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function gP(){if(pt.isUnminified)return function(e,t){var n=de._isNumber(e),r=e==="auto";return n||r||de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function P0(){if(pt.isUnminified)return function(e,t){return de._isString(e)||de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function lG(){if(pt.isUnminified)return function(e,t){const n=de._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function w7e(){if(pt.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(de._isArray(e)?e.forEach(function(r){de._isNumber(r)||de.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function nl(){if(pt.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function C7e(e){if(pt.isUnminified)return function(t,n){return t==null||de.isObject(t)||de.warn(df(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var lv="get",uv="set";const ee={addGetterSetter(e,t,n,r,i){ee.addGetter(e,t,n),ee.addSetter(e,t,r,i),ee.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=lv+de._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=uv+de._capitalize(t);e.prototype[i]||ee.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=uv+de._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=de._capitalize,s=lv+a(t),l=uv+a(t),u,d;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(S),void 0)}),this._fireChangeEvent(t,v,m),i&&i.call(this),this},ee.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=de._capitalize(t),r=uv+n,i=lv+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){de.error("Adding deprecated "+t);var i=lv+de._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){de.error(o);var a=this.attrs[t];return a===void 0?n:a},ee.addSetter(e,t,r,function(){de.error(o)}),ee.addOverloadedGetterSetter(e,t)},backCompat(e,t){de.each(t,function(n,r){var i=e.prototype[r],o=lv+de._capitalize(n),a=uv+de._capitalize(n);function s(){i.apply(this,arguments),de.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function _7e(e){var t=[],n=e.length,r=de,i,o;for(i=0;itypeof d=="number"?Math.floor(d):d)),o+=k7e+u.join($R)+E7e)):(o+=s.property,t||(o+=O7e+s.val)),o+=L7e;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=I7e&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var d=arguments,h=this._context;d.length===3?h.drawImage(t,n,r):d.length===5?h.drawImage(t,n,r,i,o):d.length===9&&h.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){return this._context.isPointInPath(t,n)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=FR.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=_7e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return vn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];vn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=de._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];vn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(vn.justDragged=!0,pt._mouseListenClick=!1,pt._touchListenClick=!1,pt._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof pt.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){vn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&vn._dragElements.delete(n)})}};pt.isBrowser&&(window.addEventListener("mouseup",vn._endDragBefore,!0),window.addEventListener("touchend",vn._endDragBefore,!0),window.addEventListener("mousemove",vn._drag),window.addEventListener("touchmove",vn._drag),window.addEventListener("mouseup",vn._endDragAfter,!1),window.addEventListener("touchend",vn._endDragAfter,!1));var B4="absoluteOpacity",Ib="allEventListeners",Fu="absoluteTransform",zR="absoluteScale",ah="canvas",j7e="Change",B7e="children",$7e="konva",C8="listening",HR="mouseenter",VR="mouseleave",WR="set",UR="Shape",$4=" ",GR="stage",fd="transform",F7e="Stage",_8="visible",z7e=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join($4);let H7e=1,Ze=class k8{constructor(t){this._id=H7e++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===fd||t===Fu)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===fd||t===Fu,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join($4);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(ah)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Fu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ah)){const{scene:t,filter:n,hit:r}=this._cache.get(ah);de.releaseCanvas(t,n,r),this._cache.delete(ah)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,h=n.hitCanvasPixelRatio||1;if(!i||!o){de.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new Fm({pixelRatio:a,width:i,height:o}),v=new Fm({pixelRatio:a,width:0,height:0}),b=new mP({pixelRatio:h,width:i,height:o}),S=m.getContext(),k=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(ah),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,v.getContext()._context.imageSmoothingEnabled=!1),S.save(),k.save(),S.translate(-s,-l),k.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(B4),this._clearSelfAndDescendantCache(zR),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,S.restore(),k.restore(),d&&(S.save(),S.beginPath(),S.rect(0,0,i,o),S.closePath(),S.setAttr("strokeStyle","red"),S.setAttr("lineWidth",5),S.stroke(),S.restore()),this._cache.set(ah,{scene:m,filter:v,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(ah)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=l.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==B7e&&(r=WR+de._capitalize(n),de._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(C8,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(_8,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;vn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!pt.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==F7e&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(fd),this._clearSelfAndDescendantCache(Fu)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new ka,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(fd);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(fd),this._clearSelfAndDescendantCache(Fu),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return de.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return de.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&de.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(B4,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=de.isObject(i)&&!de._isPlainObject(i)&&!de._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),de._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,de._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():pt.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(r&&!this.isDragging()){var i=!1;vn._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=vn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&vn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return de.haveIntersection(r,this.getClientRect())}static create(t,n){return de._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=k8.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),pt[r]||(de.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=pt[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(arguments.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Ze.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Ze.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const d=r===this;if(u){o.save();var h=this.getAbsoluteTransform(r),m=h.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var v=this.clipX(),b=this.clipY();o.rect(v,b,a,s)}o.clip(),m=h.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var S=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";S&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(k){k[t](n,r)}),S&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(S){if(S.visible()){var k=S.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});k.width===0&&k.height===0||(o===void 0?(o=k.x,a=k.y,s=k.x+k.width,l=k.y+k.height):(o=Math.min(o,k.x),a=Math.min(a,k.y),s=Math.max(s,k.x+k.width),l=Math.max(l,k.y+k.height)))}});for(var h=this.find("Shape"),m=!1,v=0;ve.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",Rg=e=>{const t=Ov(e);if(t==="pointer")return pt.pointerEventsEnabled&&PC.pointer;if(t==="touch")return PC.touch;if(t==="mouse")return PC.mouse};function YR(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&de.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const K7e="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",F4=[];let Hx=class extends Aa{constructor(t){super(YR(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),F4.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{YR(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||de.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===W7e){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t=this.children,n=t.length,r;for(r=0;r-1&&F4.splice(n,1),de.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(de.warn(K7e),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t=t||{},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var n=new Fm({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+qR,this.content.style.height=n+qR),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;rq7e&&de.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),pt.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return cG(t,this)}setPointerCapture(t){dG(t,this)}releaseCapture(t){a2(t)}getLayers(){return this.children}_bindContentEvents(){pt.isBrowser&&Y7e.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=Rg(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=Rg(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=Rg(t.type),r=Ov(t.type);if(n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!vn.isDragging||pt.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=Rg(t.type),r=Ov(t.type);if(n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(vn.justDragged=!1,pt["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;pt.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=Rg(t.type),r=Ov(t.type);if(!n)return;vn.isDragging&&vn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!vn.isDragging||pt.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=EC(l.id)||this.getIntersection(l),d=l.id,h={evt:t,pointerId:d};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},h),u),s._fireAndBubble(n.pointerleave,Object.assign({},h),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},h),s),u._fireAndBubble(n.pointerenter,Object.assign({},h),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},h))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=Rg(t.type),r=Ov(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=EC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const d=l.id,h={evt:t,pointerId:d};let m=!1;pt["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):vn.justDragged||(pt["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){pt["_"+r+"InDblClickWindow"]=!1},pt.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},h)),pt["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},h)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},h)))):(this[r+"ClickEndShape"]=null,pt["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:d}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:d}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),pt["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(E8,{evt:t}):this._fire(E8,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(P8,{evt:t}):this._fire(P8,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=EC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(um,vP(t)),a2(t.pointerId)}_lostpointercapture(t){a2(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}])}_setPointerPosition(t){de.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Fm({width:this.width(),height:this.height()}),this.bufferHitCanvas=new mP({pixelRatio:1,width:this.width(),height:this.height()}),!!pt.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return de.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};Hx.prototype.nodeType=V7e;Ar(Hx);ee.addGetterSetter(Hx,"container");var wG="hasShadow",CG="shadowRGBA",_G="patternImage",kG="linearGradient",EG="radialGradient";let Bb;function TC(){return Bb||(Bb=de.createCanvasElement().getContext("2d"),Bb)}const s2={};function X7e(e){e.fill()}function Z7e(e){e.stroke()}function Q7e(e){e.fill()}function J7e(e){e.stroke()}function e9e(){this._clearCache(wG)}function t9e(){this._clearCache(CG)}function n9e(){this._clearCache(_G)}function r9e(){this._clearCache(kG)}function i9e(){this._clearCache(EG)}class je extends Ze{constructor(t){super(t);let n;for(;n=de.getRandomColor(),!(n&&!(n in s2)););this.colorKey=n,s2[n]=this}getContext(){return de.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return de.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(wG,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(_G,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=TC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new ka;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(pt.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(kG,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=TC(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return Ze.prototype.destroy.call(this),delete s2[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){de.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),d=u?this.shadowOffsetX():0,h=u?this.shadowOffsetY():0,m=s+Math.abs(d),v=l+Math.abs(h),b=u&&this.shadowBlur()||0,S=m+b*2,k=v+b*2,E={width:S,height:k,x:-(a/2+b)+Math.min(d,0)+i.x,y:-(a/2+b)+Math.min(h,0)+i.y};return n?E:this._transformedRect(E,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,d,h,m=i.isCache,v=n===this;if(!this.isVisible()&&!v)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),d=u.bufferCanvas,h=d.getContext(),h.clear(),h.save(),h._applyLineJoin(this);var S=this.getAbsoluteTransform(n).getMatrix();h.transform(S[0],S[1],S[2],S[3],S[4],S[5]),s.call(this,h,this),h.restore();var k=d.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(d._canvas,0,0,d.width/k,d.height/k)}else{if(o._applyLineJoin(this),!v){var S=this.getAbsoluteTransform(n).getMatrix();o.transform(S[0],S[1],S[2],S[3],S[4],S[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||de.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){a.save();var d=this.getAbsoluteTransform(n).getMatrix();return a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,d,h,m,v;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,d=u.length,h=de._hexToRgb(this.colorKey),m=0;mt?(u[m]=h.r,u[m+1]=h.g,u[m+2]=h.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){de.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return cG(t,this)}setPointerCapture(t){dG(t,this)}releaseCapture(t){a2(t)}}je.prototype._fillFunc=X7e;je.prototype._strokeFunc=Z7e;je.prototype._fillFuncHit=Q7e;je.prototype._strokeFuncHit=J7e;je.prototype._centroid=!1;je.prototype.nodeType="Shape";Ar(je);je.prototype.eventListeners={};je.prototype.on.call(je.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",e9e);je.prototype.on.call(je.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",t9e);je.prototype.on.call(je.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",n9e);je.prototype.on.call(je.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",r9e);je.prototype.on.call(je.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",i9e);ee.addGetterSetter(je,"stroke",void 0,lG());ee.addGetterSetter(je,"strokeWidth",2,qe());ee.addGetterSetter(je,"fillAfterStrokeEnabled",!1);ee.addGetterSetter(je,"hitStrokeWidth","auto",gP());ee.addGetterSetter(je,"strokeHitEnabled",!0,nl());ee.addGetterSetter(je,"perfectDrawEnabled",!0,nl());ee.addGetterSetter(je,"shadowForStrokeEnabled",!0,nl());ee.addGetterSetter(je,"lineJoin");ee.addGetterSetter(je,"lineCap");ee.addGetterSetter(je,"sceneFunc");ee.addGetterSetter(je,"hitFunc");ee.addGetterSetter(je,"dash");ee.addGetterSetter(je,"dashOffset",0,qe());ee.addGetterSetter(je,"shadowColor",void 0,P0());ee.addGetterSetter(je,"shadowBlur",0,qe());ee.addGetterSetter(je,"shadowOpacity",1,qe());ee.addComponentsGetterSetter(je,"shadowOffset",["x","y"]);ee.addGetterSetter(je,"shadowOffsetX",0,qe());ee.addGetterSetter(je,"shadowOffsetY",0,qe());ee.addGetterSetter(je,"fillPatternImage");ee.addGetterSetter(je,"fill",void 0,lG());ee.addGetterSetter(je,"fillPatternX",0,qe());ee.addGetterSetter(je,"fillPatternY",0,qe());ee.addGetterSetter(je,"fillLinearGradientColorStops");ee.addGetterSetter(je,"strokeLinearGradientColorStops");ee.addGetterSetter(je,"fillRadialGradientStartRadius",0);ee.addGetterSetter(je,"fillRadialGradientEndRadius",0);ee.addGetterSetter(je,"fillRadialGradientColorStops");ee.addGetterSetter(je,"fillPatternRepeat","repeat");ee.addGetterSetter(je,"fillEnabled",!0);ee.addGetterSetter(je,"strokeEnabled",!0);ee.addGetterSetter(je,"shadowEnabled",!0);ee.addGetterSetter(je,"dashEnabled",!0);ee.addGetterSetter(je,"strokeScaleEnabled",!0);ee.addGetterSetter(je,"fillPriority","color");ee.addComponentsGetterSetter(je,"fillPatternOffset",["x","y"]);ee.addGetterSetter(je,"fillPatternOffsetX",0,qe());ee.addGetterSetter(je,"fillPatternOffsetY",0,qe());ee.addComponentsGetterSetter(je,"fillPatternScale",["x","y"]);ee.addGetterSetter(je,"fillPatternScaleX",1,qe());ee.addGetterSetter(je,"fillPatternScaleY",1,qe());ee.addComponentsGetterSetter(je,"fillLinearGradientStartPoint",["x","y"]);ee.addComponentsGetterSetter(je,"strokeLinearGradientStartPoint",["x","y"]);ee.addGetterSetter(je,"fillLinearGradientStartPointX",0);ee.addGetterSetter(je,"strokeLinearGradientStartPointX",0);ee.addGetterSetter(je,"fillLinearGradientStartPointY",0);ee.addGetterSetter(je,"strokeLinearGradientStartPointY",0);ee.addComponentsGetterSetter(je,"fillLinearGradientEndPoint",["x","y"]);ee.addComponentsGetterSetter(je,"strokeLinearGradientEndPoint",["x","y"]);ee.addGetterSetter(je,"fillLinearGradientEndPointX",0);ee.addGetterSetter(je,"strokeLinearGradientEndPointX",0);ee.addGetterSetter(je,"fillLinearGradientEndPointY",0);ee.addGetterSetter(je,"strokeLinearGradientEndPointY",0);ee.addComponentsGetterSetter(je,"fillRadialGradientStartPoint",["x","y"]);ee.addGetterSetter(je,"fillRadialGradientStartPointX",0);ee.addGetterSetter(je,"fillRadialGradientStartPointY",0);ee.addComponentsGetterSetter(je,"fillRadialGradientEndPoint",["x","y"]);ee.addGetterSetter(je,"fillRadialGradientEndPointX",0);ee.addGetterSetter(je,"fillRadialGradientEndPointY",0);ee.addGetterSetter(je,"fillPatternRotation",0);ee.backCompat(je,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var o9e="#",a9e="beforeDraw",s9e="draw",PG=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],l9e=PG.length;let dp=class extends Aa{constructor(t){super(t),this.canvas=new Fm,this.hitCanvas=new mP({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(a9e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Aa.prototype.drawScene.call(this,i,n),this._fire(s9e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Aa.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return de.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};dp.prototype.nodeType="Layer";Ar(dp);ee.addGetterSetter(dp,"imageSmoothingEnabled",!0);ee.addGetterSetter(dp,"clearBeforeDraw",!0);ee.addGetterSetter(dp,"hitGraphEnabled",!0,nl());class yP extends dp{constructor(t){super(t),this.listening(!1),de.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}yP.prototype.nodeType="FastLayer";Ar(yP);let i0=class extends Aa{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&de.throw("You may only add groups and shapes to groups.")}};i0.prototype.nodeType="Group";Ar(i0);var LC=function(){return $m.performance&&$m.performance.now?function(){return $m.performance.now()}:function(){return new Date().getTime()}}();class ts{constructor(t,n){this.id=ts.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:LC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=KR,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=XR,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;this.state===KR?this.setTime(t):this.state===XR&&this.setTime(this.duration-t)}pause(){this.state=c9e,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Xr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||l2.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=d9e++;var u=r.getLayer()||(r instanceof pt.Stage?r.getLayers():null);u||de.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new ts(function(){n.tween.onEnterFrame()},u),this.tween=new f9e(l,function(d){n._tweenFunc(d)},a,0,1,o*1e3,s),this._addListeners(),Xr.attrs[i]||(Xr.attrs[i]={}),Xr.attrs[i][this._id]||(Xr.attrs[i][this._id]={}),Xr.tweens[i]||(Xr.tweens[i]={});for(l in t)u9e[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,d,h,m;if(s=Xr.tweens[i][t],s&&delete Xr.attrs[i][s][t],o=r.getAttr(t),de._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(h=o,o=de._prepareArrayForTween(o,n,r.closed())):(d=n,n=de._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t=this.node._id,n=this._id,r=Xr.tweens[t],i;this.pause();for(i in r)delete Xr.tweens[t][i];delete Xr.attrs[t][n]}}Xr.attrs={};Xr.tweens={};Ze.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Xr(e);n.play()};const l2={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),d=a*n,h=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:h,width:d-u,height:m-h}}}cc.prototype._centroid=!0;cc.prototype.className="Arc";cc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Ar(cc);ee.addGetterSetter(cc,"innerRadius",0,qe());ee.addGetterSetter(cc,"outerRadius",0,qe());ee.addGetterSetter(cc,"angle",0,qe());ee.addGetterSetter(cc,"clockwise",!1,nl());function T8(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),d=a*l/(s+l),h=n-u*(i-e),m=r-u*(o-t),v=n+d*(i-e),b=r+d*(o-t);return[h,m,v,b]}function QR(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);ud?u:d,k=u>d?1:u/d,E=u>d?d/u:1;t.translate(s,l),t.rotate(v),t.scale(k,E),t.arc(0,0,S,h,h+m,1-b),t.scale(1/k,1/E),t.rotate(-v),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],h=u.points[5],m=u.points[4]+h,v=Math.PI/180;if(Math.abs(d-m)m;b-=v){const S=zn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(S.x,S.y)}else for(let b=d+v;bthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return zn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return zn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return zn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],d=a[3],h=a[4],m=a[5],v=a[6];return h+=m*t/o.pathLength,zn.getPointOnEllipticalArc(s,l,u,d,h,v)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var _=null,T=[],A=l,I=u,R,D,j,z,V,K,te,q,$,U;switch(v){case"l":l+=b.shift(),u+=b.shift(),_="L",T.push(l,u);break;case"L":l=b.shift(),u=b.shift(),T.push(l,u);break;case"m":var X=b.shift(),Z=b.shift();if(l+=X,u+=Z,_="M",a.length>2&&a[a.length-1].command==="z"){for(var W=a.length-2;W>=0;W--)if(a[W].command==="M"){l=a[W].points[0]+X,u=a[W].points[1]+Z;break}}T.push(l,u),v="l";break;case"M":l=b.shift(),u=b.shift(),_="M",T.push(l,u),v="L";break;case"h":l+=b.shift(),_="L",T.push(l,u);break;case"H":l=b.shift(),_="L",T.push(l,u);break;case"v":u+=b.shift(),_="L",T.push(l,u);break;case"V":u=b.shift(),_="L",T.push(l,u);break;case"C":T.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"c":T.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",T.push(l,u);break;case"S":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),T.push(D,j,b.shift(),b.shift()),l=b.shift(),u=b.shift(),_="C",T.push(l,u);break;case"s":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),T.push(D,j,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",T.push(l,u);break;case"Q":T.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"q":T.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="Q",T.push(l,u);break;case"T":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l=b.shift(),u=b.shift(),_="Q",T.push(D,j,l,u);break;case"t":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l+=b.shift(),u+=b.shift(),_="Q",T.push(D,j,l,u);break;case"A":z=b.shift(),V=b.shift(),K=b.shift(),te=b.shift(),q=b.shift(),$=l,U=u,l=b.shift(),u=b.shift(),_="A",T=this.convertEndpointToCenterParameterization($,U,l,u,te,q,z,V,K);break;case"a":z=b.shift(),V=b.shift(),K=b.shift(),te=b.shift(),q=b.shift(),$=l,U=u,l+=b.shift(),u+=b.shift(),_="A",T=this.convertEndpointToCenterParameterization($,U,l,u,te,q,z,V,K);break}a.push({command:_||v,points:T,start:{x:A,y:I},pathLength:this.calcLength(A,I,_||v,T)})}(v==="z"||v==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=zn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var d=i[4],h=i[5],m=i[4]+h,v=Math.PI/180;if(Math.abs(d-m)m;l-=v)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=d+v;l1&&(s*=Math.sqrt(v),l*=Math.sqrt(v));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(h*h))/(s*s*(m*m)+l*l*(h*h)));o===a&&(b*=-1),isNaN(b)&&(b=0);var S=b*s*m/l,k=b*-l*h/s,E=(t+r)/2+Math.cos(d)*S-Math.sin(d)*k,_=(n+i)/2+Math.sin(d)*S+Math.cos(d)*k,T=function(V){return Math.sqrt(V[0]*V[0]+V[1]*V[1])},A=function(V,K){return(V[0]*K[0]+V[1]*K[1])/(T(V)*T(K))},I=function(V,K){return(V[0]*K[1]=1&&(z=0),a===0&&z>0&&(z=z-2*Math.PI),a===1&&z<0&&(z=z+2*Math.PI),[E,_,s,l,R,z,d,a]}}zn.prototype.className="Path";zn.prototype._attrsAffectingSize=["data"];Ar(zn);ee.addGetterSetter(zn,"data");class fp extends dc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],v=zn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=zn.getPointOnQuadraticBezier(Math.min(1,1-a/v),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var d=(Math.atan2(u,l)+n)%n,h=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}fp.prototype.className="Arrow";Ar(fp);ee.addGetterSetter(fp,"pointerLength",10,qe());ee.addGetterSetter(fp,"pointerWidth",10,qe());ee.addGetterSetter(fp,"pointerAtBeginning",!1);ee.addGetterSetter(fp,"pointerAtEnding",!0);let T0=class extends je{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};T0.prototype._centroid=!0;T0.prototype.className="Circle";T0.prototype._attrsAffectingSize=["radius"];Ar(T0);ee.addGetterSetter(T0,"radius",0,qe());class ff extends je{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}ff.prototype.className="Ellipse";ff.prototype._centroid=!0;ff.prototype._attrsAffectingSize=["radiusX","radiusY"];Ar(ff);ee.addComponentsGetterSetter(ff,"radius",["x","y"]);ee.addGetterSetter(ff,"radiusX",0,qe());ee.addGetterSetter(ff,"radiusY",0,qe());let fc=class TG extends je{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.attrs.image;let o;if(i){const a=this.attrs.cropWidth,s=this.attrs.cropHeight;a&&s?o=[i,this.cropX(),this.cropY(),a,s,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&t.drawImage.apply(t,o)}_hitFunc(t){var n=this.width(),r=this.height();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=de.createImageElement();i.onload=function(){var o=new TG({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};fc.prototype.className="Image";Ar(fc);ee.addGetterSetter(fc,"image");ee.addComponentsGetterSetter(fc,"crop",["x","y","width","height"]);ee.addGetterSetter(fc,"cropX",0,qe());ee.addGetterSetter(fc,"cropY",0,qe());ee.addGetterSetter(fc,"cropWidth",0,qe());ee.addGetterSetter(fc,"cropHeight",0,qe());var LG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],h9e="Change.konva",p9e="none",L8="up",A8="right",O8="down",M8="left",g9e=LG.length;class bP extends i0{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}pp.prototype.className="RegularPolygon";pp.prototype._centroid=!0;pp.prototype._attrsAffectingSize=["radius"];Ar(pp);ee.addGetterSetter(pp,"radius",0,qe());ee.addGetterSetter(pp,"sides",0,qe());var JR=Math.PI*2;class gp extends je{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,JR,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),JR,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}gp.prototype.className="Ring";gp.prototype._centroid=!0;gp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Ar(gp);ee.addGetterSetter(gp,"innerRadius",0,qe());ee.addGetterSetter(gp,"outerRadius",0,qe());class gu extends je{constructor(t){super(t),this._updated=!0,this.anim=new ts(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],d=o[i+3],h=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,d),t.closePath(),t.fillStrokeShape(this)),h)if(a){var m=a[n],v=r*2;t.drawImage(h,s,l,u,d,m[v+0],m[v+1],u,d)}else t.drawImage(h,s,l,u,d,0,0,u,d)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],d=r*2;t.rect(u[d+0],u[d+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Fb;function OC(){return Fb||(Fb=de.createCanvasElement().getContext(y9e),Fb)}function L9e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function A9e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function O9e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Lr extends je{constructor(t){super(O9e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(E+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=de._isString(t)?t:t==null?"":t+"";return this._setAttr(b9e,n),this}getWidth(){var t=this.attrs.width===Dg||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Dg||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return de.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=OC(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+$b+this.fontVariant()+$b+(this.fontSize()+C9e)+T9e(this.fontFamily())}_addTextLine(t){this.align()===cv&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return OC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` -`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Dg&&o!==void 0,l=a!==Dg&&a!==void 0,u=this.padding(),d=o-u*2,h=a-u*2,m=0,v=this.wrap(),b=v!==nD,S=v!==E9e&&b,k=this.ellipsis();this.textArr=[],OC().font=this._getContextFont();for(var E=k?this._getTextWidth(AC):0,_=0,T=t.length;_d)for(;A.length>0;){for(var R=0,D=A.length,j="",z=0;R>>1,K=A.slice(0,V+1),te=this._getTextWidth(K)+E;te<=d?(R=V+1,j=K,z=te):D=V}if(j){if(S){var q,$=A[j.length],U=$===$b||$===eD;U&&z<=d?q=j.length:q=Math.max(j.lastIndexOf($b),j.lastIndexOf(eD))+1,q>0&&(R=q,j=j.slice(0,R),z=this._getTextWidth(j))}j=j.trimRight(),this._addTextLine(j),r=Math.max(r,z),m+=i;var X=this._shouldHandleEllipsis(m);if(X){this._tryToAddEllipsisToLastLine();break}if(A=A.slice(R),A=A.trimLeft(),A.length>0&&(I=this._getTextWidth(A),I<=d)){this._addTextLine(A),m+=i,r=Math.max(r,I);break}}else break}else this._addTextLine(A),m+=i,r=Math.max(r,I),this._shouldHandleEllipsis(m)&&_h)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Dg&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==nD;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Dg&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+AC)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var d=AG(this.text()),h=this.text().split(" ").length-1,m,v,b,S=-1,k=0,E=function(){k=0;for(var te=t.dataArray,q=S+1;q0)return S=q,te[q];te[q].command==="M"&&(m={x:te[q].points[0],y:te[q].points[1]})}return{}},_=function(te){var q=t._getTextSize(te).width+r;te===" "&&i==="justify"&&(q+=(s-a)/h);var $=0,U=0;for(v=void 0;Math.abs(q-$)/q>.01&&U<20;){U++;for(var X=$;b===void 0;)b=E(),b&&X+b.pathLengthq?v=zn.getPointOnLine(q,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var W=b.points[4],Q=b.points[5],ie=b.points[4]+Q;k===0?k=W+1e-8:q>$?k+=Math.PI/180*Q/Math.abs(Q):k-=Math.PI/360*Q/Math.abs(Q),(Q<0&&k=0&&k>ie)&&(k=ie,Z=!0),v=zn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],k,b.points[6]);break;case"C":k===0?q>b.pathLength?k=1e-8:k=q/b.pathLength:q>$?k+=(q-$)/b.pathLength/2:k=Math.max(k-($-q)/b.pathLength/2,0),k>1&&(k=1,Z=!0),v=zn.getPointOnCubicBezier(k,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":k===0?k=q/b.pathLength:q>$?k+=(q-$)/b.pathLength:k-=($-q)/b.pathLength,k>1&&(k=1,Z=!0),v=zn.getPointOnQuadraticBezier(k,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}v!==void 0&&($=zn.getLineLength(m.x,m.y,v.x,v.y)),Z&&(Z=!1,b=void 0)}},T="C",A=t._getTextSize(T).width+r,I=u/A-1,R=0;Re+`.${jG}`).join(" "),rD="nodesRect",R9e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],D9e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const N9e="ontouchstart"in pt._global;function j9e(e,t){if(e==="rotater")return"crosshair";t+=de.degToRad(D9e[e]||0);var n=(de.radToDeg(t)%360+360)%360;return de._inRange(n,315+22.5,360)||de._inRange(n,0,22.5)?"ns-resize":de._inRange(n,45-22.5,45+22.5)?"nesw-resize":de._inRange(n,90-22.5,90+22.5)?"ew-resize":de._inRange(n,135-22.5,135+22.5)?"nwse-resize":de._inRange(n,180-22.5,180+22.5)?"ns-resize":de._inRange(n,225-22.5,225+22.5)?"nesw-resize":de._inRange(n,270-22.5,270+22.5)?"ew-resize":de._inRange(n,315-22.5,315+22.5)?"nwse-resize":(de.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var J5=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],iD=1e8;function B9e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function BG(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function $9e(e,t){const n=B9e(e);return BG(e,t,n)}function F9e(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(R9e.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(rD),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(rD,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(pt.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return BG(d,-pt.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-iD,y:-iD,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const d=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var h=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],m=u.getAbsoluteTransform();h.forEach(function(v){var b=m.point(v);n.push(b)})});const r=new ka;r.rotate(-pt.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var d=r.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:pt.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),J5.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new By({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:N9e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=pt.getAngle(this.rotation()),o=j9e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new je({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*de._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const d=o.getAbsolutePosition();if(!(u.x===d.x&&u.y===d.y)){if(this._movingAnchorName==="rotater"){var h=this._getNodeRect();n=o.x()-h.width/2,r=-o.y()+h.height/2;let te=Math.atan2(-r,n)+Math.PI/2;h.height<0&&(te-=Math.PI);var m=pt.getAngle(this.rotation());const q=m+te,$=pt.getAngle(this.rotationSnapTolerance()),X=F9e(this.rotationSnaps(),q,$)-h.rotation,Z=$9e(h,X);this._fitNodesInto(Z,t);return}var v=this.keepRatio()||t.shiftKey,_=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(v){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var S=this.findOne(".top-left").x()>b.x?-1:1,k=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*S,r=i*this.sin*k,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(v){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-b.x,2)+Math.pow(b.y-o.y(),2));var S=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*S,r=i*this.sin*k,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var E=o.position();this.findOne(".top-left").y(E.y),this.findOne(".bottom-right").x(E.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(v){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var S=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(de._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(de._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new ka;if(a.rotate(pt.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const h=a.point({x:-this.padding()*2,y:0});if(t.x+=h.x,t.y+=h.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const h=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const h=a.point({x:0,y:-this.padding()*2});if(t.x+=h.x,t.y+=h.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const h=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const h=this.boundBoxFunc()(r,t);h?t=h:de.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new ka;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new ka;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const d=u.multiply(l.invert());this._nodes.forEach(h=>{var m;const v=h.getParent().getAbsoluteTransform(),b=h.getTransform().copy();b.translate(h.offsetX(),h.offsetY());const S=new ka;S.multiply(v.copy().invert()).multiply(d).multiply(v).multiply(b);const k=S.decompose();h.setAttrs(k),this._fire("transform",{evt:n,target:h}),h._fire("transform",{evt:n,target:h}),(m=h.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(de._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(de._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*de._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),i0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Ze.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function z9e(e){return e instanceof Array||de.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){J5.indexOf(t)===-1&&de.warn("Unknown anchor name: "+t+". Available names are: "+J5.join(", "))}),e||[]}In.prototype.className="Transformer";Ar(In);ee.addGetterSetter(In,"enabledAnchors",J5,z9e);ee.addGetterSetter(In,"flipEnabled",!0,nl());ee.addGetterSetter(In,"resizeEnabled",!0);ee.addGetterSetter(In,"anchorSize",10,qe());ee.addGetterSetter(In,"rotateEnabled",!0);ee.addGetterSetter(In,"rotationSnaps",[]);ee.addGetterSetter(In,"rotateAnchorOffset",50,qe());ee.addGetterSetter(In,"rotationSnapTolerance",5,qe());ee.addGetterSetter(In,"borderEnabled",!0);ee.addGetterSetter(In,"anchorStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"anchorStrokeWidth",1,qe());ee.addGetterSetter(In,"anchorFill","white");ee.addGetterSetter(In,"anchorCornerRadius",0,qe());ee.addGetterSetter(In,"borderStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"borderStrokeWidth",1,qe());ee.addGetterSetter(In,"borderDash");ee.addGetterSetter(In,"keepRatio",!0);ee.addGetterSetter(In,"centeredScaling",!1);ee.addGetterSetter(In,"ignoreStroke",!1);ee.addGetterSetter(In,"padding",0,qe());ee.addGetterSetter(In,"node");ee.addGetterSetter(In,"nodes");ee.addGetterSetter(In,"boundBoxFunc");ee.addGetterSetter(In,"anchorDragBoundFunc");ee.addGetterSetter(In,"shouldOverdrawWholeArea",!1);ee.addGetterSetter(In,"useSingleNodeRotation",!0);ee.backCompat(In,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class hc extends je{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,pt.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}hc.prototype.className="Wedge";hc.prototype._centroid=!0;hc.prototype._attrsAffectingSize=["radius"];Ar(hc);ee.addGetterSetter(hc,"radius",0,qe());ee.addGetterSetter(hc,"angle",0,qe());ee.addGetterSetter(hc,"clockwise",!1);ee.backCompat(hc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function oD(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var H9e=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],V9e=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function W9e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,d,h,m,v,b,S,k,E,_,T,A,I,R,D,j,z,V,K,te,q=t+t+1,$=r-1,U=i-1,X=t+1,Z=X*(X+1)/2,W=new oD,Q=null,ie=W,fe=null,Se=null,Pe=H9e[t],ye=V9e[t];for(s=1;s>ye,K!==0?(K=255/K,n[d]=(m*Pe>>ye)*K,n[d+1]=(v*Pe>>ye)*K,n[d+2]=(b*Pe>>ye)*K):n[d]=n[d+1]=n[d+2]=0,m-=k,v-=E,b-=_,S-=T,k-=fe.r,E-=fe.g,_-=fe.b,T-=fe.a,l=h+((l=o+t+1)<$?l:$)<<2,A+=fe.r=n[l],I+=fe.g=n[l+1],R+=fe.b=n[l+2],D+=fe.a=n[l+3],m+=A,v+=I,b+=R,S+=D,fe=fe.next,k+=j=Se.r,E+=z=Se.g,_+=V=Se.b,T+=K=Se.a,A-=j,I-=z,R-=V,D-=K,Se=Se.next,d+=4;h+=r}for(o=0;o>ye,K>0?(K=255/K,n[l]=(m*Pe>>ye)*K,n[l+1]=(v*Pe>>ye)*K,n[l+2]=(b*Pe>>ye)*K):n[l]=n[l+1]=n[l+2]=0,m-=k,v-=E,b-=_,S-=T,k-=fe.r,E-=fe.g,_-=fe.b,T-=fe.a,l=o+((l=a+X)0&&W9e(t,n)};ee.addGetterSetter(Ze,"blurRadius",0,qe(),ee.afterSetFilter);const G9e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};ee.addGetterSetter(Ze,"contrast",0,qe(),ee.afterSetFilter);const Y9e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,d=l*4,h=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:de.error("Unknown emboss direction: "+r)}do{var m=(h-1)*d,v=o;h+v<1&&(v=0),h+v>u&&(v=0);var b=(h-1+v)*l*4,S=l;do{var k=m+(S-1)*4,E=a;S+E<1&&(E=0),S+E>l&&(E=0);var _=b+(S-1+E)*4,T=s[k]-s[_],A=s[k+1]-s[_+1],I=s[k+2]-s[_+2],R=T,D=R>0?R:-R,j=A>0?A:-A,z=I>0?I:-I;if(j>D&&(R=A),z>D&&(R=I),R*=t,i){var V=s[k]+R,K=s[k+1]+R,te=s[k+2]+R;s[k]=V>255?255:V<0?0:V,s[k+1]=K>255?255:K<0?0:K,s[k+2]=te>255?255:te<0?0:te}else{var q=n-R;q<0?q=0:q>255&&(q=255),s[k]=s[k+1]=s[k+2]=q}}while(--S)}while(--h)};ee.addGetterSetter(Ze,"embossStrength",.5,qe(),ee.afterSetFilter);ee.addGetterSetter(Ze,"embossWhiteLevel",.5,qe(),ee.afterSetFilter);ee.addGetterSetter(Ze,"embossDirection","top-left",null,ee.afterSetFilter);ee.addGetterSetter(Ze,"embossBlend",!1,null,ee.afterSetFilter);function MC(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const K9e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],d=u,h,m,v=this.enhance();if(v!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),h=t[m+2],hd&&(d=h);i===r&&(i=255,r=0),s===a&&(s=255,a=0),d===u&&(d=255,u=0);var b,S,k,E,_,T,A,I,R;for(v>0?(S=i+v*(255-i),k=r-v*(r-0),_=s+v*(255-s),T=a-v*(a-0),I=d+v*(255-d),R=u-v*(u-0)):(b=(i+r)*.5,S=i+v*(i-b),k=r+v*(r-b),E=(s+a)*.5,_=s+v*(s-E),T=a+v*(a-E),A=(d+u)*.5,I=d+v*(d-A),R=u+v*(u-A)),m=0;mE?k:E;var _=a,T=o,A,I,R=360/T*Math.PI/180,D,j;for(I=0;IT?_:T;var A=a,I=o,R,D,j=n.polarRotation||0,z,V;for(d=0;dt&&(A=T,I=0,R=-1),i=0;i=0&&v=0&&b=0&&v=0&&b=255*4?255:0}return a}function l8e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&v=0&&b=n))for(o=S;o=r||(a=(n*o+i)*4,s+=A[a+0],l+=A[a+1],u+=A[a+2],d+=A[a+3],T+=1);for(s=s/T,l=l/T,u=u/T,d=d/T,i=v;i=n))for(o=S;o=r||(a=(n*o+i)*4,A[a+0]=s,A[a+1]=l,A[a+2]=u,A[a+3]=d)}};ee.addGetterSetter(Ze,"pixelSize",8,qe(),ee.afterSetFilter);const f8e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Ze,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Ze,"blue",0,aG,ee.afterSetFilter);const p8e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Ze,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Ze,"blue",0,aG,ee.afterSetFilter);ee.addGetterSetter(Ze,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const g8e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),d>127&&(d=255-d),h>127&&(h=255-h),t[l]=u,t[l+1]=d,t[l+2]=h}while(--s)}while(--o)},v8e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new Fg.Stage({container:i,width:n,height:r}),a=new Fg.Layer,s=new Fg.Layer;a.add(new Fg.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new Fg.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l};let $G=null,FG=null;const b8e=e=>{$G=e},el=()=>$G,S8e=e=>{FG=e},zG=()=>FG,x8e=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},HG=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),w8e=e=>{const t=el(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:o,systemState:a}=e,{codeformerFidelity:s,facetoolStrength:l,facetoolType:u,hiresFix:d,hiresStrength:h,shouldRunESRGAN:m,shouldRunFacetool:v,upscalingLevel:b,upscalingStrength:S,upscalingDenoising:k}=i,{cfgScale:E,height:_,img2imgStrength:T,infillMethod:A,initialImage:I,iterations:R,perlin:D,prompt:j,negativePrompt:z,sampler:V,seamBlur:K,seamless:te,seamSize:q,seamSteps:$,seamStrength:U,seed:X,seedWeights:Z,shouldFitToWidthHeight:W,shouldGenerateVariations:Q,shouldRandomizeSeed:ie,steps:fe,threshold:Se,tileSize:Pe,variationAmount:ye,width:We}=r,{shouldDisplayInProgressType:De,saveIntermediatesInterval:ot,enableImageDebugging:He}=a,Be={prompt:j,iterations:R,steps:fe,cfg_scale:E,threshold:Se,perlin:D,height:_,width:We,sampler_name:V,seed:X,progress_images:De==="full-res",progress_latents:De==="latents",save_intermediates:ot,generation_mode:n,init_mask:""};let wt=!1,st=!1;if(z!==""&&(Be.prompt=`${j} [${z}]`),Be.seed=ie?HG(hP,pP):X,["txt2img","img2img"].includes(n)&&(Be.seamless=te,Be.hires_fix=d,d&&(Be.strength=h),m&&(wt={level:b,denoise_str:k,strength:S}),v&&(st={type:u,strength:l},u==="codeformer"&&(st.codeformer_fidelity=s))),n==="img2img"&&I&&(Be.init_img=typeof I=="string"?I:I.url,Be.strength=T,Be.fit=W),n==="unifiedCanvas"&&t){const{layerState:{objects:mt},boundingBoxCoordinates:St,boundingBoxDimensions:Le,stageScale:lt,isMaskEnabled:Mt,shouldPreserveMaskedArea:ut,boundingBoxScaleMethod:_t,scaledBoundingBoxDimensions:ln}=o,ae={...St,...Le},Re=y8e(Mt?mt.filter(tP):[],ae);Be.init_mask=Re,Be.fit=!1,Be.strength=T,Be.invert_mask=ut,Be.bounding_box=ae;const Ye=t.scale();t.scale({x:1/lt,y:1/lt});const Ke=t.getAbsolutePosition(),xe=t.toDataURL({x:ae.x+Ke.x,y:ae.y+Ke.y,width:ae.width,height:ae.height});He&&x8e([{base64:Re,caption:"mask sent as init_mask"},{base64:xe,caption:"image sent as init_img"}]),t.scale(Ye),Be.init_img=xe,Be.progress_images=!1,_t!=="none"&&(Be.inpaint_width=ln.width,Be.inpaint_height=ln.height),Be.seam_size=q,Be.seam_blur=K,Be.seam_strength=U,Be.seam_steps=$,Be.tile_size=Pe,Be.infill_method=A,Be.force_outpaint=!1}return Q?(Be.variation_amount=ye,Z&&(Be.with_variations=Kxe(Z))):Be.variation_amount=0,He&&(Be.enable_image_debugging=He),{generationParameters:Be,esrganParameters:wt,facetoolParameters:st}};var C8e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,_8e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,k8e=/[^-+\dA-Z]/g;function no(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(aD[t]||t||aD.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},d=function(){return e[o()+"Hours"]()},h=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},v=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},S=function(){return E8e(e)},k=function(){return P8e(e)},E={d:function(){return a()},dd:function(){return wa(a())},ddd:function(){return Uo.dayNames[s()]},DDD:function(){return sD({y:u(),m:l(),d:a(),_:o(),dayName:Uo.dayNames[s()],short:!0})},dddd:function(){return Uo.dayNames[s()+7]},DDDD:function(){return sD({y:u(),m:l(),d:a(),_:o(),dayName:Uo.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return wa(l()+1)},mmm:function(){return Uo.monthNames[l()]},mmmm:function(){return Uo.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return wa(u(),4)},h:function(){return d()%12||12},hh:function(){return wa(d()%12||12)},H:function(){return d()},HH:function(){return wa(d())},M:function(){return h()},MM:function(){return wa(h())},s:function(){return m()},ss:function(){return wa(m())},l:function(){return wa(v(),3)},L:function(){return wa(Math.floor(v()/10))},t:function(){return d()<12?Uo.timeNames[0]:Uo.timeNames[1]},tt:function(){return d()<12?Uo.timeNames[2]:Uo.timeNames[3]},T:function(){return d()<12?Uo.timeNames[4]:Uo.timeNames[5]},TT:function(){return d()<12?Uo.timeNames[6]:Uo.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":T8e(e)},o:function(){return(b()>0?"-":"+")+wa(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+wa(Math.floor(Math.abs(b())/60),2)+":"+wa(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return S()},WW:function(){return wa(S())},N:function(){return k()}};return t.replace(C8e,function(_){return _ in E?E[_]():_.slice(1,_.length-1)})}var aD={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Uo={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},wa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},sD=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,d=new Date;d.setDate(d[o+"Date"]()-1);var h=new Date;h.setDate(h[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},v=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},S=function(){return d[o+"Date"]()},k=function(){return d[o+"Month"]()},E=function(){return d[o+"FullYear"]()},_=function(){return h[o+"Date"]()},T=function(){return h[o+"Month"]()},A=function(){return h[o+"FullYear"]()};return b()===n&&v()===r&&m()===i?l?"Tdy":"Today":E()===n&&k()===r&&S()===i?l?"Ysd":"Yesterday":A()===n&&T()===r&&_()===i?l?"Tmw":"Tomorrow":a},E8e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},P8e=function(t){var n=t.getDay();return n===0&&(n=7),n},T8e=function(t){return(String(t).match(_8e)||[""]).pop().replace(k8e,"").replace(/GMT\+0000/g,"UTC")};const L8e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(Hs(!0));const o=r(),{generation:a,postprocessing:s,system:l,canvas:u}=o,d={generationMode:i,generationState:a,postprocessingState:s,canvasState:u,systemState:l};n(eCe());const{generationParameters:h,esrganParameters:m,facetoolParameters:v}=w8e(d);t.emit("generateImage",h,m,v),h.init_mask&&(h.init_mask=h.init_mask.substr(0,64).concat("...")),h.init_img&&(h.init_img=h.init_img.substr(0,64).concat("...")),n(to({timestamp:no(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...h,...m,...v})}`}))},emitRunESRGAN:i=>{n(Hs(!0));const{postprocessing:{upscalingLevel:o,upscalingDenoising:a,upscalingStrength:s}}=r(),l={upscale:[o,a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(Hs(!0));const{postprocessing:{facetoolType:o,facetoolStrength:a,codeformerFidelity:s}}=r(),l={facetool_strength:a};o==="codeformer"&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",i,{type:o,...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`Face restoration (${o}) requested: ${JSON.stringify({file:i.url,...l})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(eU(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitRequestModelChange:i=>{n(Z6e()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}};let Hb;const A8e=new Uint8Array(16);function O8e(){if(!Hb&&(Hb=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hb(A8e)}const zi=[];for(let e=0;e<256;++e)zi.push((e+256).toString(16).slice(1));function M8e(e,t=0){return(zi[e[t+0]]+zi[e[t+1]]+zi[e[t+2]]+zi[e[t+3]]+"-"+zi[e[t+4]]+zi[e[t+5]]+"-"+zi[e[t+6]]+zi[e[t+7]]+"-"+zi[e[t+8]]+zi[e[t+9]]+"-"+zi[e[t+10]]+zi[e[t+11]]+zi[e[t+12]]+zi[e[t+13]]+zi[e[t+14]]+zi[e[t+15]]).toLowerCase()}const I8e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lD={randomUUID:I8e};function cm(e,t,n){if(lD.randomUUID&&!t&&!e)return lD.randomUUID();e=e||{};const r=e.random||(e.rng||O8e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return M8e(r)}const I8=zr("socketio/generateImage"),R8e=zr("socketio/runESRGAN"),D8e=zr("socketio/runFacetool"),N8e=zr("socketio/deleteImage"),R8=zr("socketio/requestImages"),uD=zr("socketio/requestNewImages"),j8e=zr("socketio/cancelProcessing"),B8e=zr("socketio/requestSystemConfig"),cD=zr("socketio/searchForModels"),$y=zr("socketio/addNewModel"),$8e=zr("socketio/deleteModel"),VG=zr("socketio/requestModelChange"),F8e=zr("socketio/saveStagingAreaImageToGallery"),z8e=zr("socketio/requestEmptyTempFolder"),H8e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(PR(!0)),t(R4(zt.t("common:statusConnected"))),t(B8e());const r=n().gallery;r.categories.result.latest_mtime?t(uD("result")):t(R8("result")),r.categories.user.latest_mtime?t(uD("user")):t(R8("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(PR(!1)),t(R4(zt.t("common:statusDisconnected"))),t(to({timestamp:no(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:o}=i.ui,{shouldLoopback:a}=i.postprocessing,{boundingBox:s,generationMode:l,...u}=r,d={uuid:cm(),...u};if(["txt2img","img2img"].includes(l)&&t(sm({category:"result",image:{...d,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:h}=r;t(pxe({image:{...d,category:"temp"},boundingBox:h})),i.canvas.shouldAutoSave&&t(sm({image:{...d,category:"result"},category:"result"}))}if(a)switch(cP[o]){case"img2img":{t(k0(d));break}}t(SC()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(jxe({uuid:cm(),...r,category:"result"})),r.isBase64||t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(sm({category:"result",image:{uuid:cm(),...r,category:"result"}})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(Hs(!0)),t(q6e(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(to({timestamp:no(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(TR()),t(SC())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:cm(),...l}));t(Nxe({images:s,areMoreImagesAvailable:o,category:a})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(X6e());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(sm({category:"result",image:r})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(SC())),t(to({timestamp:no(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(eU(r));const{generation:{initialImage:o,maskPath:a}}=n();(o===i||(o==null?void 0:o.url)===i)&&t(oU()),a===i&&t(cU("")),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(Y6e(r)),r.infill_methods.includes("patchmatch")||t(uU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(FU(i)),t(zU(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(Tb(o)),t(Hs(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t(Th({title:a?`${zt.t("modelmanager:modelUpdated")}: ${i}`:`${zt.t("modelmanager:modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(Tb(o)),t(Hs(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`${zt.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t(Th({title:`${zt.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(Tb(o)),t(R4(zt.t("common:statusModelChanged"))),t(Hs(!1)),t(lm(!0)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(Tb(o)),t(Hs(!1)),t(lm(!0)),t(TR()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Th({title:zt.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},V8e=()=>{const{origin:e}=new URL(window.location.href),t=j4(e,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:d,onGenerationResult:h,onIntermediateResult:m,onProgressUpdate:v,onGalleryImages:b,onProcessingCanceled:S,onImageDeleted:k,onSystemConfig:E,onModelChanged:_,onFoundModels:T,onNewModelAdded:A,onModelDeleted:I,onModelChangeFailed:R,onTempFolderEmptied:D}=H8e(i),{emitGenerateImage:j,emitRunESRGAN:z,emitRunFacetool:V,emitDeleteImage:K,emitRequestImages:te,emitRequestNewImages:q,emitCancelProcessing:$,emitRequestSystemConfig:U,emitSearchForModels:X,emitAddNewModel:Z,emitDeleteModel:W,emitRequestModelChange:Q,emitSaveStagingAreaImageToGallery:ie,emitRequestEmptyTempFolder:fe}=L8e(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",Se=>u(Se)),t.on("generationResult",Se=>h(Se)),t.on("postprocessingResult",Se=>d(Se)),t.on("intermediateResult",Se=>m(Se)),t.on("progressUpdate",Se=>v(Se)),t.on("galleryImages",Se=>b(Se)),t.on("processingCanceled",()=>{S()}),t.on("imageDeleted",Se=>{k(Se)}),t.on("systemConfig",Se=>{E(Se)}),t.on("foundModels",Se=>{T(Se)}),t.on("newModelAdded",Se=>{A(Se)}),t.on("modelDeleted",Se=>{I(Se)}),t.on("modelChanged",Se=>{_(Se)}),t.on("modelChangeFailed",Se=>{R(Se)}),t.on("tempFolderEmptied",()=>{D()}),n=!0),a.type){case"socketio/generateImage":{j(a.payload);break}case"socketio/runESRGAN":{z(a.payload);break}case"socketio/runFacetool":{V(a.payload);break}case"socketio/deleteImage":{K(a.payload);break}case"socketio/requestImages":{te(a.payload);break}case"socketio/requestNewImages":{q(a.payload);break}case"socketio/cancelProcessing":{$();break}case"socketio/requestSystemConfig":{U();break}case"socketio/searchForModels":{X(a.payload);break}case"socketio/addNewModel":{Z(a.payload);break}case"socketio/deleteModel":{W(a.payload);break}case"socketio/requestModelChange":{Q(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{ie(a.payload);break}case"socketio/requestEmptyTempFolder":{fe();break}}o(a)}},W8e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),U8e=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map(e=>`system.${e}`),G8e=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),WG=wW({generation:nwe,postprocessing:swe,gallery:Wxe,system:rCe,canvas:Rxe,ui:hCe,lightbox:qxe}),q8e=IW.getPersistConfig({key:"root",storage:MW,rootReducer:WG,blacklist:[...W8e,...U8e,...G8e],debounce:300}),Y8e=zSe(q8e,WG),UG=vSe({reducer:Y8e,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(V8e()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),GG=qSe(UG),SP=w.createContext(null),Me=O5e,he=S5e;let dD;const xP=()=>({setOpenUploader:e=>{e&&(dD=e)},openUploader:dD}),Or=at(e=>e.ui,e=>cP[e.activeTab],{memoizeOptions:{equalityCheck:ke.isEqual}}),K8e=at(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:ke.isEqual}}),mp=at(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),fD=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Or(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:a})).json(),u={uuid:cm(),category:"user",...l};t(sm({image:u,category:"user"})),o==="unifiedCanvas"?t(Dx(u)):o==="img2img"&&t(k0(u))};function X8e(){const{t:e}=Ve();return y.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[y.jsx("h1",{children:e("common:nodes")}),y.jsx("p",{children:e("common:nodesDesc")})]})}const Z8e=()=>{const{t:e}=Ve();return y.jsxs("div",{className:"work-in-progress post-processing-work-in-progress",children:[y.jsx("h1",{children:e("common:postProcessing")}),y.jsx("p",{children:e("common:postProcessDesc1")}),y.jsx("p",{children:e("common:postProcessDesc2")}),y.jsx("p",{children:e("common:postProcessDesc3")})]})};function Q8e(){const{t:e}=Ve();return y.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[y.jsx("h1",{children:e("common:training")}),y.jsxs("p",{children:[e("common:trainingDesc1"),y.jsx("br",{}),y.jsx("br",{}),e("common:trainingDesc2")]})]})}function J8e(e){const{i18n:t}=Ve(),n=localStorage.getItem("i18nextLng");N.useEffect(()=>{e()},[e]),N.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const e_e=yt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:y.jsx("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),t_e=yt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),n_e=yt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),r_e=yt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:y.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:y.jsx("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})}),i_e=yt({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),o_e=yt({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})}),Qe=Ae((e,t)=>{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return y.jsx(uo,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:y.jsx(ss,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})}),cr=Ae((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return y.jsx(uo,{label:r,...i,children:y.jsx(as,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),Zs=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return y.jsxs(ME,{...o,children:[y.jsx(DE,{children:t}),y.jsxs(RE,{className:`invokeai__popover-content ${r}`,children:[i&&y.jsx(IE,{className:"invokeai__popover-arrow"}),n]})]})},Vx=at(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),hD=/^-?(0\.)?\.?$/,ra=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:d,min:h,max:m,isInteger:v=!0,formControlProps:b,formLabelProps:S,numberInputFieldProps:k,numberInputStepperProps:E,tooltipProps:_,...T}=e,[A,I]=w.useState(String(u));w.useEffect(()=>{!A.match(hD)&&u!==Number(A)&&I(String(u))},[u,A]);const R=j=>{I(j),j.match(hD)||d(v?Math.floor(Number(j)):Number(j))},D=j=>{const z=ke.clamp(v?Math.floor(Number(j.target.value)):Number(j.target.value),h,m);I(String(z)),d(z)};return y.jsx(uo,{..._,children:y.jsxs(dn,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&y.jsx(kn,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...S,children:t}),y.jsxs(TE,{className:"invokeai__number-input-root",value:A,min:h,max:m,keepWithinRange:!0,clampValueOnBlur:!1,onChange:R,onBlur:D,width:a,...T,children:[y.jsx(LE,{className:"invokeai__number-input-field",textAlign:s,...k}),o&&y.jsxs("div",{className:"invokeai__number-input-stepper",children:[y.jsx(OE,{...E,className:"invokeai__number-input-stepper-button"}),y.jsx(AE,{...E,className:"invokeai__number-input-stepper-button"})]})]})]})})},tl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return y.jsxs(dn,{isDisabled:n,className:`invokeai__select ${l}`,onClick:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation(),d.nativeEvent.stopPropagation(),d.nativeEvent.cancelBubble=!0},children:[t&&y.jsx(kn,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),y.jsx(uo,{label:i,...o,children:y.jsx(FV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(d=>typeof d=="string"||typeof d=="number"?y.jsx("option",{value:d,className:"invokeai__select-option",children:d},d):y.jsx("option",{value:d.value,className:"invokeai__select-option",children:d.key},d.value))})})]})},Fy=e=>e.postprocessing,ir=e=>e.system,a_e=e=>e.system.toastQueue,qG=at(ir,e=>{const{model_list:t}=e,n=ke.reduce(t,(r,i,o)=>(i.status==="active"&&(r=o),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),s_e=at([Fy,ir],({facetoolStrength:e,facetoolType:t,codeformerFidelity:n},{isGFPGANAvailable:r})=>({facetoolStrength:e,facetoolType:t,codeformerFidelity:n,isGFPGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),wP=()=>{const e=Me(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r,isGFPGANAvailable:i}=he(s_e),o=u=>e(u8(u)),a=u=>e(xU(u)),s=u=>e(I4(u.target.value)),{t:l}=Ve();return y.jsxs(Ge,{direction:"column",gap:2,children:[y.jsx(tl,{label:l("parameters:type"),validValues:a7e.concat(),value:n,onChange:s}),y.jsx(ra,{isDisabled:!i,label:l("parameters:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&y.jsx(ra,{isDisabled:!i,label:l("parameters:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};var YG={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pD=N.createContext&&N.createContext(YG),Fd=globalThis&&globalThis.__assign||function(){return Fd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{Se(i)},[i]);const Pe=w.useMemo(()=>U!=null&&U.max?U.max:a,[a,U==null?void 0:U.max]),ye=He=>{l(He)},We=He=>{He.target.value===""&&(He.target.value=String(o));const Be=ke.clamp(S?Math.floor(Number(He.target.value)):Number(fe),o,Pe);l(Be)},De=He=>{Se(He)},ot=()=>{I&&I()};return y.jsxs(dn,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":h,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...V,children:[y.jsx(kn,{className:"invokeai__slider-component-label",...K,children:r}),y.jsxs(wy,{w:"100%",gap:2,alignItems:"center",children:[y.jsxs(jE,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:ye,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...ie,children:[h&&y.jsxs(y.Fragment,{children:[y.jsx(G9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),y.jsx(G9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:v,...te,children:a})]}),y.jsx(ZV,{className:"invokeai__slider_track",...q,children:y.jsx(QV,{className:"invokeai__slider_track-filled"})}),y.jsx(uo,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${d}`,hidden:T,...W,children:y.jsx(XV,{className:"invokeai__slider-thumb",...$})})]}),b&&y.jsxs(TE,{min:o,max:Pe,step:s,value:fe,onChange:De,onBlur:We,className:"invokeai__slider-number-field",isDisabled:j,...U,children:[y.jsx(LE,{className:"invokeai__slider-number-input",width:k,readOnly:E,minWidth:k,...X}),y.jsxs(IV,{...Z,children:[y.jsx(OE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"}),y.jsx(AE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"})]})]}),_&&y.jsx(Qe,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:y.jsx(Wx,{}),onClick:ot,isDisabled:R,...Q})]})]})}const g_e=at([Fy,ir],({upscalingLevel:e,upscalingStrength:t,upscalingDenoising:n},{isESRGANAvailable:r})=>({upscalingLevel:e,upscalingDenoising:n,upscalingStrength:t,isESRGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),CP=()=>{const e=Me(),{upscalingLevel:t,upscalingStrength:n,upscalingDenoising:r,isESRGANAvailable:i}=he(g_e),{t:o}=Ve(),a=l=>e(wU(Number(l.target.value))),s=l=>e(d8(l));return y.jsxs(Ge,{flexDir:"column",rowGap:"1rem",minWidth:"20rem",children:[y.jsx(tl,{isDisabled:!i,label:o("parameters:scale"),value:t,onChange:a,validValues:o7e}),y.jsx(so,{label:o("parameters:denoisingStrength"),value:r,min:0,max:1,step:.01,onChange:l=>{e(c8(l))},handleReset:()=>e(c8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i}),y.jsx(so,{label:`${o("parameters:upscale")} ${o("parameters:strength")}`,value:n,min:0,max:1,step:.05,onChange:s,handleReset:()=>e(d8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i})]})};var m_e=Object.create,ZG=Object.defineProperty,v_e=Object.getOwnPropertyDescriptor,y_e=Object.getOwnPropertyNames,b_e=Object.getPrototypeOf,S_e=Object.prototype.hasOwnProperty,Ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),x_e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of y_e(t))!S_e.call(e,i)&&i!==n&&ZG(e,i,{get:()=>t[i],enumerable:!(r=v_e(t,i))||r.enumerable});return e},QG=(e,t,n)=>(n=e!=null?m_e(b_e(e)):{},x_e(t||!e||!e.__esModule?ZG(n,"default",{value:e,enumerable:!0}):n,e)),w_e=Ue((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),JG=Ue((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Ux=Ue((e,t)=>{var n=JG();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),C_e=Ue((e,t)=>{var n=Ux(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),__e=Ue((e,t)=>{var n=Ux();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),k_e=Ue((e,t)=>{var n=Ux();function r(i){return n(this.__data__,i)>-1}t.exports=r}),E_e=Ue((e,t)=>{var n=Ux();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Gx=Ue((e,t)=>{var n=w_e(),r=C_e(),i=__e(),o=k_e(),a=E_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Gx();function r(){this.__data__=new n,this.size=0}t.exports=r}),T_e=Ue((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),L_e=Ue((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),A_e=Ue((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),eq=Ue((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),pc=Ue((e,t)=>{var n=eq(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),_P=Ue((e,t)=>{var n=pc(),r=n.Symbol;t.exports=r}),O_e=Ue((e,t)=>{var n=_P(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),d=l[a];try{l[a]=void 0;var h=!0}catch{}var m=o.call(l);return h&&(u?l[a]=d:delete l[a]),m}t.exports=s}),M_e=Ue((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),qx=Ue((e,t)=>{var n=_P(),r=O_e(),i=M_e(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),tq=Ue((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),nq=Ue((e,t)=>{var n=qx(),r=tq(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var d=n(u);return d==o||d==a||d==i||d==s}t.exports=l}),I_e=Ue((e,t)=>{var n=pc(),r=n["__core-js_shared__"];t.exports=r}),R_e=Ue((e,t)=>{var n=I_e(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),rq=Ue((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch{}try{return o+""}catch{}}return""}t.exports=i}),D_e=Ue((e,t)=>{var n=nq(),r=R_e(),i=tq(),o=rq(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,h=u.hasOwnProperty,m=RegExp("^"+d.call(h).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(b){if(!i(b)||r(b))return!1;var S=n(b)?m:s;return S.test(o(b))}t.exports=v}),N_e=Ue((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),L0=Ue((e,t)=>{var n=D_e(),r=N_e();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),kP=Ue((e,t)=>{var n=L0(),r=pc(),i=n(r,"Map");t.exports=i}),Yx=Ue((e,t)=>{var n=L0(),r=n(Object,"create");t.exports=r}),j_e=Ue((e,t)=>{var n=Yx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),B_e=Ue((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),$_e=Ue((e,t)=>{var n=Yx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),F_e=Ue((e,t)=>{var n=Yx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),z_e=Ue((e,t)=>{var n=Yx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),H_e=Ue((e,t)=>{var n=j_e(),r=B_e(),i=$_e(),o=F_e(),a=z_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=H_e(),r=Gx(),i=kP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),W_e=Ue((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),Kx=Ue((e,t)=>{var n=W_e();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),U_e=Ue((e,t)=>{var n=Kx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),G_e=Ue((e,t)=>{var n=Kx();function r(i){return n(this,i).get(i)}t.exports=r}),q_e=Ue((e,t)=>{var n=Kx();function r(i){return n(this,i).has(i)}t.exports=r}),Y_e=Ue((e,t)=>{var n=Kx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),iq=Ue((e,t)=>{var n=V_e(),r=U_e(),i=G_e(),o=q_e(),a=Y_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Gx(),r=kP(),i=iq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var d=u.__data__;if(!r||d.length{var n=Gx(),r=P_e(),i=T_e(),o=L_e(),a=A_e(),s=K_e();function l(u){var d=this.__data__=new n(u);this.size=d.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),Z_e=Ue((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),Q_e=Ue((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),J_e=Ue((e,t)=>{var n=iq(),r=Z_e(),i=Q_e();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),oq=Ue((e,t)=>{var n=J_e(),r=eke(),i=tke(),o=1,a=2;function s(l,u,d,h,m,v){var b=d&o,S=l.length,k=u.length;if(S!=k&&!(b&&k>S))return!1;var E=v.get(l),_=v.get(u);if(E&&_)return E==u&&_==l;var T=-1,A=!0,I=d&a?new n:void 0;for(v.set(l,u),v.set(u,l);++T{var n=pc(),r=n.Uint8Array;t.exports=r}),rke=Ue((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),ike=Ue((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),oke=Ue((e,t)=>{var n=_P(),r=nke(),i=JG(),o=oq(),a=rke(),s=ike(),l=1,u=2,d="[object Boolean]",h="[object Date]",m="[object Error]",v="[object Map]",b="[object Number]",S="[object RegExp]",k="[object Set]",E="[object String]",_="[object Symbol]",T="[object ArrayBuffer]",A="[object DataView]",I=n?n.prototype:void 0,R=I?I.valueOf:void 0;function D(j,z,V,K,te,q,$){switch(V){case A:if(j.byteLength!=z.byteLength||j.byteOffset!=z.byteOffset)return!1;j=j.buffer,z=z.buffer;case T:return!(j.byteLength!=z.byteLength||!q(new r(j),new r(z)));case d:case h:case b:return i(+j,+z);case m:return j.name==z.name&&j.message==z.message;case S:case E:return j==z+"";case v:var U=a;case k:var X=K&l;if(U||(U=s),j.size!=z.size&&!X)return!1;var Z=$.get(j);if(Z)return Z==z;K|=u,$.set(j,z);var W=o(U(j),U(z),K,te,q,$);return $.delete(j),W;case _:if(R)return R.call(j)==R.call(z)}return!1}t.exports=D}),ake=Ue((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),ske=Ue((e,t)=>{var n=ake(),r=EP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),lke=Ue((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),cke=Ue((e,t)=>{var n=lke(),r=uke(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),dke=Ue((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),fke=Ue((e,t)=>{var n=qx(),r=Xx(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),hke=Ue((e,t)=>{var n=fke(),r=Xx(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),pke=Ue((e,t)=>{function n(){return!1}t.exports=n}),aq=Ue((e,t)=>{var n=pc(),r=pke(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),gke=Ue((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a??n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),mke=Ue((e,t)=>{var n=qx(),r=sq(),i=Xx(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",h="[object Map]",m="[object Number]",v="[object Object]",b="[object RegExp]",S="[object Set]",k="[object String]",E="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",A="[object Float32Array]",I="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",j="[object Int32Array]",z="[object Uint8Array]",V="[object Uint8ClampedArray]",K="[object Uint16Array]",te="[object Uint32Array]",q={};q[A]=q[I]=q[R]=q[D]=q[j]=q[z]=q[V]=q[K]=q[te]=!0,q[o]=q[a]=q[_]=q[s]=q[T]=q[l]=q[u]=q[d]=q[h]=q[m]=q[v]=q[b]=q[S]=q[k]=q[E]=!1;function $(U){return i(U)&&r(U.length)&&!!q[n(U)]}t.exports=$}),vke=Ue((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),yke=Ue((e,t)=>{var n=eq(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s}),lq=Ue((e,t)=>{var n=mke(),r=vke(),i=yke(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),bke=Ue((e,t)=>{var n=dke(),r=hke(),i=EP(),o=aq(),a=gke(),s=lq(),l=Object.prototype,u=l.hasOwnProperty;function d(h,m){var v=i(h),b=!v&&r(h),S=!v&&!b&&o(h),k=!v&&!b&&!S&&s(h),E=v||b||S||k,_=E?n(h.length,String):[],T=_.length;for(var A in h)(m||u.call(h,A))&&!(E&&(A=="length"||S&&(A=="offset"||A=="parent")||k&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,T)))&&_.push(A);return _}t.exports=d}),Ske=Ue((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),xke=Ue((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),wke=Ue((e,t)=>{var n=xke(),r=n(Object.keys,Object);t.exports=r}),Cke=Ue((e,t)=>{var n=Ske(),r=wke(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),_ke=Ue((e,t)=>{var n=nq(),r=sq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),kke=Ue((e,t)=>{var n=bke(),r=Cke(),i=_ke();function o(a){return i(a)?n(a):r(a)}t.exports=o}),Eke=Ue((e,t)=>{var n=ske(),r=cke(),i=kke();function o(a){return n(a,i,r)}t.exports=o}),Pke=Ue((e,t)=>{var n=Eke(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,d,h,m){var v=u&r,b=n(s),S=b.length,k=n(l),E=k.length;if(S!=E&&!v)return!1;for(var _=S;_--;){var T=b[_];if(!(v?T in l:o.call(l,T)))return!1}var A=m.get(s),I=m.get(l);if(A&&I)return A==l&&I==s;var R=!0;m.set(s,l),m.set(l,s);for(var D=v;++_{var n=L0(),r=pc(),i=n(r,"DataView");t.exports=i}),Lke=Ue((e,t)=>{var n=L0(),r=pc(),i=n(r,"Promise");t.exports=i}),Ake=Ue((e,t)=>{var n=L0(),r=pc(),i=n(r,"Set");t.exports=i}),Oke=Ue((e,t)=>{var n=L0(),r=pc(),i=n(r,"WeakMap");t.exports=i}),Mke=Ue((e,t)=>{var n=Tke(),r=kP(),i=Lke(),o=Ake(),a=Oke(),s=qx(),l=rq(),u="[object Map]",d="[object Object]",h="[object Promise]",m="[object Set]",v="[object WeakMap]",b="[object DataView]",S=l(n),k=l(r),E=l(i),_=l(o),T=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=h||o&&A(new o)!=m||a&&A(new a)!=v)&&(A=function(I){var R=s(I),D=R==d?I.constructor:void 0,j=D?l(D):"";if(j)switch(j){case S:return b;case k:return u;case E:return h;case _:return m;case T:return v}return R}),t.exports=A}),Ike=Ue((e,t)=>{var n=X_e(),r=oq(),i=oke(),o=Pke(),a=Mke(),s=EP(),l=aq(),u=lq(),d=1,h="[object Arguments]",m="[object Array]",v="[object Object]",b=Object.prototype,S=b.hasOwnProperty;function k(E,_,T,A,I,R){var D=s(E),j=s(_),z=D?m:a(E),V=j?m:a(_);z=z==h?v:z,V=V==h?v:V;var K=z==v,te=V==v,q=z==V;if(q&&l(E)){if(!l(_))return!1;D=!0,K=!1}if(q&&!K)return R||(R=new n),D||u(E)?r(E,_,T,A,I,R):i(E,_,z,T,A,I,R);if(!(T&d)){var $=K&&S.call(E,"__wrapped__"),U=te&&S.call(_,"__wrapped__");if($||U){var X=$?E.value():E,Z=U?_.value():_;return R||(R=new n),I(X,Z,T,A,R)}}return q?(R||(R=new n),o(E,_,T,A,I,R)):!1}t.exports=k}),Rke=Ue((e,t)=>{var n=Ike(),r=Xx();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),uq=Ue((e,t)=>{var n=Rke();function r(i,o){return n(i,o)}t.exports=r}),Dke=["ctrl","shift","alt","meta","mod"],Nke={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function IC(e,t=","){return typeof e=="string"?e.split(t):e}function u2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>Nke[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!Dke.includes(o));return{...r,keys:i}}function jke(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function Bke(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function $ke(e){return cq(e,["input","textarea","select"])}function cq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function Fke(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var zke=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:d,metaKey:h,shiftKey:m,key:v,code:b}=e,S=b.toLowerCase().replace("key",""),k=v.toLowerCase();if(u!==r&&k!=="alt"||m!==s&&k!=="shift")return!1;if(a){if(!h&&!d)return!1}else if(h!==o&&S!=="meta"||d!==i&&S!=="ctrl")return!1;return l&&l.length===1&&(l.includes(k)||l.includes(S))?!0:l?l.every(E=>n.has(E)):!l},Hke=w.createContext(void 0),Vke=()=>w.useContext(Hke),Wke=w.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),Uke=()=>w.useContext(Wke),Gke=QG(uq());function qke(e){let t=w.useRef(void 0);return(0,Gke.default)(t.current,e)||(t.current=e),t.current}var gD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Je(e,t,n,r){let i=w.useRef(null),{current:o}=w.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=w.useCallback(t,[...s]),u=qke(a),{enabledScopes:d}=Uke(),h=Vke();return w.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!Fke(d,u==null?void 0:u.scopes))return;let m=S=>{var k;if(!($ke(S)&&!cq(S,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){gD(S);return}(k=S.target)!=null&&k.isContentEditable&&!(u!=null&&u.enableOnContentEditable)||IC(e,u==null?void 0:u.splitKey).forEach(E=>{var T;let _=u2(E,u==null?void 0:u.combinationKey);if(zke(S,_,o)||(T=_.keys)!=null&&T.includes("*")){if(jke(S,_,u==null?void 0:u.preventDefault),!Bke(S,_,u==null?void 0:u.enabled)){gD(S);return}l(S,_)}})}},v=S=>{o.add(S.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||u!=null&&u.keydown)&&m(S)},b=S=>{S.key.toLowerCase()!=="meta"?o.delete(S.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(S)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",v),h&&IC(e,u==null?void 0:u.splitKey).forEach(S=>h.addHotkey(u2(S,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",v),h&&IC(e,u==null?void 0:u.splitKey).forEach(S=>h.removeHotkey(u2(S,u==null?void 0:u.combinationKey)))}},[e,l,u,d]),i}QG(uq());var D8=new Set;function Yke(e){(Array.isArray(e)?e:[e]).forEach(t=>D8.add(u2(t)))}function Kke(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=u2(t);for(let i of D8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&D8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{Yke(e.key)}),document.addEventListener("keyup",e=>{Kke(e.key)})});function Xke(e){return gt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function Zke(e){return gt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function Qke(e){return gt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function dq(e){return gt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function fq(e){return gt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function Jke(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function eEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function hq(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function tEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function nEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function PP(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function pq(e){return gt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function o0(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function gq(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function rEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function TP(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function mq(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function iEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function oEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function vq(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function aEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function sEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function yq(e){return gt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function lEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function uEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function cEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function dEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"}}]})(e)}function bq(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function fEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function hEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function Sq(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function pEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function gEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function zy(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function mEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function vEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function yEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function LP(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function bEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function SEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function mD(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function AP(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function xEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function vp(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function wEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function Zx(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function CEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function OP(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const sn=e=>e.canvas,Mr=at([sn,Or,ir],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),xq=e=>e.canvas.layerState.objects.find(W5),yp=e=>e.gallery,_Ee=at([yp,Vx,Mr,Or],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,galleryWidth:b,shouldUseSingleGalleryColumn:S}=e,{isLightboxOpen:k}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,galleryGridTemplateColumns:S?"auto":`repeat(auto-fill, minmax(${d}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightboxOpen:k,isStaging:n,shouldEnableResize:!(k||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:S}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),kEe=at([yp,ir,Vx,Or],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),EEe=at(ir,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),eS=w.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Wh(),a=Me(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=he(EEe),d=w.useRef(null),h=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(N8e(e)),o()};Je("delete",()=>{s?i():m()},[e,s,l,u]);const v=b=>a(BU(!b.target.checked));return y.jsxs(y.Fragment,{children:[w.cloneElement(t,{onClick:e?h:void 0,ref:n}),y.jsx(AV,{isOpen:r,leastDestructiveRef:d,onClose:o,children:y.jsx(Kd,{children:y.jsxs(OV,{className:"modal",children:[y.jsx(w0,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),y.jsx(n0,{children:y.jsxs(Ge,{direction:"column",gap:5,children:[y.jsx(fn,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),y.jsx(dn,{children:y.jsxs(Ge,{alignItems:"center",children:[y.jsx(kn,{mb:0,children:"Don't ask me again"}),y.jsx(BE,{checked:!s,onChange:v})]})})]})}),y.jsxs(yx,{children:[y.jsx(as,{ref:d,onClick:o,className:"modal-close-btn",children:"Cancel"}),y.jsx(as,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})});eS.displayName="DeleteImageModal";const PEe=at([ir,yp,Fy,mp,Vx,Or],(e,t,n,r,i,o)=>{const{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u}=e,{upscalingLevel:d,facetoolStrength:h}=n,{isLightboxOpen:m}=i,{shouldShowImageDetails:v}=r,{intermediateImage:b,currentImage:S}=t;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:d,facetoolStrength:h,shouldDisableToolbarButtons:Boolean(b)||!S,currentImage:S,shouldShowImageDetails:v,activeTabName:o,isLightboxOpen:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),wq=()=>{var z,V,K,te,q,$;const e=Me(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightboxOpen:d,activeTabName:h}=he(PEe),m=Ry(),{t:v}=Ve(),b=()=>{u&&(d&&e(Bm(!1)),e(k0(u)),e(qo("img2img")))},S=async()=>{if(!u)return;const U=await fetch(u.url).then(Z=>Z.blob()),X=[new ClipboardItem({[U.type]:U})];await navigator.clipboard.write(X),m({title:v("toast:imageCopied"),status:"success",duration:2500,isClosable:!0})},k=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:v("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};Je("shift+i",()=>{u?(b(),m({title:v("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:imageNotLoaded"),description:v("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var U,X;u&&(u.metadata&&e(aU(u.metadata)),((U=u.metadata)==null?void 0:U.image.type)==="img2img"?e(qo("img2img")):((X=u.metadata)==null?void 0:X.image.type)==="txt2img"&&e(qo("txt2img")))};Je("a",()=>{var U,X;["txt2img","img2img"].includes((X=(U=u==null?void 0:u.metadata)==null?void 0:U.image)==null?void 0:X.type)?(E(),m({title:v("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:parametersNotSet"),description:v("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{u!=null&&u.metadata&&e(Ny(u.metadata.image.seed))};Je("s",()=>{var U,X;(X=(U=u==null?void 0:u.metadata)==null?void 0:U.image)!=null&&X.seed?(_(),m({title:v("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:seedNotSet"),description:v("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const T=()=>{var U,X,Z,W;if((X=(U=u==null?void 0:u.metadata)==null?void 0:U.image)!=null&&X.prompt){const[Q,ie]=aP((W=(Z=u==null?void 0:u.metadata)==null?void 0:Z.image)==null?void 0:W.prompt);Q&&e(Nx(Q)),e(Q2(ie||""))}};Je("p",()=>{var U,X;(X=(U=u==null?void 0:u.metadata)==null?void 0:U.image)!=null&&X.prompt?(T(),m({title:v("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:promptNotSet"),description:v("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const A=()=>{u&&e(R8e(u))};Je("Shift+U",()=>{i&&!s&&n&&!t&&o?A():m({title:v("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const I=()=>{u&&e(D8e(u))};Je("Shift+R",()=>{r&&!s&&n&&!t&&a?I():m({title:v("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(VU(!l)),D=()=>{u&&(d&&e(Bm(!1)),e(Dx(u)),e(vi(!0)),h!=="unifiedCanvas"&&e(qo("unifiedCanvas")),m({title:v("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};Je("i",()=>{u?R():m({title:v("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const j=()=>{e(Bm(!d))};return y.jsxs("div",{className:"current-image-options",children:[y.jsxs(oo,{isAttached:!0,children:[y.jsx(Zs,{trigger:"hover",triggerComponent:y.jsx(Qe,{"aria-label":`${v("parameters:sendTo")}...`,icon:y.jsx(SEe,{})}),children:y.jsxs("div",{className:"current-image-send-to-popover",children:[y.jsx(cr,{size:"sm",onClick:b,leftIcon:y.jsx(mD,{}),children:v("parameters:sendToImg2Img")}),y.jsx(cr,{size:"sm",onClick:D,leftIcon:y.jsx(mD,{}),children:v("parameters:sendToUnifiedCanvas")}),y.jsx(cr,{size:"sm",onClick:S,leftIcon:y.jsx(o0,{}),children:v("parameters:copyImage")}),y.jsx(cr,{size:"sm",onClick:k,leftIcon:y.jsx(o0,{}),children:v("parameters:copyImageToLink")}),y.jsx(Nh,{download:!0,href:u==null?void 0:u.url,children:y.jsx(cr,{leftIcon:y.jsx(TP,{}),size:"sm",w:"100%",children:v("parameters:downloadImage")})})]})}),y.jsx(Qe,{icon:y.jsx(oEe,{}),tooltip:d?`${v("parameters:closeViewer")} (Z)`:`${v("parameters:openInViewer")} (Z)`,"aria-label":d?`${v("parameters:closeViewer")} (Z)`:`${v("parameters:openInViewer")} (Z)`,"data-selected":d,onClick:j})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Qe,{icon:y.jsx(mEe,{}),tooltip:`${v("parameters:usePrompt")} (P)`,"aria-label":`${v("parameters:usePrompt")} (P)`,isDisabled:!((V=(z=u==null?void 0:u.metadata)==null?void 0:z.image)!=null&&V.prompt),onClick:T}),y.jsx(Qe,{icon:y.jsx(bEe,{}),tooltip:`${v("parameters:useSeed")} (S)`,"aria-label":`${v("parameters:useSeed")} (S)`,isDisabled:!((te=(K=u==null?void 0:u.metadata)==null?void 0:K.image)!=null&&te.seed),onClick:_}),y.jsx(Qe,{icon:y.jsx(tEe,{}),tooltip:`${v("parameters:useAll")} (A)`,"aria-label":`${v("parameters:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes(($=(q=u==null?void 0:u.metadata)==null?void 0:q.image)==null?void 0:$.type),onClick:E})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Zs,{trigger:"hover",triggerComponent:y.jsx(Qe,{icon:y.jsx(lEe,{}),"aria-label":v("parameters:restoreFaces")}),children:y.jsxs("div",{className:"current-image-postprocessing-popover",children:[y.jsx(wP,{}),y.jsx(cr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:I,children:v("parameters:restoreFaces")})]})}),y.jsx(Zs,{trigger:"hover",triggerComponent:y.jsx(Qe,{icon:y.jsx(iEe,{}),"aria-label":v("parameters:upscale")}),children:y.jsxs("div",{className:"current-image-postprocessing-popover",children:[y.jsx(CP,{}),y.jsx(cr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:A,children:v("parameters:upscaleImage")})]})})]}),y.jsx(oo,{isAttached:!0,children:y.jsx(Qe,{icon:y.jsx(pq,{}),tooltip:`${v("parameters:info")} (I)`,"aria-label":`${v("parameters:info")} (I)`,"data-selected":l,onClick:R})}),y.jsx(eS,{image:u,children:y.jsx(Qe,{icon:y.jsx(vp,{}),tooltip:`${v("parameters:deleteImage")} (Del)`,"aria-label":`${v("parameters:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};yt({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});yt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});yt({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});yt({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});yt({displayName:"SunIcon",path:N.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},N.createElement("circle",{cx:"12",cy:"12",r:"5"}),N.createElement("path",{d:"M12 1v2"}),N.createElement("path",{d:"M12 21v2"}),N.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),N.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),N.createElement("path",{d:"M1 12h2"}),N.createElement("path",{d:"M21 12h2"}),N.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),N.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))});yt({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});yt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:N.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});yt({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});yt({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});yt({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});yt({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});yt({displayName:"ViewIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),N.createElement("circle",{cx:"12",cy:"12",r:"2"}))});yt({displayName:"ViewOffIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),N.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))});yt({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});var TEe=yt({displayName:"DeleteIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"}))});yt({displayName:"RepeatIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),N.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))});yt({displayName:"RepeatClockIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),N.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))});var LEe=yt({displayName:"EditIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),N.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});yt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});yt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});yt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});yt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});yt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});yt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});yt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});yt({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});yt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var Cq=yt({displayName:"ExternalLinkIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),N.createElement("path",{d:"M15 3h6v6"}),N.createElement("path",{d:"M10 14L21 3"}))});yt({displayName:"LinkIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),N.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))});yt({displayName:"PlusSquareIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),N.createElement("path",{d:"M12 8v8"}),N.createElement("path",{d:"M8 12h8"}))});yt({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});yt({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});yt({displayName:"TimeIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),N.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))});yt({displayName:"ArrowRightIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),N.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))});yt({displayName:"ArrowLeftIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),N.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))});yt({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});yt({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});yt({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});yt({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});yt({displayName:"EmailIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),N.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))});yt({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});yt({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});yt({displayName:"SpinnerIcon",path:N.createElement(N.Fragment,null,N.createElement("defs",null,N.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},N.createElement("stop",{stopColor:"currentColor",offset:"0%"}),N.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),N.createElement("g",{transform:"translate(2)",fill:"none"},N.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),N.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),N.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))});yt({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});yt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:N.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});yt({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});yt({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});yt({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});yt({displayName:"InfoOutlineIcon",path:N.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},N.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),N.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),N.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))});yt({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});yt({displayName:"QuestionOutlineIcon",path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))});yt({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});yt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});yt({viewBox:"0 0 14 14",path:N.createElement("g",{fill:"currentColor"},N.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))});yt({displayName:"MinusIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))});yt({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function AEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Qn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>y.jsxs(Ge,{gap:2,children:[n&&y.jsx(uo,{label:`Recall ${e}`,children:y.jsx(ss,{"aria-label":"Use this parameter",icon:y.jsx(AEe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&y.jsx(uo,{label:`Copy ${e}`,children:y.jsx(ss,{"aria-label":`Copy ${e}`,icon:y.jsx(o0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),y.jsxs(Ge,{direction:i?"column":"row",children:[y.jsxs(fn,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?y.jsxs(Nh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",y.jsx(Cq,{mx:"2px"})]}):y.jsx(fn,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),OEe=(e,t)=>e.image.uuid===t.image.uuid,MP=w.memo(({image:e,styleClass:t})=>{var V,K;const n=Me();Je("esc",()=>{n(VU(!1))});const r=((V=e==null?void 0:e.metadata)==null?void 0:V.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:d,orig_path:h,perlin:m,postprocessing:v,prompt:b,sampler:S,seamless:k,seed:E,steps:_,strength:T,denoise_str:A,threshold:I,type:R,variations:D,width:j}=r,z=JSON.stringify(e.metadata,null,2);return y.jsx("div",{className:`image-metadata-viewer ${t}`,children:y.jsxs(Ge,{gap:1,direction:"column",width:"100%",children:[y.jsxs(Ge,{gap:2,children:[y.jsx(fn,{fontWeight:"semibold",children:"File:"}),y.jsxs(Nh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,y.jsx(Cq,{mx:"2px"})]})]}),Object.keys(r).length>0?y.jsxs(y.Fragment,{children:[R&&y.jsx(Qn,{label:"Generation type",value:R}),((K=e.metadata)==null?void 0:K.model_weights)&&y.jsx(Qn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(R)&&y.jsx(Qn,{label:"Original image",value:h}),b&&y.jsx(Qn,{label:"Prompt",labelPosition:"top",value:i2(b),onClick:()=>n(Nx(b))}),E!==void 0&&y.jsx(Qn,{label:"Seed",value:E,onClick:()=>n(Ny(E))}),I!==void 0&&y.jsx(Qn,{label:"Noise Threshold",value:I,onClick:()=>n(vU(I))}),m!==void 0&&y.jsx(Qn,{label:"Perlin Noise",value:m,onClick:()=>n(dU(m))}),S&&y.jsx(Qn,{label:"Sampler",value:S,onClick:()=>n(fU(S))}),_&&y.jsx(Qn,{label:"Steps",value:_,onClick:()=>n(mU(_))}),o!==void 0&&y.jsx(Qn,{label:"CFG scale",value:o,onClick:()=>n(sU(o))}),D&&D.length>0&&y.jsx(Qn,{label:"Seed-weight pairs",value:Y5(D),onClick:()=>n(pU(Y5(D)))}),k&&y.jsx(Qn,{label:"Seamless",value:k,onClick:()=>n(hU(k))}),l&&y.jsx(Qn,{label:"High Resolution Optimization",value:l,onClick:()=>n(lP(l))}),j&&y.jsx(Qn,{label:"Width",value:j,onClick:()=>n(yU(j))}),s&&y.jsx(Qn,{label:"Height",value:s,onClick:()=>n(lU(s))}),u&&y.jsx(Qn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(k0(u))}),d&&y.jsx(Qn,{label:"Mask image",value:d,isLink:!0,onClick:()=>n(cU(d))}),R==="img2img"&&T&&y.jsx(Qn,{label:"Image to image strength",value:T,onClick:()=>n(l8(T))}),a&&y.jsx(Qn,{label:"Image to image fit",value:a,onClick:()=>n(gU(a))}),v&&v.length>0&&y.jsxs(y.Fragment,{children:[y.jsx(Dh,{size:"sm",children:"Postprocessing"}),v.map((te,q)=>{if(te.type==="esrgan"){const{scale:$,strength:U,denoise_str:X}=te;return y.jsxs(Ge,{pl:"2rem",gap:1,direction:"column",children:[y.jsx(fn,{size:"md",children:`${q+1}: Upscale (ESRGAN)`}),y.jsx(Qn,{label:"Scale",value:$,onClick:()=>n(wU($))}),y.jsx(Qn,{label:"Strength",value:U,onClick:()=>n(d8(U))}),X!==void 0&&y.jsx(Qn,{label:"Denoising strength",value:X,onClick:()=>n(c8(X))})]},q)}else if(te.type==="gfpgan"){const{strength:$}=te;return y.jsxs(Ge,{pl:"2rem",gap:1,direction:"column",children:[y.jsx(fn,{size:"md",children:`${q+1}: Face restoration (GFPGAN)`}),y.jsx(Qn,{label:"Strength",value:$,onClick:()=>{n(u8($)),n(I4("gfpgan"))}})]},q)}else if(te.type==="codeformer"){const{strength:$,fidelity:U}=te;return y.jsxs(Ge,{pl:"2rem",gap:1,direction:"column",children:[y.jsx(fn,{size:"md",children:`${q+1}: Face restoration (Codeformer)`}),y.jsx(Qn,{label:"Strength",value:$,onClick:()=>{n(u8($)),n(I4("codeformer"))}}),U&&y.jsx(Qn,{label:"Fidelity",value:U,onClick:()=>{n(xU(U)),n(I4("codeformer"))}})]},q)}})]}),i&&y.jsx(Qn,{withCopy:!0,label:"Dream Prompt",value:i}),y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsxs(Ge,{gap:2,children:[y.jsx(uo,{label:"Copy metadata JSON",children:y.jsx(ss,{"aria-label":"Copy metadata JSON",icon:y.jsx(o0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),y.jsx(fn,{fontWeight:"semibold",children:"Metadata JSON:"})]}),y.jsx("div",{className:"image-json-viewer",children:y.jsx("pre",{children:z})})]})]}):y.jsx(uF,{width:"100%",pt:10,children:y.jsx(fn,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},OEe);MP.displayName="ImageMetadataViewer";const _q=at([yp,mp],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var d;return u.uuid===((d=e==null?void 0:e.currentImage)==null?void 0:d.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function MEe(){const e=Me(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=he(_q),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(oP())},h=()=>{e(iP())};return y.jsxs("div",{className:"current-image-preview",children:[i&&y.jsx(KS,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&y.jsxs("div",{className:"current-image-next-prev-buttons",children:[y.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&y.jsx(ss,{"aria-label":"Previous image",icon:y.jsx(dq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),y.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&y.jsx(ss,{"aria-label":"Next image",icon:y.jsx(fq,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),r&&i&&y.jsx(MP,{image:i,styleClass:"current-image-metadata"})]})}var IEe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=globalThis&&globalThis.__assign||function(){return ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},FEe=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],xD="__resizable_base__",kq=function(e){NEe(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(xD):o.className+=xD,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;o&&o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||jEe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),d=u/l[s]*100;return d+"%"}return RC(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?RC(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?RC(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&Ng("left",o),s=i&&Ng("top",o),l,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=a?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,h=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,v=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,S=u||0;if(s){var k=(m-b)*this.ratio+S,E=(v-b)*this.ratio+S,_=(d-S)/this.ratio+b,T=(h-S)/this.ratio+b,A=Math.max(d,k),I=Math.min(h,E),R=Math.max(m,_),D=Math.min(v,T);n=Wb(n,A,I),r=Wb(r,R,D)}else n=Wb(n,d,h),r=Wb(r,m,v);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&BEe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Ub(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Nl(Nl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(h)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Ub(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Ub(n)?n.touches[0].clientX:n.clientX,d=Ub(n)?n.touches[0].clientY:n.clientY,h=this.state,m=h.direction,v=h.original,b=h.width,S=h.height,k=this.getParentSize(),E=$Ee(k,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=E.maxWidth,a=E.maxHeight,s=E.minWidth,l=E.minHeight;var _=this.calculateNewSizeFromDirection(u,d),T=_.newHeight,A=_.newWidth,I=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=SD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=SD(T,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(A,T,{width:I.maxWidth,height:I.maxHeight},{width:s,height:l});if(A=R.newWidth,T=R.newHeight,this.props.grid){var D=bD(A,this.props.grid[0]),j=bD(T,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,T=z===0||Math.abs(j-T)<=z?j:T}var V={width:A-v.width,height:T-v.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var K=A/k.width*100;A=K+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var q=A/this.window.innerHeight*100;A=q+"vh"}}if(S&&typeof S=="string"){if(S.endsWith("%")){var K=T/k.height*100;T=K+"%"}else if(S.endsWith("vw")){var te=T/this.window.innerWidth*100;T=te+"vw"}else if(S.endsWith("vh")){var q=T/this.window.innerHeight*100;T=q+"vh"}}var $={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?$.flexBasis=$.width:this.flexDir==="column"&&($.flexBasis=$.height),Qs.flushSync(function(){r.setState($)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,V)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Nl(Nl({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(h){return i[h]!==!1?w.createElement(DEe,{key:h,direction:h,onResizeStart:n.onResizeStart,replaceStyles:o&&o[h],className:a&&a[h]},u&&u[h]?u[h]:null):null});return w.createElement("div",{className:l,style:s},d)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return FEe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Nl(Nl(Nl({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return w.createElement(o,Nl({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&w.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(w.PureComponent);const er=e=>{const{label:t,styleClass:n,...r}=e;return y.jsx(Q$,{className:`invokeai__checkbox ${n}`,...r,children:t})};function Eq(e){return gt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function Pq(e){return gt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function zEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function HEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function VEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function WEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function Tq(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function UEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function GEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function qEe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function YEe(e,t){e.classList?e.classList.add(t):qEe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function wD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function KEe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=wD(e.className,t):e.setAttribute("class",wD(e.className&&e.className.baseVal||"",t))}const CD={disabled:!1},Lq=N.createContext(null);var Aq=function(t){return t.scrollTop},Mv="unmounted",ph="exited",gh="entering",zg="entered",N8="exiting",gc=function(e){yE(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=ph,o.appearStatus=gh):l=zg:r.unmountOnExit||r.mountOnEnter?l=Mv:l=ph,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Mv?{status:ph}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==gh&&a!==zg&&(o=gh):(a===gh||a===zg)&&(o=N8)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===gh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:vb.findDOMNode(this);a&&Aq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ph&&this.setState({status:Mv})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[vb.findDOMNode(this),s],u=l[0],d=l[1],h=this.getTimeouts(),m=s?h.appear:h.enter;if(!i&&!a||CD.disabled){this.safeSetState({status:zg},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:gh},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:zg},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:vb.findDOMNode(this);if(!o||CD.disabled){this.safeSetState({status:ph},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:N8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:ph},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:vb.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Mv)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=gE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return N.createElement(Lq.Provider,{value:null},typeof a=="function"?a(i,s):N.cloneElement(N.Children.only(a),s))},t}(N.Component);gc.contextType=Lq;gc.propTypes={};function jg(){}gc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:jg,onEntering:jg,onEntered:jg,onExit:jg,onExiting:jg,onExited:jg};gc.UNMOUNTED=Mv;gc.EXITED=ph;gc.ENTERING=gh;gc.ENTERED=zg;gc.EXITING=N8;const XEe=gc;var ZEe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return YEe(t,r)})},DC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return KEe(t,r)})},IP=function(e){yE(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ab,Object.values(b));return w.createElement(S.Provider,{value:k},v)}function d(h,m){const v=(m==null?void 0:m[e][l])||s,b=w.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const i=()=>{const o=n.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,QEe(i,...t)]}function QEe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...s,...h}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function JEe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Mq(...e){return t=>e.forEach(n=>JEe(n,t))}function fs(...e){return w.useCallback(Mq(...e),e)}const oy=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),o=i.find(tPe);if(o){const a=o.props.children,s=i.map(l=>l===o?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return w.createElement(j8,bn({},r,{ref:t}),w.isValidElement(a)?w.cloneElement(a,void 0,s):null)}return w.createElement(j8,bn({},r,{ref:t}),n)});oy.displayName="Slot";const j8=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...nPe(r,n.props),ref:Mq(t,n.ref)}):w.Children.count(n)>1?w.Children.only(null):null});j8.displayName="SlotClone";const ePe=({children:e})=>w.createElement(w.Fragment,null,e);function tPe(e){return w.isValidElement(e)&&e.type===ePe}function nPe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const rPe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],ac=rPe.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?oy:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(s,bn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Iq(e,t){e&&Qs.flushSync(()=>e.dispatchEvent(t))}function Rq(e){const t=e+"CollectionProvider",[n,r]=Hy(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:S}=v,k=N.useRef(null),E=N.useRef(new Map).current;return N.createElement(i,{scope:b,itemMap:E,collectionRef:k},S)},s=e+"CollectionSlot",l=N.forwardRef((v,b)=>{const{scope:S,children:k}=v,E=o(s,S),_=fs(b,E.collectionRef);return N.createElement(oy,{ref:_},k)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=N.forwardRef((v,b)=>{const{scope:S,children:k,...E}=v,_=N.useRef(null),T=fs(b,_),A=o(u,S);return N.useEffect(()=>(A.itemMap.set(_,{ref:_,...E}),()=>void A.itemMap.delete(_))),N.createElement(oy,{[d]:"",ref:T},k)});function m(v){const b=o(e+"CollectionConsumer",v);return N.useCallback(()=>{const k=b.collectionRef.current;if(!k)return[];const E=Array.from(k.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((A,I)=>E.indexOf(A.ref.current)-E.indexOf(I.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:h},m,r]}const iPe=w.createContext(void 0);function Dq(e){const t=w.useContext(iPe);return e||t||"ltr"}function uu(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function oPe(e,t=globalThis==null?void 0:globalThis.document){const n=uu(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const B8="dismissableLayer.update",aPe="dismissableLayer.pointerDownOutside",sPe="dismissableLayer.focusOutside";let _D;const lPe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),uPe=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=w.useContext(lPe),[h,m]=w.useState(null),v=(n=h==null?void 0:h.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=w.useState({}),S=fs(t,j=>m(j)),k=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=k.indexOf(E),T=h?k.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,I=T>=_,R=cPe(j=>{const z=j.target,V=[...d.branches].some(K=>K.contains(z));!I||V||(o==null||o(j),s==null||s(j),j.defaultPrevented||l==null||l())},v),D=dPe(j=>{const z=j.target;[...d.branches].some(K=>K.contains(z))||(a==null||a(j),s==null||s(j),j.defaultPrevented||l==null||l())},v);return oPe(j=>{T===d.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},v),w.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(_D=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),kD(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=_D)}},[h,v,r,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),kD())},[h,d]),w.useEffect(()=>{const j=()=>b({});return document.addEventListener(B8,j),()=>document.removeEventListener(B8,j)},[]),w.createElement(ac.div,bn({},u,{ref:S,style:{pointerEvents:A?I?"auto":"none":void 0,...e.style},onFocusCapture:rr(e.onFocusCapture,D.onFocusCapture),onBlurCapture:rr(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:rr(e.onPointerDownCapture,R.onPointerDownCapture)}))});function cPe(e,t=globalThis==null?void 0:globalThis.document){const n=uu(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){Nq(aPe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function dPe(e,t=globalThis==null?void 0:globalThis.document){const n=uu(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&Nq(sPe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function kD(){const e=new CustomEvent(B8);document.dispatchEvent(e)}function Nq(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Iq(i,o):i.dispatchEvent(o)}let NC=0;function fPe(){w.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:ED()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:ED()),NC++,()=>{NC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),NC--}},[])}function ED(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const jC="focusScope.autoFocusOnMount",BC="focusScope.autoFocusOnUnmount",PD={bubbles:!1,cancelable:!0},hPe=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=w.useState(null),u=uu(i),d=uu(o),h=w.useRef(null),m=fs(t,S=>l(S)),v=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let S=function(E){if(v.paused||!s)return;const _=E.target;s.contains(_)?h.current=_:mh(h.current,{select:!0})},k=function(E){v.paused||!s||s.contains(E.relatedTarget)||mh(h.current,{select:!0})};return document.addEventListener("focusin",S),document.addEventListener("focusout",k),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",k)}}},[r,s,v.paused]),w.useEffect(()=>{if(s){LD.add(v);const S=document.activeElement;if(!s.contains(S)){const E=new CustomEvent(jC,PD);s.addEventListener(jC,u),s.dispatchEvent(E),E.defaultPrevented||(pPe(bPe(jq(s)),{select:!0}),document.activeElement===S&&mh(s))}return()=>{s.removeEventListener(jC,u),setTimeout(()=>{const E=new CustomEvent(BC,PD);s.addEventListener(BC,d),s.dispatchEvent(E),E.defaultPrevented||mh(S??document.body,{select:!0}),s.removeEventListener(BC,d),LD.remove(v)},0)}}},[s,u,d,v]);const b=w.useCallback(S=>{if(!n&&!r||v.paused)return;const k=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,E=document.activeElement;if(k&&E){const _=S.currentTarget,[T,A]=gPe(_);T&&A?!S.shiftKey&&E===A?(S.preventDefault(),n&&mh(T,{select:!0})):S.shiftKey&&E===T&&(S.preventDefault(),n&&mh(A,{select:!0})):E===_&&S.preventDefault()}},[n,r,v.paused]);return w.createElement(ac.div,bn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function pPe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mh(r,{select:t}),document.activeElement!==n)return}function gPe(e){const t=jq(e),n=TD(t,e),r=TD(t.reverse(),e);return[n,r]}function jq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function TD(e,t){for(const n of e)if(!mPe(n,{upTo:t}))return n}function mPe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function vPe(e){return e instanceof HTMLInputElement&&"select"in e}function mh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vPe(e)&&t&&e.select()}}const LD=yPe();function yPe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=AD(e,t),e.unshift(t)},remove(t){var n;e=AD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function AD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bPe(e){return e.filter(t=>t.tagName!=="A")}const a0=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:()=>{},SPe=XC["useId".toString()]||(()=>{});let xPe=0;function wPe(e){const[t,n]=w.useState(SPe());return a0(()=>{e||n(r=>r??String(xPe++))},[e]),e||(t?`radix-${t}`:"")}function A0(e){return e.split("-")[0]}function Qx(e){return e.split("-")[1]}function O0(e){return["top","bottom"].includes(A0(e))?"x":"y"}function RP(e){return e==="y"?"height":"width"}function OD(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=O0(t),l=RP(s),u=r[l]/2-i[l]/2,d=s==="x";let h;switch(A0(t)){case"top":h={x:o,y:r.y-i.height};break;case"bottom":h={x:o,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:a};break;case"left":h={x:r.x-i.width,y:a};break;default:h={x:r.x,y:r.y}}switch(Qx(t)){case"start":h[s]-=u*(n&&d?-1:1);break;case"end":h[s]+=u*(n&&d?-1:1)}return h}const CPe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=OD(l,r,s),h=r,m={},v=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=Bq(r),d={x:i,y:o},h=O0(a),m=Qx(a),v=RP(h),b=await l.getDimensions(n),S=h==="y"?"top":"left",k=h==="y"?"bottom":"right",E=s.reference[v]+s.reference[h]-d[h]-s.floating[v],_=d[h]-s.reference[h],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=T?h==="y"?T.clientHeight||0:T.clientWidth||0:0;A===0&&(A=s.floating[v]);const I=E/2-_/2,R=u[S],D=A-b[v]-u[k],j=A/2-b[v]/2+I,z=$8(R,j,D),V=(m==="start"?u[S]:u[k])>0&&j!==z&&s.reference[v]<=s.floating[v];return{[h]:d[h]-(V?jEPe[t])}function PPe(e,t,n){n===void 0&&(n=!1);const r=Qx(e),i=O0(e),o=RP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=rS(a)),{main:a,cross:rS(a)}}const TPe={start:"end",end:"start"};function ID(e){return e.replace(/start|end/g,t=>TPe[t])}const $q=["top","right","bottom","left"];$q.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const LPe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...b}=e,S=A0(r),k=h||(S===a||!v?[rS(a)]:function(j){const z=rS(j);return[ID(j),z,ID(z)]}(a)),E=[a,...k],_=await nS(t,b),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(_[S]),d){const{main:j,cross:z}=PPe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));T.push(_[j],_[z])}if(A=[...A,{placement:r,overflows:T}],!T.every(j=>j<=0)){var I,R;const j=((I=(R=i.flip)==null?void 0:R.index)!=null?I:0)+1,z=E[j];if(z)return{data:{index:j,overflows:A},reset:{placement:z}};let V="bottom";switch(m){case"bestFit":{var D;const K=(D=A.map(te=>[te,te.overflows.filter(q=>q>0).reduce((q,$)=>q+$,0)]).sort((te,q)=>te[1]-q[1])[0])==null?void 0:D[0].placement;K&&(V=K);break}case"initialPlacement":V=a}if(r!==V)return{reset:{placement:V}}}return{}}}};function RD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function DD(e){return $q.some(t=>e[t]>=0)}const APe=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=RD(await nS(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:DD(o)}}}case"escaped":{const o=RD(await nS(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:o,escaped:DD(o)}}}default:return{}}}}},OPe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),h=A0(s),m=Qx(s),v=O0(s)==="x",b=["left","top"].includes(h)?-1:1,S=d&&v?-1:1,k=typeof a=="function"?a(o):a;let{mainAxis:E,crossAxis:_,alignmentAxis:T}=typeof k=="number"?{mainAxis:k,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...k};return m&&typeof T=="number"&&(_=m==="end"?-1*T:T),v?{x:_*S,y:E*b}:{x:E*b,y:_*S}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function Fq(e){return e==="x"?"y":"x"}const MPe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:k=>{let{x:E,y:_}=k;return{x:E,y:_}}},...l}=e,u={x:n,y:r},d=await nS(t,l),h=O0(A0(i)),m=Fq(h);let v=u[h],b=u[m];if(o){const k=h==="y"?"bottom":"right";v=$8(v+d[h==="y"?"top":"left"],v,v-d[k])}if(a){const k=m==="y"?"bottom":"right";b=$8(b+d[m==="y"?"top":"left"],b,b-d[k])}const S=s.fn({...t,[h]:v,[m]:b});return{...S,data:{x:S.x-n,y:S.y-r}}}}},IPe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,d={x:n,y:r},h=O0(i),m=Fq(h);let v=d[h],b=d[m];const S=typeof s=="function"?s({...o,placement:i}):s,k=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(l){const I=h==="y"?"height":"width",R=o.reference[h]-o.floating[I]+k.mainAxis,D=o.reference[h]+o.reference[I]-k.mainAxis;vD&&(v=D)}if(u){var E,_,T,A;const I=h==="y"?"width":"height",R=["top","left"].includes(A0(i)),D=o.reference[m]-o.floating[I]+(R&&(E=(_=a.offset)==null?void 0:_[m])!=null?E:0)+(R?0:k.crossAxis),j=o.reference[m]+o.reference[I]+(R?0:(T=(A=a.offset)==null?void 0:A[m])!=null?T:0)-(R?k.crossAxis:0);bj&&(b=j)}return{[h]:v,[m]:b}}}};function zq(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function mc(e){if(e==null)return window;if(!zq(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Vy(e){return mc(e).getComputedStyle(e)}function Xu(e){return zq(e)?"":e?(e.nodeName||"").toLowerCase():""}function Hq(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function cu(e){return e instanceof mc(e).HTMLElement}function Jd(e){return e instanceof mc(e).Element}function DP(e){return typeof ShadowRoot>"u"?!1:e instanceof mc(e).ShadowRoot||e instanceof ShadowRoot}function Jx(e){const{overflow:t,overflowX:n,overflowY:r}=Vy(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function RPe(e){return["table","td","th"].includes(Xu(e))}function ND(e){const t=/firefox/i.test(Hq()),n=Vy(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function Vq(){return!/^((?!chrome|android).)*safari/i.test(Hq())}const jD=Math.min,c2=Math.max,iS=Math.round;function Zu(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&cu(e)&&(l=e.offsetWidth>0&&iS(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&iS(s.height)/e.offsetHeight||1);const d=Jd(e)?mc(e):window,h=!Vq()&&n,m=(s.left+(h&&(r=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,v=(s.top+(h&&(o=(a=d.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,S=s.height/u;return{width:b,height:S,top:v,right:m+b,bottom:v+S,left:m,x:m,y:v}}function zd(e){return(t=e,(t instanceof mc(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function ew(e){return Jd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Wq(e){return Zu(zd(e)).left+ew(e).scrollLeft}function DPe(e,t,n){const r=cu(t),i=zd(t),o=Zu(e,r&&function(l){const u=Zu(l);return iS(u.width)!==l.offsetWidth||iS(u.height)!==l.offsetHeight}(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Xu(t)!=="body"||Jx(i))&&(a=ew(t)),cu(t)){const l=Zu(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=Wq(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function Uq(e){return Xu(e)==="html"?e:e.assignedSlot||e.parentNode||(DP(e)?e.host:null)||zd(e)}function BD(e){return cu(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function F8(e){const t=mc(e);let n=BD(e);for(;n&&RPe(n)&&getComputedStyle(n).position==="static";)n=BD(n);return n&&(Xu(n)==="html"||Xu(n)==="body"&&getComputedStyle(n).position==="static"&&!ND(n))?t:n||function(r){let i=Uq(r);for(DP(i)&&(i=i.host);cu(i)&&!["html","body"].includes(Xu(i));){if(ND(i))return i;i=i.parentNode}return null}(e)||t}function $D(e){if(cu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Zu(e);return{width:t.width,height:t.height}}function Gq(e){const t=Uq(e);return["html","body","#document"].includes(Xu(t))?e.ownerDocument.body:cu(t)&&Jx(t)?t:Gq(t)}function oS(e,t){var n;t===void 0&&(t=[]);const r=Gq(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=mc(r),a=i?[o].concat(o.visualViewport||[],Jx(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(oS(a))}function FD(e,t,n){return t==="viewport"?tS(function(r,i){const o=mc(r),a=zd(r),s=o.visualViewport;let l=a.clientWidth,u=a.clientHeight,d=0,h=0;if(s){l=s.width,u=s.height;const m=Vq();(m||!m&&i==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}return{width:l,height:u,x:d,y:h}}(e,n)):Jd(t)?function(r,i){const o=Zu(r,!1,i==="fixed"),a=o.top+r.clientTop,s=o.left+r.clientLeft;return{top:a,left:s,x:s,y:a,right:s+r.clientWidth,bottom:a+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):tS(function(r){var i;const o=zd(r),a=ew(r),s=(i=r.ownerDocument)==null?void 0:i.body,l=c2(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=c2(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let d=-a.scrollLeft+Wq(r);const h=-a.scrollTop;return Vy(s||o).direction==="rtl"&&(d+=c2(o.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:d,y:h}}(zd(e)))}function NPe(e){const t=oS(e),n=["absolute","fixed"].includes(Vy(e).position)&&cu(e)?F8(e):e;return Jd(n)?t.filter(r=>Jd(r)&&function(i,o){const a=o.getRootNode==null?void 0:o.getRootNode();if(i.contains(o))return!0;if(a&&DP(a)){let s=o;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Xu(r)!=="body"):[]}const jPe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?NPe(t):[].concat(n),r],a=o[0],s=o.reduce((l,u)=>{const d=FD(t,u,i);return l.top=c2(d.top,l.top),l.right=jD(d.right,l.right),l.bottom=jD(d.bottom,l.bottom),l.left=c2(d.left,l.left),l},FD(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=cu(n),o=zd(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Xu(n)!=="body"||Jx(o))&&(a=ew(n)),cu(n))){const l=Zu(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:Jd,getDimensions:$D,getOffsetParent:F8,getDocumentElement:zd,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:DPe(t,F8(n),r),floating:{...$D(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Vy(e).direction==="rtl"};function BPe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,d=l||u?[...Jd(e)?oS(e):[],...oS(t)]:[];d.forEach(b=>{l&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});let h,m=null;if(a){let b=!0;m=new ResizeObserver(()=>{b||n(),b=!1}),Jd(e)&&!s&&m.observe(e),m.observe(t)}let v=s?Zu(e):null;return s&&function b(){const S=Zu(e);!v||S.x===v.x&&S.y===v.y&&S.width===v.width&&S.height===v.height||n(),v=S,h=requestAnimationFrame(b)}(),n(),()=>{var b;d.forEach(S=>{l&&S.removeEventListener("scroll",n),u&&S.removeEventListener("resize",n)}),(b=m)==null||b.disconnect(),m=null,s&&cancelAnimationFrame(h)}}const $Pe=(e,t,n)=>CPe(e,t,{platform:jPe,...n});var z8=typeof document<"u"?w.useLayoutEffect:w.useEffect;function H8(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!H8(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!H8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function FPe(e){const t=w.useRef(e);return z8(()=>{t.current=e}),t}function zPe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=w.useRef(null),a=w.useRef(null),s=FPe(i),l=w.useRef(null),[u,d]=w.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,m]=w.useState(t);H8(h==null?void 0:h.map(T=>{let{options:A}=T;return A}),t==null?void 0:t.map(T=>{let{options:A}=T;return A}))||m(t);const v=w.useCallback(()=>{!o.current||!a.current||$Pe(o.current,a.current,{middleware:h,placement:n,strategy:r}).then(T=>{b.current&&Qs.flushSync(()=>{d(T)})})},[h,n,r]);z8(()=>{b.current&&v()},[v]);const b=w.useRef(!1);z8(()=>(b.current=!0,()=>{b.current=!1}),[]);const S=w.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const T=s.current(o.current,a.current,v);l.current=T}else v()},[v,s]),k=w.useCallback(T=>{o.current=T,S()},[S]),E=w.useCallback(T=>{a.current=T,S()},[S]),_=w.useMemo(()=>({reference:o,floating:a}),[]);return w.useMemo(()=>({...u,update:v,refs:_,reference:k,floating:E}),[u,v,_,k,E])}const HPe=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?MD({element:t.current,padding:n}).fn(i):{}:t?MD({element:t,padding:n}).fn(i):{}}}};function VPe(e){const[t,n]=w.useState(void 0);return a0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const qq="Popper",[NP,Yq]=Hy(qq),[WPe,Kq]=NP(qq),UPe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return w.createElement(WPe,{scope:t,anchor:r,onAnchorChange:i},n)},GPe="PopperAnchor",qPe=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Kq(GPe,n),a=w.useRef(null),s=fs(t,a);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:w.createElement(ac.div,bn({},i,{ref:s}))}),aS="PopperContent",[YPe,Cze]=NP(aS),[KPe,XPe]=NP(aS,{hasParent:!1,positionUpdateFns:new Set}),ZPe=w.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:d,side:h="bottom",sideOffset:m=0,align:v="center",alignOffset:b=0,arrowPadding:S=0,collisionBoundary:k=[],collisionPadding:E=0,sticky:_="partial",hideWhenDetached:T=!1,avoidCollisions:A=!0,...I}=e,R=Kq(aS,d),[D,j]=w.useState(null),z=fs(t,ae=>j(ae)),[V,K]=w.useState(null),te=VPe(V),q=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,$=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,U=h+(v!=="center"?"-"+v:""),X=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},Z=Array.isArray(k)?k:[k],W=Z.length>0,Q={padding:X,boundary:Z.filter(JPe),altBoundary:W},{reference:ie,floating:fe,strategy:Se,x:Pe,y:ye,placement:We,middlewareData:De,update:ot}=zPe({strategy:"fixed",placement:U,whileElementsMounted:BPe,middleware:[OPe({mainAxis:m+$,alignmentAxis:b}),A?MPe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?IPe():void 0,...Q}):void 0,V?HPe({element:V,padding:S}):void 0,A?LPe({...Q}):void 0,eTe({arrowWidth:q,arrowHeight:$}),T?APe({strategy:"referenceHidden"}):void 0].filter(QPe)});a0(()=>{ie(R.anchor)},[ie,R.anchor]);const He=Pe!==null&&ye!==null,[Be,wt]=Xq(We),st=(i=De.arrow)===null||i===void 0?void 0:i.x,mt=(o=De.arrow)===null||o===void 0?void 0:o.y,St=((a=De.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Le,lt]=w.useState();a0(()=>{D&<(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Mt,positionUpdateFns:ut}=XPe(aS,d),_t=!Mt;w.useLayoutEffect(()=>{if(!_t)return ut.add(ot),()=>{ut.delete(ot)}},[_t,ut,ot]),w.useLayoutEffect(()=>{_t&&He&&Array.from(ut).reverse().forEach(ae=>requestAnimationFrame(ae))},[_t,He,ut]);const ln={"data-side":Be,"data-align":wt,...I,ref:z,style:{...I.style,animation:He?void 0:"none",opacity:(s=De.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return w.createElement("div",{ref:fe,"data-radix-popper-content-wrapper":"",style:{position:Se,left:0,top:0,transform:He?`translate3d(${Math.round(Pe)}px, ${Math.round(ye)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Le,["--radix-popper-transform-origin"]:[(l=De.transformOrigin)===null||l===void 0?void 0:l.x,(u=De.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},w.createElement(YPe,{scope:d,placedSide:Be,onArrowChange:K,arrowX:st,arrowY:mt,shouldHideArrow:St},_t?w.createElement(KPe,{scope:d,hasParent:!0,positionUpdateFns:ut},w.createElement(ac.div,ln)):w.createElement(ac.div,ln)))});function QPe(e){return e!==void 0}function JPe(e){return e!==null}const eTe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,h=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=h?0:e.arrowWidth,v=h?0:e.arrowHeight,[b,S]=Xq(s),k={start:"0%",center:"50%",end:"100%"}[S],E=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+v/2;let T="",A="";return b==="bottom"?(T=h?k:`${E}px`,A=`${-v}px`):b==="top"?(T=h?k:`${E}px`,A=`${l.floating.height+v}px`):b==="right"?(T=`${-v}px`,A=h?k:`${_}px`):b==="left"&&(T=`${l.floating.width+v}px`,A=h?k:`${_}px`),{data:{x:T,y:A}}}});function Xq(e){const[t,n="center"]=e.split("-");return[t,n]}const tTe=UPe,nTe=qPe,rTe=ZPe;function iTe(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Zq=e=>{const{present:t,children:n}=e,r=oTe(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=fs(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};Zq.displayName="Presence";function oTe(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[s,l]=iTe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=qb(r.current);o.current=s==="mounted"?u:"none"},[s]),a0(()=>{const u=r.current,d=i.current;if(d!==e){const m=o.current,v=qb(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),a0(()=>{if(t){const u=h=>{const v=qb(r.current).includes(h.animationName);h.target===t&&v&&Qs.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(o.current=qb(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function qb(e){return(e==null?void 0:e.animationName)||"none"}function aTe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=sTe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=uu(n),l=w.useCallback(u=>{if(o){const h=typeof u=="function"?u(e):u;h!==e&&s(h)}else i(u)},[o,e,i,s]);return[a,l]}function sTe({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),o=uu(t);return w.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const $C="rovingFocusGroup.onEntryFocus",lTe={bubbles:!1,cancelable:!0},jP="RovingFocusGroup",[V8,Qq,uTe]=Rq(jP),[cTe,Jq]=Hy(jP,[uTe]),[dTe,fTe]=cTe(jP),hTe=w.forwardRef((e,t)=>w.createElement(V8.Provider,{scope:e.__scopeRovingFocusGroup},w.createElement(V8.Slot,{scope:e.__scopeRovingFocusGroup},w.createElement(pTe,bn({},e,{ref:t}))))),pTe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=w.useRef(null),m=fs(t,h),v=Dq(o),[b=null,S]=aTe({prop:a,defaultProp:s,onChange:l}),[k,E]=w.useState(!1),_=uu(u),T=Qq(n),A=w.useRef(!1),[I,R]=w.useState(0);return w.useEffect(()=>{const D=h.current;if(D)return D.addEventListener($C,_),()=>D.removeEventListener($C,_)},[_]),w.createElement(dTe,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:b,onItemFocus:w.useCallback(D=>S(D),[S]),onItemShiftTab:w.useCallback(()=>E(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>R(D=>D-1),[])},w.createElement(ac.div,bn({tabIndex:k||I===0?-1:0,"data-orientation":r},d,{ref:m,style:{outline:"none",...e.style},onMouseDown:rr(e.onMouseDown,()=>{A.current=!0}),onFocus:rr(e.onFocus,D=>{const j=!A.current;if(D.target===D.currentTarget&&j&&!k){const z=new CustomEvent($C,lTe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const V=T().filter(U=>U.focusable),K=V.find(U=>U.active),te=V.find(U=>U.id===b),$=[K,te,...V].filter(Boolean).map(U=>U.ref.current);eY($)}}A.current=!1}),onBlur:rr(e.onBlur,()=>E(!1))})))}),gTe="RovingFocusGroupItem",mTe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=wPe(),s=fTe(gTe,n),l=s.currentTabStopId===a,u=Qq(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=s;return w.useEffect(()=>{if(r)return d(),()=>h()},[r,d,h]),w.createElement(V8.ItemSlot,{scope:n,id:a,focusable:r,active:i},w.createElement(ac.span,bn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:rr(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:rr(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:rr(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=bTe(m,s.orientation,s.dir);if(v!==void 0){m.preventDefault();let S=u().filter(k=>k.focusable).map(k=>k.ref.current);if(v==="last")S.reverse();else if(v==="prev"||v==="next"){v==="prev"&&S.reverse();const k=S.indexOf(m.currentTarget);S=s.loop?STe(S,k+1):S.slice(k+1)}setTimeout(()=>eY(S))}})})))}),vTe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yTe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bTe(e,t,n){const r=yTe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return vTe[r]}function eY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function STe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const xTe=hTe,wTe=mTe,CTe=["Enter"," "],_Te=["ArrowDown","PageUp","Home"],tY=["ArrowUp","PageDown","End"],kTe=[..._Te,...tY],tw="Menu",[W8,ETe,PTe]=Rq(tw),[bp,nY]=Hy(tw,[PTe,Yq,Jq]),BP=Yq(),rY=Jq(),[TTe,nw]=bp(tw),[LTe,$P]=bp(tw),ATe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=BP(t),[l,u]=w.useState(null),d=w.useRef(!1),h=uu(o),m=Dq(i);return w.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),w.createElement(tTe,s,w.createElement(TTe,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u},w.createElement(LTe,{scope:t,onClose:w.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:m,modal:a},r)))},OTe=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=BP(n);return w.createElement(nTe,bn({},i,r,{ref:t}))}),MTe="MenuPortal",[_ze,ITe]=bp(MTe,{forceMount:void 0}),Hd="MenuContent",[RTe,iY]=bp(Hd),DTe=w.forwardRef((e,t)=>{const n=ITe(Hd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=nw(Hd,e.__scopeMenu),a=$P(Hd,e.__scopeMenu);return w.createElement(W8.Provider,{scope:e.__scopeMenu},w.createElement(Zq,{present:r||o.open},w.createElement(W8.Slot,{scope:e.__scopeMenu},a.modal?w.createElement(NTe,bn({},i,{ref:t})):w.createElement(jTe,bn({},i,{ref:t})))))}),NTe=w.forwardRef((e,t)=>{const n=nw(Hd,e.__scopeMenu),r=w.useRef(null),i=fs(t,r);return w.useEffect(()=>{const o=r.current;if(o)return zH(o)},[]),w.createElement(oY,bn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:rr(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),jTe=w.forwardRef((e,t)=>{const n=nw(Hd,e.__scopeMenu);return w.createElement(oY,bn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),oY=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m,disableOutsideScroll:v,...b}=e,S=nw(Hd,n),k=$P(Hd,n),E=BP(n),_=rY(n),T=ETe(n),[A,I]=w.useState(null),R=w.useRef(null),D=fs(t,R,S.onContentChange),j=w.useRef(0),z=w.useRef(""),V=w.useRef(0),K=w.useRef(null),te=w.useRef("right"),q=w.useRef(0),$=v?PV:w.Fragment,U=v?{as:oy,allowPinchZoom:!0}:void 0,X=W=>{var Q,ie;const fe=z.current+W,Se=T().filter(He=>!He.disabled),Pe=document.activeElement,ye=(Q=Se.find(He=>He.ref.current===Pe))===null||Q===void 0?void 0:Q.textValue,We=Se.map(He=>He.textValue),De=GTe(We,fe,ye),ot=(ie=Se.find(He=>He.textValue===De))===null||ie===void 0?void 0:ie.ref.current;(function He(Be){z.current=Be,window.clearTimeout(j.current),Be!==""&&(j.current=window.setTimeout(()=>He(""),1e3))})(fe),ot&&setTimeout(()=>ot.focus())};w.useEffect(()=>()=>window.clearTimeout(j.current),[]),fPe();const Z=w.useCallback(W=>{var Q,ie;return te.current===((Q=K.current)===null||Q===void 0?void 0:Q.side)&&YTe(W,(ie=K.current)===null||ie===void 0?void 0:ie.area)},[]);return w.createElement(RTe,{scope:n,searchRef:z,onItemEnter:w.useCallback(W=>{Z(W)&&W.preventDefault()},[Z]),onItemLeave:w.useCallback(W=>{var Q;Z(W)||((Q=R.current)===null||Q===void 0||Q.focus(),I(null))},[Z]),onTriggerLeave:w.useCallback(W=>{Z(W)&&W.preventDefault()},[Z]),pointerGraceTimerRef:V,onPointerGraceIntentChange:w.useCallback(W=>{K.current=W},[])},w.createElement($,U,w.createElement(hPe,{asChild:!0,trapped:i,onMountAutoFocus:rr(o,W=>{var Q;W.preventDefault(),(Q=R.current)===null||Q===void 0||Q.focus()}),onUnmountAutoFocus:a},w.createElement(uPe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m},w.createElement(xTe,bn({asChild:!0},_,{dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:I,onEntryFocus:W=>{k.isUsingKeyboardRef.current||W.preventDefault()}}),w.createElement(rTe,bn({role:"menu","aria-orientation":"vertical","data-state":VTe(S.open),"data-radix-menu-content":"",dir:k.dir},E,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:rr(b.onKeyDown,W=>{const ie=W.target.closest("[data-radix-menu-content]")===W.currentTarget,fe=W.ctrlKey||W.altKey||W.metaKey,Se=W.key.length===1;ie&&(W.key==="Tab"&&W.preventDefault(),!fe&&Se&&X(W.key));const Pe=R.current;if(W.target!==Pe||!kTe.includes(W.key))return;W.preventDefault();const We=T().filter(De=>!De.disabled).map(De=>De.ref.current);tY.includes(W.key)&&We.reverse(),WTe(We)}),onBlur:rr(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(j.current),z.current="")}),onPointerMove:rr(e.onPointerMove,G8(W=>{const Q=W.target,ie=q.current!==W.clientX;if(W.currentTarget.contains(Q)&&ie){const fe=W.clientX>q.current?"right":"left";te.current=fe,q.current=W.clientX}}))})))))))}),U8="MenuItem",zD="menu.itemSelect",BTe=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=w.useRef(null),a=$P(U8,e.__scopeMenu),s=iY(U8,e.__scopeMenu),l=fs(t,o),u=w.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const m=new CustomEvent(zD,{bubbles:!0,cancelable:!0});h.addEventListener(zD,v=>r==null?void 0:r(v),{once:!0}),Iq(h,m),m.defaultPrevented?u.current=!1:a.onClose()}};return w.createElement($Te,bn({},i,{ref:l,disabled:n,onClick:rr(e.onClick,d),onPointerDown:h=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,h),u.current=!0},onPointerUp:rr(e.onPointerUp,h=>{var m;u.current||(m=h.currentTarget)===null||m===void 0||m.click()}),onKeyDown:rr(e.onKeyDown,h=>{const m=s.searchRef.current!=="";n||m&&h.key===" "||CTe.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}))}),$Te=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=iY(U8,n),s=rY(n),l=w.useRef(null),u=fs(t,l),[d,h]=w.useState(!1),[m,v]=w.useState("");return w.useEffect(()=>{const b=l.current;if(b){var S;v(((S=b.textContent)!==null&&S!==void 0?S:"").trim())}},[o.children]),w.createElement(W8.ItemSlot,{scope:n,disabled:r,textValue:i??m},w.createElement(wTe,bn({asChild:!0},s,{focusable:!r}),w.createElement(ac.div,bn({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:rr(e.onPointerMove,G8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:rr(e.onPointerLeave,G8(b=>a.onItemLeave(b))),onFocus:rr(e.onFocus,()=>h(!0)),onBlur:rr(e.onBlur,()=>h(!1))}))))}),FTe="MenuRadioGroup";bp(FTe,{value:void 0,onValueChange:()=>{}});const zTe="MenuItemIndicator";bp(zTe,{checked:!1});const HTe="MenuSub";bp(HTe);function VTe(e){return e?"open":"closed"}function WTe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function UTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function GTe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=UTe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function qTe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(u-s)*(r-l)/(d-l)+s&&(i=!i)}return i}function YTe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return qTe(n,t)}function G8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const KTe=ATe,XTe=OTe,ZTe=DTe,QTe=BTe,aY="ContextMenu",[JTe,kze]=Hy(aY,[nY]),rw=nY(),[eLe,sY]=JTe(aY),tLe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=w.useState(!1),l=rw(t),u=uu(r),d=w.useCallback(h=>{s(h),u(h)},[u]);return w.createElement(eLe,{scope:t,open:a,onOpenChange:d,modal:o},w.createElement(KTe,bn({},l,{dir:i,open:a,onOpenChange:d,modal:o}),n))},nLe="ContextMenuTrigger",rLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=sY(nLe,n),o=rw(n),a=w.useRef({x:0,y:0}),s=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=w.useRef(0),u=w.useCallback(()=>window.clearTimeout(l.current),[]),d=h=>{a.current={x:h.clientX,y:h.clientY},i.onOpenChange(!0)};return w.useEffect(()=>u,[u]),w.createElement(w.Fragment,null,w.createElement(XTe,bn({},o,{virtualRef:s})),w.createElement(ac.span,bn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:rr(e.onContextMenu,h=>{u(),d(h),h.preventDefault()}),onPointerDown:rr(e.onPointerDown,Yb(h=>{u(),l.current=window.setTimeout(()=>d(h),700)})),onPointerMove:rr(e.onPointerMove,Yb(u)),onPointerCancel:rr(e.onPointerCancel,Yb(u)),onPointerUp:rr(e.onPointerUp,Yb(u))})))}),iLe="ContextMenuContent",oLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=sY(iLe,n),o=rw(n),a=w.useRef(!1);return w.createElement(ZTe,bn({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),aLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=rw(n);return w.createElement(QTe,bn({},i,r,{ref:t}))});function Yb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const sLe=tLe,lLe=rLe,uLe=oLe,ud=aLe,cLe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,lY=w.memo(e=>{var te,q,$,U,X,Z,W,Q;const t=Me(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,shouldUseSingleGalleryColumn:a}=he(kEe),{image:s,isSelected:l}=e,{url:u,thumbnail:d,uuid:h,metadata:m}=s,[v,b]=w.useState(!1),S=Ry(),{t:k}=Ve(),E=()=>b(!0),_=()=>b(!1),T=()=>{var ie,fe;if(s.metadata){const[Se,Pe]=aP((fe=(ie=s.metadata)==null?void 0:ie.image)==null?void 0:fe.prompt);Se&&t(Nx(Se)),t(Q2(Pe||""))}S({title:k("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},A=()=>{s.metadata&&t(Ny(s.metadata.image.seed)),S({title:k("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},I=()=>{t(k0(s)),n!=="img2img"&&t(qo("img2img")),S({title:k("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},R=()=>{t(Dx(s)),t(Rx()),n!=="unifiedCanvas"&&t(qo("unifiedCanvas")),S({title:k("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},D=()=>{m&&t(aU(m)),S({title:k("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},j=async()=>{var ie;if((ie=m==null?void 0:m.image)!=null&&ie.init_image_path&&(await fetch(m.image.init_image_path)).ok){t(qo("img2img")),t(Zxe(m)),S({title:k("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}S({title:k("toast:initialImageNotSet"),description:k("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},z=()=>t(jI(s)),V=ie=>{ie.dataTransfer.setData("invokeai/imageUuid",h),ie.dataTransfer.effectAllowed="move"},K=()=>{t(jI(s))};return y.jsxs(sLe,{onOpenChange:ie=>{t(tU(ie))},children:[y.jsx(lLe,{children:y.jsxs(ko,{position:"relative",className:"hoverable-image",onMouseOver:E,onMouseOut:_,userSelect:"none",draggable:!0,onDragStart:V,children:[y.jsx(KS,{className:"hoverable-image-image",objectFit:a?"contain":r,rounded:"md",src:d||u,loading:"lazy"}),y.jsx("div",{className:"hoverable-image-content",onClick:z,children:l&&y.jsx(Da,{width:"50%",height:"50%",as:PP,className:"hoverable-image-check"})}),v&&i>=64&&y.jsx("div",{className:"hoverable-image-delete-button",children:y.jsx(eS,{image:s,children:y.jsx(ss,{"aria-label":k("parameters:deleteImage"),icon:y.jsx(xEe,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},h)}),y.jsxs(uLe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:ie=>{ie.detail.originalEvent.preventDefault()},children:[y.jsx(ud,{onClickCapture:K,children:k("parameters:openInViewer")}),y.jsx(ud,{onClickCapture:T,disabled:((q=(te=s==null?void 0:s.metadata)==null?void 0:te.image)==null?void 0:q.prompt)===void 0,children:k("parameters:usePrompt")}),y.jsx(ud,{onClickCapture:A,disabled:((U=($=s==null?void 0:s.metadata)==null?void 0:$.image)==null?void 0:U.seed)===void 0,children:k("parameters:useSeed")}),y.jsx(ud,{onClickCapture:D,disabled:!["txt2img","img2img"].includes((Z=(X=s==null?void 0:s.metadata)==null?void 0:X.image)==null?void 0:Z.type),children:k("parameters:useAll")}),y.jsx(ud,{onClickCapture:j,disabled:((Q=(W=s==null?void 0:s.metadata)==null?void 0:W.image)==null?void 0:Q.type)!=="img2img",children:k("parameters:useInitImg")}),y.jsx(ud,{onClickCapture:I,children:k("parameters:sendToImg2Img")}),y.jsx(ud,{onClickCapture:R,children:k("parameters:sendToUnifiedCanvas")}),y.jsx(ud,{"data-warning":!0,children:y.jsx(eS,{image:s,children:y.jsx("p",{children:k("parameters:deleteImage")})})})]})]})},cLe);lY.displayName="HoverableImage";const Kb=320,HD=40,dLe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},VD=400;function uY(){const e=Me(),{t}=Ve(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,areMoreImagesAvailable:b,galleryWidth:S,isLightboxOpen:k,isStaging:E,shouldEnableResize:_,shouldUseSingleGalleryColumn:T}=he(_Ee),{galleryMinWidth:A,galleryMaxWidth:I}=k?{galleryMinWidth:VD,galleryMaxWidth:VD}:dLe[d],[R,D]=w.useState(S>=Kb),[j,z]=w.useState(!1),[V,K]=w.useState(0),te=w.useRef(null),q=w.useRef(null),$=w.useRef(null);w.useEffect(()=>{S>=Kb&&D(!1)},[S]);const U=()=>{e(Bxe(!o)),e(vi(!0))},X=()=>{a?W():Z()},Z=()=>{e(Bd(!0)),o&&e(vi(!0))},W=w.useCallback(()=>{e(Bd(!1)),e(tU(!1)),e($xe(q.current?q.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),Q=()=>{e(R8(r))},ie=ye=>{e(rv(ye))},fe=()=>{m||($.current=window.setTimeout(()=>W(),500))},Se=()=>{$.current&&window.clearTimeout($.current)};Je("g",()=>{X()},[a,o]),Je("left",()=>{e(oP())},{enabled:!E||d!=="unifiedCanvas"},[E]),Je("right",()=>{e(iP())},{enabled:!E||d!=="unifiedCanvas"},[E]),Je("shift+g",()=>{U()},[o]),Je("esc",()=>{e(Bd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const Pe=32;return Je("shift+up",()=>{if(l<256){const ye=ke.clamp(l+Pe,32,256);e(rv(ye))}},[l]),Je("shift+down",()=>{if(l>32){const ye=ke.clamp(l-Pe,32,256);e(rv(ye))}},[l]),w.useEffect(()=>{q.current&&(q.current.scrollTop=s)},[s,a]),w.useEffect(()=>{function ye(We){!o&&te.current&&!te.current.contains(We.target)&&W()}return document.addEventListener("mousedown",ye),()=>{document.removeEventListener("mousedown",ye)}},[W,o]),y.jsx(Oq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:y.jsxs("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Se,onMouseOver:o?void 0:Se,children:[y.jsxs(kq,{minWidth:A,maxWidth:o?I:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:_},size:{width:S,height:o?"100%":"100vh"},onResizeStart:(ye,We,De)=>{K(De.clientHeight),De.style.height=`${De.clientHeight}px`,o&&(De.style.position="fixed",De.style.right="1rem",z(!0))},onResizeStop:(ye,We,De,ot)=>{const He=o?ke.clamp(Number(S)+ot.width,A,Number(I)):Number(S)+ot.width;e(Hxe(He)),De.removeAttribute("data-resize-alert"),o&&(De.style.position="relative",De.style.removeProperty("right"),De.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(ye,We,De,ot)=>{const He=ke.clamp(Number(S)+ot.width,A,Number(o?I:.95*window.innerWidth));He>=Kb&&!R?D(!0):HeHe-HD&&e(rv(He-HD)),o&&(He>=I?De.setAttribute("data-resize-alert","true"):De.removeAttribute("data-resize-alert")),De.style.height=`${V}px`},children:[y.jsxs("div",{className:"image-gallery-header",children:[y.jsx(oo,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:R?y.jsxs(y.Fragment,{children:[y.jsx(cr,{size:"sm","data-selected":r==="result",onClick:()=>e(kb("result")),children:t("gallery:generations")}),y.jsx(cr,{size:"sm","data-selected":r==="user",onClick:()=>e(kb("user")),children:t("gallery:uploads")})]}):y.jsxs(y.Fragment,{children:[y.jsx(Qe,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:y.jsx(uEe,{}),onClick:()=>e(kb("result"))}),y.jsx(Qe,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:y.jsx(CEe,{}),onClick:()=>e(kb("user"))})]})}),y.jsxs("div",{className:"image-gallery-header-right-icons",children:[y.jsx(Zs,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:y.jsx(Qe,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:y.jsx(OP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:y.jsxs("div",{className:"image-gallery-settings-popover",children:[y.jsxs("div",{children:[y.jsx(so,{value:l,onChange:ie,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),y.jsx(Qe,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(rv(64)),icon:y.jsx(Wx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),y.jsx("div",{children:y.jsx(er,{label:t("gallery:maintainAspectRatio"),isChecked:h==="contain",onChange:()=>e(Fxe(h==="contain"?"cover":"contain"))})}),y.jsx("div",{children:y.jsx(er,{label:t("gallery:autoSwitchNewImages"),isChecked:v,onChange:ye=>e(zxe(ye.target.checked))})}),y.jsx("div",{children:y.jsx(er,{label:t("gallery:singleColumnLayout"),isChecked:T,onChange:ye=>e(Vxe(ye.target.checked))})})]})}),y.jsx(Qe,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:U,icon:o?y.jsx(Eq,{}):y.jsx(Pq,{})})]})]}),y.jsx("div",{className:"image-gallery-container",ref:q,children:n.length||b?y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(ye=>{const{uuid:We}=ye,De=i===We;return y.jsx(lY,{image:ye,isSelected:De},We)})}),y.jsx(as,{onClick:Q,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):y.jsxs("div",{className:"image-gallery-container-placeholder",children:[y.jsx(Tq,{}),y.jsx("p",{children:t("gallery:noImagesInGallery")})]})})]}),j&&y.jsx("div",{style:{width:`${S}px`,height:"100%"}})]})})}/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var q8=function(e,t){return q8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},q8(e,t)};function fLe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");q8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ru=function(){return ru=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function pf(e,t,n,r){var i=TLe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=t.scale-s,h=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):fY(e,r,n,function(v){var b=s+d*v,S=l+h*v,k=u+m*v;o(b,S,k)})}}function TLe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function LLe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,d=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:d}}var ALe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,d=s,h=r-i-l,m=l;return{minPositionX:u,maxPositionX:d,minPositionY:h,maxPositionY:m}},FP=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=LLe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,d=o.newContentHeight,h=o.newDiffHeight,m=ALe(a,l,u,s,d,h,Boolean(i));return m},s0=function(e,t){var n=FP(e,t);return e.bounds=n,n};function iw(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,d=n.maxPositionY,h=0,m=0;a&&(h=i,m=o);var v=Y8(e,s-h,u+h,r),b=Y8(t,l-m,d+m,r);return{x:v,y:b}}var Y8=function(e,t,n,r){return r?en?rs(n,2):rs(e,2):rs(e,2)};function ow(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var h=l-t*d,m=u-n*d,v=iw(h,m,i,o,0,0,null);return v}function Wy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var UD=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=aw(o,n);return!l},GD=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},OLe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},MLe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function ILe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var d=e.bounds,h=d.maxPositionX,m=d.minPositionX,v=d.maxPositionY,b=d.minPositionY,S=n>h||nv||rh?u.offsetWidth:e.setup.minPositionX||0,_=r>v?u.offsetHeight:e.setup.minPositionY||0,T=ow(e,E,_,i,e.bounds,s||l),A=T.x,I=T.y;return{scale:i,positionX:S?A:n,positionY:k?I:r}}}function RLe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,d=l.positionX,h=l.positionY,m=t!==d,v=n!==h,b=!m||!v;if(!(!a||b||!s)){var S=iw(t,n,s,o,r,i,a),k=S.x,E=S.y;e.setTransformState(u,k,E)}}var DLe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var d=t-r.x,h=n-r.y,m=a?l:d,v=s?u:h;return{x:m,y:v}},sS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},NLe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},jLe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function BLe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function qD(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var d=a+(e-a)*u;return d>l?l:do?o:d}}return r?t:Y8(e,o,a,i)}function $Le(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function FLe(e,t){var n=NLe(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=$Le(a,s),d=t.x-r.x,h=t.y-r.y,m=d/u,v=h/u,b=l-i,S=d*d+h*h,k=Math.sqrt(S)/b;e.velocity={velocityX:m,velocityY:v,total:k}}e.lastMousePosition=t,e.velocityTime=l}}function zLe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=jLe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,d=n.minPositionX,h=n.maxPositionY,m=n.minPositionY,v=r.limitToBounds,b=r.alignmentAnimation,S=r.zoomAnimation,k=r.panning,E=k.lockAxisY,_=k.lockAxisX,T=S.animationType,A=b.sizeX,I=b.sizeY,R=b.velocityAlignmentTime,D=R,j=BLe(e,l),z=Math.max(j,D),V=sS(e,A),K=sS(e,I),te=V*i.offsetWidth/100,q=K*i.offsetHeight/100,$=u+te,U=d-te,X=h+q,Z=m-q,W=e.transformState,Q=new Date().getTime();fY(e,T,z,function(ie){var fe=e.transformState,Se=fe.scale,Pe=fe.positionX,ye=fe.positionY,We=new Date().getTime()-Q,De=We/D,ot=cY[b.animationType],He=1-ot(Math.min(1,De)),Be=1-ie,wt=Pe+a*Be,st=ye+s*Be,mt=qD(wt,W.positionX,Pe,_,v,d,u,U,$,He),St=qD(st,W.positionY,ye,E,v,m,h,Z,X,He);(Pe!==wt||ye!==st)&&e.setTransformState(Se,mt,St)})}}function YD(e,t){var n=e.transformState.scale;Vl(e),s0(e,n),t.touches?MLe(e,t):OLe(e,t)}function KD(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(r){var l=DLe(e,t,n),u=l.x,d=l.y,h=sS(e,a),m=sS(e,s);FLe(e,{x:u,y:d}),RLe(e,u,d,h,m)}}function HLe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,d=(a==null?void 0:a.height)||0,h=s.1&&h;m?zLe(e):hY(e)}}function hY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,d=o||t=a;if((r>=1||s)&&hY(e),!(m||!i||!e.mounted)){var v=t||i.offsetWidth/2,b=n||i.offsetHeight/2,S=zP(e,a,v,b);S&&pf(e,S,d,h)}}function zP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Wy(rs(t,2),o,a,0,!1),u=s0(e,l),d=ow(e,n,r,l,u,s),h=d.x,m=d.y;return{scale:l,positionX:h,positionY:m}}var dm={previousScale:1,scale:1,positionX:0,positionY:0},VLe=ru(ru({},dm),{setComponents:function(){},contextInstance:null}),fv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},gY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:dm.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:dm.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:dm.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:dm.positionY}},XD=function(e){var t=ru({},fv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof fv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(fv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=ru(ru({},fv[n]),e[n]):s?t[n]=WD(WD([],fv[n]),e[n]):t[n]=e[n]}}),t},mY=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var d=r*Math.exp(t*n),h=Wy(rs(d,3),s,a,u,!1);return h};function vY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var d=o.offsetWidth,h=o.offsetHeight,m=(d/2-l)/s,v=(h/2-u)/s,b=mY(e,t,n),S=zP(e,b,m,v);if(!S)return console.error("Error during zoom event. New transformation state was not calculated.");pf(e,S,r,i)}function yY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=gY(e.props),s=e.transformState,l=s.scale,u=s.positionX,d=s.positionY;if(i){var h=FP(e,a.scale),m=iw(a.positionX,a.positionY,h,o,0,0,i),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&d===a.positionY||pf(e,v,t,n)}}function WLe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return dm;var l=r.getBoundingClientRect(),u=ULe(t),d=u.x,h=u.y,m=t.offsetWidth,v=t.offsetHeight,b=r.offsetWidth/m,S=r.offsetHeight/v,k=Wy(n||Math.min(b,S),a,s,0,!1),E=(l.width-m*k)/2,_=(l.height-v*k)/2,T=(l.left-d)*k+E,A=(l.top-h)*k+_,I=FP(e,k),R=iw(T,A,I,o,0,0,r),D=R.x,j=R.y;return{positionX:D,positionY:j,scale:k}}function ULe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function GLe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var qLe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),vY(e,1,t,n,r)}},YLe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),vY(e,-1,t,n,r)}},KLe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,d=e.wrapperComponent,h=e.contentComponent,m=e.setup.disabled;if(!(m||!d||!h)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};pf(e,v,i,o)}}},XLe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),yY(e,t,n)}},ZLe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=bY(t||i.scale,o,a);pf(e,s,n,r)}}},QLe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Vl(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&GLe(a)&&a&&o.contains(a)){var s=WLe(e,a,n);pf(e,s,r,i)}}},ri=function(e){return{instance:e,state:e.transformState,zoomIn:qLe(e),zoomOut:YLe(e),setTransform:KLe(e),resetTransform:XLe(e),centerView:ZLe(e),zoomToElement:QLe(e)}},FC=!1;function zC(){try{var e={get passive(){return FC=!0,!1}};return e}catch{return FC=!1,FC}}var aw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},ZD=function(e){e&&clearTimeout(e)},JLe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},bY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},eAe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,d=s&&!l&&!r&&u;if(!d||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var h=aw(u,a);return!h};function tAe(e,t){var n=e?e.deltaY<0?1:-1:0,r=hLe(t,n);return r}function SY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var nAe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,d=s.zoomAnimation,h=d.size,m=d.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*n)*n;if(i)return v;var b=r?!1:!m,S=Wy(rs(v,3),u,l,h,b);return S},rAe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},iAe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=aw(a,i);return!l},oAe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},aAe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=rs(i[0].clientX-r.left,5),a=rs(i[0].clientY-r.top,5),s=rs(i[1].clientX-r.left,5),l=rs(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},xY=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},sAe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var d=t/r,h=d*n;return Wy(rs(h,2),a,o,l,!u)},lAe=160,uAe=100,cAe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Vl(e),Pi(ri(e),t,r),Pi(ri(e),t,i))},dAe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,d=a.centerZoomedOut,h=a.zoomAnimation,m=a.wheel,v=h.size,b=h.disabled,S=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var k=tAe(t,null),E=nAe(e,k,S,!t.ctrlKey);if(l!==E){var _=s0(e,E),T=SY(t,o,l),A=b||v===0||d,I=u&&A,R=ow(e,T.x,T.y,E,_,I),D=R.x,j=R.y;e.previousWheelEvent=t,e.setTransformState(E,D,j),Pi(ri(e),t,r),Pi(ri(e),t,i)}},fAe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;ZD(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(pY(e,t.x,t.y),e.wheelAnimationTimer=null)},uAe);var o=rAe(e,t);o&&(ZD(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Pi(ri(e),t,r),Pi(ri(e),t,i))},lAe))},hAe=function(e,t){var n=xY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Vl(e)},pAe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,d=l.size;if(!(r===null||!n)){var h=aAe(t,i,n);if(!(!isFinite(h.x)||!isFinite(h.y))){var m=xY(t),v=sAe(e,m);if(v!==i){var b=s0(e,v),S=u||d===0||s,k=a&&S,E=ow(e,h.x,h.y,v,b,k),_=E.x,T=E.y;e.pinchMidpoint=h,e.lastDistance=m,e.setTransformState(v,_,T)}}}},gAe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,pY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function mAe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return yY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var d=i==="zoomOut"?-1:1,h=mY(e,d,o),m=SY(t,u,l),v=zP(e,h,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");pf(e,v,a,s)}}var vAe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),d=n&&l&&u&&!a;if(!d)return!1;var h=aw(l,s);return!(h||!d)},wY=N.createContext(VLe),yAe=function(e){fLe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=gY(n.props),n.setup=XD(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=zC();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=eAe(n,r);if(o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(cAe(n,r),dAe(n,r),fAe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=UD(n,r);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),Vl(n),YD(n,r),Pi(ri(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=GD(n);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),KD(n,r.clientX,r.clientY),Pi(ri(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(HLe(n),Pi(ri(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=iAe(n,r);l&&(hAe(n,r),Vl(n),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=oAe(n);l&&(r.preventDefault(),r.stopPropagation(),pAe(n,r),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(gAe(n),Pi(ri(n),r,o),Pi(ri(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=UD(n,r);if(a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Vl(n);var l=r.touches,u=l.length===1,d=l.length===2;u&&(Vl(n),YD(n,r),Pi(ri(n),r,o)),d&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=GD(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];KD(n,s.clientX,s.clientY),Pi(ri(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=vAe(n,r);o&&mAe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,s0(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Pi(ri(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=bY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=JLe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ri(n))},n}return t.prototype.componentDidMount=function(){var n=zC();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=zC();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Vl(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(s0(this,this.transformState.scale),this.setup=XD(this.props))},t.prototype.render=function(){var n=ri(this),r=this.props.children,i=typeof r=="function"?r(n):r;return N.createElement(wY.Provider,{value:ru(ru({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},i)},t}(w.Component),bAe=N.forwardRef(function(e,t){var n=w.useState(null),r=n[0],i=n[1];return w.useImperativeHandle(t,function(){return r},[r]),N.createElement(yAe,ru({},e,{setRef:i}))});function SAe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var xAe=`.transform-component-module_wrapper__1_Fgj { - position: relative; - width: -moz-fit-content; - width: fit-content; - height: -moz-fit-content; - height: fit-content; - overflow: hidden; - -webkit-touch-callout: none; /* iOS Safari */ - -webkit-user-select: none; /* Safari */ - -khtml-user-select: none; /* Konqueror HTML */ - -moz-user-select: none; /* Firefox */ - -ms-user-select: none; /* Internet Explorer/Edge */ - user-select: none; - margin: 0; - padding: 0; -} -.transform-component-module_content__2jYgh { - display: flex; - flex-wrap: wrap; - width: -moz-fit-content; - width: fit-content; - height: -moz-fit-content; - height: fit-content; - margin: 0; - padding: 0; - transform-origin: 0% 0%; -} -.transform-component-module_content__2jYgh img { - pointer-events: none; -} -`,QD={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};SAe(xAe);var wAe=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=w.useContext(wY).setComponents,u=w.useRef(null),d=w.useRef(null);return w.useEffect(function(){var h=u.current,m=d.current;h!==null&&m!==null&&l&&l(h,m)},[]),N.createElement("div",{ref:u,className:"react-transform-wrapper "+QD.wrapper+" "+r,style:a},N.createElement("div",{ref:d,className:"react-transform-component "+QD.content+" "+o,style:s},t))};function CAe({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=w.useState(0),[a,s]=w.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},d=()=>{s(!a)};return y.jsx(bAe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:h,zoomOut:m,resetTransform:v,centerView:b})=>y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"lightbox-image-options",children:[y.jsx(Qe,{icon:y.jsx(h_e,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>h(),fontSize:20}),y.jsx(Qe,{icon:y.jsx(p_e,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),y.jsx(Qe,{icon:y.jsx(d_e,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),y.jsx(Qe,{icon:y.jsx(f_e,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),y.jsx(Qe,{icon:y.jsx(WEe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),y.jsx(Qe,{icon:y.jsx(Wx,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{v(),o(0),s(!1)},fontSize:20})]}),y.jsx(wAe,{wrapperStyle:{width:"100%",height:"100%"},children:y.jsx("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function _Ae(){const e=Me(),t=he(m=>m.lightbox.isLightboxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=he(_q),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(oP())},h=()=>{e(iP())};return Je("Esc",()=>{t&&e(Bm(!1))},[t]),y.jsxs("div",{className:"lightbox-container",children:[y.jsx(Qe,{icon:y.jsx(c_e,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Bm(!1))},fontSize:20}),y.jsxs("div",{className:"lightbox-display-container",children:[y.jsxs("div",{className:"lightbox-preview-wrapper",children:[y.jsx(wq,{}),!r&&y.jsxs("div",{className:"current-image-next-prev-buttons",children:[y.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&y.jsx(ss,{"aria-label":"Previous image",icon:y.jsx(dq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),y.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&y.jsx(ss,{"aria-label":"Next image",icon:y.jsx(fq,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),n&&y.jsxs(y.Fragment,{children:[y.jsx(CAe,{image:n.url,styleClass:"lightbox-image"}),r&&y.jsx(MP,{image:n})]})]}),y.jsx(uY,{})]})]})}function kAe(e){return gt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}const EAe=at(yp,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),PAe=()=>{const{resultImages:e,userImages:t}=he(EAe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},TAe=at([mp,Vx,Or],(e,t,n)=>{const{shouldShowDualDisplay:r,shouldPinParametersPanel:i}=e,{isLightboxOpen:o}=t;return{shouldShowDualDisplay:r,shouldPinParametersPanel:i,isLightboxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HP=e=>{const t=Me(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,shouldShowDualDisplay:a,isLightboxOpen:s,shouldShowDualDisplayButton:l}=he(TAe),u=PAe(),d=()=>{t(cCe(!a)),t(vi(!0))},h=m=>{const v=m.dataTransfer.getData("invokeai/imageUuid"),b=u(v);b&&(o==="img2img"?t(k0(b)):o==="unifiedCanvas"&&t(Dx(b)))};return y.jsx("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:y.jsxs("div",{className:"workarea-main",children:[n,y.jsxs("div",{className:"workarea-children-wrapper",onDrop:h,children:[r,l&&y.jsx(uo,{label:"Toggle Split View",children:y.jsx("div",{className:"workarea-split-button","data-selected":a,onClick:d,children:y.jsx(kAe,{})})})]}),!s&&y.jsx(uY,{})]})})},LAe=e=>{const{styleClass:t}=e,n=w.useContext(SP),r=()=>{n&&n()};return y.jsx("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:y.jsxs("div",{className:"image-upload-button",children:[y.jsx(Zx,{}),y.jsx(Dh,{size:"lg",children:"Click or Drag and Drop"})]})})},AAe=at([yp,mp,Or],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),CY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=he(AAe);return y.jsx("div",{className:"current-image-area","data-tab-name":t,children:e?y.jsxs(y.Fragment,{children:[y.jsx(wq,{}),y.jsx(MEe,{})]}):y.jsx("div",{className:"current-image-display-placeholder",children:y.jsx(UEe,{})})})},OAe=()=>{const e=w.useContext(SP);return y.jsx(Qe,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:y.jsx(Zx,{}),onClick:e||void 0})};function MAe(){const e=he(o=>o.generation.initialImage),{t}=Ve(),n=Me(),r=Ry(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(oU())};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"init-image-preview-header",children:[y.jsx("h2",{children:t("parameters:initialImage")}),y.jsx(OAe,{})]}),e&&y.jsx("div",{className:"init-image-preview",children:y.jsx(KS,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const IAe=()=>{const e=he(r=>r.generation.initialImage),{currentImage:t}=he(r=>r.gallery),n=e?y.jsx("div",{className:"image-to-image-area",children:y.jsx(MAe,{})}):y.jsx(LAe,{});return y.jsxs("div",{className:"workarea-split-view",children:[y.jsx("div",{className:"workarea-split-view-left",children:n}),t&&y.jsx("div",{className:"workarea-split-view-right",children:y.jsx(CY,{})})]})};var ao=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(ao||{});const RAe=()=>{const{t:e}=Ve();return w.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},DAe=e=>RAe()[e],Vs=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return y.jsxs(dn,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[y.jsx(kn,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),y.jsx(BE,{className:"invokeai__switch-root",...s})]})};function _Y(){const e=he(i=>i.system.isGFPGANAvailable),t=he(i=>i.postprocessing.shouldRunFacetool),n=Me(),r=i=>n(awe(i.target.checked));return y.jsx(Vs,{isDisabled:!e,isChecked:t,onChange:r})}function NAe(){const e=Me(),t=he(i=>i.generation.shouldFitToWidthHeight),n=i=>e(gU(i.target.checked)),{t:r}=Ve();return y.jsx(Vs,{label:r("parameters:imageFit"),isChecked:t,onChange:n})}function kY(e){const{t}=Ve(),{label:n=`${t("parameters:strength")}`,styleClass:r}=e,i=he(l=>l.generation.img2imgStrength),o=Me(),a=l=>o(l8(l)),s=()=>{o(l8(.75))};return y.jsx(so,{label:n,step:.01,min:.01,max:1,onChange:a,value:i,isInteger:!1,styleClass:r,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:s})}const EY=()=>{const e=Me(),t=he(i=>i.generation.seamless),n=i=>e(hU(i.target.checked)),{t:r}=Ve();return y.jsx(Ge,{gap:2,direction:"column",children:y.jsx(Vs,{label:r("parameters:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},jAe=()=>y.jsx(Ge,{gap:2,direction:"column",children:y.jsx(EY,{})});function BAe(){const e=Me(),t=he(i=>i.generation.perlin),{t:n}=Ve(),r=i=>e(dU(i));return y.jsx(ra,{label:n("parameters:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}function $Ae(){const e=Me(),{t}=Ve(),n=he(i=>i.generation.shouldRandomizeSeed),r=i=>e(ewe(i.target.checked));return y.jsx(Vs,{label:t("parameters:randomizeSeed"),isChecked:n,onChange:r})}function FAe(){const e=he(a=>a.generation.seed),t=he(a=>a.generation.shouldRandomizeSeed),n=he(a=>a.generation.shouldGenerateVariations),{t:r}=Ve(),i=Me(),o=a=>i(Ny(a));return y.jsx(ra,{label:r("parameters:seed"),step:1,precision:0,flexGrow:1,min:hP,max:pP,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function zAe(){const e=Me(),t=he(i=>i.generation.shouldRandomizeSeed),{t:n}=Ve(),r=()=>e(Ny(HG(hP,pP)));return y.jsx(as,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:y.jsx("p",{children:n("parameters:shuffle")})})}function HAe(){const e=Me(),t=he(i=>i.generation.threshold),{t:n}=Ve(),r=i=>e(vU(i));return y.jsx(ra,{label:n("parameters:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}const VP=()=>y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx($Ae,{}),y.jsxs(Ge,{gap:2,children:[y.jsx(FAe,{}),y.jsx(zAe,{})]}),y.jsx(Ge,{gap:2,children:y.jsx(HAe,{})}),y.jsx(Ge,{gap:2,children:y.jsx(BAe,{})})]});function PY(){const e=he(i=>i.system.isESRGANAvailable),t=he(i=>i.postprocessing.shouldRunESRGAN),n=Me(),r=i=>n(owe(i.target.checked));return y.jsx(Vs,{isDisabled:!e,isChecked:t,onChange:r})}function WP(){const e=he(r=>r.generation.shouldGenerateVariations),t=Me(),n=r=>t(Jxe(r.target.checked));return y.jsx(Vs,{isChecked:e,width:"auto",onChange:n})}function kr(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return y.jsxs(dn,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&y.jsx(kn,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),y.jsx(hk,{...l,className:"input-entry",size:a,width:o})]})}function VAe(){const e=he(o=>o.generation.seedWeights),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ve(),r=Me(),i=o=>r(pU(o.target.value));return y.jsx(kr,{label:n("parameters:seedWeights"),value:e,isInvalid:t&&!(sP(e)||e===""),isDisabled:!t,onChange:i})}function WAe(){const e=he(o=>o.generation.variationAmount),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ve(),r=Me(),i=o=>r(twe(o));return y.jsx(ra,{label:n("parameters:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const UP=()=>y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(WAe,{}),y.jsx(VAe,{})]});function UAe(){const e=Me(),t=he(i=>i.generation.cfgScale),{t:n}=Ve(),r=i=>e(sU(i));return y.jsx(ra,{label:n("parameters:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function GAe(){const e=he(o=>o.generation.height),t=he(Or),n=Me(),{t:r}=Ve(),i=o=>n(lU(Number(o.target.value)));return y.jsx(tl,{isDisabled:t==="unifiedCanvas",label:r("parameters:height"),value:e,flexGrow:1,onChange:i,validValues:i7e,styleClass:"main-settings-block"})}const qAe=at([e=>e.generation],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function YAe(){const e=Me(),{iterations:t}=he(qAe),{t:n}=Ve(),r=i=>e(Qxe(i));return y.jsx(ra,{label:n("parameters:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function KAe(){const e=he(o=>o.generation.sampler),t=he(qG),n=Me(),{t:r}=Ve(),i=o=>n(fU(o.target.value));return y.jsx(tl,{label:r("parameters:sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?n7e:t7e,styleClass:"main-settings-block"})}function XAe(){const e=Me(),t=he(i=>i.generation.steps),{t:n}=Ve(),r=i=>e(mU(i));return y.jsx(ra,{label:n("parameters:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function ZAe(){const e=he(o=>o.generation.width),t=he(Or),{t:n}=Ve(),r=Me(),i=o=>r(yU(Number(o.target.value)));return y.jsx(tl,{isDisabled:t==="unifiedCanvas",label:n("parameters:width"),value:e,flexGrow:1,onChange:i,validValues:r7e,styleClass:"main-settings-block"})}function GP(){return y.jsx("div",{className:"main-settings",children:y.jsxs("div",{className:"main-settings-list",children:[y.jsxs("div",{className:"main-settings-row",children:[y.jsx(YAe,{}),y.jsx(XAe,{}),y.jsx(UAe,{})]}),y.jsxs("div",{className:"main-settings-row",children:[y.jsx(ZAe,{}),y.jsx(GAe,{}),y.jsx(KAe,{})]})]})})}const QAe=at(ir,e=>e.shouldDisplayGuides),JAe=({children:e,feature:t})=>{const n=he(QAe),{text:r}=DAe(t);return n?y.jsxs(ME,{trigger:"hover",children:[y.jsx(DE,{children:y.jsx(ko,{children:e})}),y.jsxs(RE,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[y.jsx(IE,{className:"guide-popover-arrow"}),y.jsx("div",{className:"guide-popover-guide-content",children:r})]})]}):null},eOe=Ae(({feature:e,icon:t=HEe},n)=>y.jsx(JAe,{feature:e,children:y.jsx(ko,{ref:n,children:y.jsx(Da,{marginBottom:"-.15rem",as:t})})}));function tOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return y.jsxs(Gg,{className:"advanced-parameters-item",children:[y.jsx(Wg,{className:"advanced-parameters-header",children:y.jsxs(Ge,{width:"100%",gap:"0.5rem",align:"center",children:[y.jsx(ko,{flexGrow:1,textAlign:"left",children:t}),i,n&&y.jsx(eOe,{feature:n}),y.jsx(Ug,{})]})}),y.jsx(qg,{className:"advanced-parameters-panel",children:r})]})}const qP=e=>{const{accordionInfo:t}=e,n=he(a=>a.system.openAccordions),r=Me(),i=a=>r(G6e(a)),o=()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:d,additionalHeaderComponents:h}=t[s];a.push(y.jsx(tOe,{header:l,feature:u,content:d,additionalHeaderComponents:h},s))}),a};return y.jsx(ok,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:i,className:"advanced-parameters",children:o()})},nOe=at(ir,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function YP(e){const{...t}=e,n=Me(),{isProcessing:r,isConnected:i,isCancelable:o}=he(nOe),a=()=>n(j8e()),{t:s}=Ve();return Je("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),y.jsx(Qe,{icon:y.jsx(GEe,{}),tooltip:s("parameters:cancel"),"aria-label":s("parameters:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const KP=e=>e.generation;at(KP,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:ke.isEqual}});const TY=at([KP,ir,xq,Or],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:d}=t;let h=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(h=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(h=!1,m.push("No initial image selected")),u&&(h=!1,m.push("System Busy")),d||(h=!1,m.push("System Disconnected")),o&&(!(sP(a)||a==="")||l===-1)&&(h=!1,m.push("Seed-Weights badly formatted.")),{isReady:h,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:ke.isEqual,resultEqualityCheck:ke.isEqual}});function XP(e){const{iconButton:t=!1,...n}=e,r=Me(),{isReady:i}=he(TY),o=he(Or),a=()=>{r(I8(o))},{t:s}=Ve();return Je(["ctrl+enter","meta+enter"],()=>{r(I8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),y.jsx("div",{style:{flexGrow:4},children:t?y.jsx(Qe,{"aria-label":s("parameters:invoke"),type:"submit",icon:y.jsx(gEe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("parameters:invoke"),tooltipProps:{placement:"bottom"},...n}):y.jsx(cr,{"aria-label":s("parameters:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const rOe=at(Fy,({shouldLoopback:e})=>e),iOe=()=>{const e=Me(),t=he(rOe),{t:n}=Ve();return y.jsx(Qe,{"aria-label":n("parameters:toggleLoopback"),tooltip:n("parameters:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:y.jsx(vEe,{}),onClick:()=>{e(iwe(!t))}})},ZP=()=>{const e=he(Or);return y.jsxs("div",{className:"process-buttons",children:[y.jsx(XP,{}),e==="img2img"&&y.jsx(iOe,{}),y.jsx(YP,{})]})},QP=()=>{const e=he(r=>r.generation.negativePrompt),t=Me(),{t:n}=Ve();return y.jsx(dn,{children:y.jsx($E,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(Q2(r.target.value)),background:"var(--prompt-bg-color)",placeholder:n("parameters:negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},oOe=at([e=>e.generation,Or],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),JP=()=>{const e=Me(),{prompt:t,activeTabName:n}=he(oOe),{isReady:r}=he(TY),i=w.useRef(null),{t:o}=Ve(),a=l=>{e(Nx(l.target.value))};Je("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(I8(n)))};return y.jsx("div",{className:"prompt-bar",children:y.jsx(dn,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:y.jsx($E,{id:"prompt",name:"prompt",placeholder:o("parameters:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},LY=""+new URL("logo-13003d72.png",import.meta.url).href,aOe=at(mp,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),eT=e=>{const t=Me(),{shouldShowParametersPanel:n,shouldHoldParametersPanelOpen:r,shouldPinParametersPanel:i}=he(aOe),o=w.useRef(null),a=w.useRef(null),s=w.useRef(null),{children:l}=e;Je("o",()=>{t(Ku(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),Je("esc",()=>{t(Ku(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Je("shift+o",()=>{m(),t(vi(!0))},[i]);const u=w.useCallback(()=>{i||(t(sCe(a.current?a.current.scrollTop:0)),t(Ku(!1)),t(lCe(!1)))},[t,i]),d=()=>{s.current=window.setTimeout(()=>u(),500)},h=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(uCe(!i)),t(vi(!0))};return w.useEffect(()=>{function v(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[u]),y.jsx(Oq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:y.jsx("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:h,onMouseOver:i?void 0:h,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:y.jsx("div",{className:"parameters-panel-margin",children:y.jsxs("div",{className:"parameters-panel",ref:a,onMouseLeave:v=>{v.target!==a.current?h():!i&&d()},children:[y.jsx(uo,{label:"Pin Options Panel",children:y.jsx("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:m,children:i?y.jsx(Eq,{}):y.jsx(Pq,{})})}),!i&&y.jsxs("div",{className:"invoke-ai-logo-wrapper",children:[y.jsx("img",{src:LY,alt:"invoke-ai-logo"}),y.jsxs("h1",{children:["invoke ",y.jsx("strong",{children:"ai"})]})]}),l]})})})})};function sOe(){const{t:e}=Ve(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:y.jsx(VP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:y.jsx(UP,{}),additionalHeaderComponents:y.jsx(WP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:y.jsx(wP,{}),additionalHeaderComponents:y.jsx(_Y,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:y.jsx(CP,{}),additionalHeaderComponents:y.jsx(PY,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:y.jsx(jAe,{})}},n=Me(),r=he(Or);return w.useEffect(()=>{r==="img2img"&&n(lP(!1))},[r,n]),y.jsxs(eT,{children:[y.jsxs(Ge,{flexDir:"column",rowGap:"0.5rem",children:[y.jsx(JP,{}),y.jsx(QP,{})]}),y.jsx(ZP,{}),y.jsx(GP,{}),y.jsx(kY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),y.jsx(NAe,{}),y.jsx(qP,{accordionInfo:t})]})}function lOe(){return y.jsx(HP,{optionsPanel:y.jsx(sOe,{}),children:y.jsx(IAe,{})})}const uOe=()=>y.jsx("div",{className:"workarea-single-view",children:y.jsx("div",{className:"text-to-image-area",children:y.jsx(CY,{})})}),cOe=at([Fy],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),dOe=()=>{const{hiresFix:e,hiresStrength:t}=he(cOe),n=Me(),{t:r}=Ve(),i=a=>{n(VI(a))},o=()=>{n(VI(.75))};return y.jsx(so,{label:r("parameters:hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:o,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},fOe=()=>{const e=Me(),t=he(i=>i.postprocessing.hiresFix),{t:n}=Ve(),r=i=>e(lP(i.target.checked));return y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(Vs,{label:n("parameters:hiresOptim"),fontSize:"md",isChecked:t,onChange:r}),y.jsx(dOe,{})]})},hOe=()=>y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(EY,{}),y.jsx(fOe,{})]});function pOe(){const{t:e}=Ve(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:y.jsx(VP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:y.jsx(UP,{}),additionalHeaderComponents:y.jsx(WP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:y.jsx(wP,{}),additionalHeaderComponents:y.jsx(_Y,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:y.jsx(CP,{}),additionalHeaderComponents:y.jsx(PY,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:y.jsx(hOe,{})}};return y.jsxs(eT,{children:[y.jsxs(Ge,{flexDir:"column",rowGap:"0.5rem",children:[y.jsx(JP,{}),y.jsx(QP,{})]}),y.jsx(ZP,{}),y.jsx(GP,{}),y.jsx(qP,{accordionInfo:t})]})}function gOe(){return y.jsx(HP,{optionsPanel:y.jsx(pOe,{}),children:y.jsx(uOe,{})})}var K8={},mOe={get exports(){return K8},set exports(e){K8=e}};/** - * @license React - * react-reconciler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var vOe=function(t){var n={},r=w,i=Bh,o=Object.assign;function a(f){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+f,x=1;xle||L[G]!==M[le]){var pe=` -`+L[G].replace(" at new "," at ");return f.displayName&&pe.includes("")&&(pe=pe.replace("",f.displayName)),pe}while(1<=G&&0<=le);break}}}finally{al=!1,Error.prepareStackTrace=x}return(f=f?f.displayName||f.name:"")?yu(f):""}var Tp=Object.prototype.hasOwnProperty,xc=[],sl=-1;function oa(f){return{current:f}}function Dn(f){0>sl||(f.current=xc[sl],xc[sl]=null,sl--)}function Pn(f,p){sl++,xc[sl]=f.current,f.current=p}var aa={},Hr=oa(aa),li=oa(!1),sa=aa;function ll(f,p){var x=f.type.contextTypes;if(!x)return aa;var P=f.stateNode;if(P&&P.__reactInternalMemoizedUnmaskedChildContext===p)return P.__reactInternalMemoizedMaskedChildContext;var L={},M;for(M in x)L[M]=p[M];return P&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=p,f.__reactInternalMemoizedMaskedChildContext=L),L}function ui(f){return f=f.childContextTypes,f!=null}function vs(){Dn(li),Dn(Hr)}function bf(f,p,x){if(Hr.current!==aa)throw Error(a(168));Pn(Hr,p),Pn(li,x)}function Su(f,p,x){var P=f.stateNode;if(p=p.childContextTypes,typeof P.getChildContext!="function")return x;P=P.getChildContext();for(var L in P)if(!(L in p))throw Error(a(108,j(f)||"Unknown",L));return o({},x,P)}function ys(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||aa,sa=Hr.current,Pn(Hr,f),Pn(li,li.current),!0}function Sf(f,p,x){var P=f.stateNode;if(!P)throw Error(a(169));x?(f=Su(f,p,sa),P.__reactInternalMemoizedMergedChildContext=f,Dn(li),Dn(Hr),Pn(Hr,f)):Dn(li),Pn(li,x)}var Mi=Math.clz32?Math.clz32:xf,Lp=Math.log,Ap=Math.LN2;function xf(f){return f>>>=0,f===0?32:31-(Lp(f)/Ap|0)|0}var ul=64,Io=4194304;function cl(f){switch(f&-f){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function xu(f,p){var x=f.pendingLanes;if(x===0)return 0;var P=0,L=f.suspendedLanes,M=f.pingedLanes,G=x&268435455;if(G!==0){var le=G&~L;le!==0?P=cl(le):(M&=G,M!==0&&(P=cl(M)))}else G=x&~L,G!==0?P=cl(G):M!==0&&(P=cl(M));if(P===0)return 0;if(p!==0&&p!==P&&!(p&L)&&(L=P&-P,M=p&-p,L>=M||L===16&&(M&4194240)!==0))return p;if(P&4&&(P|=x&16),p=f.entangledLanes,p!==0)for(f=f.entanglements,p&=P;0x;x++)p.push(f);return p}function $a(f,p,x){f.pendingLanes|=p,p!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,p=31-Mi(p),f[p]=x}function Cf(f,p){var x=f.pendingLanes&~p;f.pendingLanes=p,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=p,f.mutableReadLanes&=p,f.entangledLanes&=p,p=f.entanglements;var P=f.eventTimes;for(f=f.expirationTimes;0>=G,L-=G,co=1<<32-Mi(p)+L|x<Gt?(ti=Rt,Rt=null):ti=Rt.sibling;var Jt=rt(me,Rt,be[Gt],et);if(Jt===null){Rt===null&&(Rt=ti);break}f&&Rt&&Jt.alternate===null&&p(me,Rt),ue=M(Jt,ue,Gt),Bt===null?Oe=Jt:Bt.sibling=Jt,Bt=Jt,Rt=ti}if(Gt===be.length)return x(me,Rt),Vn&&dl(me,Gt),Oe;if(Rt===null){for(;GtGt?(ti=Rt,Rt=null):ti=Rt.sibling;var Ps=rt(me,Rt,Jt.value,et);if(Ps===null){Rt===null&&(Rt=ti);break}f&&Rt&&Ps.alternate===null&&p(me,Rt),ue=M(Ps,ue,Gt),Bt===null?Oe=Ps:Bt.sibling=Ps,Bt=Ps,Rt=ti}if(Jt.done)return x(me,Rt),Vn&&dl(me,Gt),Oe;if(Rt===null){for(;!Jt.done;Gt++,Jt=be.next())Jt=jt(me,Jt.value,et),Jt!==null&&(ue=M(Jt,ue,Gt),Bt===null?Oe=Jt:Bt.sibling=Jt,Bt=Jt);return Vn&&dl(me,Gt),Oe}for(Rt=P(me,Rt);!Jt.done;Gt++,Jt=be.next())Jt=Un(Rt,me,Gt,Jt.value,et),Jt!==null&&(f&&Jt.alternate!==null&&Rt.delete(Jt.key===null?Gt:Jt.key),ue=M(Jt,ue,Gt),Bt===null?Oe=Jt:Bt.sibling=Jt,Bt=Jt);return f&&Rt.forEach(function(ki){return p(me,ki)}),Vn&&dl(me,Gt),Oe}function ya(me,ue,be,et){if(typeof be=="object"&&be!==null&&be.type===d&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case l:e:{for(var Oe=be.key,Bt=ue;Bt!==null;){if(Bt.key===Oe){if(Oe=be.type,Oe===d){if(Bt.tag===7){x(me,Bt.sibling),ue=L(Bt,be.props.children),ue.return=me,me=ue;break e}}else if(Bt.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===T&&t1(Oe)===Bt.type){x(me,Bt.sibling),ue=L(Bt,be.props),ue.ref=Ha(me,Bt,be),ue.return=me,me=ue;break e}x(me,Bt);break}else p(me,Bt);Bt=Bt.sibling}be.type===d?(ue=kl(be.props.children,me.mode,et,be.key),ue.return=me,me=ue):(et=Zf(be.type,be.key,be.props,null,me.mode,et),et.ref=Ha(me,ue,be),et.return=me,me=et)}return G(me);case u:e:{for(Bt=be.key;ue!==null;){if(ue.key===Bt)if(ue.tag===4&&ue.stateNode.containerInfo===be.containerInfo&&ue.stateNode.implementation===be.implementation){x(me,ue.sibling),ue=L(ue,be.children||[]),ue.return=me,me=ue;break e}else{x(me,ue);break}else p(me,ue);ue=ue.sibling}ue=El(be,me.mode,et),ue.return=me,me=ue}return G(me);case T:return Bt=be._init,ya(me,ue,Bt(be._payload),et)}if(U(be))return Nn(me,ue,be,et);if(R(be))return mr(me,ue,be,et);Xi(me,be)}return typeof be=="string"&&be!==""||typeof be=="number"?(be=""+be,ue!==null&&ue.tag===6?(x(me,ue.sibling),ue=L(ue,be),ue.return=me,me=ue):(x(me,ue),ue=vg(be,me.mode,et),ue.return=me,me=ue),G(me)):x(me,ue)}return ya}var Mc=r3(!0),i3=r3(!1),Rf={},jo=oa(Rf),Va=oa(Rf),oe=oa(Rf);function we(f){if(f===Rf)throw Error(a(174));return f}function ve(f,p){Pn(oe,p),Pn(Va,f),Pn(jo,Rf),f=Z(p),Dn(jo),Pn(jo,f)}function nt(){Dn(jo),Dn(Va),Dn(oe)}function It(f){var p=we(oe.current),x=we(jo.current);p=W(x,f.type,p),x!==p&&(Pn(Va,f),Pn(jo,p))}function rn(f){Va.current===f&&(Dn(jo),Dn(Va))}var $t=oa(0);function mn(f){for(var p=f;p!==null;){if(p.tag===13){var x=p.memoizedState;if(x!==null&&(x=x.dehydrated,x===null||bc(x)||yf(x)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if(p.flags&128)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var Df=[];function n1(){for(var f=0;fx?x:4,f(!0);var P=Ic.transition;Ic.transition={};try{f(!1),p()}finally{Yt=x,Ic.transition=P}}function Fc(){return Di().memoizedState}function c1(f,p,x){var P=qr(f);if(x={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null},Hc(f))Vc(p,x);else if(x=Oc(f,p,x,P),x!==null){var L=_i();Fo(x,f,P,L),zf(x,p,P)}}function zc(f,p,x){var P=qr(f),L={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null};if(Hc(f))Vc(p,L);else{var M=f.alternate;if(f.lanes===0&&(M===null||M.lanes===0)&&(M=p.lastRenderedReducer,M!==null))try{var G=p.lastRenderedState,le=M(G,x);if(L.hasEagerState=!0,L.eagerState=le,Y(le,G)){var pe=p.interleaved;pe===null?(L.next=L,Mf(p)):(L.next=pe.next,pe.next=L),p.interleaved=L;return}}catch{}finally{}x=Oc(f,p,L,P),x!==null&&(L=_i(),Fo(x,f,P,L),zf(x,p,P))}}function Hc(f){var p=f.alternate;return f===Tn||p!==null&&p===Tn}function Vc(f,p){Nf=un=!0;var x=f.pending;x===null?p.next=p:(p.next=x.next,x.next=p),f.pending=p}function zf(f,p,x){if(x&4194240){var P=p.lanes;P&=f.pendingLanes,x|=P,p.lanes=x,wu(f,x)}}var xs={readContext:fo,useCallback:Si,useContext:Si,useEffect:Si,useImperativeHandle:Si,useInsertionEffect:Si,useLayoutEffect:Si,useMemo:Si,useReducer:Si,useRef:Si,useState:Si,useDebugValue:Si,useDeferredValue:Si,useTransition:Si,useMutableSource:Si,useSyncExternalStore:Si,useId:Si,unstable_isNewReconciler:!1},gw={readContext:fo,useCallback:function(f,p){return di().memoizedState=[f,p===void 0?null:p],f},useContext:fo,useEffect:s3,useImperativeHandle:function(f,p,x){return x=x!=null?x.concat([f]):null,Eu(4194308,4,Rr.bind(null,p,f),x)},useLayoutEffect:function(f,p){return Eu(4194308,4,f,p)},useInsertionEffect:function(f,p){return Eu(4,2,f,p)},useMemo:function(f,p){var x=di();return p=p===void 0?null:p,f=f(),x.memoizedState=[f,p],f},useReducer:function(f,p,x){var P=di();return p=x!==void 0?x(p):p,P.memoizedState=P.baseState=p,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:p},P.queue=f,f=f.dispatch=c1.bind(null,Tn,f),[P.memoizedState,f]},useRef:function(f){var p=di();return f={current:f},p.memoizedState=f},useState:a3,useDebugValue:s1,useDeferredValue:function(f){return di().memoizedState=f},useTransition:function(){var f=a3(!1),p=f[0];return f=u1.bind(null,f[1]),di().memoizedState=f,[p,f]},useMutableSource:function(){},useSyncExternalStore:function(f,p,x){var P=Tn,L=di();if(Vn){if(x===void 0)throw Error(a(407));x=x()}else{if(x=p(),ei===null)throw Error(a(349));ku&30||a1(P,p,x)}L.memoizedState=x;var M={value:x,getSnapshot:p};return L.queue=M,s3(pl.bind(null,P,M,f),[f]),P.flags|=2048,$f(9,Bc.bind(null,P,M,x,p),void 0,null),x},useId:function(){var f=di(),p=ei.identifierPrefix;if(Vn){var x=Fa,P=co;x=(P&~(1<<32-Mi(P)-1)).toString(32)+x,p=":"+p+"R"+x,x=Rc++,0sg&&(p.flags|=128,P=!0,Gc(L,!1),p.lanes=4194304)}else{if(!P)if(f=mn(M),f!==null){if(p.flags|=128,P=!0,f=f.updateQueue,f!==null&&(p.updateQueue=f,p.flags|=4),Gc(L,!0),L.tail===null&&L.tailMode==="hidden"&&!M.alternate&&!Vn)return xi(p),null}else 2*Kn()-L.renderingStartTime>sg&&x!==1073741824&&(p.flags|=128,P=!0,Gc(L,!1),p.lanes=4194304);L.isBackwards?(M.sibling=p.child,p.child=M):(f=L.last,f!==null?f.sibling=M:p.child=M,L.last=M)}return L.tail!==null?(p=L.tail,L.rendering=p,L.tail=p.sibling,L.renderingStartTime=Kn(),p.sibling=null,f=$t.current,Pn($t,P?f&1|2:f&1),p):(xi(p),null);case 22:case 23:return td(),x=p.memoizedState!==null,f!==null&&f.memoizedState!==null!==x&&(p.flags|=8192),x&&p.mode&1?po&1073741824&&(xi(p),st&&p.subtreeFlags&6&&(p.flags|=8192)):xi(p),null;case 24:return null;case 25:return null}throw Error(a(156,p.tag))}function y1(f,p){switch(Z0(p),p.tag){case 1:return ui(p.type)&&vs(),f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 3:return nt(),Dn(li),Dn(Hr),n1(),f=p.flags,f&65536&&!(f&128)?(p.flags=f&-65537|128,p):null;case 5:return rn(p),null;case 13:if(Dn($t),f=p.memoizedState,f!==null&&f.dehydrated!==null){if(p.alternate===null)throw Error(a(340));Tc()}return f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 19:return Dn($t),null;case 4:return nt(),null;case 10:return Af(p.type._context),null;case 22:case 23:return td(),null;case 24:return null;default:return null}}var ml=!1,Wr=!1,xw=typeof WeakSet=="function"?WeakSet:Set,ct=null;function qc(f,p){var x=f.ref;if(x!==null)if(typeof x=="function")try{x(null)}catch(P){Zn(f,p,P)}else x.current=null}function pa(f,p,x){try{x()}catch(P){Zn(f,p,P)}}var Yp=!1;function Tu(f,p){for(Q(f.containerInfo),ct=p;ct!==null;)if(f=ct,p=f.child,(f.subtreeFlags&1028)!==0&&p!==null)p.return=f,ct=p;else for(;ct!==null;){f=ct;try{var x=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var P=x.memoizedProps,L=x.memoizedState,M=f.stateNode,G=M.getSnapshotBeforeUpdate(f.elementType===f.type?P:ua(f.type,P),L);M.__reactInternalSnapshotBeforeUpdate=G}break;case 3:st&&rl(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(le){Zn(f,f.return,le)}if(p=f.sibling,p!==null){p.return=f.return,ct=p;break}ct=f.return}return x=Yp,Yp=!1,x}function wi(f,p,x){var P=p.updateQueue;if(P=P!==null?P.lastEffect:null,P!==null){var L=P=P.next;do{if((L.tag&f)===f){var M=L.destroy;L.destroy=void 0,M!==void 0&&pa(p,x,M)}L=L.next}while(L!==P)}}function Kp(f,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var x=p=p.next;do{if((x.tag&f)===f){var P=x.create;x.destroy=P()}x=x.next}while(x!==p)}}function Xp(f){var p=f.ref;if(p!==null){var x=f.stateNode;switch(f.tag){case 5:f=X(x);break;default:f=x}typeof p=="function"?p(f):p.current=f}}function b1(f){var p=f.alternate;p!==null&&(f.alternate=null,b1(p)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(p=f.stateNode,p!==null&&ut(p)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Yc(f){return f.tag===5||f.tag===3||f.tag===4}function Cs(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Yc(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function Zp(f,p,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,p?Xe(x,f,p):At(x,f);else if(P!==4&&(f=f.child,f!==null))for(Zp(f,p,x),f=f.sibling;f!==null;)Zp(f,p,x),f=f.sibling}function S1(f,p,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,p?Rn(x,f,p):Te(x,f);else if(P!==4&&(f=f.child,f!==null))for(S1(f,p,x),f=f.sibling;f!==null;)S1(f,p,x),f=f.sibling}var Nr=null,ga=!1;function ma(f,p,x){for(x=x.child;x!==null;)Ur(f,p,x),x=x.sibling}function Ur(f,p,x){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(gn,x)}catch{}switch(x.tag){case 5:Wr||qc(x,p);case 6:if(st){var P=Nr,L=ga;Nr=null,ma(f,p,x),Nr=P,ga=L,Nr!==null&&(ga?ft(Nr,x.stateNode):xt(Nr,x.stateNode))}else ma(f,p,x);break;case 18:st&&Nr!==null&&(ga?G0(Nr,x.stateNode):U0(Nr,x.stateNode));break;case 4:st?(P=Nr,L=ga,Nr=x.stateNode.containerInfo,ga=!0,ma(f,p,x),Nr=P,ga=L):(mt&&(P=x.stateNode.containerInfo,L=Ba(P),yc(P,L)),ma(f,p,x));break;case 0:case 11:case 14:case 15:if(!Wr&&(P=x.updateQueue,P!==null&&(P=P.lastEffect,P!==null))){L=P=P.next;do{var M=L,G=M.destroy;M=M.tag,G!==void 0&&(M&2||M&4)&&pa(x,p,G),L=L.next}while(L!==P)}ma(f,p,x);break;case 1:if(!Wr&&(qc(x,p),P=x.stateNode,typeof P.componentWillUnmount=="function"))try{P.props=x.memoizedProps,P.state=x.memoizedState,P.componentWillUnmount()}catch(le){Zn(x,p,le)}ma(f,p,x);break;case 21:ma(f,p,x);break;case 22:x.mode&1?(Wr=(P=Wr)||x.memoizedState!==null,ma(f,p,x),Wr=P):ma(f,p,x);break;default:ma(f,p,x)}}function Qp(f){var p=f.updateQueue;if(p!==null){f.updateQueue=null;var x=f.stateNode;x===null&&(x=f.stateNode=new xw),p.forEach(function(P){var L=k3.bind(null,f,P);x.has(P)||(x.add(P),P.then(L,L))})}}function Bo(f,p){var x=p.deletions;if(x!==null)for(var P=0;P";case ng:return":has("+(C1(f)||"")+")";case rg:return'[role="'+f.value+'"]';case ig:return'"'+f.value+'"';case Kc:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Xc(f,p){var x=[];f=[f,0];for(var P=0;PL&&(L=G),P&=~M}if(P=L,P=Kn()-P,P=(120>P?120:480>P?480:1080>P?1080:1920>P?1920:3e3>P?3e3:4320>P?4320:1960*ww(P/1960))-P,10f?16:f,Ot===null)var P=!1;else{if(f=Ot,Ot=null,lg=0,Ut&6)throw Error(a(331));var L=Ut;for(Ut|=4,ct=f.current;ct!==null;){var M=ct,G=M.child;if(ct.flags&16){var le=M.deletions;if(le!==null){for(var pe=0;peKn()-E1?wl(f,0):k1|=x),hi(f,p)}function O1(f,p){p===0&&(f.mode&1?(p=Io,Io<<=1,!(Io&130023424)&&(Io=4194304)):p=1);var x=_i();f=ca(f,p),f!==null&&($a(f,p,x),hi(f,x))}function _w(f){var p=f.memoizedState,x=0;p!==null&&(x=p.retryLane),O1(f,x)}function k3(f,p){var x=0;switch(f.tag){case 13:var P=f.stateNode,L=f.memoizedState;L!==null&&(x=L.retryLane);break;case 19:P=f.stateNode;break;default:throw Error(a(314))}P!==null&&P.delete(p),O1(f,x)}var M1;M1=function(f,p,x){if(f!==null)if(f.memoizedProps!==p.pendingProps||li.current)Zi=!0;else{if(!(f.lanes&x)&&!(p.flags&128))return Zi=!1,bw(f,p,x);Zi=!!(f.flags&131072)}else Zi=!1,Vn&&p.flags&1048576&&X0(p,Ir,p.index);switch(p.lanes=0,p.tag){case 2:var P=p.type;Wa(f,p),f=p.pendingProps;var L=ll(p,Hr.current);Ac(p,x),L=i1(null,p,P,f,L,x);var M=Dc();return p.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,ui(P)?(M=!0,ys(p)):M=!1,p.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,J0(p),L.updater=da,p.stateNode=L,L._reactInternals=p,e1(p,P,f,x),p=fa(null,p,P,!0,M,x)):(p.tag=0,Vn&&M&&Ii(p),Ni(null,p,L,x),p=p.child),p;case 16:P=p.elementType;e:{switch(Wa(f,p),f=p.pendingProps,L=P._init,P=L(P._payload),p.type=P,L=p.tag=gg(P),f=ua(P,f),L){case 0:p=h1(null,p,P,f,x);break e;case 1:p=m3(null,p,P,f,x);break e;case 11:p=f3(null,p,P,f,x);break e;case 14:p=gl(null,p,P,ua(P.type,f),x);break e}throw Error(a(306,P,""))}return p;case 0:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ua(P,L),h1(f,p,P,L,x);case 1:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ua(P,L),m3(f,p,P,L,x);case 3:e:{if(v3(p),f===null)throw Error(a(387));P=p.pendingProps,M=p.memoizedState,L=M.element,Jy(f,p),$p(p,P,null,x);var G=p.memoizedState;if(P=G.element,St&&M.isDehydrated)if(M={element:P,isDehydrated:!1,cache:G.cache,pendingSuspenseBoundaries:G.pendingSuspenseBoundaries,transitions:G.transitions},p.updateQueue.baseState=M,p.memoizedState=M,p.flags&256){L=Wc(Error(a(423)),p),p=y3(f,p,P,x,L);break e}else if(P!==L){L=Wc(Error(a(424)),p),p=y3(f,p,P,x,L);break e}else for(St&&(Do=B0(p.stateNode.containerInfo),Xn=p,Vn=!0,Ki=null,No=!1),x=i3(p,null,P,x),p.child=x;x;)x.flags=x.flags&-3|4096,x=x.sibling;else{if(Tc(),P===L){p=ws(f,p,x);break e}Ni(f,p,P,x)}p=p.child}return p;case 5:return It(p),f===null&&Ef(p),P=p.type,L=p.pendingProps,M=f!==null?f.memoizedProps:null,G=L.children,We(P,L)?G=null:M!==null&&We(P,M)&&(p.flags|=32),g3(f,p),Ni(f,p,G,x),p.child;case 6:return f===null&&Ef(p),null;case 13:return b3(f,p,x);case 4:return ve(p,p.stateNode.containerInfo),P=p.pendingProps,f===null?p.child=Mc(p,null,P,x):Ni(f,p,P,x),p.child;case 11:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ua(P,L),f3(f,p,P,L,x);case 7:return Ni(f,p,p.pendingProps,x),p.child;case 8:return Ni(f,p,p.pendingProps.children,x),p.child;case 12:return Ni(f,p,p.pendingProps.children,x),p.child;case 10:e:{if(P=p.type._context,L=p.pendingProps,M=p.memoizedProps,G=L.value,Qy(p,P,G),M!==null)if(Y(M.value,G)){if(M.children===L.children&&!li.current){p=ws(f,p,x);break e}}else for(M=p.child,M!==null&&(M.return=p);M!==null;){var le=M.dependencies;if(le!==null){G=M.child;for(var pe=le.firstContext;pe!==null;){if(pe.context===P){if(M.tag===1){pe=Ss(-1,x&-x),pe.tag=2;var ze=M.updateQueue;if(ze!==null){ze=ze.shared;var dt=ze.pending;dt===null?pe.next=pe:(pe.next=dt.next,dt.next=pe),ze.pending=pe}}M.lanes|=x,pe=M.alternate,pe!==null&&(pe.lanes|=x),Of(M.return,x,p),le.lanes|=x;break}pe=pe.next}}else if(M.tag===10)G=M.type===p.type?null:M.child;else if(M.tag===18){if(G=M.return,G===null)throw Error(a(341));G.lanes|=x,le=G.alternate,le!==null&&(le.lanes|=x),Of(G,x,p),G=M.sibling}else G=M.child;if(G!==null)G.return=M;else for(G=M;G!==null;){if(G===p){G=null;break}if(M=G.sibling,M!==null){M.return=G.return,G=M;break}G=G.return}M=G}Ni(f,p,L.children,x),p=p.child}return p;case 9:return L=p.type,P=p.pendingProps.children,Ac(p,x),L=fo(L),P=P(L),p.flags|=1,Ni(f,p,P,x),p.child;case 14:return P=p.type,L=ua(P,p.pendingProps),L=ua(P.type,L),gl(f,p,P,L,x);case 15:return h3(f,p,p.type,p.pendingProps,x);case 17:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ua(P,L),Wa(f,p),p.tag=1,ui(P)?(f=!0,ys(p)):f=!1,Ac(p,x),t3(p,P,L),e1(p,P,L,x),fa(null,p,P,!0,f,x);case 19:return x3(f,p,x);case 22:return p3(f,p,x)}throw Error(a(156,p.tag))};function $i(f,p){return kc(f,p)}function Ua(f,p,x,P){this.tag=f,this.key=x,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=P,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zo(f,p,x,P){return new Ua(f,p,x,P)}function I1(f){return f=f.prototype,!(!f||!f.isReactComponent)}function gg(f){if(typeof f=="function")return I1(f)?1:0;if(f!=null){if(f=f.$$typeof,f===S)return 11;if(f===_)return 14}return 2}function mo(f,p){var x=f.alternate;return x===null?(x=zo(f.tag,p,f.key,f.mode),x.elementType=f.elementType,x.type=f.type,x.stateNode=f.stateNode,x.alternate=f,f.alternate=x):(x.pendingProps=p,x.type=f.type,x.flags=0,x.subtreeFlags=0,x.deletions=null),x.flags=f.flags&14680064,x.childLanes=f.childLanes,x.lanes=f.lanes,x.child=f.child,x.memoizedProps=f.memoizedProps,x.memoizedState=f.memoizedState,x.updateQueue=f.updateQueue,p=f.dependencies,x.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},x.sibling=f.sibling,x.index=f.index,x.ref=f.ref,x}function Zf(f,p,x,P,L,M){var G=2;if(P=f,typeof f=="function")I1(f)&&(G=1);else if(typeof f=="string")G=5;else e:switch(f){case d:return kl(x.children,L,M,p);case h:G=8,L|=8;break;case m:return f=zo(12,x,p,L|2),f.elementType=m,f.lanes=M,f;case k:return f=zo(13,x,p,L),f.elementType=k,f.lanes=M,f;case E:return f=zo(19,x,p,L),f.elementType=E,f.lanes=M,f;case A:return mg(x,L,M,p);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case v:G=10;break e;case b:G=9;break e;case S:G=11;break e;case _:G=14;break e;case T:G=16,P=null;break e}throw Error(a(130,f==null?f:typeof f,""))}return p=zo(G,x,p,L),p.elementType=f,p.type=P,p.lanes=M,p}function kl(f,p,x,P){return f=zo(7,f,P,p),f.lanes=x,f}function mg(f,p,x,P){return f=zo(22,f,P,p),f.elementType=A,f.lanes=x,f.stateNode={isHidden:!1},f}function vg(f,p,x){return f=zo(6,f,null,p),f.lanes=x,f}function El(f,p,x){return p=zo(4,f.children!==null?f.children:[],f.key,p),p.lanes=x,p.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},p}function Qf(f,p,x,P,L){this.tag=p,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Be,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_c(0),this.expirationTimes=_c(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_c(0),this.identifierPrefix=P,this.onRecoverableError=L,St&&(this.mutableSourceEagerHydrationData=null)}function E3(f,p,x,P,L,M,G,le,pe){return f=new Qf(f,p,x,le,pe),p===1?(p=1,M===!0&&(p|=8)):p=0,M=zo(3,null,null,p),f.current=M,M.stateNode=f,M.memoizedState={element:P,isDehydrated:x,cache:null,transitions:null,pendingSuspenseBoundaries:null},J0(M),f}function R1(f){if(!f)return aa;f=f._reactInternals;e:{if(z(f)!==f||f.tag!==1)throw Error(a(170));var p=f;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(ui(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(a(171))}if(f.tag===1){var x=f.type;if(ui(x))return Su(f,x,p)}return p}function D1(f){var p=f._reactInternals;if(p===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=te(p),f===null?null:f.stateNode}function Jf(f,p){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var x=f.retryLane;f.retryLane=x!==0&&x=ze&&M>=jt&&L<=dt&&G<=rt){f.splice(p,1);break}else if(P!==ze||x.width!==pe.width||rtG){if(!(M!==jt||x.height!==pe.height||dtL)){ze>P&&(pe.width+=ze-P,pe.x=P),dtM&&(pe.height+=jt-M,pe.y=M),rtx&&(x=G)),G ")+` - -No matching component was found for: - `)+f.join(" > ")}return null},n.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return X(f.child.stateNode);default:return f.child.stateNode}},n.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:yg,findFiberByHostInstance:f.findFiberByHostInstance||N1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(p.isDisabled||!p.supportsFiber)f=!0;else{try{gn=p.inject(f),Kt=p}catch{}f=!!p.checkDCE}}return f},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(f,p,x,P){if(!ae)throw Error(a(363));f=_1(f,p);var L=Dt(f,x,P).disconnect;return{disconnect:function(){L()}}},n.registerMutableSourceForHydration=function(f,p){var x=p._getVersion;x=x(p._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[p,x]:f.mutableSourceEagerHydrationData.push(p,x)},n.runWithPriority=function(f,p){var x=Yt;try{return Yt=f,p()}finally{Yt=x}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(f,p,x,P){var L=p.current,M=_i(),G=qr(L);return x=R1(x),p.context===null?p.context=x:p.pendingContext=x,p=Ss(M,G),p.payload={element:f},P=P===void 0?null:P,P!==null&&(p.callback=P),f=hl(L,p,G),f!==null&&(Fo(f,L,G,M),Bp(f,L,G)),G},n};(function(e){e.exports=vOe})(mOe);const yOe=d_(K8);var lS={},bOe={get exports(){return lS},set exports(e){lS=e}},Sp={};/** - * @license React - * react-reconciler-constants.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */Sp.ConcurrentRoot=1;Sp.ContinuousEventPriority=4;Sp.DefaultEventPriority=16;Sp.DiscreteEventPriority=1;Sp.IdleEventPriority=536870912;Sp.LegacyRoot=0;(function(e){e.exports=Sp})(bOe);const JD={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let eN=!1,tN=!1;const tT=".react-konva-event",SOe=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. -Position of a node will be changed during drag&drop, so you should update state of the react app as well. -Consider to add onDragMove or onDragEnd events. -For more info see: https://github.com/konvajs/react-konva/issues/256 -`,xOe=`ReactKonva: You are using "zIndex" attribute for a Konva node. -react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. -For more info see: https://github.com/konvajs/react-konva/issues/194 -`,wOe={};function sw(e,t,n=wOe){if(!eN&&"zIndex"in t&&(console.warn(xOe),eN=!0),!tN&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(SOe),tN=!0)}for(var o in n)if(!JD[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var d=t._useStrictMode,h={},m=!1;const v={};for(var o in t)if(!JD[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(v[l]=t[o])}!a&&(t[o]!==n[o]||d&&t[o]!==e.getAttr(o))&&(m=!0,h[o]=t[o])}m&&(e.setAttrs(h),gf(e));for(var l in v)e.on(l+tT,v[l])}function gf(e){if(!pt.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const AY={},COe={};ep.Node.prototype._applyProps=sw;function _Oe(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),gf(e)}function kOe(e,t,n){let r=ep[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=ep.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return sw(l,o),l}function EOe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function POe(e,t,n){return!1}function TOe(e){return e}function LOe(){return null}function AOe(){return null}function OOe(e,t,n,r){return COe}function MOe(){}function IOe(e){}function ROe(e,t){return!1}function DOe(){return AY}function NOe(){return AY}const jOe=setTimeout,BOe=clearTimeout,$Oe=-1;function FOe(e,t){return!1}const zOe=!1,HOe=!0,VOe=!0;function WOe(e,t){t.parent===e?t.moveToTop():e.add(t),gf(e)}function UOe(e,t){t.parent===e?t.moveToTop():e.add(t),gf(e)}function OY(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),gf(e)}function GOe(e,t,n){OY(e,t,n)}function qOe(e,t){t.destroy(),t.off(tT),gf(e)}function YOe(e,t){t.destroy(),t.off(tT),gf(e)}function KOe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function XOe(e,t,n){}function ZOe(e,t,n,r,i){sw(e,i,r)}function QOe(e){e.hide(),gf(e)}function JOe(e){}function eMe(e,t){(t.visible==null||t.visible)&&e.show()}function tMe(e,t){}function nMe(e){}function rMe(){}const iMe=()=>lS.DefaultEventPriority,oMe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:WOe,appendChildToContainer:UOe,appendInitialChild:_Oe,cancelTimeout:BOe,clearContainer:nMe,commitMount:XOe,commitTextUpdate:KOe,commitUpdate:ZOe,createInstance:kOe,createTextInstance:EOe,detachDeletedInstance:rMe,finalizeInitialChildren:POe,getChildHostContext:NOe,getCurrentEventPriority:iMe,getPublicInstance:TOe,getRootHostContext:DOe,hideInstance:QOe,hideTextInstance:JOe,idlePriority:Bh.unstable_IdlePriority,insertBefore:OY,insertInContainerBefore:GOe,isPrimaryRenderer:zOe,noTimeout:$Oe,now:Bh.unstable_now,prepareForCommit:LOe,preparePortalMount:AOe,prepareUpdate:OOe,removeChild:qOe,removeChildFromContainer:YOe,resetAfterCommit:MOe,resetTextContent:IOe,run:Bh.unstable_runWithPriority,scheduleTimeout:jOe,shouldDeprioritizeSubtree:ROe,shouldSetTextContent:FOe,supportsMutation:VOe,unhideInstance:eMe,unhideTextInstance:tMe,warnsIfNotActing:HOe},Symbol.toStringTag,{value:"Module"}));var aMe=Object.defineProperty,sMe=Object.defineProperties,lMe=Object.getOwnPropertyDescriptors,nN=Object.getOwnPropertySymbols,uMe=Object.prototype.hasOwnProperty,cMe=Object.prototype.propertyIsEnumerable,rN=(e,t,n)=>t in e?aMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iN=(e,t)=>{for(var n in t||(t={}))uMe.call(t,n)&&rN(e,n,t[n]);if(nN)for(var n of nN(t))cMe.call(t,n)&&rN(e,n,t[n]);return e},dMe=(e,t)=>sMe(e,lMe(t));function nT(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=nT(r,t,n);if(i)return i;r=t?null:r.sibling}}function MY(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const rT=MY(w.createContext(null));class IY extends w.Component{render(){return w.createElement(rT.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:fMe,ReactCurrentDispatcher:hMe}=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function pMe(){const e=w.useContext(rT);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=w.useId();return w.useMemo(()=>{var r;return(r=fMe.current)!=null?r:nT(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const hv=[],oN=new WeakMap;function gMe(){var e;const t=pMe();hv.splice(0,hv.length),nT(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==rT&&hv.push(MY(i))});for(const n of hv){const r=(e=hMe.current)==null?void 0:e.readContext(n);oN.set(n,r)}return w.useMemo(()=>hv.reduce((n,r)=>i=>w.createElement(n,null,w.createElement(r.Provider,dMe(iN({},i),{value:oN.get(r)}))),n=>w.createElement(IY,iN({},n))),[])}function mMe(e){const t=N.useRef();return N.useLayoutEffect(()=>{t.current=e}),t.current}const vMe=e=>{const t=N.useRef(),n=N.useRef(),r=N.useRef(),i=mMe(e),o=gMe(),a=s=>{const{forwardedRef:l}=e;l&&(typeof l=="function"?l(s):l.current=s)};return N.useLayoutEffect(()=>(n.current=new ep.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=Iv.createContainer(n.current,lS.LegacyRoot,!1,null),Iv.updateContainer(N.createElement(o,{},e.children),r.current),()=>{ep.isBrowser&&(a(null),Iv.updateContainer(null,r.current,null),n.current.destroy())}),[]),N.useLayoutEffect(()=>{a(n.current),sw(n.current,e,i),Iv.updateContainer(N.createElement(o,{},e.children),r.current,null)}),N.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},pv="Layer",sc="Group",lc="Rect",sh="Circle",uS="Line",RY="Image",yMe="Transformer",Iv=yOe(oMe);Iv.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:N.version,rendererPackageName:"react-konva"});const bMe=N.forwardRef((e,t)=>N.createElement(IY,{},N.createElement(vMe,{...e,forwardedRef:t}))),SMe=at([sn,Mr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),xMe=()=>{const e=Me(),{tool:t,isStaging:n,isMovingBoundingBox:r}=he(SMe);return{handleDragStart:w.useCallback(()=>{(t==="move"||n)&&!r&&e(U5(!0))},[e,r,n,t]),handleDragMove:w.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(ZW(o))},[e,r,n,t]),handleDragEnd:w.useCallback(()=>{(t==="move"||n)&&!r&&e(U5(!1))},[e,r,n,t])}},wMe=at([sn,Or,Mr],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),CMe=()=>{const e=Me(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=he(wMe),s=w.useRef(null),l=zG(),u=()=>e(nP());Je(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const d=()=>e(Dy(!o));Je(["h"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[o]),Je(["n"],()=>{e(q5(!a))},{enabled:!0,preventDefault:!0},[a]),Je("esc",()=>{e(Cxe())},{enabled:()=>!0,preventDefault:!0}),Je("shift+h",()=>{e(Axe(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),Je(["space"],h=>{h.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(tu("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(tu(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},iT=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},DY=()=>{const e=Me(),t=el(),n=zG();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=Fg.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(Pxe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(mxe())}}},_Me=at([Or,sn,Mr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),kMe=e=>{const t=Me(),{tool:n,isStaging:r}=he(_Me),{commitColorUnderCursor:i}=DY();return w.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(U5(!0));return}if(n==="colorPicker"){i();return}const a=iT(e.current);a&&(o.evt.preventDefault(),t(HW(!0)),t(gxe([a.x,a.y])))},[e,n,r,t,i])},EMe=at([Or,sn,Mr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),PMe=(e,t,n)=>{const r=Me(),{isDrawing:i,tool:o,isStaging:a}=he(EMe),{updateColorUnderCursor:s}=DY();return w.useCallback(()=>{if(!e.current)return;const l=iT(e.current);if(l){if(r(Txe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r($W([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},TMe=()=>{const e=Me();return w.useCallback(()=>{e(bxe())},[e])},LMe=at([Or,sn,Mr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),AMe=(e,t)=>{const n=Me(),{tool:r,isDrawing:i,isStaging:o}=he(LMe);return w.useCallback(()=>{if(r==="move"||o){n(U5(!1));return}if(!t.current&&i&&e.current){const a=iT(e.current);if(!a)return;n($W([a.x,a.y]))}else t.current=!1;n(HW(!1))},[t,n,i,o,e,r])},OMe=at([sn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),MMe=e=>{const t=Me(),{isMoveStageKeyHeld:n,stageScale:r}=he(OMe);return w.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=ke.clamp(r*ixe**s,oxe,axe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(Mxe(l)),t(ZW(u))},[e,n,r,t])},IMe=at(sn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),RMe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(IMe);return y.jsxs(sc,{children:[y.jsx(lc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),y.jsx(lc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},DMe=at([sn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),NMe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},jMe=()=>{const{colorMode:e}=dy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=he(DMe),[i,o]=w.useState([]),a=w.useCallback(s=>s/t,[t]);return w.useLayoutEffect(()=>{const s=NMe[e],{width:l,height:u}=r,{x:d,y:h}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(d),y:a(h)}},v={x:Math.ceil(a(d)/64)*64,y:Math.ceil(a(h)/64)*64},b={x1:-v.x,y1:-v.y,x2:a(l)-v.x+64,y2:a(u)-v.y+64},k={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},E=k.x2-k.x1,_=k.y2-k.y1,T=Math.round(E/64)+1,A=Math.round(_/64)+1,I=ke.range(0,T).map(D=>y.jsx(uS,{x:k.x1+D*64,y:k.y1,points:[0,0,0,_],stroke:s,strokeWidth:1},`x_${D}`)),R=ke.range(0,A).map(D=>y.jsx(uS,{x:k.x1,y:k.y1+D*64,points:[0,0,E,0],stroke:s,strokeWidth:1},`y_${D}`));o(I.concat(R))},[t,n,r,e,a]),y.jsx(sc,{children:i})},BMe=at([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),$Me=e=>{const{...t}=e,n=he(BMe),[r,i]=w.useState(null);if(w.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?y.jsx(RY,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},Hh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},FMe=at(sn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:Hh(t)}}),aN=e=>`data:image/svg+xml;utf8, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`.replaceAll("black",e),zMe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(FMe),[a,s]=w.useState(null),[l,u]=w.useState(0),d=w.useRef(null),h=w.useCallback(()=>{u(l+1),setTimeout(h,500)},[l]);return w.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=aN(n)},[a,n]),w.useEffect(()=>{a&&(a.src=aN(n))},[a,n]),w.useEffect(()=>{const m=setInterval(()=>u(v=>(v+1)%5),50);return()=>clearInterval(m)},[]),!a||!ke.isNumber(r.x)||!ke.isNumber(r.y)||!ke.isNumber(o)||!ke.isNumber(i.width)||!ke.isNumber(i.height)?null:y.jsx(lc,{ref:d,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:ke.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},HMe=at([sn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VMe=e=>{const{...t}=e,{objects:n}=he(HMe);return y.jsx(sc,{listening:!1,...t,children:n.filter(tP).map((r,i)=>y.jsx(uS,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})};var lh=w,WMe=function(t,n,r){const i=lh.useRef("loading"),o=lh.useRef(),[a,s]=lh.useState(0),l=lh.useRef(),u=lh.useRef(),d=lh.useRef();return(l.current!==t||u.current!==n||d.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,d.current=r),lh.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function m(){i.current="loaded",o.current=h,s(Math.random())}function v(){i.current="failed",o.current=void 0,s(Math.random())}return h.addEventListener("load",m),h.addEventListener("error",v),n&&(h.crossOrigin=n),r&&(h.referrerpolicy=r),h.src=t,function(){h.removeEventListener("load",m),h.removeEventListener("error",v)}},[t,n,r]),[o.current,i.current]};const NY=e=>{const{url:t,x:n,y:r}=e,[i]=WMe(t);return y.jsx(RY,{x:n,y:r,image:i,listening:!1})},UMe=at([sn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),GMe=()=>{const{objects:e}=he(UMe);return e?y.jsx(sc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(W5(t))return y.jsx(NY,{x:t.x,y:t.y,url:t.image.url},n);if(uxe(t)){const r=y.jsx(uS,{points:t.points,stroke:t.color?Hh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?y.jsx(sc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(cxe(t))return y.jsx(lc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Hh(t.color)},n);if(dxe(t))return y.jsx(lc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},qMe=at([sn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),YMe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=he(qMe);return y.jsxs(sc,{...t,children:[r&&n&&y.jsx(NY,{url:n.image.url,x:o,y:a}),i&&y.jsxs(sc,{children:[y.jsx(lc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),y.jsx(lc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},KMe=at([sn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),XMe=()=>{const e=Me(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=he(KMe),{t:o}=Ve(),a=w.useCallback(()=>{e(NI(!0))},[e]),s=w.useCallback(()=>{e(NI(!1))},[e]);Je(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),Je(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),Je(["enter"],()=>{d()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(xxe()),u=()=>e(Sxe()),d=()=>e(vxe());return r?y.jsx(Ge,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:y.jsxs(oo,{isAttached:!0,children:[y.jsx(Qe,{tooltip:`${o("unifiedcanvas:previous")} (Left)`,"aria-label":`${o("unifiedcanvas:previous")} (Left)`,icon:y.jsx(Jke,{}),onClick:l,"data-selected":!0,isDisabled:t}),y.jsx(Qe,{tooltip:`${o("unifiedcanvas:next")} (Right)`,"aria-label":`${o("unifiedcanvas:next")} (Right)`,icon:y.jsx(eEe,{}),onClick:u,"data-selected":!0,isDisabled:n}),y.jsx(Qe,{tooltip:`${o("unifiedcanvas:accept")} (Enter)`,"aria-label":`${o("unifiedcanvas:accept")} (Enter)`,icon:y.jsx(PP,{}),onClick:d,"data-selected":!0}),y.jsx(Qe,{tooltip:o("unifiedcanvas:showHide"),"aria-label":o("unifiedcanvas:showHide"),"data-alert":!i,icon:i?y.jsx(sEe,{}):y.jsx(aEe,{}),onClick:()=>e(Oxe(!i)),"data-selected":!0}),y.jsx(Qe,{tooltip:o("unifiedcanvas:saveToGallery"),"aria-label":o("unifiedcanvas:saveToGallery"),icon:y.jsx(LP,{}),onClick:()=>e(F8e(r.image.url)),"data-selected":!0}),y.jsx(Qe,{tooltip:o("unifiedcanvas:discardAll"),"aria-label":o("unifiedcanvas:discardAll"),icon:y.jsx(zy,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(yxe()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},fm=e=>Math.round(e*100)/100,ZMe=at([sn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${fm(n)}, ${fm(r)})`}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function QMe(){const{cursorCoordinatesString:e}=he(ZMe),{t}=Ve();return y.jsx("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const JMe=at([sn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:d},stageScale:h,shouldShowCanvasDebugInfo:m,layer:v,boundingBoxScaleMethod:b,shouldPreserveMaskedArea:S}=e;let k="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(k="var(--status-working-color)"),{activeLayerColor:v==="mask"?"var(--status-working-color)":"inherit",activeLayerString:v.charAt(0).toUpperCase()+v.slice(1),boundingBoxColor:k,boundingBoxCoordinatesString:`(${fm(u)}, ${fm(d)})`,boundingBoxDimensionsString:`${o}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${fm(r)}×${fm(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none",shouldPreserveMaskedArea:S}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),eIe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:d,shouldShowBoundingBox:h,shouldPreserveMaskedArea:m}=he(JMe),{t:v}=Ve();return y.jsxs("div",{className:"canvas-status-text",children:[y.jsx("div",{style:{color:e},children:`${v("unifiedcanvas:activeLayer")}: ${t}`}),y.jsx("div",{children:`${v("unifiedcanvas:canvasScale")}: ${u}%`}),m&&y.jsx("div",{style:{color:"var(--status-working-color)"},children:"Preserve Masked Area: On"}),h&&y.jsx("div",{style:{color:n},children:`${v("unifiedcanvas:boundingBox")}: ${i}`}),a&&y.jsx("div",{style:{color:n},children:`${v("unifiedcanvas:scaledBoundingBox")}: ${o}`}),d&&y.jsxs(y.Fragment,{children:[y.jsx("div",{children:`${v("unifiedcanvas:boundingBoxPosition")}: ${r}`}),y.jsx("div",{children:`${v("unifiedcanvas:canvasDimensions")}: ${l}`}),y.jsx("div",{children:`${v("unifiedcanvas:canvasPosition")}: ${s}`}),y.jsx(QMe,{})]})]})},tIe=at(sn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),nIe=e=>{const{...t}=e,n=Me(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:d,hitStrokeWidth:h}=he(tIe),m=w.useRef(null),v=w.useRef(null),[b,S]=w.useState(!1);w.useEffect(()=>{var te;!m.current||!v.current||(m.current.nodes([v.current]),(te=m.current.getLayer())==null||te.batchDraw())},[]);const k=64*l,E=w.useCallback(te=>{if(!u){n(vC({x:Math.floor(te.target.x()),y:Math.floor(te.target.y())}));return}const q=te.target.x(),$=te.target.y(),U=Gl(q,64),X=Gl($,64);te.target.x(U),te.target.y(X),n(vC({x:U,y:X}))},[n,u]),_=w.useCallback(()=>{if(!v.current)return;const te=v.current,q=te.scaleX(),$=te.scaleY(),U=Math.round(te.width()*q),X=Math.round(te.height()*$),Z=Math.round(te.x()),W=Math.round(te.y());n(Ev({width:U,height:X})),n(vC({x:u?Ed(Z,64):Z,y:u?Ed(W,64):W})),te.scaleX(1),te.scaleY(1)},[n,u]),T=w.useCallback((te,q,$)=>{const U=te.x%k,X=te.y%k;return{x:Ed(q.x,k)+U,y:Ed(q.y,k)+X}},[k]),A=()=>{n(bC(!0))},I=()=>{n(bC(!1)),n(yC(!1)),n(Cb(!1)),S(!1)},R=()=>{n(yC(!0))},D=()=>{n(bC(!1)),n(yC(!1)),n(Cb(!1)),S(!1)},j=()=>{S(!0)},z=()=>{!s&&!a&&S(!1)},V=()=>{n(Cb(!0))},K=()=>{n(Cb(!1))};return y.jsxs(sc,{...t,children:[y.jsx(lc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:V,onMouseOver:V,onMouseLeave:K,onMouseOut:K}),y.jsx(lc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:h,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onDragMove:E,onMouseDown:R,onMouseOut:z,onMouseOver:j,onMouseEnter:j,onMouseUp:D,onTransform:_,onTransformEnd:I,ref:v,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),y.jsx(yMe,{anchorCornerRadius:3,anchorDragBoundFunc:T,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:d==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onMouseDown:A,onMouseUp:I,onTransformEnd:I,ref:m,rotateEnabled:!1})]})},rIe=at(sn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:d,stageScale:h,stageDimensions:m,boundingBoxCoordinates:v,boundingBoxDimensions:b,shouldRestrictStrokesToBox:S}=e,k=S?{clipX:v.x,clipY:v.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:RI/h,colorPickerInnerRadius:(RI-s8+1)/h,maskColorString:Hh({...i,a:.5}),brushColorString:Hh(o),colorPickerColorString:Hh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||d||!t)&&l,strokeWidth:1.5/h,dotRadius:1.5/h,clip:k}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),iIe=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:d,brushColorString:h,colorPickerColorString:m,colorPickerInnerRadius:v,colorPickerOuterRadius:b,clip:S}=he(rIe);return l?y.jsxs(sc,{listening:!1,...S,...t,children:[a==="colorPicker"?y.jsxs(y.Fragment,{children:[y.jsx(sh,{x:n,y:r,radius:b,stroke:h,strokeWidth:s8,strokeScaleEnabled:!1}),y.jsx(sh,{x:n,y:r,radius:v,stroke:m,strokeWidth:s8,strokeScaleEnabled:!1})]}):y.jsxs(y.Fragment,{children:[y.jsx(sh,{x:n,y:r,radius:i,fill:s==="mask"?o:h,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),y.jsx(sh,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:d*2,strokeEnabled:!0,listening:!1}),y.jsx(sh,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),y.jsx(sh,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),y.jsx(sh,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},oIe=at([sn,Mr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:d,isMovingStage:h,shouldShowIntermediates:m,shouldShowGrid:v,shouldRestrictStrokesToBox:b}=e;let S="none";return d==="move"||t?h?S="grabbing":S="grab":o?S=void 0:b&&!a&&(S="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:v,stageCoordinates:u,stageCursor:S,stageDimensions:l,stageScale:r,tool:d,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),jY=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:d}=he(oIe);CMe();const h=w.useRef(null),m=w.useRef(null),v=w.useCallback(z=>{S8e(z),h.current=z},[]),b=w.useCallback(z=>{b8e(z),m.current=z},[]),S=w.useRef({x:0,y:0}),k=w.useRef(!1),E=MMe(h),_=kMe(h),T=AMe(h,k),A=PMe(h,k,S),I=TMe(),{handleDragStart:R,handleDragMove:D,handleDragEnd:j}=xMe();return y.jsx("div",{className:"inpainting-canvas-container",children:y.jsxs("div",{className:"inpainting-canvas-wrapper",children:[y.jsxs(bMe,{tabIndex:-1,ref:v,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:_,onTouchMove:A,onTouchEnd:T,onMouseDown:_,onMouseLeave:I,onMouseMove:A,onMouseUp:T,onDragStart:R,onDragMove:D,onDragEnd:j,onContextMenu:z=>z.evt.preventDefault(),onWheel:E,draggable:(l==="move"||u)&&!t,children:[y.jsx(pv,{id:"grid",visible:r,children:y.jsx(jMe,{})}),y.jsx(pv,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:y.jsx(GMe,{})}),y.jsxs(pv,{id:"mask",visible:e,listening:!1,children:[y.jsx(VMe,{visible:!0,listening:!1}),y.jsx(zMe,{listening:!1})]}),y.jsx(pv,{children:y.jsx(RMe,{})}),y.jsxs(pv,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&y.jsx(iIe,{visible:l!=="move",listening:!1}),y.jsx(YMe,{visible:u}),d&&y.jsx($Me,{}),y.jsx(nIe,{visible:n&&!u})]})]}),y.jsx(eIe,{}),y.jsx(XMe,{})]})})},aIe=at(sn,xq,Or,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),BY=()=>{const e=Me(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=he(aIe),o=w.useRef(null);return w.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(Exe({width:a,height:s})),e(i?_xe():Rx()),e(vi(!1))},0)},[e,r,t,n,i]),y.jsx("div",{ref:o,className:"inpainting-canvas-area",children:y.jsx(xy,{thickness:"2px",speed:"1s",size:"xl"})})},sIe=at([sn,Or,ir],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function $Y(){const e=Me(),{canRedo:t,activeTabName:n}=he(sIe),{t:r}=Ve(),i=()=>{e(wxe())};return Je(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),y.jsx(Qe,{"aria-label":`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,icon:y.jsx(yEe,{}),onClick:i,isDisabled:!t})}const lIe=at([sn,Or,ir],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function FY(){const e=Me(),{t}=Ve(),{canUndo:n,activeTabName:r}=he(lIe),i=()=>{e(Ixe())};return Je(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),y.jsx(Qe,{"aria-label":`${t("unifiedcanvas:undo")} (Ctrl+Z)`,tooltip:`${t("unifiedcanvas:undo")} (Ctrl+Z)`,icon:y.jsx(wEe,{}),onClick:i,isDisabled:!n})}const uIe=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");o&&(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},cIe=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},dIe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:a,y:s,width:l,height:u},h=e.toDataURL(d);return e.scale(i),{dataURL:h,boundingBox:{x:o.x,y:o.y,width:l,height:u}}},fIe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Td=(e=fIe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(nCe("Exporting Image")),t(lm(!1));const u=n(),{stageScale:d,boundingBoxCoordinates:h,boundingBoxDimensions:m,stageCoordinates:v}=u.canvas,b=el();if(!b){t(Hs(!1)),t(lm(!0));return}const{dataURL:S,boundingBox:k}=dIe(b,d,v,i?{...h,...m}:void 0);if(!S){t(Hs(!1)),t(lm(!0));return}const E=new FormData;E.append("data",JSON.stringify({dataURL:S,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:E})).json(),{url:A,width:I,height:R}=T,D={uuid:cm(),category:o?"result":"user",...T};a&&(cIe(A),t(Th({title:zt.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(uIe(A,I,R),t(Th({title:zt.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(sm({image:D,category:"result"})),t(Th({title:zt.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(Lxe({kind:"image",layer:"base",...k,image:D})),t(Th({title:zt.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(Hs(!1)),t(R4(zt.t("common:statusConnected"))),t(lm(!0))};function hIe(){const e=he(Mr),t=el(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Me(),{t:o}=Ve();Je(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Td({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return y.jsx(Qe,{"aria-label":`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:y.jsx(o0,{}),onClick:a,isDisabled:e})}function pIe(){const e=Me(),{t}=Ve(),n=el(),r=he(Mr),i=he(s=>s.system.isProcessing),o=he(s=>s.canvas.shouldCropToBoundingBoxOnSave);Je(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Td({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return y.jsx(Qe,{"aria-label":`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:y.jsx(TP,{}),onClick:a,isDisabled:r})}function gIe(){const e=he(Mr),{openUploader:t}=xP(),{t:n}=Ve();return y.jsx(Qe,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:y.jsx(Zx,{}),onClick:t,isDisabled:e})}const mIe=at([sn,Mr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function vIe(){const e=Me(),{t}=Ve(),{layer:n,isMaskEnabled:r,isStaging:i}=he(mIe),o=()=>{e(G5(n==="mask"?"base":"mask"))};Je(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(G5(l)),l==="mask"&&!r&&e(Dy(!0))};return y.jsx(tl,{tooltip:`${t("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:DW,onChange:a,isDisabled:i})}function yIe(){const e=Me(),{t}=Ve(),n=el(),r=he(Mr),i=he(a=>a.system.isProcessing);Je(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Td({cropVisible:!1,shouldSetAsInitialImage:!0}))};return y.jsx(Qe,{"aria-label":`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:y.jsx(bq,{}),onClick:o,isDisabled:r})}function bIe(){const e=he(o=>o.canvas.tool),t=he(Mr),n=Me(),{t:r}=Ve();Je(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(tu("move"));return y.jsx(Qe,{"aria-label":`${r("unifiedcanvas:move")} (V)`,tooltip:`${r("unifiedcanvas:move")} (V)`,icon:y.jsx(hq,{}),"data-selected":e==="move"||t,onClick:i})}function SIe(){const e=he(i=>i.ui.shouldPinParametersPanel),t=Me(),{t:n}=Ve(),r=()=>{t(Ku(!0)),e&&setTimeout(()=>t(vi(!0)),400)};return y.jsxs(Ge,{flexDirection:"column",gap:"0.5rem",children:[y.jsx(Qe,{tooltip:`${n("parameters:showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters:showOptionsPanel"),onClick:r,children:y.jsx(AP,{})}),y.jsx(Ge,{children:y.jsx(XP,{iconButton:!0})}),y.jsx(Ge,{children:y.jsx(YP,{width:"100%",height:"40px"})})]})}function xIe(){const e=Me(),{t}=Ve(),n=he(Mr),r=()=>{e(rP()),e(Rx())};return y.jsx(Qe,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:y.jsx(vp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function zY(e,t,n=250){const[r,i]=w.useState(0);return w.useEffect(()=>{const o=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(o)},[r,e,t,n]),()=>i(o=>o+1)}function wIe(){const e=el(),t=Me(),{t:n}=Ve();Je(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=zY(()=>i(!1),()=>i(!0)),i=(o=!1)=>{const a=el();if(!a)return;const s=a.getClientRect({skipTransform:!0});t(zW({contentRect:s,shouldScaleTo1:o}))};return y.jsx(Qe,{"aria-label":`${n("unifiedcanvas:resetView")} (R)`,tooltip:`${n("unifiedcanvas:resetView")} (R)`,icon:y.jsx(gq,{}),onClick:r})}function CIe(){const e=he(Mr),t=el(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Me(),{t:o}=Ve();Je(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Td({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return y.jsx(Qe,{"aria-label":`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:y.jsx(LP,{}),onClick:a,isDisabled:e})}const _Ie=at([sn,Mr,ir],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),kIe=()=>{const e=Me(),{t}=Ve(),{tool:n,isStaging:r}=he(_Ie);Je(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),Je(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),Je(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),Je(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),Je(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(tu("brush")),o=()=>e(tu("eraser")),a=()=>e(tu("colorPicker")),s=()=>e(BW()),l=()=>e(jW());return y.jsxs(Ge,{flexDirection:"column",gap:"0.5rem",children:[y.jsxs(oo,{children:[y.jsx(Qe,{"aria-label":`${t("unifiedcanvas:brush")} (B)`,tooltip:`${t("unifiedcanvas:brush")} (B)`,icon:y.jsx(Sq,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),y.jsx(Qe,{"aria-label":`${t("unifiedcanvas:eraser")} (E)`,tooltip:`${t("unifiedcanvas:eraser")} (B)`,icon:y.jsx(mq,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),y.jsxs(oo,{children:[y.jsx(Qe,{"aria-label":`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:y.jsx(yq,{}),isDisabled:r,onClick:s}),y.jsx(Qe,{"aria-label":`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:y.jsx(zy,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),y.jsx(Qe,{"aria-label":`${t("unifiedcanvas:colorPicker")} (C)`,tooltip:`${t("unifiedcanvas:colorPicker")} (C)`,icon:y.jsx(vq,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},oT=Ae((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:d,onClose:h}=Wh(),m=w.useRef(null),v=()=>{r(),h()},b=()=>{o&&o(),h()};return y.jsxs(y.Fragment,{children:[w.cloneElement(l,{onClick:d,ref:t}),y.jsx(AV,{isOpen:u,leastDestructiveRef:m,onClose:h,children:y.jsx(Kd,{children:y.jsxs(OV,{className:"modal",children:[y.jsx(w0,{fontSize:"lg",fontWeight:"bold",children:s}),y.jsx(n0,{children:a}),y.jsxs(yx,{children:[y.jsx(as,{ref:m,onClick:b,className:"modal-close-btn",children:i}),y.jsx(as,{colorScheme:"red",onClick:v,ml:3,children:n})]})]})})})]})}),HY=()=>{const e=he(Mr),t=Me(),{t:n}=Ve(),r=()=>{t(z8e()),t(rP()),t(FW())};return y.jsxs(oT,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:y.jsx(cr,{leftIcon:y.jsx(vp,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[y.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),y.jsx("br",{}),y.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},VY=()=>{const e=he(Mr),t=Me(),{t:n}=Ve();return y.jsxs(oT,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:()=>t(FW()),acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:y.jsx(cr,{size:"sm",leftIcon:y.jsx(vp,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[y.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),y.jsx("br",{}),y.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},EIe=at([sn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),PIe=()=>{const e=Me(),{t}=Ve(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=he(EIe);return y.jsx(Zs,{trigger:"hover",triggerComponent:y.jsx(Qe,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:y.jsx(OP,{})}),children:y.jsxs(Ge,{direction:"column",gap:"0.5rem",children:[y.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:o,onChange:a=>e(XW(a.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:a=>e(WW(a.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:a=>e(UW(a.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:a=>e(YW(a.target.checked))}),y.jsx(VY,{}),y.jsx(HY,{})]})})},TIe=()=>{const e=he(t=>t.ui.shouldShowParametersPanel);return y.jsxs(Ge,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[y.jsx(vIe,{}),y.jsx(kIe,{}),y.jsxs(Ge,{gap:"0.5rem",children:[y.jsx(bIe,{}),y.jsx(wIe,{})]}),y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(yIe,{}),y.jsx(CIe,{})]}),y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(hIe,{}),y.jsx(pIe,{})]}),y.jsxs(Ge,{gap:"0.5rem",children:[y.jsx(FY,{}),y.jsx($Y,{})]}),y.jsxs(Ge,{gap:"0.5rem",children:[y.jsx(gIe,{}),y.jsx(xIe,{})]}),y.jsx(PIe,{}),!e&&y.jsx(SIe,{})]})};function LIe(){const e=Me(),t=he(i=>i.canvas.brushSize),{t:n}=Ve(),r=he(Mr);return Je(["BracketLeft"],()=>{e(jm(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),Je(["BracketRight"],()=>{e(jm(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),y.jsx(so,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:i=>e(jm(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function lw(){return(lw=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function X8(e){var t=w.useRef(e),n=w.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var l0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:k.buttons>0)&&i.current?o(sN(i.current,k,s.current)):S(!1)},b=function(){return S(!1)};function S(k){var E=l.current,_=Z8(i.current),T=k?_.addEventListener:_.removeEventListener;T(E?"touchmove":"mousemove",v),T(E?"touchend":"mouseup",b)}return[function(k){var E=k.nativeEvent,_=i.current;if(_&&(lN(E),!function(A,I){return I&&!d2(A)}(E,l.current)&&_)){if(d2(E)){l.current=!0;var T=E.changedTouches||[];T.length&&(s.current=T[0].identifier)}_.focus(),o(sN(_,E,s.current)),S(!0)}},function(k){var E=k.which||k.keyCode;E<37||E>40||(k.preventDefault(),a({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},S]},[a,o]),d=u[0],h=u[1],m=u[2];return w.useEffect(function(){return m},[m]),N.createElement("div",lw({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),uw=function(e){return e.filter(Boolean).join(" ")},sT=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=uw(["react-colorful__pointer",e.className]);return N.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},N.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Eo=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},UY=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Eo(e.h),s:Eo(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Eo(i/2),a:Eo(r,2)}},Q8=function(e){var t=UY(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},HC=function(e){var t=UY(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},AIe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:Eo(255*[r,s,a,a,l,r][u]),g:Eo(255*[l,r,r,s,a,a][u]),b:Eo(255*[a,a,l,r,r,s][u]),a:Eo(i,2)}},OIe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Eo(60*(s<0?s+6:s)),s:Eo(o?a/o*100:0),v:Eo(o/255*100),a:i}},MIe=N.memo(function(e){var t=e.hue,n=e.onChange,r=uw(["react-colorful__hue",e.className]);return N.createElement("div",{className:r},N.createElement(aT,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:l0(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Eo(t),"aria-valuemax":"360","aria-valuemin":"0"},N.createElement(sT,{className:"react-colorful__hue-pointer",left:t/360,color:Q8({h:t,s:100,v:100,a:1})})))}),IIe=N.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Q8({h:t.h,s:100,v:100,a:1})};return N.createElement("div",{className:"react-colorful__saturation",style:r},N.createElement(aT,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:l0(t.s+100*i.left,0,100),v:l0(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Eo(t.s)+"%, Brightness "+Eo(t.v)+"%"},N.createElement(sT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Q8(t)})))}),GY=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function RIe(e,t,n){var r=X8(n),i=w.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=w.useRef({color:t,hsva:o});w.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),w.useEffect(function(){var u;GY(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=w.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var DIe=typeof window<"u"?w.useLayoutEffect:w.useEffect,NIe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},uN=new Map,jIe=function(e){DIe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!uN.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,uN.set(t,n);var r=NIe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},BIe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+HC(Object.assign({},n,{a:0}))+", "+HC(Object.assign({},n,{a:1}))+")"},o=uw(["react-colorful__alpha",t]),a=Eo(100*n.a);return N.createElement("div",{className:o},N.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),N.createElement(aT,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:l0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},N.createElement(sT,{className:"react-colorful__alpha-pointer",left:n.a,color:HC(n)})))},$Ie=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=WY(e,["className","colorModel","color","onChange"]),s=w.useRef(null);jIe(s);var l=RIe(n,i,o),u=l[0],d=l[1],h=uw(["react-colorful",t]);return N.createElement("div",lw({},a,{ref:s,className:h}),N.createElement(IIe,{hsva:u,onChange:d}),N.createElement(MIe,{hue:u.h,onChange:d}),N.createElement(BIe,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},FIe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:OIe,fromHsva:AIe,equal:GY},zIe=function(e){return N.createElement($Ie,lw({},e,{colorModel:FIe}))};const cS=e=>{const{styleClass:t,...n}=e;return y.jsx(zIe,{className:`invokeai__color-picker ${t}`,...n})},HIe=at([sn,Mr],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function VIe(){const e=Me(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=he(HIe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return Je(["shift+BracketLeft"],()=>{e(Nm({...t,a:ke.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),Je(["shift+BracketRight"],()=>{e(Nm({...t,a:ke.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),y.jsx(Zs,{trigger:"hover",triggerComponent:y.jsx(ko,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:y.jsxs(Ge,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&y.jsx(cS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(Nm(a))}),r==="mask"&&y.jsx(cS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(VW(a))})]})})}function qY(){return y.jsxs(Ge,{columnGap:"1rem",alignItems:"center",children:[y.jsx(LIe,{}),y.jsx(VIe,{})]})}function WIe(){const e=Me(),t=he(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ve();return y.jsx(er,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:r=>e(QW(r.target.checked))})}function UIe(){return y.jsxs(Ge,{gap:"1rem",alignItems:"center",children:[y.jsx(qY,{}),y.jsx(WIe,{})]})}function GIe(){const e=Me(),{t}=Ve(),n=()=>e(nP());return y.jsx(cr,{size:"sm",leftIcon:y.jsx(vp,{}),onClick:n,tooltip:`${t("unifiedcanvas:clearMask")} (Shift+C)`,children:t("unifiedcanvas:betaClear")})}function qIe(){const e=he(i=>i.canvas.isMaskEnabled),t=Me(),{t:n}=Ve(),r=()=>t(Dy(!e));return y.jsx(er,{label:`${n("unifiedcanvas:enableMask")} (H)`,isChecked:e,onChange:r})}function YIe(){const e=Me(),{t}=Ve(),n=he(r=>r.canvas.shouldPreserveMaskedArea);return y.jsx(er,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:r=>e(qW(r.target.checked))})}function KIe(){return y.jsxs(Ge,{gap:"1rem",alignItems:"center",children:[y.jsx(qY,{}),y.jsx(qIe,{}),y.jsx(YIe,{}),y.jsx(GIe,{})]})}function XIe(){const e=he(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Me(),{t:n}=Ve();return y.jsx(er,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:r=>t(GW(r.target.checked))})}function ZIe(){const e=he(r=>r.canvas.shouldShowGrid),t=Me(),{t:n}=Ve();return y.jsx(er,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:r=>t(KW(r.target.checked))})}function QIe(){const e=he(i=>i.canvas.shouldSnapToGrid),t=Me(),{t:n}=Ve(),r=i=>t(q5(i.target.checked));return y.jsx(er,{label:`${n("unifiedcanvas:snapToGrid")} (N)`,isChecked:e,onChange:r})}function JIe(){return y.jsxs(Ge,{alignItems:"center",gap:"1rem",children:[y.jsx(ZIe,{}),y.jsx(QIe,{}),y.jsx(XIe,{})]})}const eRe=at([sn],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function tRe(){const{tool:e,layer:t}=he(eRe);return y.jsxs(Ge,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&y.jsx(UIe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&y.jsx(KIe,{}),e=="move"&&y.jsx(JIe,{})]})}const nRe=at([sn],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),rRe=()=>{const e=Me(),{doesCanvasNeedScaling:t}=he(nRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),y.jsx("div",{className:"workarea-single-view",children:y.jsxs(Ge,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[y.jsx(TIe,{}),y.jsxs(Ge,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[y.jsx(tRe,{}),t?y.jsx(BY,{}):y.jsx(jY,{})]})]})})},iRe=at([sn,Mr],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:Hh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),oRe=()=>{const e=Me(),{t}=Ve(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=he(iRe);Je(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),Je(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),Je(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(G5(n==="mask"?"base":"mask"))},l=()=>e(nP()),u=()=>e(Dy(!i));return y.jsx(Zs,{trigger:"hover",triggerComponent:y.jsx(oo,{children:y.jsx(Qe,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:y.jsx(fEe,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:y.jsxs(Ge,{direction:"column",gap:"0.5rem",children:[y.jsx(er,{label:`${t("unifiedcanvas:enableMask")} (H)`,isChecked:i,onChange:u}),y.jsx(er,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:o,onChange:d=>e(qW(d.target.checked))}),y.jsx(cS,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:d=>e(VW(d))}),y.jsxs(cr,{size:"sm",leftIcon:y.jsx(vp,{}),onClick:l,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},aRe=at([sn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),sRe=()=>{const e=Me(),{t}=Ve(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=he(aRe);Je(["n"],()=>{e(q5(!l))},{enabled:!0,preventDefault:!0},[l]);const d=h=>e(q5(h.target.checked));return y.jsx(Zs,{trigger:"hover",triggerComponent:y.jsx(Qe,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:y.jsx(OP,{})}),children:y.jsxs(Ge,{direction:"column",gap:"0.5rem",children:[y.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:s,onChange:h=>e(XW(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:showGrid"),isChecked:a,onChange:h=>e(KW(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:snapToGrid"),isChecked:l,onChange:d}),y.jsx(er,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:h=>e(GW(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:h=>e(WW(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:h=>e(UW(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:u,onChange:h=>e(QW(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:o,onChange:h=>e(YW(h.target.checked))}),y.jsx(VY,{}),y.jsx(HY,{})]})})},lRe=at([sn,Mr,ir],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),uRe=()=>{const e=Me(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=he(lRe),{t:o}=Ve();Je(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),Je(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),Je(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),Je(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),Je(["delete","backspace"],()=>{d()},{enabled:()=>!i,preventDefault:!0}),Je(["BracketLeft"],()=>{e(jm(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),Je(["BracketRight"],()=>{e(jm(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),Je(["shift+BracketLeft"],()=>{e(Nm({...n,a:ke.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),Je(["shift+BracketRight"],()=>{e(Nm({...n,a:ke.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(tu("brush")),s=()=>e(tu("eraser")),l=()=>e(tu("colorPicker")),u=()=>e(BW()),d=()=>e(jW());return y.jsxs(oo,{isAttached:!0,children:[y.jsx(Qe,{"aria-label":`${o("unifiedcanvas:brush")} (B)`,tooltip:`${o("unifiedcanvas:brush")} (B)`,icon:y.jsx(Sq,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),y.jsx(Qe,{"aria-label":`${o("unifiedcanvas:eraser")} (E)`,tooltip:`${o("unifiedcanvas:eraser")} (E)`,icon:y.jsx(mq,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),y.jsx(Qe,{"aria-label":`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:y.jsx(yq,{}),isDisabled:i,onClick:u}),y.jsx(Qe,{"aria-label":`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:y.jsx(zy,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),y.jsx(Qe,{"aria-label":`${o("unifiedcanvas:colorPicker")} (C)`,tooltip:`${o("unifiedcanvas:colorPicker")} (C)`,icon:y.jsx(vq,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),y.jsx(Zs,{trigger:"hover",triggerComponent:y.jsx(Qe,{"aria-label":o("unifiedcanvas:brushOptions"),tooltip:o("unifiedcanvas:brushOptions"),icon:y.jsx(AP,{})}),children:y.jsxs(Ge,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[y.jsx(Ge,{gap:"1rem",justifyContent:"space-between",children:y.jsx(so,{label:o("unifiedcanvas:brushSize"),value:r,withInput:!0,onChange:h=>e(jm(h)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),y.jsx(cS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:h=>e(Nm(h))})]})})]})},cRe=at([ir,sn,Mr],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),dRe=()=>{const e=Me(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=he(cRe),s=el(),{t:l}=Ve(),{openUploader:u}=xP();Je(["v"],()=>{d()},{enabled:()=>!n,preventDefault:!0},[]),Je(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[s]),Je(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),Je(["shift+s"],()=>{S()},{enabled:()=>!n,preventDefault:!0},[s,t]),Je(["meta+c","ctrl+c"],()=>{k()},{enabled:()=>!n,preventDefault:!0},[s,t]),Je(["shift+d"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]);const d=()=>e(tu("move")),h=zY(()=>m(!1),()=>m(!0)),m=(T=!1)=>{const A=el();if(!A)return;const I=A.getClientRect({skipTransform:!0});e(zW({contentRect:I,shouldScaleTo1:T}))},v=()=>{e(rP()),e(Rx())},b=()=>{e(Td({cropVisible:!1,shouldSetAsInitialImage:!0}))},S=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},k=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},E=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},_=T=>{const A=T.target.value;e(G5(A)),A==="mask"&&!r&&e(Dy(!0))};return y.jsxs("div",{className:"inpainting-settings",children:[y.jsx(tl,{tooltip:`${l("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:DW,onChange:_,isDisabled:n}),y.jsx(oRe,{}),y.jsx(uRe,{}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Qe,{"aria-label":`${l("unifiedcanvas:move")} (V)`,tooltip:`${l("unifiedcanvas:move")} (V)`,icon:y.jsx(hq,{}),"data-selected":o==="move"||n,onClick:d}),y.jsx(Qe,{"aria-label":`${l("unifiedcanvas:resetView")} (R)`,tooltip:`${l("unifiedcanvas:resetView")} (R)`,icon:y.jsx(gq,{}),onClick:h})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Qe,{"aria-label":`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:y.jsx(bq,{}),onClick:b,isDisabled:n}),y.jsx(Qe,{"aria-label":`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:y.jsx(LP,{}),onClick:S,isDisabled:n}),y.jsx(Qe,{"aria-label":`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:y.jsx(o0,{}),onClick:k,isDisabled:n}),y.jsx(Qe,{"aria-label":`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:y.jsx(TP,{}),onClick:E,isDisabled:n})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(FY,{}),y.jsx($Y,{})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Qe,{"aria-label":`${l("common:upload")}`,tooltip:`${l("common:upload")}`,icon:y.jsx(Zx,{}),onClick:u,isDisabled:n}),y.jsx(Qe,{"aria-label":`${l("unifiedcanvas:clearCanvas")}`,tooltip:`${l("unifiedcanvas:clearCanvas")}`,icon:y.jsx(vp,{}),onClick:v,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),y.jsx(oo,{isAttached:!0,children:y.jsx(sRe,{})})]})},fRe=at([sn],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),hRe=()=>{const e=Me(),{doesCanvasNeedScaling:t}=he(fRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),y.jsx("div",{className:"workarea-single-view",children:y.jsx("div",{className:"workarea-split-view-left",children:y.jsxs("div",{className:"inpainting-main-area",children:[y.jsx(dRe,{}),y.jsx("div",{className:"inpainting-canvas-area",children:t?y.jsx(BY,{}):y.jsx(jY,{})})]})})})},pRe=at(sn,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),gRe=()=>{const e=Me(),{boundingBoxDimensions:t}=he(pRe),{t:n}=Ve(),r=s=>{e(Ev({...t,width:Math.floor(s)}))},i=s=>{e(Ev({...t,height:Math.floor(s)}))},o=()=>{e(Ev({...t,width:Math.floor(512)}))},a=()=>{e(Ev({...t,height:Math.floor(512)}))};return y.jsxs(Ge,{direction:"column",gap:"1rem",children:[y.jsx(so,{label:n("parameters:width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:o}),y.jsx(so,{label:n("parameters:height"),min:64,max:1024,step:64,value:t.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:a})]})},mRe=at([KP,ir,sn],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),vRe=()=>{const e=Me(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=he(mRe),{t:s}=Ve(),l=v=>{e(_b({...a,width:Math.floor(v)}))},u=v=>{e(_b({...a,height:Math.floor(v)}))},d=()=>{e(_b({...a,width:Math.floor(512)}))},h=()=>{e(_b({...a,height:Math.floor(512)}))},m=v=>{e(kxe(v.target.value))};return y.jsxs(Ge,{direction:"column",gap:"1rem",children:[y.jsx(tl,{label:s("parameters:scaleBeforeProcessing"),validValues:lxe,value:i,onChange:m}),y.jsx(so,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:d}),y.jsx(so,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:h}),y.jsx(tl,{label:s("parameters:infillMethod"),value:n,validValues:r,onChange:v=>e(uU(v.target.value))}),y.jsx(so,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("parameters:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:v=>{e(HI(v))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(HI(32))}})]})};function yRe(){const e=Me(),t=he(r=>r.generation.seamBlur),{t:n}=Ve();return y.jsx(so,{sliderMarkRightOffset:-4,label:n("parameters:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(BI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(BI(16))}})}function bRe(){const e=Me(),{t}=Ve(),n=he(r=>r.generation.seamSize);return y.jsx(so,{sliderMarkRightOffset:-6,label:t("parameters:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e($I(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e($I(96))})}function SRe(){const{t:e}=Ve(),t=he(r=>r.generation.seamSteps),n=Me();return y.jsx(so,{sliderMarkRightOffset:-4,label:e("parameters:seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(FI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(FI(30))}})}function xRe(){const e=Me(),{t}=Ve(),n=he(r=>r.generation.seamStrength);return y.jsx(so,{sliderMarkRightOffset:-7,label:t("parameters:seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(zI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(zI(.7))}})}const wRe=()=>y.jsxs(Ge,{direction:"column",gap:"1rem",children:[y.jsx(bRe,{}),y.jsx(yRe,{}),y.jsx(xRe,{}),y.jsx(SRe,{})]});function CRe(){const{t:e}=Ve(),t={boundingBox:{header:`${e("parameters:boundingBoxHeader")}`,feature:ao.BOUNDING_BOX,content:y.jsx(gRe,{})},seamCorrection:{header:`${e("parameters:seamCorrectionHeader")}`,feature:ao.SEAM_CORRECTION,content:y.jsx(wRe,{})},infillAndScaling:{header:`${e("parameters:infillScalingHeader")}`,feature:ao.INFILL_AND_SCALING,content:y.jsx(vRe,{})},seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:y.jsx(VP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:y.jsx(UP,{}),additionalHeaderComponents:y.jsx(WP,{})}};return y.jsxs(eT,{children:[y.jsxs(Ge,{flexDir:"column",rowGap:"0.5rem",children:[y.jsx(JP,{}),y.jsx(QP,{})]}),y.jsx(ZP,{}),y.jsx(GP,{}),y.jsx(kY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),y.jsx(qP,{accordionInfo:t})]})}function _Re(){const e=he(t=>t.ui.shouldUseCanvasBetaLayout);return y.jsx(HP,{optionsPanel:y.jsx(CRe,{}),styleClass:"inpainting-workarea-overrides",children:e?y.jsx(rRe,{}):y.jsx(hRe,{})})}const es={txt2img:{title:y.jsx(r_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(gOe,{}),tooltip:"Text To Image"},img2img:{title:y.jsx(e_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(lOe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:y.jsx(o_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(_Re,{}),tooltip:"Unified Canvas"},nodes:{title:y.jsx(t_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(X8e,{}),tooltip:"Nodes"},postprocess:{title:y.jsx(n_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(Z8e,{}),tooltip:"Post Processing"},training:{title:y.jsx(i_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(Q8e,{}),tooltip:"Training"}};function kRe(){es.txt2img.tooltip=zt.t("common:text2img"),es.img2img.tooltip=zt.t("common:img2img"),es.unifiedCanvas.tooltip=zt.t("common:unifiedCanvas"),es.nodes.tooltip=zt.t("common:nodes"),es.postprocess.tooltip=zt.t("common:postProcessing"),es.training.tooltip=zt.t("common:training")}function ERe(){const e=he(K8e),t=he(o=>o.lightbox.isLightboxOpen);J8e(kRe);const n=Me();Je("1",()=>{n(qo(0))}),Je("2",()=>{n(qo(1))}),Je("3",()=>{n(qo(2))}),Je("4",()=>{n(qo(3))}),Je("5",()=>{n(qo(4))}),Je("6",()=>{n(qo(5))}),Je("z",()=>{n(Bm(!t))},[t]);const r=()=>{const o=[];return Object.keys(es).forEach(a=>{o.push(y.jsx(uo,{hasArrow:!0,label:es[a].tooltip,placement:"right",children:y.jsx(oW,{children:es[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(es).forEach(a=>{o.push(y.jsx(rW,{className:"app-tabs-panel",children:es[a].workarea},a))}),o};return y.jsxs(nW,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(qo(o))},children:[y.jsx("div",{className:"app-tabs-list",children:r()}),y.jsx(iW,{className:"app-tabs-panels",children:t?y.jsx(_Ae,{}):i()})]})}var PRe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Uy(e,t){var n=TRe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function TRe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=PRe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var LRe=[".DS_Store","Thumbs.db"];function ARe(e){return m0(this,void 0,void 0,function(){return v0(this,function(t){return dS(e)&&ORe(e.dataTransfer)?[2,DRe(e.dataTransfer,e.type)]:MRe(e)?[2,IRe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,RRe(e)]:[2,[]]})})}function ORe(e){return dS(e)}function MRe(e){return dS(e)&&dS(e.target)}function dS(e){return typeof e=="object"&&e!==null}function IRe(e){return J8(e.target.files).map(function(t){return Uy(t)})}function RRe(e){return m0(this,void 0,void 0,function(){var t;return v0(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Uy(r)})]}})})}function DRe(e,t){return m0(this,void 0,void 0,function(){var n,r;return v0(this,function(i){switch(i.label){case 0:return e.items?(n=J8(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(NRe))]):[3,2];case 1:return r=i.sent(),[2,cN(YY(r))];case 2:return[2,cN(J8(e.files).map(function(o){return Uy(o)}))]}})})}function cN(e){return e.filter(function(t){return LRe.indexOf(t.name)===-1})}function J8(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,gN(n)];if(e.sizen)return[!1,gN(n)]}return[!0,null]}function Sh(e){return e!=null}function QRe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=QY(l,n),d=ay(u,1),h=d[0],m=JY(l,r,i),v=ay(m,1),b=v[0],S=s?s(l):null;return h&&b&&!S})}function fS(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Xb(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function vN(e){e.preventDefault()}function JRe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function eDe(e){return e.indexOf("Edge/")!==-1}function tDe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return JRe(e)||eDe(e)}function Il(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yDe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var lT=w.forwardRef(function(e,t){var n=e.children,r=hS(e,sDe),i=iK(r),o=i.open,a=hS(i,lDe);return w.useImperativeHandle(t,function(){return{open:o}},[o]),N.createElement(w.Fragment,null,n(Cr(Cr({},a),{},{open:o})))});lT.displayName="Dropzone";var rK={disabled:!1,getFilesFromEvent:ARe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};lT.defaultProps=rK;lT.propTypes={children:jn.func,accept:jn.objectOf(jn.arrayOf(jn.string)),multiple:jn.bool,preventDropOnDocument:jn.bool,noClick:jn.bool,noKeyboard:jn.bool,noDrag:jn.bool,noDragEventsBubbling:jn.bool,minSize:jn.number,maxSize:jn.number,maxFiles:jn.number,disabled:jn.bool,getFilesFromEvent:jn.func,onFileDialogCancel:jn.func,onFileDialogOpen:jn.func,useFsAccessApi:jn.bool,autoFocus:jn.bool,onDragEnter:jn.func,onDragLeave:jn.func,onDragOver:jn.func,onDrop:jn.func,onDropAccepted:jn.func,onDropRejected:jn.func,onError:jn.func,validator:jn.func};var r_={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function iK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Cr(Cr({},rK),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,h=t.onDragOver,m=t.onDrop,v=t.onDropAccepted,b=t.onDropRejected,S=t.onFileDialogCancel,k=t.onFileDialogOpen,E=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,A=t.noClick,I=t.noKeyboard,R=t.noDrag,D=t.noDragEventsBubbling,j=t.onError,z=t.validator,V=w.useMemo(function(){return iDe(n)},[n]),K=w.useMemo(function(){return rDe(n)},[n]),te=w.useMemo(function(){return typeof k=="function"?k:bN},[k]),q=w.useMemo(function(){return typeof S=="function"?S:bN},[S]),$=w.useRef(null),U=w.useRef(null),X=w.useReducer(bDe,r_),Z=VC(X,2),W=Z[0],Q=Z[1],ie=W.isFocused,fe=W.isFileDialogActive,Se=w.useRef(typeof window<"u"&&window.isSecureContext&&E&&nDe()),Pe=function(){!Se.current&&fe&&setTimeout(function(){if(U.current){var Ne=U.current.files;Ne.length||(Q({type:"closeDialog"}),q())}},300)};w.useEffect(function(){return window.addEventListener("focus",Pe,!1),function(){window.removeEventListener("focus",Pe,!1)}},[U,fe,q,Se]);var ye=w.useRef([]),We=function(Ne){$.current&&$.current.contains(Ne.target)||(Ne.preventDefault(),ye.current=[])};w.useEffect(function(){return T&&(document.addEventListener("dragover",vN,!1),document.addEventListener("drop",We,!1)),function(){T&&(document.removeEventListener("dragover",vN),document.removeEventListener("drop",We))}},[$,T]),w.useEffect(function(){return!r&&_&&$.current&&$.current.focus(),function(){}},[$,_,r]);var De=w.useCallback(function(xe){j?j(xe):console.error(xe)},[j]),ot=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe),ye.current=[].concat(dDe(ye.current),[xe.target]),Xb(xe)&&Promise.resolve(i(xe)).then(function(Ne){if(!(fS(xe)&&!D)){var Ct=Ne.length,Dt=Ct>0&&QRe({files:Ne,accept:V,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:z}),Te=Ct>0&&!Dt;Q({isDragAccept:Dt,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),u&&u(xe)}}).catch(function(Ne){return De(Ne)})},[i,u,De,D,V,a,o,s,l,z]),He=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe);var Ne=Xb(xe);if(Ne&&xe.dataTransfer)try{xe.dataTransfer.dropEffect="copy"}catch{}return Ne&&h&&h(xe),!1},[h,D]),Be=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe);var Ne=ye.current.filter(function(Dt){return $.current&&$.current.contains(Dt)}),Ct=Ne.indexOf(xe.target);Ct!==-1&&Ne.splice(Ct,1),ye.current=Ne,!(Ne.length>0)&&(Q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Xb(xe)&&d&&d(xe))},[$,d,D]),wt=w.useCallback(function(xe,Ne){var Ct=[],Dt=[];xe.forEach(function(Te){var At=QY(Te,V),$e=VC(At,2),vt=$e[0],tn=$e[1],Rn=JY(Te,a,o),Xe=VC(Rn,2),xt=Xe[0],ft=Xe[1],Ht=z?z(Te):null;if(vt&&xt&&!Ht)Ct.push(Te);else{var nn=[tn,ft];Ht&&(nn=nn.concat(Ht)),Dt.push({file:Te,errors:nn.filter(function(pr){return pr})})}}),(!s&&Ct.length>1||s&&l>=1&&Ct.length>l)&&(Ct.forEach(function(Te){Dt.push({file:Te,errors:[ZRe]})}),Ct.splice(0)),Q({acceptedFiles:Ct,fileRejections:Dt,type:"setFiles"}),m&&m(Ct,Dt,Ne),Dt.length>0&&b&&b(Dt,Ne),Ct.length>0&&v&&v(Ct,Ne)},[Q,s,V,a,o,l,m,v,b,z]),st=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe),ye.current=[],Xb(xe)&&Promise.resolve(i(xe)).then(function(Ne){fS(xe)&&!D||wt(Ne,xe)}).catch(function(Ne){return De(Ne)}),Q({type:"reset"})},[i,wt,De,D]),mt=w.useCallback(function(){if(Se.current){Q({type:"openDialog"}),te();var xe={multiple:s,types:K};window.showOpenFilePicker(xe).then(function(Ne){return i(Ne)}).then(function(Ne){wt(Ne,null),Q({type:"closeDialog"})}).catch(function(Ne){oDe(Ne)?(q(Ne),Q({type:"closeDialog"})):aDe(Ne)?(Se.current=!1,U.current?(U.current.value=null,U.current.click()):De(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):De(Ne)});return}U.current&&(Q({type:"openDialog"}),te(),U.current.value=null,U.current.click())},[Q,te,q,E,wt,De,K,s]),St=w.useCallback(function(xe){!$.current||!$.current.isEqualNode(xe.target)||(xe.key===" "||xe.key==="Enter"||xe.keyCode===32||xe.keyCode===13)&&(xe.preventDefault(),mt())},[$,mt]),Le=w.useCallback(function(){Q({type:"focus"})},[]),lt=w.useCallback(function(){Q({type:"blur"})},[]),Mt=w.useCallback(function(){A||(tDe()?setTimeout(mt,0):mt())},[A,mt]),ut=function(Ne){return r?null:Ne},_t=function(Ne){return I?null:ut(Ne)},ln=function(Ne){return R?null:ut(Ne)},ae=function(Ne){D&&Ne.stopPropagation()},Re=w.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=xe.refKey,Ct=Ne===void 0?"ref":Ne,Dt=xe.role,Te=xe.onKeyDown,At=xe.onFocus,$e=xe.onBlur,vt=xe.onClick,tn=xe.onDragEnter,Rn=xe.onDragOver,Xe=xe.onDragLeave,xt=xe.onDrop,ft=hS(xe,uDe);return Cr(Cr(n_({onKeyDown:_t(Il(Te,St)),onFocus:_t(Il(At,Le)),onBlur:_t(Il($e,lt)),onClick:ut(Il(vt,Mt)),onDragEnter:ln(Il(tn,ot)),onDragOver:ln(Il(Rn,He)),onDragLeave:ln(Il(Xe,Be)),onDrop:ln(Il(xt,st)),role:typeof Dt=="string"&&Dt!==""?Dt:"presentation"},Ct,$),!r&&!I?{tabIndex:0}:{}),ft)}},[$,St,Le,lt,Mt,ot,He,Be,st,I,R,r]),Ye=w.useCallback(function(xe){xe.stopPropagation()},[]),Ke=w.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=xe.refKey,Ct=Ne===void 0?"ref":Ne,Dt=xe.onChange,Te=xe.onClick,At=hS(xe,cDe),$e=n_({accept:V,multiple:s,type:"file",style:{display:"none"},onChange:ut(Il(Dt,st)),onClick:ut(Il(Te,Ye)),tabIndex:-1},Ct,U);return Cr(Cr({},$e),At)}},[U,n,s,st,r]);return Cr(Cr({},W),{},{isFocused:ie&&!r,getRootProps:Re,getInputProps:Ke,rootRef:$,inputRef:U,open:ut(mt)})}function bDe(e,t){switch(t.type){case"focus":return Cr(Cr({},e),{},{isFocused:!0});case"blur":return Cr(Cr({},e),{},{isFocused:!1});case"openDialog":return Cr(Cr({},r_),{},{isFileDialogActive:!0});case"closeDialog":return Cr(Cr({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Cr(Cr({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Cr(Cr({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Cr({},r_);default:return e}}function bN(){}const SDe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return Je("esc",()=>{i(!1)}),y.jsxs("div",{className:"dropzone-container",children:[t&&y.jsx("div",{className:"dropzone-overlay is-drag-accept",children:y.jsxs(Dh,{size:"lg",children:["Upload Image",r]})}),n&&y.jsxs("div",{className:"dropzone-overlay is-drag-reject",children:[y.jsx(Dh,{size:"lg",children:"Invalid Upload"}),y.jsx(Dh,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},xDe=e=>{const{children:t}=e,n=Me(),r=he(Or),i=Ry({}),{t:o}=Ve(),[a,s]=w.useState(!1),{setOpenUploader:l}=xP(),u=w.useCallback(T=>{s(!0);const A=T.errors.reduce((I,R)=>`${I} -${R.message}`,"");i({title:o("toast:uploadFailed"),description:A,status:"error",isClosable:!0})},[o,i]),d=w.useCallback(async T=>{n(fD({imageFile:T}))},[n]),h=w.useCallback((T,A)=>{A.forEach(I=>{u(I)}),T.forEach(I=>{d(I)})},[d,u]),{getRootProps:m,getInputProps:v,isDragAccept:b,isDragReject:S,isDragActive:k,open:E}=iK({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:()=>s(!0),maxFiles:1});l(E),w.useEffect(()=>{const T=A=>{var j;const I=(j=A.clipboardData)==null?void 0:j.items;if(!I)return;const R=[];for(const z of I)z.kind==="file"&&["image/png","image/jpg"].includes(z.type)&&R.push(z);if(!R.length)return;if(A.stopImmediatePropagation(),R.length>1){i({description:o("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=R[0].getAsFile();if(!D){i({description:o("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(fD({imageFile:D}))};return document.addEventListener("paste",T),()=>{document.removeEventListener("paste",T)}},[o,n,i,r]);const _=["img2img","unifiedCanvas"].includes(r)?` to ${es[r].tooltip}`:"";return y.jsx(SP.Provider,{value:E,children:y.jsxs("div",{...m({style:{}}),onKeyDown:T=>{T.key},children:[y.jsx("input",{...v()}),t,k&&a&&y.jsx(SDe,{isDragAccept:b,isDragReject:S,overlaySecondaryText:_,setIsHandlingUpload:s})]})})},wDe=at(ir,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),CDe=at(ir,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),_De=()=>{const e=Me(),t=he(wDe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=he(CDe),[o,a]=w.useState(!0),s=w.useRef(null);w.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e($U()),e(CC(!n))};Je("`",()=>{e(CC(!n))},[n]),Je("esc",()=>{e(CC(!1))});const u=()=>{s.current&&o&&s.current.scrollTop{const{timestamp:m,message:v,level:b}=d;return y.jsxs("div",{className:`console-entry console-${b}-color`,children:[y.jsxs("p",{className:"console-timestamp",children:[m,":"]}),y.jsx("p",{className:"console-message",children:v})]},h)})})}),n&&y.jsx(uo,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:y.jsx(ss,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:y.jsx(Qke,{}),onClick:()=>a(!o)})}),y.jsx(uo,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:y.jsx(ss,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?y.jsx(hEe,{}):y.jsx(pq,{}),onClick:l})})]})},kDe=at(ir,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),EDe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=he(kDe),i=t?Math.round(t*100/n):0;return y.jsx(BV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function PDe(e){const{title:t,hotkey:n,description:r}=e;return y.jsxs("div",{className:"hotkey-modal-item",children:[y.jsxs("div",{className:"hotkey-info",children:[y.jsx("p",{className:"hotkey-title",children:t}),r&&y.jsx("p",{className:"hotkey-description",children:r})]}),y.jsx("div",{className:"hotkey-key",children:n})]})}function TDe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Wh(),{t:i}=Ve(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=d=>{const h=[];return d.forEach((m,v)=>{h.push(y.jsx(PDe,{title:m.title,description:m.desc,hotkey:m.hotkey},v))}),y.jsx("div",{className:"hotkey-modal-category",children:h})};return y.jsxs(y.Fragment,{children:[w.cloneElement(e,{onClick:n}),y.jsxs(Yd,{isOpen:t,onClose:r,children:[y.jsx(Kd,{}),y.jsxs(Zh,{className:" modal hotkeys-modal",children:[y.jsx(Ly,{className:"modal-close-btn"}),y.jsx("h1",{children:"Keyboard Shorcuts"}),y.jsx("div",{className:"hotkeys-modal-items",children:y.jsxs(ok,{allowMultiple:!0,children:[y.jsxs(Gg,{children:[y.jsxs(Wg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:appHotkeys")}),y.jsx(Ug,{})]}),y.jsx(qg,{children:u(o)})]}),y.jsxs(Gg,{children:[y.jsxs(Wg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:generalHotkeys")}),y.jsx(Ug,{})]}),y.jsx(qg,{children:u(a)})]}),y.jsxs(Gg,{children:[y.jsxs(Wg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:galleryHotkeys")}),y.jsx(Ug,{})]}),y.jsx(qg,{children:u(s)})]}),y.jsxs(Gg,{children:[y.jsxs(Wg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),y.jsx(Ug,{})]}),y.jsx(qg,{children:u(l)})]})]})})]})]})]})}var SN=Array.isArray,xN=Object.keys,LDe=Object.prototype.hasOwnProperty,ADe=typeof Element<"u";function i_(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=SN(e),r=SN(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!i_(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var h=xN(e);if(o=h.length,o!==xN(t).length)return!1;for(i=o;i--!==0;)if(!LDe.call(t,h[i]))return!1;if(ADe&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=h[i],!(a==="_owner"&&e.$$typeof)&&!i_(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var md=function(t,n){try{return i_(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},ODe=function(t){return MDe(t)&&!IDe(t)};function MDe(e){return!!e&&typeof e=="object"}function IDe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||NDe(e)}var RDe=typeof Symbol=="function"&&Symbol.for,DDe=RDe?Symbol.for("react.element"):60103;function NDe(e){return e.$$typeof===DDe}function jDe(e){return Array.isArray(e)?[]:{}}function pS(e,t){return t.clone!==!1&&t.isMergeableObject(e)?sy(jDe(e),e,t):e}function BDe(e,t,n){return e.concat(t).map(function(r){return pS(r,n)})}function $De(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=pS(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=pS(t[i],n):r[i]=sy(e[i],t[i],n)}),r}function sy(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||BDe,n.isMergeableObject=n.isMergeableObject||ODe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):$De(e,t,n):pS(t,n)}sy.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return sy(r,i,n)},{})};var o_=sy,FDe=typeof global=="object"&&global&&global.Object===Object&&global;const oK=FDe;var zDe=typeof self=="object"&&self&&self.Object===Object&&self,HDe=oK||zDe||Function("return this")();const mu=HDe;var VDe=mu.Symbol;const ef=VDe;var aK=Object.prototype,WDe=aK.hasOwnProperty,UDe=aK.toString,gv=ef?ef.toStringTag:void 0;function GDe(e){var t=WDe.call(e,gv),n=e[gv];try{e[gv]=void 0;var r=!0}catch{}var i=UDe.call(e);return r&&(t?e[gv]=n:delete e[gv]),i}var qDe=Object.prototype,YDe=qDe.toString;function KDe(e){return YDe.call(e)}var XDe="[object Null]",ZDe="[object Undefined]",wN=ef?ef.toStringTag:void 0;function xp(e){return e==null?e===void 0?ZDe:XDe:wN&&wN in Object(e)?GDe(e):KDe(e)}function sK(e,t){return function(n){return e(t(n))}}var QDe=sK(Object.getPrototypeOf,Object);const uT=QDe;function wp(e){return e!=null&&typeof e=="object"}var JDe="[object Object]",eNe=Function.prototype,tNe=Object.prototype,lK=eNe.toString,nNe=tNe.hasOwnProperty,rNe=lK.call(Object);function CN(e){if(!wp(e)||xp(e)!=JDe)return!1;var t=uT(e);if(t===null)return!0;var n=nNe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&lK.call(n)==rNe}function iNe(){this.__data__=[],this.size=0}function uK(e,t){return e===t||e!==e&&t!==t}function cw(e,t){for(var n=e.length;n--;)if(uK(e[n][0],t))return n;return-1}var oNe=Array.prototype,aNe=oNe.splice;function sNe(e){var t=this.__data__,n=cw(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():aNe.call(t,n,1),--this.size,!0}function lNe(e){var t=this.__data__,n=cw(t,e);return n<0?void 0:t[n][1]}function uNe(e){return cw(this.__data__,e)>-1}function cNe(e,t){var n=this.__data__,r=cw(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function vc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=vje}var yje="[object Arguments]",bje="[object Array]",Sje="[object Boolean]",xje="[object Date]",wje="[object Error]",Cje="[object Function]",_je="[object Map]",kje="[object Number]",Eje="[object Object]",Pje="[object RegExp]",Tje="[object Set]",Lje="[object String]",Aje="[object WeakMap]",Oje="[object ArrayBuffer]",Mje="[object DataView]",Ije="[object Float32Array]",Rje="[object Float64Array]",Dje="[object Int8Array]",Nje="[object Int16Array]",jje="[object Int32Array]",Bje="[object Uint8Array]",$je="[object Uint8ClampedArray]",Fje="[object Uint16Array]",zje="[object Uint32Array]",sr={};sr[Ije]=sr[Rje]=sr[Dje]=sr[Nje]=sr[jje]=sr[Bje]=sr[$je]=sr[Fje]=sr[zje]=!0;sr[yje]=sr[bje]=sr[Oje]=sr[Sje]=sr[Mje]=sr[xje]=sr[wje]=sr[Cje]=sr[_je]=sr[kje]=sr[Eje]=sr[Pje]=sr[Tje]=sr[Lje]=sr[Aje]=!1;function Hje(e){return wp(e)&&mK(e.length)&&!!sr[xp(e)]}function cT(e){return function(t){return e(t)}}var vK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,f2=vK&&typeof module=="object"&&module&&!module.nodeType&&module,Vje=f2&&f2.exports===vK,UC=Vje&&oK.process,Wje=function(){try{var e=f2&&f2.require&&f2.require("util").types;return e||UC&&UC.binding&&UC.binding("util")}catch{}}();const u0=Wje;var LN=u0&&u0.isTypedArray,Uje=LN?cT(LN):Hje;const Gje=Uje;var qje=Object.prototype,Yje=qje.hasOwnProperty;function yK(e,t){var n=qy(e),r=!n&&lje(e),i=!n&&!r&&gK(e),o=!n&&!r&&!i&&Gje(e),a=n||r||i||o,s=a?rje(e.length,String):[],l=s.length;for(var u in e)(t||Yje.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||mje(u,l)))&&s.push(u);return s}var Kje=Object.prototype;function dT(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Kje;return e===n}var Xje=sK(Object.keys,Object);const Zje=Xje;var Qje=Object.prototype,Jje=Qje.hasOwnProperty;function eBe(e){if(!dT(e))return Zje(e);var t=[];for(var n in Object(e))Jje.call(e,n)&&n!="constructor"&&t.push(n);return t}function bK(e){return e!=null&&mK(e.length)&&!cK(e)}function fT(e){return bK(e)?yK(e):eBe(e)}function tBe(e,t){return e&&fw(t,fT(t),e)}function nBe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var rBe=Object.prototype,iBe=rBe.hasOwnProperty;function oBe(e){if(!Gy(e))return nBe(e);var t=dT(e),n=[];for(var r in e)r=="constructor"&&(t||!iBe.call(e,r))||n.push(r);return n}function hT(e){return bK(e)?yK(e,!0):oBe(e)}function aBe(e,t){return e&&fw(t,hT(t),e)}var SK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,AN=SK&&typeof module=="object"&&module&&!module.nodeType&&module,sBe=AN&&AN.exports===SK,ON=sBe?mu.Buffer:void 0,MN=ON?ON.allocUnsafe:void 0;function lBe(e,t){if(t)return e.slice();var n=e.length,r=MN?MN(n):new e.constructor(n);return e.copy(r),r}function xK(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function YN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var KN=function(t){return Array.isArray(t)&&t.length===0},Go=function(t){return typeof t=="function"},hw=function(t){return t!==null&&typeof t=="object"},aFe=function(t){return String(Math.floor(Number(t)))===t},GC=function(t){return Object.prototype.toString.call(t)==="[object String]"},MK=function(t){return w.Children.count(t)===0},qC=function(t){return hw(t)&&Go(t.then)};function Vi(e,t,n,r){r===void 0&&(r=0);for(var i=OK(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function IK(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?Re.map(function(Ke){return j(Ke,Vi(ae,Ke))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ye).then(function(Ke){return Ke.reduce(function(xe,Ne,Ct){return Ne==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ne&&(xe=iu(xe,Re[Ct],Ne)),xe},{})})},[j]),V=w.useCallback(function(ae){return Promise.all([z(ae),m.validationSchema?D(ae):{},m.validate?R(ae):{}]).then(function(Re){var Ye=Re[0],Ke=Re[1],xe=Re[2],Ne=o_.all([Ye,Ke,xe],{arrayMerge:fFe});return Ne})},[m.validate,m.validationSchema,z,R,D]),K=Ka(function(ae){return ae===void 0&&(ae=A.values),I({type:"SET_ISVALIDATING",payload:!0}),V(ae).then(function(Re){return E.current&&(I({type:"SET_ISVALIDATING",payload:!1}),I({type:"SET_ERRORS",payload:Re})),Re})});w.useEffect(function(){a&&E.current===!0&&md(v.current,m.initialValues)&&K(v.current)},[a,K]);var te=w.useCallback(function(ae){var Re=ae&&ae.values?ae.values:v.current,Ye=ae&&ae.errors?ae.errors:b.current?b.current:m.initialErrors||{},Ke=ae&&ae.touched?ae.touched:S.current?S.current:m.initialTouched||{},xe=ae&&ae.status?ae.status:k.current?k.current:m.initialStatus;v.current=Re,b.current=Ye,S.current=Ke,k.current=xe;var Ne=function(){I({type:"RESET_FORM",payload:{isSubmitting:!!ae&&!!ae.isSubmitting,errors:Ye,touched:Ke,status:xe,values:Re,isValidating:!!ae&&!!ae.isValidating,submitCount:ae&&ae.submitCount&&typeof ae.submitCount=="number"?ae.submitCount:0}})};if(m.onReset){var Ct=m.onReset(A.values,st);qC(Ct)?Ct.then(Ne):Ne()}else Ne()},[m.initialErrors,m.initialStatus,m.initialTouched]);w.useEffect(function(){E.current===!0&&!md(v.current,m.initialValues)&&(u&&(v.current=m.initialValues,te()),a&&K(v.current))},[u,m.initialValues,te,a,K]),w.useEffect(function(){u&&E.current===!0&&!md(b.current,m.initialErrors)&&(b.current=m.initialErrors||uh,I({type:"SET_ERRORS",payload:m.initialErrors||uh}))},[u,m.initialErrors]),w.useEffect(function(){u&&E.current===!0&&!md(S.current,m.initialTouched)&&(S.current=m.initialTouched||Zb,I({type:"SET_TOUCHED",payload:m.initialTouched||Zb}))},[u,m.initialTouched]),w.useEffect(function(){u&&E.current===!0&&!md(k.current,m.initialStatus)&&(k.current=m.initialStatus,I({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var q=Ka(function(ae){if(_.current[ae]&&Go(_.current[ae].validate)){var Re=Vi(A.values,ae),Ye=_.current[ae].validate(Re);return qC(Ye)?(I({type:"SET_ISVALIDATING",payload:!0}),Ye.then(function(Ke){return Ke}).then(function(Ke){I({type:"SET_FIELD_ERROR",payload:{field:ae,value:Ke}}),I({type:"SET_ISVALIDATING",payload:!1})})):(I({type:"SET_FIELD_ERROR",payload:{field:ae,value:Ye}}),Promise.resolve(Ye))}else if(m.validationSchema)return I({type:"SET_ISVALIDATING",payload:!0}),D(A.values,ae).then(function(Ke){return Ke}).then(function(Ke){I({type:"SET_FIELD_ERROR",payload:{field:ae,value:Ke[ae]}}),I({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),$=w.useCallback(function(ae,Re){var Ye=Re.validate;_.current[ae]={validate:Ye}},[]),U=w.useCallback(function(ae){delete _.current[ae]},[]),X=Ka(function(ae,Re){I({type:"SET_TOUCHED",payload:ae});var Ye=Re===void 0?i:Re;return Ye?K(A.values):Promise.resolve()}),Z=w.useCallback(function(ae){I({type:"SET_ERRORS",payload:ae})},[]),W=Ka(function(ae,Re){var Ye=Go(ae)?ae(A.values):ae;I({type:"SET_VALUES",payload:Ye});var Ke=Re===void 0?n:Re;return Ke?K(Ye):Promise.resolve()}),Q=w.useCallback(function(ae,Re){I({type:"SET_FIELD_ERROR",payload:{field:ae,value:Re}})},[]),ie=Ka(function(ae,Re,Ye){I({type:"SET_FIELD_VALUE",payload:{field:ae,value:Re}});var Ke=Ye===void 0?n:Ye;return Ke?K(iu(A.values,ae,Re)):Promise.resolve()}),fe=w.useCallback(function(ae,Re){var Ye=Re,Ke=ae,xe;if(!GC(ae)){ae.persist&&ae.persist();var Ne=ae.target?ae.target:ae.currentTarget,Ct=Ne.type,Dt=Ne.name,Te=Ne.id,At=Ne.value,$e=Ne.checked,vt=Ne.outerHTML,tn=Ne.options,Rn=Ne.multiple;Ye=Re||Dt||Te,Ke=/number|range/.test(Ct)?(xe=parseFloat(At),isNaN(xe)?"":xe):/checkbox/.test(Ct)?pFe(Vi(A.values,Ye),$e,At):tn&&Rn?hFe(tn):At}Ye&&ie(Ye,Ke)},[ie,A.values]),Se=Ka(function(ae){if(GC(ae))return function(Re){return fe(Re,ae)};fe(ae)}),Pe=Ka(function(ae,Re,Ye){Re===void 0&&(Re=!0),I({type:"SET_FIELD_TOUCHED",payload:{field:ae,value:Re}});var Ke=Ye===void 0?i:Ye;return Ke?K(A.values):Promise.resolve()}),ye=w.useCallback(function(ae,Re){ae.persist&&ae.persist();var Ye=ae.target,Ke=Ye.name,xe=Ye.id,Ne=Ye.outerHTML,Ct=Re||Ke||xe;Pe(Ct,!0)},[Pe]),We=Ka(function(ae){if(GC(ae))return function(Re){return ye(Re,ae)};ye(ae)}),De=w.useCallback(function(ae){Go(ae)?I({type:"SET_FORMIK_STATE",payload:ae}):I({type:"SET_FORMIK_STATE",payload:function(){return ae}})},[]),ot=w.useCallback(function(ae){I({type:"SET_STATUS",payload:ae})},[]),He=w.useCallback(function(ae){I({type:"SET_ISSUBMITTING",payload:ae})},[]),Be=Ka(function(){return I({type:"SUBMIT_ATTEMPT"}),K().then(function(ae){var Re=ae instanceof Error,Ye=!Re&&Object.keys(ae).length===0;if(Ye){var Ke;try{if(Ke=mt(),Ke===void 0)return}catch(xe){throw xe}return Promise.resolve(Ke).then(function(xe){return E.current&&I({type:"SUBMIT_SUCCESS"}),xe}).catch(function(xe){if(E.current)throw I({type:"SUBMIT_FAILURE"}),xe})}else if(E.current&&(I({type:"SUBMIT_FAILURE"}),Re))throw ae})}),wt=Ka(function(ae){ae&&ae.preventDefault&&Go(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&Go(ae.stopPropagation)&&ae.stopPropagation(),Be().catch(function(Re){console.warn("Warning: An unhandled error was caught from submitForm()",Re)})}),st={resetForm:te,validateForm:K,validateField:q,setErrors:Z,setFieldError:Q,setFieldTouched:Pe,setFieldValue:ie,setStatus:ot,setSubmitting:He,setTouched:X,setValues:W,setFormikState:De,submitForm:Be},mt=Ka(function(){return d(A.values,st)}),St=Ka(function(ae){ae&&ae.preventDefault&&Go(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&Go(ae.stopPropagation)&&ae.stopPropagation(),te()}),Le=w.useCallback(function(ae){return{value:Vi(A.values,ae),error:Vi(A.errors,ae),touched:!!Vi(A.touched,ae),initialValue:Vi(v.current,ae),initialTouched:!!Vi(S.current,ae),initialError:Vi(b.current,ae)}},[A.errors,A.touched,A.values]),lt=w.useCallback(function(ae){return{setValue:function(Ye,Ke){return ie(ae,Ye,Ke)},setTouched:function(Ye,Ke){return Pe(ae,Ye,Ke)},setError:function(Ye){return Q(ae,Ye)}}},[ie,Pe,Q]),Mt=w.useCallback(function(ae){var Re=hw(ae),Ye=Re?ae.name:ae,Ke=Vi(A.values,Ye),xe={name:Ye,value:Ke,onChange:Se,onBlur:We};if(Re){var Ne=ae.type,Ct=ae.value,Dt=ae.as,Te=ae.multiple;Ne==="checkbox"?Ct===void 0?xe.checked=!!Ke:(xe.checked=!!(Array.isArray(Ke)&&~Ke.indexOf(Ct)),xe.value=Ct):Ne==="radio"?(xe.checked=Ke===Ct,xe.value=Ct):Dt==="select"&&Te&&(xe.value=xe.value||[],xe.multiple=!0)}return xe},[We,Se,A.values]),ut=w.useMemo(function(){return!md(v.current,A.values)},[v.current,A.values]),_t=w.useMemo(function(){return typeof s<"u"?ut?A.errors&&Object.keys(A.errors).length===0:s!==!1&&Go(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,ut,A.errors,m]),ln=Gn({},A,{initialValues:v.current,initialErrors:b.current,initialTouched:S.current,initialStatus:k.current,handleBlur:We,handleChange:Se,handleReset:St,handleSubmit:wt,resetForm:te,setErrors:Z,setFormikState:De,setFieldTouched:Pe,setFieldValue:ie,setFieldError:Q,setStatus:ot,setSubmitting:He,setTouched:X,setValues:W,submitForm:Be,validateForm:K,validateField:q,isValid:_t,dirty:ut,unregisterField:U,registerField:$,getFieldProps:Mt,getFieldMeta:Le,getFieldHelpers:lt,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return ln}function Yy(e){var t=uFe(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return w.useImperativeHandle(o,function(){return t}),w.createElement(sFe,{value:t},n?w.createElement(n,t):i?i(t):r?Go(r)?r(t):MK(r)?null:w.Children.only(r):null)}function cFe(e){var t={};if(e.inner){if(e.inner.length===0)return iu(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Vi(t,a.path)||(t=iu(t,a.path,a.message))}}return t}function dFe(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=c_(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function c_(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||CN(i)?c_(i):i!==""?i:void 0}):CN(e[r])?t[r]=c_(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function fFe(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?o_(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=o_(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function hFe(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function pFe(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var gFe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function Ka(e){var t=w.useRef(e);return gFe(function(){t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(Gn({},t,{length:n+1}))}else return[]},SFe=function(e){oFe(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,d=l.formik.setFormikState;d(function(h){var m=typeof s=="function"?s:o,v=typeof a=="function"?a:o,b=iu(h.values,u,o(Vi(h.values,u))),S=s?m(Vi(h.errors,u)):void 0,k=a?v(Vi(h.touched,u)):void 0;return KN(S)&&(S=void 0),KN(k)&&(k=void 0),Gn({},h,{values:b,errors:s?iu(h.errors,u,S):h.errors,touched:a?iu(h.touched,u,k):h.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(c0(a),[iFe(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return yFe(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return vFe(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return YC(s,o,a)},function(s){return YC(s,o,null)},function(s){return YC(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return bFe(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(YN(i)),i.pop=i.pop.bind(YN(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!md(Vi(i.formik.values,i.name),Vi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?c0(a):[];return o||(o=s[i]),Go(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,d=o.formik,h=Lh(d,["validate","validationSchema"]),m=Gn({},i,{form:h,name:u});return a?w.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):MK(l)?null:w.Children.only(l):null},t}(w.Component);SFe.defaultProps={validateOnChange:!0};const xFe=at([ir],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),XN=64,ZN=2048;function wFe(){const{openModel:e,model_list:t}=he(xFe),n=he(l=>l.system.isProcessing),r=Me(),{t:i}=Ve(),[o,a]=w.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});w.useEffect(()=>{var l,u,d,h,m,v,b;if(e){const S=ke.pickBy(t,(k,E)=>ke.isEqual(E,e));a({name:e,description:(l=S[e])==null?void 0:l.description,config:(u=S[e])==null?void 0:u.config,weights:(d=S[e])==null?void 0:d.weights,vae:(h=S[e])==null?void 0:h.vae,width:(m=S[e])==null?void 0:m.width,height:(v=S[e])==null?void 0:v.height,default:(b=S[e])==null?void 0:b.default,format:"ckpt"})}},[t,e]);const s=l=>{r($y({...l,width:Number(l.width),height:Number(l.height)}))};return e?y.jsxs(Ge,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[y.jsx(Ge,{alignItems:"center",children:y.jsx(fn,{fontSize:"lg",fontWeight:"bold",children:e})}),y.jsx(Ge,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:y.jsx(Yy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>y.jsx("form",{onSubmit:l,children:y.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[y.jsxs(dn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[y.jsx(kn,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?y.jsx(ur,{children:u.description}):y.jsx(lr,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!u.config&&d.config,isRequired:!0,children:[y.jsx(kn,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"config",name:"config",type:"text",width:"lg"}),u.config&&d.config?y.jsx(ur,{children:u.config}):y.jsx(lr,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!u.weights&&d.weights,isRequired:!0,children:[y.jsx(kn,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"weights",name:"weights",type:"text",width:"lg"}),u.weights&&d.weights?y.jsx(ur,{children:u.weights}):y.jsx(lr,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!u.vae&&d.vae,children:[y.jsx(kn,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"vae",name:"vae",type:"text",width:"lg"}),u.vae&&d.vae?y.jsx(ur,{children:u.vae}):y.jsx(lr,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(wy,{width:"100%",children:[y.jsxs(dn,{isInvalid:!!u.width&&d.width,children:[y.jsx(kn,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"width",name:"width",children:({field:h,form:m})=>y.jsx(ra,{id:"width",name:"width",min:XN,max:ZN,step:64,value:m.values.width,onChange:v=>m.setFieldValue(h.name,Number(v))})}),u.width&&d.width?y.jsx(ur,{children:u.width}):y.jsx(lr,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!u.height&&d.height,children:[y.jsx(kn,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"height",name:"height",children:({field:h,form:m})=>y.jsx(ra,{id:"height",name:"height",min:XN,max:ZN,step:64,value:m.values.height,onChange:v=>m.setFieldValue(h.name,Number(v))})}),u.height&&d.height?y.jsx(ur,{children:u.height}):y.jsx(lr,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y.jsx(cr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):y.jsx(Ge,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:y.jsx(fn,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const CFe=at([ir],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function _Fe(){const{openModel:e,model_list:t}=he(CFe),n=he(l=>l.system.isProcessing),r=Me(),{t:i}=Ve(),[o,a]=w.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});w.useEffect(()=>{var l,u,d,h,m,v,b,S,k,E,_,T,A,I,R,D;if(e){const j=ke.pickBy(t,(z,V)=>ke.isEqual(V,e));a({name:e,description:(l=j[e])==null?void 0:l.description,path:(u=j[e])!=null&&u.path&&((d=j[e])==null?void 0:d.path)!=="None"?(h=j[e])==null?void 0:h.path:"",repo_id:(m=j[e])!=null&&m.repo_id&&((v=j[e])==null?void 0:v.repo_id)!=="None"?(b=j[e])==null?void 0:b.repo_id:"",vae:{repo_id:(k=(S=j[e])==null?void 0:S.vae)!=null&&k.repo_id?(_=(E=j[e])==null?void 0:E.vae)==null?void 0:_.repo_id:"",path:(A=(T=j[e])==null?void 0:T.vae)!=null&&A.path?(R=(I=j[e])==null?void 0:I.vae)==null?void 0:R.path:""},default:(D=j[e])==null?void 0:D.default,format:"diffusers"})}},[t,e]);const s=l=>{const u=l;l.path===""&&delete u.path,l.repo_id===""&&delete u.repo_id,l.vae.path===""&&delete u.vae.path,l.vae.repo_id===""&&delete u.vae.repo_id,r($y(l))};return e?y.jsxs(Ge,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[y.jsx(Ge,{alignItems:"center",children:y.jsx(fn,{fontSize:"lg",fontWeight:"bold",children:e})}),y.jsx(Ge,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:y.jsx(Yy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>{var h,m,v,b,S,k,E,_,T,A;return y.jsx("form",{onSubmit:l,children:y.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[y.jsxs(dn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[y.jsx(kn,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?y.jsx(ur,{children:u.description}):y.jsx(lr,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!u.path&&d.path,isRequired:!0,children:[y.jsx(kn,{htmlFor:"path",fontSize:"sm",children:i("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"path",name:"path",type:"text",width:"lg"}),u.path&&d.path?y.jsx(ur,{children:u.path}):y.jsx(lr,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!u.repo_id&&d.repo_id,children:[y.jsx(kn,{htmlFor:"repo_id",fontSize:"sm",children:i("modelmanager:repo_id")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"repo_id",name:"repo_id",type:"text",width:"lg"}),u.repo_id&&d.repo_id?y.jsx(ur,{children:u.repo_id}):y.jsx(lr,{margin:0,children:i("modelmanager:repoIDValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!((h=u.vae)!=null&&h.path)&&((m=d.vae)==null?void 0:m.path),children:[y.jsx(kn,{htmlFor:"vae.path",fontSize:"sm",children:i("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"vae.path",name:"vae.path",type:"text",width:"lg"}),(v=u.vae)!=null&&v.path&&((b=d.vae)!=null&&b.path)?y.jsx(ur,{children:(S=u.vae)==null?void 0:S.path}):y.jsx(lr,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!((k=u.vae)!=null&&k.repo_id)&&((E=d.vae)==null?void 0:E.repo_id),children:[y.jsx(kn,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelmanager:vaeRepoID")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"lg"}),(_=u.vae)!=null&&_.repo_id&&((T=d.vae)!=null&&T.repo_id)?y.jsx(ur,{children:(A=u.vae)==null?void 0:A.repo_id}):y.jsx(lr,{margin:0,children:i("modelmanager:vaeRepoIDValidationMsg")})]})]}),y.jsx(cr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})}})})]}):y.jsx(Ge,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:y.jsx(fn,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const DK=at([ir],e=>{const{model_list:t}=e,n=[];return ke.forEach(t,r=>{n.push(r.weights)}),n});function kFe(){const{t:e}=Ve();return y.jsx(ko,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function QN({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=he(DK),i=o=>{t.includes(o.target.value)?n(ke.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return y.jsxs(ko,{position:"relative",children:[r.includes(e.location)?y.jsx(kFe,{}):null,y.jsx(er,{value:e.name,label:y.jsx(y.Fragment,{children:y.jsxs(yn,{alignItems:"start",children:[y.jsx("p",{style:{fontWeight:"bold"},children:e.name}),y.jsx("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function EFe(){const e=Me(),{t}=Ve(),n=he(S=>S.system.searchFolder),r=he(S=>S.system.foundModels),i=he(DK),o=he(S=>S.ui.shouldShowExistingModelsInSearch),a=he(S=>S.system.isProcessing),[s,l]=N.useState([]),u=()=>{e(FU(null)),e(zU(null)),l([])},d=S=>{e(cD(S.checkpointFolder))},h=()=>{l([]),r&&r.forEach(S=>{i.includes(S.location)||l(k=>[...k,S.name])})},m=()=>{l([])},v=()=>{const S=r==null?void 0:r.filter(k=>s.includes(k.name));S==null||S.forEach(k=>{const E={name:k.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:k.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e($y(E))}),l([])},b=()=>{const S=[],k=[];return r&&r.forEach((E,_)=>{i.includes(E.location)?k.push(y.jsx(QN,{model:E,modelsToAdd:s,setModelsToAdd:l},_)):S.push(y.jsx(QN,{model:E,modelsToAdd:s,setModelsToAdd:l},_))}),y.jsxs(y.Fragment,{children:[S,o&&k]})};return y.jsxs(y.Fragment,{children:[n?y.jsxs(Ge,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[y.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),y.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),y.jsx(Qe,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:y.jsx(Wx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(cD(n))}),y.jsx(Qe,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:y.jsx(zy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:u})]}):y.jsx(Yy,{initialValues:{checkpointFolder:""},onSubmit:S=>{d(S)},children:({handleSubmit:S})=>y.jsx("form",{onSubmit:S,children:y.jsxs(wy,{columnGap:"0.5rem",children:[y.jsx(dn,{isRequired:!0,width:"max-content",children:y.jsx(dr,{as:kr,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),y.jsx(Qe,{icon:y.jsx(zEe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&y.jsxs(Ge,{flexDirection:"column",rowGap:"1rem",children:[y.jsxs(Ge,{justifyContent:"space-between",alignItems:"center",children:[y.jsxs("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),y.jsxs("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),y.jsxs(Ge,{columnGap:"0.5rem",justifyContent:"space-between",children:[y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(cr,{isDisabled:s.length===r.length,onClick:h,children:t("modelmanager:selectAll")}),y.jsx(cr,{isDisabled:s.length===0,onClick:m,children:t("modelmanager:deselectAll")}),y.jsx(er,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(fCe(!o))})]}),y.jsx(cr,{isDisabled:s.length===0,onClick:v,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),y.jsxs(Ge,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&y.jsx(fn,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):y.jsx(fn,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),b()]})]})]})}const JN=64,ej=2048;function PFe(){const e=Me(),{t}=Ve(),n=he(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(u){let d;return r(u)&&(d=t("modelmanager:cannotUseSpaces")),d}const o={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=u=>{e($y(u)),e(zh(null))},[s,l]=N.useState(!1);return y.jsxs(y.Fragment,{children:[y.jsx(Qe,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(zh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:y.jsx(XG,{})}),y.jsx(EFe,{}),y.jsx(er,{label:t("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&y.jsx(Yy,{initialValues:o,onSubmit:a,children:({handleSubmit:u,errors:d,touched:h})=>y.jsx("form",{onSubmit:u,children:y.jsxs(yn,{rowGap:"0.5rem",children:[y.jsx(fn,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelmanager:manual")}),y.jsxs(dn,{isInvalid:!!d.name&&h.name,isRequired:!0,children:[y.jsx(kn,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),d.name&&h.name?y.jsx(ur,{children:d.name}):y.jsx(lr,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!d.description&&h.description,isRequired:!0,children:[y.jsx(kn,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"description",name:"description",type:"text",width:"2xl"}),d.description&&h.description?y.jsx(ur,{children:d.description}):y.jsx(lr,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!d.config&&h.config,isRequired:!0,children:[y.jsx(kn,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:config")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"config",name:"config",type:"text",width:"2xl"}),d.config&&h.config?y.jsx(ur,{children:d.config}):y.jsx(lr,{margin:0,children:t("modelmanager:configValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!d.weights&&h.weights,isRequired:!0,children:[y.jsx(kn,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"weights",name:"weights",type:"text",width:"2xl"}),d.weights&&h.weights?y.jsx(ur,{children:d.weights}):y.jsx(lr,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!d.vae&&h.vae,children:[y.jsx(kn,{htmlFor:"vae",fontSize:"sm",children:t("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"vae",name:"vae",type:"text",width:"2xl"}),d.vae&&h.vae?y.jsx(ur,{children:d.vae}):y.jsx(lr,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(wy,{width:"100%",children:[y.jsxs(dn,{isInvalid:!!d.width&&h.width,children:[y.jsx(kn,{htmlFor:"width",fontSize:"sm",children:t("modelmanager:width")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"width",name:"width",children:({field:m,form:v})=>y.jsx(ra,{id:"width",name:"width",min:JN,max:ej,step:64,width:"90%",value:v.values.width,onChange:b=>v.setFieldValue(m.name,Number(b))})}),d.width&&h.width?y.jsx(ur,{children:d.width}):y.jsx(lr,{margin:0,children:t("modelmanager:widthValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!d.height&&h.height,children:[y.jsx(kn,{htmlFor:"height",fontSize:"sm",children:t("modelmanager:height")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"height",name:"height",children:({field:m,form:v})=>y.jsx(ra,{id:"height",name:"height",min:JN,max:ej,width:"90%",step:64,value:v.values.height,onChange:b=>v.setFieldValue(m.name,Number(b))})}),d.height&&h.height?y.jsx(ur,{children:d.height}):y.jsx(lr,{margin:0,children:t("modelmanager:heightValidationMsg")})]})]})]}),y.jsx(cr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})})]})}function Qb({children:e}){return y.jsx(Ge,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:e})}function TFe(){const e=Me(),{t}=Ve(),n=he(s=>s.system.isProcessing);function r(s){return/\s/.test(s)}function i(s){let l;return r(s)&&(l=t("modelmanager:cannotUseSpaces")),l}const o={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=s=>{const l=s;s.path===""&&delete l.path,s.repo_id===""&&delete l.repo_id,s.vae.path===""&&delete l.vae.path,s.vae.repo_id===""&&delete l.vae.repo_id,e($y(l)),e(zh(null))};return y.jsxs(Ge,{children:[y.jsx(Qe,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(zh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:y.jsx(XG,{})}),y.jsx(Yy,{initialValues:o,onSubmit:a,children:({handleSubmit:s,errors:l,touched:u})=>{var d,h,m,v,b,S,k,E,_,T;return y.jsx("form",{onSubmit:s,children:y.jsxs(yn,{rowGap:"0.5rem",children:[y.jsx(Qb,{children:y.jsxs(dn,{isInvalid:!!l.name&&u.name,isRequired:!0,children:[y.jsx(kn,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),l.name&&u.name?y.jsx(ur,{children:l.name}):y.jsx(lr,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]})}),y.jsx(Qb,{children:y.jsxs(dn,{isInvalid:!!l.description&&u.description,isRequired:!0,children:[y.jsx(kn,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),l.description&&u.description?y.jsx(ur,{children:l.description}):y.jsx(lr,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]})}),y.jsxs(Qb,{children:[y.jsx(fn,{fontWeight:"bold",fontSize:"sm",children:t("modelmanager:formMessageDiffusersModelLocation")}),y.jsx(fn,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersModelLocationDesc")}),y.jsxs(dn,{isInvalid:!!l.path&&u.path,children:[y.jsx(kn,{htmlFor:"path",fontSize:"sm",children:t("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"path",name:"path",type:"text",width:"2xl"}),l.path&&u.path?y.jsx(ur,{children:l.path}):y.jsx(lr,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!l.repo_id&&u.repo_id,children:[y.jsx(kn,{htmlFor:"repo_id",fontSize:"sm",children:t("modelmanager:repo_id")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),l.repo_id&&u.repo_id?y.jsx(ur,{children:l.repo_id}):y.jsx(lr,{margin:0,children:t("modelmanager:repoIDValidationMsg")})]})]})]}),y.jsxs(Qb,{children:[y.jsx(fn,{fontWeight:"bold",children:t("modelmanager:formMessageDiffusersVAELocation")}),y.jsx(fn,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersVAELocationDesc")}),y.jsxs(dn,{isInvalid:!!((d=l.vae)!=null&&d.path)&&((h=u.vae)==null?void 0:h.path),children:[y.jsx(kn,{htmlFor:"vae.path",fontSize:"sm",children:t("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(m=l.vae)!=null&&m.path&&((v=u.vae)!=null&&v.path)?y.jsx(ur,{children:(b=l.vae)==null?void 0:b.path}):y.jsx(lr,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(dn,{isInvalid:!!((S=l.vae)!=null&&S.repo_id)&&((k=u.vae)==null?void 0:k.repo_id),children:[y.jsx(kn,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelmanager:vaeRepoID")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:kr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(E=l.vae)!=null&&E.repo_id&&((_=u.vae)!=null&&_.repo_id)?y.jsx(ur,{children:(T=l.vae)==null?void 0:T.repo_id}):y.jsx(lr,{margin:0,children:t("modelmanager:vaeRepoIDValidationMsg")})]})]})]}),y.jsx(cr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function tj({text:e,onClick:t}){return y.jsx(Ge,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:t,children:y.jsx(fn,{fontWeight:"bold",children:e})})}function LFe(){const{isOpen:e,onOpen:t,onClose:n}=Wh(),r=he(s=>s.ui.addNewModelUIOption),i=Me(),{t:o}=Ve(),a=()=>{n(),i(zh(null))};return y.jsxs(y.Fragment,{children:[y.jsx(cr,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:y.jsxs(Ge,{columnGap:"0.5rem",alignItems:"center",children:[y.jsx(zy,{}),o("modelmanager:addNew")]})}),y.jsxs(Yd,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[y.jsx(Kd,{}),y.jsxs(Zh,{className:"modal add-model-modal",fontFamily:"Inter",children:[y.jsx(w0,{children:o("modelmanager:addNewModel")}),y.jsx(Ly,{marginTop:"0.3rem"}),y.jsxs(n0,{className:"add-model-modal-body",children:[r==null&&y.jsxs(Ge,{columnGap:"1rem",children:[y.jsx(tj,{text:o("modelmanager:addCheckpointModel"),onClick:()=>i(zh("ckpt"))}),y.jsx(tj,{text:o("modelmanager:addDiffuserModel"),onClick:()=>i(zh("diffusers"))})]}),r=="ckpt"&&y.jsx(PFe,{}),r=="diffusers"&&y.jsx(TFe,{})]})]})]})]})}function Jb(e){const{isProcessing:t,isConnected:n}=he(v=>v.system),r=he(v=>v.system.openModel),{t:i}=Ve(),o=Me(),{name:a,status:s,description:l}=e,u=()=>{o(VG(a))},d=()=>{o(LR(a))},h=()=>{o($8e(a)),o(LR(null))},m=()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}};return y.jsxs(Ge,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[y.jsx(ko,{onClick:d,cursor:"pointer",children:y.jsx(uo,{label:l,hasArrow:!0,placement:"bottom",children:y.jsx(fn,{fontWeight:"bold",children:a})})}),y.jsx(fF,{onClick:d,cursor:"pointer"}),y.jsxs(Ge,{gap:2,alignItems:"center",children:[y.jsx(fn,{color:m(),children:s}),y.jsx(as,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),y.jsx(Qe,{icon:y.jsx(LEe,{}),size:"sm",onClick:d,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),y.jsx(oT,{title:i("modelmanager:deleteModel"),acceptCallback:h,acceptButtonText:i("modelmanager:delete"),triggerComponent:y.jsx(Qe,{icon:y.jsx(TEe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:y.jsxs(Ge,{rowGap:"1rem",flexDirection:"column",children:[y.jsx("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),y.jsx("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const AFe=at(ir,e=>ke.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function KC({label:e,isActive:t,onClick:n}){return y.jsx(cr,{onClick:n,isActive:t,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:e})}const OFe=()=>{const e=he(AFe),[t,n]=w.useState(""),[r,i]=w.useState("all"),[o,a]=w.useTransition(),{t:s}=Ve(),l=d=>{a(()=>{n(d.target.value)})},u=w.useMemo(()=>{const d=[],h=[],m=[],v=[];return e.forEach((b,S)=>{b.name.toLowerCase().includes(t.toLowerCase())&&(m.push(y.jsx(Jb,{name:b.name,status:b.status,description:b.description},S)),b.format===r&&v.push(y.jsx(Jb,{name:b.name,status:b.status,description:b.description},S))),b.format!=="diffusers"?d.push(y.jsx(Jb,{name:b.name,status:b.status,description:b.description},S)):h.push(y.jsx(Jb,{name:b.name,status:b.status,description:b.description},S))}),t!==""?r==="all"?y.jsx(ko,{marginTop:"1rem",children:m}):y.jsx(ko,{marginTop:"1rem",children:v}):y.jsxs(Ge,{flexDirection:"column",rowGap:"1.5rem",children:[r==="all"&&y.jsxs(y.Fragment,{children:[y.jsxs(ko,{children:[y.jsx(fn,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:s("modelmanager:checkpointModels")}),d]}),y.jsxs(ko,{children:[y.jsx(fn,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:s("modelmanager:diffusersModels")}),h]})]}),r==="ckpt"&&y.jsx(Ge,{flexDirection:"column",marginTop:"1rem",children:d}),r==="diffusers"&&y.jsx(Ge,{flexDirection:"column",marginTop:"1rem",children:h})]})},[e,t,s,r]);return y.jsxs(Ge,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[y.jsxs(Ge,{justifyContent:"space-between",children:[y.jsx(fn,{fontSize:"1.4rem",fontWeight:"bold",children:s("modelmanager:availableModels")}),y.jsx(LFe,{})]}),y.jsx(kr,{onChange:l,label:s("modelmanager:search")}),y.jsxs(Ge,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(KC,{label:s("modelmanager:allModels"),onClick:()=>i("all"),isActive:r==="all"}),y.jsx(KC,{label:s("modelmanager:checkpointModels"),onClick:()=>i("ckpt"),isActive:r==="ckpt"}),y.jsx(KC,{label:s("modelmanager:diffusersModels"),onClick:()=>i("diffusers"),isActive:r==="diffusers"})]}),u]})]})};function MFe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Wh(),i=he(s=>s.system.model_list),o=he(s=>s.system.openModel),{t:a}=Ve();return y.jsxs(y.Fragment,{children:[w.cloneElement(e,{onClick:n}),y.jsxs(Yd,{isOpen:t,onClose:r,size:"6xl",children:[y.jsx(Kd,{}),y.jsxs(Zh,{className:"modal",fontFamily:"Inter",children:[y.jsx(Ly,{className:"modal-close-btn"}),y.jsx(w0,{fontWeight:"bold",children:a("modelmanager:modelManager")}),y.jsxs(Ge,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[y.jsx(OFe,{}),o&&i[o].format==="diffusers"?y.jsx(_Fe,{}):y.jsx(wFe,{})]})]})]})]})}const IFe=at([ir],e=>{const{isProcessing:t,model_list:n}=e;return{models:ke.map(n,(i,o)=>o),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),RFe=()=>{const e=Me(),{models:t,isProcessing:n}=he(IFe),r=he(qG),i=o=>{e(VG(o.target.value))};return y.jsx(Ge,{style:{paddingLeft:"0.3rem"},children:y.jsx(tl,{style:{fontSize:"0.8rem"},tooltip:r.description,isDisabled:n,value:r.name,validValues:t,onChange:i})})},DFe=at([ir,mp],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:ke.map(o,(u,d)=>d),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),NFe=({children:e})=>{const t=Me(),{t:n}=Ve(),r=he(_=>_.generation.steps),{isOpen:i,onOpen:o,onClose:a}=Wh(),{isOpen:s,onOpen:l,onClose:u}=Wh(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:m,saveIntermediatesInterval:v,enableImageDebugging:b,shouldUseCanvasBetaLayout:S}=he(DFe),k=()=>{GG.purge().then(()=>{a(),l()})},E=_=>{_>r&&(_=r),_<1&&(_=1),t(Q6e(_))};return y.jsxs(y.Fragment,{children:[w.cloneElement(e,{onClick:o}),y.jsxs(Yd,{isOpen:i,onClose:a,size:"lg",children:[y.jsx(Kd,{}),y.jsxs(Zh,{className:"modal settings-modal",children:[y.jsx(w0,{className:"settings-modal-header",children:n("common:settingsLabel")}),y.jsx(Ly,{className:"modal-close-btn"}),y.jsxs(n0,{className:"settings-modal-content",children:[y.jsxs("div",{className:"settings-modal-items",children:[y.jsxs("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[y.jsx(tl,{label:n("settings:displayInProgress"),validValues:s7e,value:d,onChange:_=>t(U6e(_.target.value))}),d==="full-res"&&y.jsx(ra,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:E,value:v,width:"auto",textAlign:"center"})]}),y.jsx(Vs,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:_=>t(BU(_.target.checked))}),y.jsx(Vs,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:_=>t(K6e(_.target.checked))}),y.jsx(Vs,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:S,onChange:_=>t(dCe(_.target.checked))})]}),y.jsxs("div",{className:"settings-modal-items",children:[y.jsx("h2",{style:{fontWeight:"bold"},children:"Developer"}),y.jsx(Vs,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:_=>t(J6e(_.target.checked))})]}),y.jsxs("div",{className:"settings-modal-reset",children:[y.jsx(Dh,{size:"md",children:n("settings:resetWebUI")}),y.jsx(as,{colorScheme:"red",onClick:k,children:n("settings:resetWebUI")}),y.jsx(fn,{children:n("settings:resetWebUIDesc1")}),y.jsx(fn,{children:n("settings:resetWebUIDesc2")})]})]}),y.jsx(yx,{children:y.jsx(as,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),y.jsxs(Yd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[y.jsx(Kd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),y.jsx(Zh,{children:y.jsx(n0,{pb:6,pt:6,children:y.jsx(Ge,{justifyContent:"center",children:y.jsx(fn,{fontSize:"lg",children:y.jsx(fn,{children:n("settings:resetComplete")})})})})})]})]})},jFe=at(ir,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),BFe=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=he(jFe),s=Me(),{t:l}=Ve();let u;e&&!o?u="status-good":u="status-bad";let d=i;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(d)&&(u="status-working"),d&&t&&r>1&&(d=`${l(d)} (${n}/${r})`);const m=o&&!a?"Click to clear, check logs for details":void 0,v=o&&!a?"pointer":"initial",b=()=>{(o||!a)&&s($U())};return y.jsx(uo,{label:m,children:y.jsx(fn,{cursor:v,onClick:b,className:`status ${u}`,children:l(d)})})};function $Fe(){const{t:e}=Ve(),{setColorMode:t,colorMode:n}=dy(),r=Me(),i=he(l=>l.ui.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};w.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(aCe(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(y.jsx(cr,{style:{width:"6rem"},leftIcon:i===u?y.jsx(PP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return y.jsx(Zs,{trigger:"hover",triggerComponent:y.jsx(Qe,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y.jsx(pEe,{})}),children:y.jsx(yn,{align:"stretch",children:s()})})}function FFe(){const{t:e,i18n:t}=Ve(),n={en:e("common:langEnglish"),nl:e("common:langDutch"),fr:e("common:langFrench"),de:e("common:langGerman"),it:e("common:langItalian"),ja:e("common:langJapanese"),pl:e("common:langPolish"),pt_br:e("common:langBrPortuguese"),ru:e("common:langRussian"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish"),ua:e("common:langUkranian")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(y.jsx(cr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return y.jsx(Zs,{trigger:"hover",triggerComponent:y.jsx(Qe,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:y.jsx(dEe,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:y.jsx(yn,{children:r()})})}const zFe=()=>{const{t:e}=Ve(),t=he(n=>n.system.app_version);return y.jsxs("div",{className:"site-header",children:[y.jsxs("div",{className:"site-header-left-side",children:[y.jsx("img",{src:LY,alt:"invoke-ai-logo"}),y.jsxs(Ge,{alignItems:"center",columnGap:"0.6rem",children:[y.jsxs(fn,{fontSize:"1.4rem",children:["invoke ",y.jsx("strong",{children:"ai"})]}),y.jsx(fn,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),y.jsxs("div",{className:"site-header-right-side",children:[y.jsx(BFe,{}),y.jsx(RFe,{}),y.jsx(MFe,{children:y.jsx(Qe,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y.jsx(rEe,{})})}),y.jsx(TDe,{children:y.jsx(Qe,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y.jsx(cEe,{})})}),y.jsx($Fe,{}),y.jsx(FFe,{}),y.jsx(Qe,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y.jsx(Nh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:y.jsx(nEe,{})})}),y.jsx(Qe,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y.jsx(Nh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:y.jsx(Zke,{})})}),y.jsx(Qe,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y.jsx(Nh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:y.jsx(Xke,{})})}),y.jsx(NFe,{children:y.jsx(Qe,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:y.jsx(VEe,{})})})]})]})};function HFe(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const VFe=()=>{const e=Me(),t=he(a_e),n=Ry();w.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(tCe())},[e,n,t])},NK=at([yp,mp,Or],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:o,shouldUseCanvasBetaLayout:a}=t,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=e,d=a&&n==="unifiedCanvas",h=!d&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!d&&(!r||!i),shouldShowParametersPanelButton:h,shouldShowParametersPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WFe=()=>{const e=Me(),{shouldShowParametersPanel:t,shouldShowParametersPanelButton:n,shouldShowProcessButtons:r,shouldPinParametersPanel:i,shouldShowGallery:o,shouldPinGallery:a}=he(NK),s=()=>{e(Ku(!0)),i&&setTimeout(()=>e(vi(!0)),400)};return Je("f",()=>{o||t?(e(Ku(!1)),e(Bd(!1))):(e(Ku(!0)),e(Bd(!0))),(a||i)&&setTimeout(()=>e(vi(!0)),400)},[o,t]),n?y.jsxs("div",{className:"show-hide-button-options",children:[y.jsx(Qe,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:y.jsx(AP,{})}),r&&y.jsxs(y.Fragment,{children:[y.jsx(XP,{iconButton:!0}),y.jsx(YP,{})]})]}):null},UFe=()=>{const e=Me(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowParametersPanel:i,shouldPinParametersPanel:o}=he(NK),a=()=>{e(Bd(!0)),r&&e(vi(!0))};return Je("f",()=>{t||i?(e(Ku(!1)),e(Bd(!1))):(e(Ku(!0)),e(Bd(!0))),(r||o)&&setTimeout(()=>e(vi(!0)),400)},[t,i]),n?y.jsx(Qe,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:y.jsx(Tq,{})}):null};HFe();const GFe=()=>(VFe(),y.jsxs("div",{className:"App",children:[y.jsxs(xDe,{children:[y.jsx(EDe,{}),y.jsxs("div",{className:"app-content",children:[y.jsx(zFe,{}),y.jsx(ERe,{})]}),y.jsx("div",{className:"app-console",children:y.jsx(_De,{})})]}),y.jsx(WFe,{}),y.jsx(UFe,{})]})),nj=()=>y.jsx(Ge,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:y.jsx(xy,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})});const qFe=Aj({key:"invokeai-style-cache",prepend:!0});X9.createRoot(document.getElementById("root")).render(y.jsx(N.StrictMode,{children:y.jsx(T5e,{store:UG,children:y.jsx(mW,{loading:y.jsx(nj,{}),persistor:GG,children:y.jsx(qne,{value:qFe,children:y.jsx(q4e,{children:y.jsx(N.Suspense,{fallback:y.jsx(nj,{}),children:y.jsx(GFe,{})})})})})})})); diff --git a/invokeai/frontend/dist/index.html b/invokeai/frontend/dist/index.html index 832305d5d4..cc74516ac2 100644 --- a/invokeai/frontend/dist/index.html +++ b/invokeai/frontend/dist/index.html @@ -5,7 +5,7 @@ InvokeAI - A Stable Diffusion Toolkit - + diff --git a/invokeai/frontend/dist/locales/modelmanager/en.json b/invokeai/frontend/dist/locales/modelmanager/en.json index ad320d0969..967e11f061 100644 --- a/invokeai/frontend/dist/locales/modelmanager/en.json +++ b/invokeai/frontend/dist/locales/modelmanager/en.json @@ -63,5 +63,19 @@ "formMessageDiffusersModelLocation": "Diffusers Model Location", "formMessageDiffusersModelLocationDesc": "Please enter at least one.", "formMessageDiffusersVAELocation": "VAE Location", - "formMessageDiffusersVAELocationDesc": "If not provided, InvokeAI will look for the VAE file inside the model location given above." + "formMessageDiffusersVAELocationDesc": "If not provided, InvokeAI will look for the VAE file inside the model location given above.", + "convert": "Convert", + "convertToDiffusers": "Convert To Diffusers", + "convertToDiffusersHelpText1": "This model will be converted to the 🧨 Diffusers format.", + "convertToDiffusersHelpText2": "This process will replace your Model Manager entry with the Diffusers version of the same model.", + "convertToDiffusersHelpText3": "Your checkpoint file on the disk will NOT be deleted or modified in anyway. You can add your checkpoint to the Model Manager again if you want to.", + "convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.", + "convertToDiffusersHelpText5": "This process will create a Diffusers version of this model in the same directory as your checkpoint. Please make sure you have enough disk space.", + "convertToDiffusersHelpText6": "Do you wish to convert this model?", + "v1": "v1", + "v2": "v2", + "inpainting": "v1 Inpainting", + "custom": "Custom", + "pathToCustomConfig": "Path To Custom Config", + "statusConverting": "Converting" } diff --git a/invokeai/frontend/stats.html b/invokeai/frontend/stats.html index abfa9a018a..692d183d72 100644 --- a/invokeai/frontend/stats.html +++ b/invokeai/frontend/stats.html @@ -6157,7 +6157,7 @@ var drawChart = (function (exports) { + - - + document.addEventListener('DOMContentLoaded', run); + /*-->*/ + + - diff --git a/invokeai/frontend/yarn.lock b/invokeai/frontend/yarn.lock index 258a43bc01..9200e8d8c3 100644 --- a/invokeai/frontend/yarn.lock +++ b/invokeai/frontend/yarn.lock @@ -1168,18 +1168,6 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@kwsites/file-exists@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@kwsites/file-exists/-/file-exists-1.1.1.tgz#ad1efcac13e1987d8dbaf235ef3be5b0d96faa99" - integrity sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw== - dependencies: - debug "^4.1.1" - -"@kwsites/promise-deferred@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz#8ace5259254426ccef57f3175bc64ed7095ed919" - integrity sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw== - "@motionone/animation@^10.13.1": version "10.14.0" resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.14.0.tgz#2f2a3517183bb58d82e389aac777fe0850079de6" @@ -1932,7 +1920,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: +ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1942,11 +1930,6 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-escapes@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - ansi-escapes@^4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -1954,16 +1937,6 @@ ansi-escapes@^4.3.0: dependencies: type-fest "^0.21.3" -ansi-regex@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" - integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== - -ansi-regex@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" - integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -1974,7 +1947,7 @@ ansi-regex@^6.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -2006,13 +1979,6 @@ app-module-path@^2.2.0: resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" integrity sha512-gkco+qxENJV+8vFcDiiFhuoSvRXb2a/QPqpSoWhVz829VNJfOTnELbBmPmNKFxf3xdNnw4DWCkzkDaavcX/1YQ== -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" @@ -2062,18 +2028,6 @@ array.prototype.tosorted@^1.1.1: es-shim-unscopables "^1.0.0" get-intrinsic "^1.1.3" -asn1@~0.2.3: - version "0.2.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== - ast-module-types@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/ast-module-types/-/ast-module-types-2.7.1.tgz#3f7989ef8dfa1fdb82dfe0ab02bdfc7c77a57dd3" @@ -2089,11 +2043,6 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - attr-accept@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b" @@ -2104,16 +2053,6 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== - -aws4@^1.8.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" - integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== - babel-plugin-macros@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" @@ -2146,13 +2085,6 @@ base64id@2.0.0, base64id@~2.0.0: resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== - dependencies: - tweetnacl "^0.14.3" - binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" @@ -2208,17 +2140,7 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== - -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2: +chalk@^2.0.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -2235,11 +2157,6 @@ chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - "chokidar@>=3.0.0 <4.0.0": version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -2265,13 +2182,6 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw== - dependencies: - restore-cursor "^2.0.0" - cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" @@ -2279,18 +2189,11 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-spinners@^2.0.0, cli-spinners@^2.5.0: +cli-spinners@^2.5.0: version "2.7.0" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== -cli-table@^0.3.1: - version "0.3.11" - resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.11.tgz#ac69cdecbe81dccdba4889b9a18b7da312a9d3ee" - integrity sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ== - dependencies: - colors "1.0.3" - cli-truncate@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" @@ -2307,20 +2210,6 @@ cli-truncate@^3.1.0: slice-ansi "^5.0.0" string-width "^5.0.0" -cli-width@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" - integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== - -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== - dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" - cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -2364,19 +2253,7 @@ colorette@^2.0.19: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== -colors@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" - integrity sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw== - -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@^2.16.0, commander@^2.17.1, commander@^2.20.0, commander@^2.20.3, commander@^2.8.1: +commander@^2.16.0, commander@^2.20.0, commander@^2.20.3, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -2423,11 +2300,6 @@ copy-to-clipboard@3.3.1: dependencies: toggle-selection "^1.0.6" -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== - cors@~2.8.5: version "2.8.5" resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" @@ -2486,13 +2358,6 @@ csstype@^3.0.11, csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== - dependencies: - assert-plus "^1.0.0" - dateformat@^5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-5.0.3.tgz#fe2223eff3cc70ce716931cb3038b59a9280696e" @@ -2505,11 +2370,6 @@ debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3 dependencies: ms "2.1.2" -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== - deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -2545,11 +2405,6 @@ define-properties@^1.1.3, define-properties@^1.1.4: has-property-descriptors "^1.0.0" object-keys "^1.1.1" -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - dependency-tree@^8.1.1: version "8.1.2" resolved "https://registry.yarnpkg.com/dependency-tree/-/dependency-tree-8.1.2.tgz#c9e652984f53bd0239bc8a3e50cbd52f05b2e770" @@ -2689,19 +2544,6 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -3070,37 +2912,6 @@ execa@^6.1.0: signal-exit "^3.0.7" strip-final-newline "^3.0.0" -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== - dependencies: - is-extendable "^0.1.0" - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== - -extsprintf@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -3139,13 +2950,6 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA== - dependencies: - escape-string-regexp "^1.0.5" - file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -3191,13 +2995,6 @@ find-root@^1.1.0: resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - find-up@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" @@ -3245,20 +3042,6 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - formik@^2.2.9: version "2.2.9" resolved "https://registry.yarnpkg.com/formik/-/formik-2.2.9.tgz#8594ba9c5e2e5cf1f42c5704128e119fc46232d0" @@ -3305,11 +3088,6 @@ from@~0: resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" integrity sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g== -fs-exists-sync@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" - integrity sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg== - fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -3357,7 +3135,7 @@ get-amd-module-type@^3.0.0: ast-module-types "^3.0.0" node-source-walk "^4.2.2" -get-caller-file@^2.0.1, get-caller-file@^2.0.5: +get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -3394,13 +3172,6 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== - dependencies: - assert-plus "^1.0.0" - glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -3489,19 +3260,6 @@ graphviz@0.0.9: dependencies: temp "~0.4.0" -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" @@ -3567,15 +3325,6 @@ html-parse-stringify@^3.0.1: dependencies: void-elements "3.1.0" -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - human-signals@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-3.0.1.tgz#c740920859dafa50e5a3222da9d3bf4bb0e5eef5" @@ -3607,13 +3356,6 @@ i18next@^22.4.5: dependencies: "@babel/runtime" "^7.20.6" -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - ieee754@^1.1.13: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" @@ -3675,25 +3417,6 @@ ini@~1.3.0: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -inquirer@^6.1.0: - version "6.5.2" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" - integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== - dependencies: - ansi-escapes "^3.2.0" - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.12" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^2.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" - internal-slot@^1.0.3, internal-slot@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.4.tgz#8551e7baf74a7a6ba5f749cfb16aa60722f0d6f3" @@ -3777,11 +3500,6 @@ is-docker@^2.0.0, is-docker@^2.1.1: resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== -is-extendable@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== - is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" @@ -3792,11 +3510,6 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -3915,11 +3628,6 @@ is-typed-array@^1.1.10, is-typed-array@^1.1.9: gopd "^1.0.1" has-tostringtag "^1.0.0" -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== - is-unicode-supported@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" @@ -3961,11 +3669,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== - its-fine@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/its-fine/-/its-fine-1.0.6.tgz#087b14d71137816dab676d8b57c35a6cd5d2b021" @@ -3983,26 +3686,13 @@ js-sdsl@^4.1.4: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@>=3.13.1, js-yaml@^4.1.0: +js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: argparse "^2.0.1" -js-yaml@^3.8.3: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== - json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" @@ -4013,21 +3703,11 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - json5@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" @@ -4042,16 +3722,6 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" -jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - "jsx-ast-utils@^2.4.1 || ^3.0.0": version "3.3.3" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz#76b3e6e6cece5c69d49a5792c3d01bd1a0cdc7ea" @@ -4117,25 +3787,6 @@ lint-staged@^13.1.0: string-argv "^0.3.1" yaml "^2.1.3" -lint@^0.8.19: - version "0.8.19" - resolved "https://registry.yarnpkg.com/lint/-/lint-0.8.19.tgz#5be18853dbc96053b74bdfa2bb5c9c4c30e59216" - integrity sha512-i9iqBX/OO2+zSE7hEDXJ0rdLMxvBluK2T/xbCKAhEgyHE1q6kjp1HJGOVagkVB0f0UZ+FnW/wM3smsihQN0tFw== - dependencies: - chalk "^2.4.2" - cli-table "^0.3.1" - commander "^2.17.1" - inquirer "^6.1.0" - js-yaml ">=3.13.1" - loadash "^1.0.0" - moment "^2.22.2" - ora "^3.0.0" - prettier "^1.15.3" - replace-in-file "^3.4.2" - request "^2.87.0" - simple-git "^3.15.0" - write-yaml "^1.0.0" - listr2@^5.0.5: version "5.0.7" resolved "https://registry.yarnpkg.com/listr2/-/listr2-5.0.7.tgz#de69ccc4caf6bea7da03c74f7a2ffecf3904bd53" @@ -4150,19 +3801,6 @@ listr2@^5.0.5: through "^2.3.8" wrap-ansi "^7.0.0" -loadash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/loadash/-/loadash-1.0.0.tgz#b92e54d809f3c225f4f9a9cfbaeae5b56de1ca9f" - integrity sha512-xlX5HBsXB3KG0FJbJJG/3kYWCfsCyCSus3T+uHVu6QL6YxAdggmm3QeyLgn54N2yi5/UE6xxL5ZWJAAiHzHYEg== - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" @@ -4185,18 +3823,11 @@ lodash.mergewith@4.6.2: resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== -lodash@4.17.21, lodash@^4.17.12, lodash@^4.17.21: +lodash@4.17.21, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" @@ -4285,18 +3916,13 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.34: +mime-types@~2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -4319,13 +3945,6 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== -mkdirp@^0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - module-definition@^3.3.1: version "3.4.0" resolved "https://registry.yarnpkg.com/module-definition/-/module-definition-3.4.0.tgz#953a3861f65df5e43e80487df98bb35b70614c2b" @@ -4345,21 +3964,11 @@ module-lookup-amd@^7.0.1: requirejs "^2.3.5" requirejs-config-file "^4.0.0" -moment@^2.22.2: - version "2.29.4" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" - integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ== - nanoid@^3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" @@ -4416,11 +4025,6 @@ npm-run-path@^5.1.0: dependencies: path-key "^4.0.0" -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - object-assign@^4, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -4488,13 +4092,6 @@ once@^1.3.0: dependencies: wrappy "1" -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ== - dependencies: - mimic-fn "^1.0.0" - onetime@^5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" @@ -4550,18 +4147,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -ora@^3.0.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/ora/-/ora-3.4.0.tgz#bf0752491059a3ef3ed4c85097531de9fdbcd318" - integrity sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg== - dependencies: - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-spinners "^2.0.0" - log-symbols "^2.2.0" - strip-ansi "^5.2.0" - wcwidth "^1.0.1" - ora@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" @@ -4582,13 +4167,6 @@ os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== -p-limit@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -4596,13 +4174,6 @@ p-limit@^3.0.2: dependencies: yocto-queue "^0.1.0" -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - p-locate@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" @@ -4617,11 +4188,6 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -4664,11 +4230,6 @@ patch-package@^6.5.0: tmp "^0.0.33" yaml "^1.10.2" -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -4711,11 +4272,6 @@ pause-stream@0.0.11: dependencies: through "~2.3" -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -4823,11 +4379,6 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^1.15.3: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== - prettier@^2.8.3: version "2.8.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.3.tgz#ab697b1d3dd46fb4626fbe2f543afe0cc98d8632" @@ -4856,26 +4407,11 @@ ps-tree@^1.2.0: dependencies: event-stream "=3.3.4" -psl@^1.1.28: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== - punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -punycode@^2.1.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== - -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== - queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -5126,51 +4662,11 @@ regexpp@^3.2.0: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== -replace-in-file@^3.4.2: - version "3.4.4" - resolved "https://registry.yarnpkg.com/replace-in-file/-/replace-in-file-3.4.4.tgz#2c2b95a493dc4f6161c2bcd29a661be16d03d323" - integrity sha512-ehq0dFsxSpfPiPLBU5kli38Ud8bZL0CQKG8WQVbvhmyilXaMJ8y4LtDZs/K3MD8C0+rHbsfW8c9r2bUEy0B/6Q== - dependencies: - chalk "^2.4.2" - glob "^7.1.3" - yargs "^13.2.2" - -request@^2.87.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - requirejs-config-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/requirejs-config-file/-/requirejs-config-file-4.0.0.tgz#4244da5dd1f59874038cc1091d078d620abb6ebc" @@ -5217,14 +4713,6 @@ resolve@^2.0.0-next.4: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q== - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -5281,11 +4769,6 @@ rollup@^3.10.0: optionalDependencies: fsevents "~2.3.2" -run-async@^2.2.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -5293,13 +4776,6 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^6.4.0: - version "6.6.7" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" - integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== - dependencies: - tslib "^1.9.0" - rxjs@^7.8.0: version "7.8.0" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" @@ -5307,7 +4783,7 @@ rxjs@^7.8.0: dependencies: tslib "^2.1.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: +safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -5321,11 +4797,6 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - sass-lookup@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/sass-lookup/-/sass-lookup-3.0.0.tgz#3b395fa40569738ce857bc258e04df2617c48cac" @@ -5366,11 +4837,6 @@ semver@^7.3.5, semver@^7.3.7: dependencies: lru-cache "^6.0.0" -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -5409,15 +4875,6 @@ signal-exit@^3.0.2, signal-exit@^3.0.7: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -simple-git@^3.15.0: - version "3.16.0" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.16.0.tgz#421773e24680f5716999cc4a1d60127b4b6a9dec" - integrity sha512-zuWYsOLEhbJRWVxpjdiXl6eyAyGo/KzVW+KFhhw9MqEEJttcq+32jTWSGyxTdf9e/YCohxRE+9xpWFj9FdiJNw== - dependencies: - "@kwsites/file-exists" "^1.1.1" - "@kwsites/promise-deferred" "^1.1.1" - debug "^4.3.4" - slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" @@ -5524,26 +4981,6 @@ split@0.3: dependencies: through "2" -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== - -sshpk@^1.7.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" - integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - stream-combiner@~0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" @@ -5561,23 +4998,6 @@ string-argv@^0.3.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== -string-width@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -5644,20 +5064,6 @@ stringify-object@^3.2.1: is-obj "^1.0.1" is-regexp "^1.0.0" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -5757,7 +5163,7 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -through@2, through@^2.3.6, through@^2.3.8, through@~2.3, through@~2.3.1: +through@2, through@^2.3.8, through@~2.3, through@~2.3.1: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== @@ -5796,14 +5202,6 @@ toggle-selection@^1.0.6: resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32" integrity sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ== -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -5840,7 +5238,7 @@ tslib@2.4.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== -tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0: +tslib@^1.10.0, tslib@^1.8.1: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== @@ -5857,18 +5255,6 @@ tsutils@^3.21.0: dependencies: tslib "^1.8.1" -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -5974,11 +5360,6 @@ util-deprecate@^1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - uuid@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" @@ -5989,15 +5370,6 @@ vary@^1: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - vite-plugin-eslint@^1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/vite-plugin-eslint/-/vite-plugin-eslint-1.8.1.tgz#0381b8272e7f0fd8b663311b64f7608d55d8b04c" @@ -6069,11 +5441,6 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== - which-typed-array@^1.1.9: version "1.1.9" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" @@ -6105,15 +5472,6 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -6137,23 +5495,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write-yaml@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/write-yaml/-/write-yaml-1.0.0.tgz#314596119d0db91247cbc835bce0033b6e0ba09e" - integrity sha512-QFB0QwNlUTSsICNb1HV+822MvFpTC1gtKcOfm0B9oqz4qOQXbRuMSxWPWryTEFBEZDWbI5zXabXArvShXTdLiA== - dependencies: - extend-shallow "^2.0.1" - js-yaml "^3.8.3" - write "^0.3.3" - -write@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/write/-/write-0.3.3.tgz#09cdc5a2155607ee279f45e38d91ae29fb6a5178" - integrity sha512-e63bsTAFxFUU8OGClhjhhf2R72Njpq6DDTOFFBxDkfZFwoRRKZUx9rll6g/TvY0UcCdKE2OroYZje0v9ROzmfA== - dependencies: - fs-exists-sync "^0.1.0" - mkdirp "^0.5.1" - ws@~8.2.3: version "8.2.3" resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.3.tgz#63a56456db1b04367d0b721a0b80cae6d8becbba" @@ -6164,11 +5505,6 @@ xmlhttprequest-ssl@~2.0.0: resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz#91360c86b914e67f44dce769180027c0da618c67" integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A== -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -6189,35 +5525,11 @@ yaml@^2.1.3: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.1.tgz#3014bf0482dcd15147aa8e56109ce8632cd60ce4" integrity sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw== -yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs@^13.2.2: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - yargs@^17.5.1: version "17.6.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" From d0e6a57e48c9c09da417eb1fee4bd62b538bb27e Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sat, 11 Feb 2023 15:53:41 -0500 Subject: [PATCH 12/39] make inpaint model conversion work Fixed a couple of bugs: 1. The original config file for the ckpt file is derived from the entry in `models.yaml` rather than relying on the user to select. The implication of this is that V2 ckpt models need to be assigned `v2-inference-v.yaml` when they are first imported. Otherwise they won't convert right. Note that currently V2 ckpts are imported with `v1-inference.yaml`, which isn't right either. 2. Fixed a backslash in the output diffusers path, which was causing load failures on Linux. Remaining issues: 1. The radio buttons for selecting the model type are nonfunctional. It feels to me like these should be moved into the dialogue for importing ckpt/safetensors files, because this is where the algorithm needs help from the user. 2. The output diffusers model is written into the same directory as the input ckpt file. The CLI does it differently and stores the diffusers model in `ROOTDIR/models/converted-ckpts`. We should settle on one way or the other. --- invokeai/backend/invoke_ai_web_server.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/invokeai/backend/invoke_ai_web_server.py b/invokeai/backend/invoke_ai_web_server.py index dda6ee2df2..24b48f2fbb 100644 --- a/invokeai/backend/invoke_ai_web_server.py +++ b/invokeai/backend/invoke_ai_web_server.py @@ -422,26 +422,10 @@ class InvokeAIWebServer: original_config_file = Path( Globals.root, original_config_file) - if model_to_convert['model_type'] == 'inpainting': - original_config_file = Path( - 'configs', - 'stable-diffusion', - 'v1-inpainting-inference.yaml' - ) - - if model_to_convert['model_type'] == '2': - original_config_file = Path( - 'configs', - 'stable-diffusion', - 'v2-inference-v.yaml' - ) - - if model_to_convert['model_type'] == 'custom' and model_to_convert['custom_config'] is not None: - original_config_file = Path( - model_to_convert['custom_config']) - diffusers_path = Path( - f'{ckpt_path.parent.absolute()}\\{model_name}_diffusers') + ckpt_path.parent.absolute(), + f'{model_name}_diffusers' + ) if diffusers_path.exists(): shutil.rmtree(diffusers_path) From 1e98e0b159ab8305754c51dd4126173b966f99d6 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 12 Feb 2023 11:09:09 +1300 Subject: [PATCH 13/39] [Model Manager] Allow users to pick model type Users can now pick model type when adding a new model and the configuration files are automatically applied. --- .../components/ModelManager/SearchModels.tsx | 72 ++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/src/features/system/components/ModelManager/SearchModels.tsx b/invokeai/frontend/src/features/system/components/ModelManager/SearchModels.tsx index fd7da520bd..dfa197f375 100644 --- a/invokeai/frontend/src/features/system/components/ModelManager/SearchModels.tsx +++ b/invokeai/frontend/src/features/system/components/ModelManager/SearchModels.tsx @@ -3,7 +3,16 @@ import IAICheckbox from 'common/components/IAICheckbox'; import IAIIconButton from 'common/components/IAIIconButton'; import React from 'react'; -import { Box, Flex, FormControl, HStack, Text, VStack } from '@chakra-ui/react'; +import { + Box, + Flex, + FormControl, + HStack, + Radio, + RadioGroup, + Text, + VStack, +} from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { systemSelector } from 'features/system/store/systemSelectors'; @@ -135,6 +144,8 @@ export default function SearchModels() { ); const [modelsToAdd, setModelsToAdd] = React.useState([]); + const [modelType, setModelType] = React.useState('v1'); + const [pathToConfig, setPathToConfig] = React.useState(''); const resetSearchModelHandler = () => { dispatch(setSearchFolder(null)); @@ -167,11 +178,19 @@ export default function SearchModels() { const modelsToBeAdded = foundModels?.filter((foundModel) => modelsToAdd.includes(foundModel.name) ); + + const configFiles = { + v1: 'configs/stable-diffusion/v1-inference.yaml', + v2: 'configs/stable-diffusion/v2-inference-v.yaml', + inpainting: 'configs/stable-diffusion/v1-inpainting-inference.yaml', + custom: pathToConfig, + }; + modelsToBeAdded?.forEach((model) => { const modelFormat = { name: model.name, description: '', - config: 'configs/stable-diffusion/v1-inference.yaml', + config: configFiles[modelType as keyof typeof configFiles], weights: model.location, vae: '', width: 512, @@ -346,6 +365,55 @@ export default function SearchModels() { {t('modelmanager:addSelected')} + + + + + Pick Model Type: + + setModelType(v)} + defaultValue="v1" + name="model_type" + > + + {t('modelmanager:v1')} + {t('modelmanager:v2')} + + {t('modelmanager:inpainting')} + + {t('modelmanager:customConfig')} + + + + + {modelType === 'custom' && ( + + + {t('modelmanager:pathToCustomConfig')} + + { + if (e.target.value !== '') setPathToConfig(e.target.value); + }} + width="42.5rem" + /> + + )} + + Date: Sun, 12 Feb 2023 11:10:17 +1300 Subject: [PATCH 14/39] [Model Manager] Allows uses to pick Diffusers converted model save location Users can now pick the folder to save their diffusers converted model. It can either be the same folder as the ckpt, or the invoke root models folder or a totally custom location. --- invokeai/frontend/src/app/invokeai.d.ts | 6 +- .../components/ModelManager/ModelConvert.tsx | 68 +++++++++---------- 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/invokeai/frontend/src/app/invokeai.d.ts b/invokeai/frontend/src/app/invokeai.d.ts index e67a3e4951..9578c71f93 100644 --- a/invokeai/frontend/src/app/invokeai.d.ts +++ b/invokeai/frontend/src/app/invokeai.d.ts @@ -220,9 +220,9 @@ export declare type InvokeDiffusersModelConfigProps = { }; export declare type InvokeModelConversionProps = { - name: string; - model_type: string; - custom_config: string | null; + model_name: string; + save_location: string; + custom_location: string | null; }; /** diff --git a/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx b/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx index 89061e7bd8..6f34dbf43a 100644 --- a/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx +++ b/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx @@ -29,9 +29,6 @@ export default function ModelConvert(props: ModelConvertProps) { const retrievedModel = model_list[model]; - const [pathToConfig, setPathToConfig] = useState(''); - const [modelType, setModelType] = useState('1'); - const dispatch = useAppDispatch(); const { t } = useTranslation(); @@ -43,33 +40,28 @@ export default function ModelConvert(props: ModelConvertProps) { (state: RootState) => state.system.isConnected ); - // Need to manually handle local state reset because the component does not re-render. - const stateReset = () => { - setModelType('1'); - setPathToConfig(''); - }; + const [saveLocation, setSaveLocation] = useState('same'); + const [customSaveLocation, setCustomSaveLocation] = useState(''); - // Reset local state when model changes useEffect(() => { - stateReset(); + setSaveLocation('same'); }, [model]); - // Handle local state reset when user cancels input const modelConvertCancelHandler = () => { - stateReset(); + setSaveLocation('same'); }; const modelConvertHandler = () => { - const modelConvertData = { - name: model, - model_type: modelType, - custom_config: - modelType === 'custom' && pathToConfig !== '' ? pathToConfig : null, + const modelToConvert = { + model_name: model, + save_location: saveLocation, + custom_location: + saveLocation === 'custom' && customSaveLocation !== '' + ? customSaveLocation + : null, }; - dispatch(setIsProcessing(true)); - dispatch(convertToDiffusers(modelConvertData)); - stateReset(); // Edge case: Cancel local state when model convert fails + dispatch(convertToDiffusers(modelToConvert)); }; return ( @@ -102,32 +94,34 @@ export default function ModelConvert(props: ModelConvertProps) { {t('modelmanager:convertToDiffusersHelpText5')} {t('modelmanager:convertToDiffusersHelpText6')} - setModelType(v)} - defaultValue="1" - name="model_type" - > - - {t('modelmanager:v1')} - {t('modelmanager:v2')} - {t('modelmanager:inpainting')} - {t('modelmanager:custom')} - - - {modelType === 'custom' && ( + + + + + Save Location + setSaveLocation(v)}> + + {t('modelmanager:sameFolder')} + {t('modelmanager:invokeRoot')} + {t('modelmanager:custom')} + + + + + {saveLocation === 'custom' && ( - {t('modelmanager:pathToCustomConfig')} + {t('modelmanager:customSaveLocation')} { - if (e.target.value !== '') setPathToConfig(e.target.value); + if (e.target.value !== '') + setCustomSaveLocation(e.target.value); }} width="25rem" /> From b1a53c8ef09b190e0f8ab290d465f135119da7e5 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 12 Feb 2023 11:10:47 +1300 Subject: [PATCH 15/39] {Model Manager] Backend update to support custom save locations and configs --- invokeai/backend/invoke_ai_web_server.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/invokeai/backend/invoke_ai_web_server.py b/invokeai/backend/invoke_ai_web_server.py index 24b48f2fbb..dbe2714ade 100644 --- a/invokeai/backend/invoke_ai_web_server.py +++ b/invokeai/backend/invoke_ai_web_server.py @@ -402,11 +402,11 @@ class InvokeAIWebServer: @socketio.on('convertToDiffusers') def convert_to_diffusers(model_to_convert: dict): try: - if (model_info := self.generate.model_manager.model_info(model_name=model_to_convert['name'])): + if (model_info := self.generate.model_manager.model_info(model_name=model_to_convert['model_name'])): if 'weights' in model_info: ckpt_path = Path(model_info['weights']) original_config_file = Path(model_info['config']) - model_name = model_to_convert["name"] + model_name = model_to_convert['model_name'] model_description = model_info['description'] else: self.socketio.emit( @@ -427,6 +427,12 @@ class InvokeAIWebServer: f'{model_name}_diffusers' ) + if model_to_convert['save_location'] == 'root': + diffusers_path = Path(Globals.root, 'models', 'converted_ckpts', f'{model_name}_diffusers') + + if model_to_convert['save_location'] == 'custom' and model_to_convert['custom_location'] is not None: + diffusers_path = Path(model_to_convert['custom_location'], f'{model_name}_diffusers') + if diffusers_path.exists(): shutil.rmtree(diffusers_path) From 04ae6fde80263d8b76e0e9019fe103b02bf558e8 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 12 Feb 2023 11:11:00 +1300 Subject: [PATCH 16/39] Model Manager localization updates --- .../public/locales/modelmanager/en-US.json | 20 ++++++++++++++++++- .../public/locales/modelmanager/en.json | 8 ++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/public/locales/modelmanager/en-US.json b/invokeai/frontend/public/locales/modelmanager/en-US.json index c5c5eda054..f90fe59ca5 100644 --- a/invokeai/frontend/public/locales/modelmanager/en-US.json +++ b/invokeai/frontend/public/locales/modelmanager/en-US.json @@ -63,5 +63,23 @@ "formMessageDiffusersModelLocation": "Diffusers Model Location", "formMessageDiffusersModelLocationDesc": "Please enter at least one.", "formMessageDiffusersVAELocation": "VAE Location", - "formMessageDiffusersVAELocationDesc": "If not provided, InvokeAI will look for the VAE file inside the model location given above." + "formMessageDiffusersVAELocationDesc": "If not provided, InvokeAI will look for the VAE file inside the model location given above.", + "convert": "Convert", + "convertToDiffusers": "Convert To Diffusers", + "convertToDiffusersHelpText1": "This model will be converted to the 🧨 Diffusers format.", + "convertToDiffusersHelpText2": "This process will replace your Model Manager entry with the Diffusers version of the same model.", + "convertToDiffusersHelpText3": "Your checkpoint file on the disk will NOT be deleted or modified in anyway. You can add your checkpoint to the Model Manager again if you want to.", + "convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.", + "convertToDiffusersHelpText5": "This process will create a Diffusers version of this model in the same directory as your checkpoint. Please make sure you have enough disk space.", + "convertToDiffusersHelpText6": "Do you wish to convert this model?", + "v1": "v1", + "v2": "v2", + "inpainting": "v1 Inpainting", + "customConfig": "Custom Config", + "pathToCustomConfig": "Path To Custom Config", + "statusConverting": "Converting", + "sameFolder": "Same Folder", + "invokeRoot": "Invoke Models", + "custom": "Custom", + "customSaveLocation": "Custom Save Location" } diff --git a/invokeai/frontend/public/locales/modelmanager/en.json b/invokeai/frontend/public/locales/modelmanager/en.json index 967e11f061..6d6481085c 100644 --- a/invokeai/frontend/public/locales/modelmanager/en.json +++ b/invokeai/frontend/public/locales/modelmanager/en.json @@ -75,7 +75,11 @@ "v1": "v1", "v2": "v2", "inpainting": "v1 Inpainting", - "custom": "Custom", + "customConfig": "Custom Config", "pathToCustomConfig": "Path To Custom Config", - "statusConverting": "Converting" + "statusConverting": "Converting", + "sameFolder": "Same Folder", + "invokeRoot": "Invoke Models", + "custom": "Custom", + "customSaveLocation": "Custom Save Location" } From 08c747f1e018dfc7234a3576556d13bf339d192f Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sun, 12 Feb 2023 11:12:23 +1300 Subject: [PATCH 17/39] test-build (model-conversion-v1) --- .../{index-a78f4d86.js => index-337fc9d4.js} | 102 +- invokeai/frontend/dist/index.html | 2 +- .../dist/locales/modelmanager/en-US.json | 20 +- .../dist/locales/modelmanager/en.json | 8 +- invokeai/frontend/stats.html | 38797 +++------------- 5 files changed, 5994 insertions(+), 32935 deletions(-) rename invokeai/frontend/dist/assets/{index-a78f4d86.js => index-337fc9d4.js} (65%) diff --git a/invokeai/frontend/dist/assets/index-a78f4d86.js b/invokeai/frontend/dist/assets/index-337fc9d4.js similarity index 65% rename from invokeai/frontend/dist/assets/index-a78f4d86.js rename to invokeai/frontend/dist/assets/index-337fc9d4.js index a2254b8262..f8d6ff6b91 100644 --- a/invokeai/frontend/dist/assets/index-a78f4d86.js +++ b/invokeai/frontend/dist/assets/index-337fc9d4.js @@ -1,4 +1,4 @@ -var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var sn=(e,t,n)=>(Cee(e,typeof t!="symbol"?t+"":t,n),n);function cj(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var _o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function v_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var y={},_ee={get exports(){return y},set exports(e){y=e}},bS={},w={},kee={get exports(){return w},set exports(e){w=e}},tn={};/** +var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var sn=(e,t,n)=>(Cee(e,typeof t!="symbol"?t+"":t,n),n);function dj(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var _o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function v_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var v={},_ee={get exports(){return v},set exports(e){v=e}},bS={},w={},kee={get exports(){return w},set exports(e){w=e}},tn={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var py=Symbol.for("react.element"),Eee=Symbol.for("react.portal"),Pee=Symbol.for("react.fragment"),Tee=Symbol.for("react.strict_mode"),Lee=Symbol.for("react.profiler"),Aee=Symbol.for("react.provider"),Oee=Symbol.for("react.context"),Mee=Symbol.for("react.forward_ref"),Iee=Symbol.for("react.suspense"),Ree=Symbol.for("react.memo"),Dee=Symbol.for("react.lazy"),gL=Symbol.iterator;function Nee(e){return e===null||typeof e!="object"?null:(e=gL&&e[gL]||e["@@iterator"],typeof e=="function"?e:null)}var dj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fj=Object.assign,hj={};function p0(e,t,n){this.props=e,this.context=t,this.refs=hj,this.updater=n||dj}p0.prototype.isReactComponent={};p0.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};p0.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function pj(){}pj.prototype=p0.prototype;function y_(e,t,n){this.props=e,this.context=t,this.refs=hj,this.updater=n||dj}var b_=y_.prototype=new pj;b_.constructor=y_;fj(b_,p0.prototype);b_.isPureReactComponent=!0;var mL=Array.isArray,gj=Object.prototype.hasOwnProperty,S_={current:null},mj={key:!0,ref:!0,__self:!0,__source:!0};function vj(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)gj.call(t,r)&&!mj.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1t in e?wee(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var zee=w,Hee=Symbol.for("react.element"),Vee=Symbol.for("react.fragment"),Wee=Object.prototype.hasOwnProperty,Uee=zee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Gee={key:!0,ref:!0,__self:!0,__source:!0};function yj(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Wee.call(t,r)&&!Gee.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Hee,type:e,key:o,ref:a,props:i,_owner:Uee.current}}bS.Fragment=Vee;bS.jsx=yj;bS.jsxs=yj;(function(e){e.exports=bS})(_ee);var Gs=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:w.useEffect,w_=w.createContext({});w_.displayName="ColorModeContext";function gy(){const e=w.useContext(w_);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var z3={light:"chakra-ui-light",dark:"chakra-ui-dark"};function qee(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?z3.dark:z3.light),document.body.classList.remove(r?z3.light:z3.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){return n.query().matches??r==="dark"?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var Yee="chakra-ui-color-mode";function Kee(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var Xee=Kee(Yee),yL=()=>{};function bL(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function bj(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=Xee}=e,s=i==="dark"?"dark":"light",[l,u]=w.useState(()=>bL(a,s)),[d,h]=w.useState(()=>bL(a)),{getSystemTheme:m,setClassName:v,setDataset:b,addListener:S}=w.useMemo(()=>qee({preventTransition:o}),[o]),_=i==="system"&&!l?d:l,E=w.useCallback(A=>{const M=A==="system"?m():A;u(M),v(M==="dark"),b(M),a.set(M)},[a,m,v,b]);Gs(()=>{i==="system"&&h(m())},[]),w.useEffect(()=>{const A=a.get();if(A){E(A);return}if(i==="system"){E("system");return}E(s)},[a,s,i,E]);const k=w.useCallback(()=>{E(_==="dark"?"light":"dark")},[_,E]);w.useEffect(()=>{if(r)return S(E)},[r,S,E]);const T=w.useMemo(()=>({colorMode:t??_,toggleColorMode:t?yL:k,setColorMode:t?yL:E,forced:t!==void 0}),[_,k,E,t]);return N.createElement(w_.Provider,{value:T},n)}bj.displayName="ColorModeProvider";var U4={},Zee={get exports(){return U4},set exports(e){U4=e}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",m="[object Error]",v="[object Function]",b="[object GeneratorFunction]",S="[object Map]",_="[object Number]",E="[object Null]",k="[object Object]",T="[object Proxy]",A="[object RegExp]",M="[object Set]",R="[object String]",D="[object Undefined]",j="[object WeakMap]",z="[object ArrayBuffer]",H="[object DataView]",K="[object Float32Array]",te="[object Float64Array]",G="[object Int8Array]",$="[object Int16Array]",W="[object Int32Array]",X="[object Uint8Array]",Z="[object Uint8ClampedArray]",U="[object Uint16Array]",Q="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Ee=/^(?:0|[1-9]\d*)$/,be={};be[K]=be[te]=be[G]=be[$]=be[W]=be[X]=be[Z]=be[U]=be[Q]=!0,be[s]=be[l]=be[z]=be[d]=be[H]=be[h]=be[m]=be[v]=be[S]=be[_]=be[k]=be[A]=be[M]=be[R]=be[j]=!1;var ye=typeof _o=="object"&&_o&&_o.Object===Object&&_o,Fe=typeof self=="object"&&self&&self.Object===Object&&self,Me=ye||Fe||Function("return this")(),rt=t&&!t.nodeType&&t,Ve=rt&&!0&&e&&!e.nodeType&&e,je=Ve&&Ve.exports===rt,wt=je&&ye.process,Be=function(){try{var Y=Ve&&Ve.require&&Ve.require("util").types;return Y||wt&&wt.binding&&wt.binding("util")}catch{}}(),at=Be&&Be.isTypedArray;function bt(Y,ie,ge){switch(ge.length){case 0:return Y.call(ie);case 1:return Y.call(ie,ge[0]);case 2:return Y.call(ie,ge[0],ge[1]);case 3:return Y.call(ie,ge[0],ge[1],ge[2])}return Y.apply(ie,ge)}function Le(Y,ie){for(var ge=-1,st=Array(Y);++ge-1}function B0(Y,ie){var ge=this.__data__,st=ys(ge,Y);return st<0?(++this.size,ge.push([Y,ie])):ge[st][1]=ie,this}oa.prototype.clear=bf,oa.prototype.delete=j0,oa.prototype.get=xc,oa.prototype.has=Sf,oa.prototype.set=B0;function al(Y){var ie=-1,ge=Y==null?0:Y.length;for(this.clear();++ie1?ge[Wt-1]:void 0,kt=Wt>2?ge[2]:void 0;for(xn=Y.length>3&&typeof xn=="function"?(Wt--,xn):void 0,kt&&Ip(ge[0],ge[1],kt)&&(xn=Wt<3?void 0:xn,Wt=1),ie=Object(ie);++st-1&&Y%1==0&&Y0){if(++ie>=i)return arguments[0]}else ie=0;return Y.apply(void 0,arguments)}}function Ec(Y){if(Y!=null){try{return Ke.call(Y)}catch{}try{return Y+""}catch{}}return""}function Fa(Y,ie){return Y===ie||Y!==Y&&ie!==ie}var kf=xu(function(){return arguments}())?xu:function(Y){return Kn(Y)&&Xe.call(Y,"callee")&&!Ze.call(Y,"callee")},_u=Array.isArray;function Yt(Y){return Y!=null&&Dp(Y.length)&&!Tc(Y)}function Rp(Y){return Kn(Y)&&Yt(Y)}var Pc=rn||Z0;function Tc(Y){if(!ua(Y))return!1;var ie=ll(Y);return ie==v||ie==b||ie==u||ie==T}function Dp(Y){return typeof Y=="number"&&Y>-1&&Y%1==0&&Y<=a}function ua(Y){var ie=typeof Y;return Y!=null&&(ie=="object"||ie=="function")}function Kn(Y){return Y!=null&&typeof Y=="object"}function Ef(Y){if(!Kn(Y)||ll(Y)!=k)return!1;var ie=nn(Y);if(ie===null)return!0;var ge=Xe.call(ie,"constructor")&&ie.constructor;return typeof ge=="function"&&ge instanceof ge&&Ke.call(ge)==Ct}var Np=at?ut(at):Cc;function Pf(Y){return ui(Y,jp(Y))}function jp(Y){return Yt(Y)?Y0(Y,!0):ul(Y)}var gn=bs(function(Y,ie,ge,st){aa(Y,ie,ge,st)});function Kt(Y){return function(){return Y}}function Bp(Y){return Y}function Z0(){return!1}e.exports=gn})(Zee,U4);const Gl=U4;function qs(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Ch(e,...t){return Qee(e)?e(...t):e}var Qee=e=>typeof e=="function",Jee=e=>/!(important)?$/.test(e),SL=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,r7=(e,t)=>n=>{const r=String(t),i=Jee(r),o=SL(r),a=e?`${e}.${o}`:o;let s=qs(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=SL(s),i?`${s} !important`:s};function y2(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{const s=r7(t,o)(a);let l=(n==null?void 0:n(s,a))??s;return r&&(l=r(l,a)),l}}var H3=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Ms(e,t){return n=>{const r={property:n,scale:e};return r.transform=y2({scale:e,transform:t}),r}}var ete=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function tte(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:ete(t),transform:n?y2({scale:n,compose:r}):r}}var Sj=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function nte(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Sj].join(" ")}function rte(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Sj].join(" ")}var ite={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},ote={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function ate(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var ste={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},xj="& > :not(style) ~ :not(style)",lte={[xj]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},ute={[xj]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},i7={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},cte=new Set(Object.values(i7)),wj=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),dte=e=>e.trim();function fte(e,t){var n;if(e==null||wj.has(e))return e;const r=/(?^[a-z-A-Z]+)\((?(.*))\)/g,{type:i,values:o}=((n=r.exec(e))==null?void 0:n.groups)??{};if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(dte).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in i7?i7[s]:s;l.unshift(u);const d=l.map(h=>{if(cte.has(h))return h;const m=h.indexOf(" "),[v,b]=m!==-1?[h.substr(0,m),h.substr(m+1)]:[h],S=Cj(b)?b:b&&b.split(" "),_=`colors.${v}`,E=_ in t.__cssMap?t.__cssMap[_].varRef:v;return S?[E,...Array.isArray(S)?S:[S]].join(" "):E});return`${a}(${d.join(", ")})`}var Cj=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),hte=(e,t)=>fte(e,t??{});function pte(e){return/^var\(--.+\)$/.test(e)}var gte=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Al=e=>t=>`${e}(${t})`,hn={filter(e){return e!=="auto"?e:ite},backdropFilter(e){return e!=="auto"?e:ote},ring(e){return ate(hn.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?nte():e==="auto-gpu"?rte():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=gte(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(pte(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:hte,blur:Al("blur"),opacity:Al("opacity"),brightness:Al("brightness"),contrast:Al("contrast"),dropShadow:Al("drop-shadow"),grayscale:Al("grayscale"),hueRotate:Al("hue-rotate"),invert:Al("invert"),saturate:Al("saturate"),sepia:Al("sepia"),bgImage(e){return e==null||Cj(e)||wj.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=ste[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},se={borderWidths:Ms("borderWidths"),borderStyles:Ms("borderStyles"),colors:Ms("colors"),borders:Ms("borders"),radii:Ms("radii",hn.px),space:Ms("space",H3(hn.vh,hn.px)),spaceT:Ms("space",H3(hn.vh,hn.px)),degreeT(e){return{property:e,transform:hn.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:y2({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Ms("sizes",H3(hn.vh,hn.px)),sizesT:Ms("sizes",H3(hn.vh,hn.fraction)),shadows:Ms("shadows"),logical:tte,blur:Ms("blur",hn.blur)},a4={background:se.colors("background"),backgroundColor:se.colors("backgroundColor"),backgroundImage:se.propT("backgroundImage",hn.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:hn.bgClip},bgSize:se.prop("backgroundSize"),bgPosition:se.prop("backgroundPosition"),bg:se.colors("background"),bgColor:se.colors("backgroundColor"),bgPos:se.prop("backgroundPosition"),bgRepeat:se.prop("backgroundRepeat"),bgAttachment:se.prop("backgroundAttachment"),bgGradient:se.propT("backgroundImage",hn.gradient),bgClip:{transform:hn.bgClip}};Object.assign(a4,{bgImage:a4.backgroundImage,bgImg:a4.backgroundImage});var Cn={border:se.borders("border"),borderWidth:se.borderWidths("borderWidth"),borderStyle:se.borderStyles("borderStyle"),borderColor:se.colors("borderColor"),borderRadius:se.radii("borderRadius"),borderTop:se.borders("borderTop"),borderBlockStart:se.borders("borderBlockStart"),borderTopLeftRadius:se.radii("borderTopLeftRadius"),borderStartStartRadius:se.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:se.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:se.radii("borderTopRightRadius"),borderStartEndRadius:se.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:se.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:se.borders("borderRight"),borderInlineEnd:se.borders("borderInlineEnd"),borderBottom:se.borders("borderBottom"),borderBlockEnd:se.borders("borderBlockEnd"),borderBottomLeftRadius:se.radii("borderBottomLeftRadius"),borderBottomRightRadius:se.radii("borderBottomRightRadius"),borderLeft:se.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:se.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:se.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:se.borders(["borderLeft","borderRight"]),borderInline:se.borders("borderInline"),borderY:se.borders(["borderTop","borderBottom"]),borderBlock:se.borders("borderBlock"),borderTopWidth:se.borderWidths("borderTopWidth"),borderBlockStartWidth:se.borderWidths("borderBlockStartWidth"),borderTopColor:se.colors("borderTopColor"),borderBlockStartColor:se.colors("borderBlockStartColor"),borderTopStyle:se.borderStyles("borderTopStyle"),borderBlockStartStyle:se.borderStyles("borderBlockStartStyle"),borderBottomWidth:se.borderWidths("borderBottomWidth"),borderBlockEndWidth:se.borderWidths("borderBlockEndWidth"),borderBottomColor:se.colors("borderBottomColor"),borderBlockEndColor:se.colors("borderBlockEndColor"),borderBottomStyle:se.borderStyles("borderBottomStyle"),borderBlockEndStyle:se.borderStyles("borderBlockEndStyle"),borderLeftWidth:se.borderWidths("borderLeftWidth"),borderInlineStartWidth:se.borderWidths("borderInlineStartWidth"),borderLeftColor:se.colors("borderLeftColor"),borderInlineStartColor:se.colors("borderInlineStartColor"),borderLeftStyle:se.borderStyles("borderLeftStyle"),borderInlineStartStyle:se.borderStyles("borderInlineStartStyle"),borderRightWidth:se.borderWidths("borderRightWidth"),borderInlineEndWidth:se.borderWidths("borderInlineEndWidth"),borderRightColor:se.colors("borderRightColor"),borderInlineEndColor:se.colors("borderInlineEndColor"),borderRightStyle:se.borderStyles("borderRightStyle"),borderInlineEndStyle:se.borderStyles("borderInlineEndStyle"),borderTopRadius:se.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:se.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:se.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:se.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Cn,{rounded:Cn.borderRadius,roundedTop:Cn.borderTopRadius,roundedTopLeft:Cn.borderTopLeftRadius,roundedTopRight:Cn.borderTopRightRadius,roundedTopStart:Cn.borderStartStartRadius,roundedTopEnd:Cn.borderStartEndRadius,roundedBottom:Cn.borderBottomRadius,roundedBottomLeft:Cn.borderBottomLeftRadius,roundedBottomRight:Cn.borderBottomRightRadius,roundedBottomStart:Cn.borderEndStartRadius,roundedBottomEnd:Cn.borderEndEndRadius,roundedLeft:Cn.borderLeftRadius,roundedRight:Cn.borderRightRadius,roundedStart:Cn.borderInlineStartRadius,roundedEnd:Cn.borderInlineEndRadius,borderStart:Cn.borderInlineStart,borderEnd:Cn.borderInlineEnd,borderTopStartRadius:Cn.borderStartStartRadius,borderTopEndRadius:Cn.borderStartEndRadius,borderBottomStartRadius:Cn.borderEndStartRadius,borderBottomEndRadius:Cn.borderEndEndRadius,borderStartRadius:Cn.borderInlineStartRadius,borderEndRadius:Cn.borderInlineEndRadius,borderStartWidth:Cn.borderInlineStartWidth,borderEndWidth:Cn.borderInlineEndWidth,borderStartColor:Cn.borderInlineStartColor,borderEndColor:Cn.borderInlineEndColor,borderStartStyle:Cn.borderInlineStartStyle,borderEndStyle:Cn.borderInlineEndStyle});var mte={color:se.colors("color"),textColor:se.colors("color"),fill:se.colors("fill"),stroke:se.colors("stroke")},o7={boxShadow:se.shadows("boxShadow"),mixBlendMode:!0,blendMode:se.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:se.prop("backgroundBlendMode"),opacity:!0};Object.assign(o7,{shadow:o7.boxShadow});var vte={filter:{transform:hn.filter},blur:se.blur("--chakra-blur"),brightness:se.propT("--chakra-brightness",hn.brightness),contrast:se.propT("--chakra-contrast",hn.contrast),hueRotate:se.degreeT("--chakra-hue-rotate"),invert:se.propT("--chakra-invert",hn.invert),saturate:se.propT("--chakra-saturate",hn.saturate),dropShadow:se.propT("--chakra-drop-shadow",hn.dropShadow),backdropFilter:{transform:hn.backdropFilter},backdropBlur:se.blur("--chakra-backdrop-blur"),backdropBrightness:se.propT("--chakra-backdrop-brightness",hn.brightness),backdropContrast:se.propT("--chakra-backdrop-contrast",hn.contrast),backdropHueRotate:se.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:se.propT("--chakra-backdrop-invert",hn.invert),backdropSaturate:se.propT("--chakra-backdrop-saturate",hn.saturate)},G4={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:hn.flexDirection},experimental_spaceX:{static:lte,transform:y2({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:ute,transform:y2({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:se.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:se.space("gap"),rowGap:se.space("rowGap"),columnGap:se.space("columnGap")};Object.assign(G4,{flexDir:G4.flexDirection});var _j={gridGap:se.space("gridGap"),gridColumnGap:se.space("gridColumnGap"),gridRowGap:se.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},yte={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:hn.outline},outlineOffset:!0,outlineColor:se.colors("outlineColor")},Za={width:se.sizesT("width"),inlineSize:se.sizesT("inlineSize"),height:se.sizes("height"),blockSize:se.sizes("blockSize"),boxSize:se.sizes(["width","height"]),minWidth:se.sizes("minWidth"),minInlineSize:se.sizes("minInlineSize"),minHeight:se.sizes("minHeight"),minBlockSize:se.sizes("minBlockSize"),maxWidth:se.sizes("maxWidth"),maxInlineSize:se.sizes("maxInlineSize"),maxHeight:se.sizes("maxHeight"),maxBlockSize:se.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:se.propT("float",hn.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Za,{w:Za.width,h:Za.height,minW:Za.minWidth,maxW:Za.maxWidth,minH:Za.minHeight,maxH:Za.maxHeight,overscroll:Za.overscrollBehavior,overscrollX:Za.overscrollBehaviorX,overscrollY:Za.overscrollBehaviorY});var bte={listStyleType:!0,listStylePosition:!0,listStylePos:se.prop("listStylePosition"),listStyleImage:!0,listStyleImg:se.prop("listStyleImage")};function Ste(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},wte=xte(Ste),Cte={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},_te={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Xw=(e,t,n)=>{const r={},i=wte(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},kte={srOnly:{transform(e){return e===!0?Cte:e==="focusable"?_te:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Xw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Xw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Xw(t,e,n)}},Bv={position:!0,pos:se.prop("position"),zIndex:se.prop("zIndex","zIndices"),inset:se.spaceT("inset"),insetX:se.spaceT(["left","right"]),insetInline:se.spaceT("insetInline"),insetY:se.spaceT(["top","bottom"]),insetBlock:se.spaceT("insetBlock"),top:se.spaceT("top"),insetBlockStart:se.spaceT("insetBlockStart"),bottom:se.spaceT("bottom"),insetBlockEnd:se.spaceT("insetBlockEnd"),left:se.spaceT("left"),insetInlineStart:se.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:se.spaceT("right"),insetInlineEnd:se.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Bv,{insetStart:Bv.insetInlineStart,insetEnd:Bv.insetInlineEnd});var Ete={ring:{transform:hn.ring},ringColor:se.colors("--chakra-ring-color"),ringOffset:se.prop("--chakra-ring-offset-width"),ringOffsetColor:se.colors("--chakra-ring-offset-color"),ringInset:se.prop("--chakra-ring-inset")},sr={margin:se.spaceT("margin"),marginTop:se.spaceT("marginTop"),marginBlockStart:se.spaceT("marginBlockStart"),marginRight:se.spaceT("marginRight"),marginInlineEnd:se.spaceT("marginInlineEnd"),marginBottom:se.spaceT("marginBottom"),marginBlockEnd:se.spaceT("marginBlockEnd"),marginLeft:se.spaceT("marginLeft"),marginInlineStart:se.spaceT("marginInlineStart"),marginX:se.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:se.spaceT("marginInline"),marginY:se.spaceT(["marginTop","marginBottom"]),marginBlock:se.spaceT("marginBlock"),padding:se.space("padding"),paddingTop:se.space("paddingTop"),paddingBlockStart:se.space("paddingBlockStart"),paddingRight:se.space("paddingRight"),paddingBottom:se.space("paddingBottom"),paddingBlockEnd:se.space("paddingBlockEnd"),paddingLeft:se.space("paddingLeft"),paddingInlineStart:se.space("paddingInlineStart"),paddingInlineEnd:se.space("paddingInlineEnd"),paddingX:se.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:se.space("paddingInline"),paddingY:se.space(["paddingTop","paddingBottom"]),paddingBlock:se.space("paddingBlock")};Object.assign(sr,{m:sr.margin,mt:sr.marginTop,mr:sr.marginRight,me:sr.marginInlineEnd,marginEnd:sr.marginInlineEnd,mb:sr.marginBottom,ml:sr.marginLeft,ms:sr.marginInlineStart,marginStart:sr.marginInlineStart,mx:sr.marginX,my:sr.marginY,p:sr.padding,pt:sr.paddingTop,py:sr.paddingY,px:sr.paddingX,pb:sr.paddingBottom,pl:sr.paddingLeft,ps:sr.paddingInlineStart,paddingStart:sr.paddingInlineStart,pr:sr.paddingRight,pe:sr.paddingInlineEnd,paddingEnd:sr.paddingInlineEnd});var Pte={textDecorationColor:se.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:se.shadows("textShadow")},Tte={clipPath:!0,transform:se.propT("transform",hn.transform),transformOrigin:!0,translateX:se.spaceT("--chakra-translate-x"),translateY:se.spaceT("--chakra-translate-y"),skewX:se.degreeT("--chakra-skew-x"),skewY:se.degreeT("--chakra-skew-y"),scaleX:se.prop("--chakra-scale-x"),scaleY:se.prop("--chakra-scale-y"),scale:se.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:se.degreeT("--chakra-rotate")},Lte={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:se.prop("transitionDuration","transition.duration"),transitionProperty:se.prop("transitionProperty","transition.property"),transitionTimingFunction:se.prop("transitionTimingFunction","transition.easing")},Ate={fontFamily:se.prop("fontFamily","fonts"),fontSize:se.prop("fontSize","fontSizes",hn.px),fontWeight:se.prop("fontWeight","fontWeights"),lineHeight:se.prop("lineHeight","lineHeights"),letterSpacing:se.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},Ote={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:se.spaceT("scrollMargin"),scrollMarginTop:se.spaceT("scrollMarginTop"),scrollMarginBottom:se.spaceT("scrollMarginBottom"),scrollMarginLeft:se.spaceT("scrollMarginLeft"),scrollMarginRight:se.spaceT("scrollMarginRight"),scrollMarginX:se.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:se.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:se.spaceT("scrollPadding"),scrollPaddingTop:se.spaceT("scrollPaddingTop"),scrollPaddingBottom:se.spaceT("scrollPaddingBottom"),scrollPaddingLeft:se.spaceT("scrollPaddingLeft"),scrollPaddingRight:se.spaceT("scrollPaddingRight"),scrollPaddingX:se.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:se.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function kj(e){return qs(e)&&e.reference?e.reference:String(e)}var SS=(e,...t)=>t.map(kj).join(` ${e} `).replace(/calc/g,""),xL=(...e)=>`calc(${SS("+",...e)})`,wL=(...e)=>`calc(${SS("-",...e)})`,a7=(...e)=>`calc(${SS("*",...e)})`,CL=(...e)=>`calc(${SS("/",...e)})`,_L=e=>{const t=kj(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:a7(t,-1)},Sh=Object.assign(e=>({add:(...t)=>Sh(xL(e,...t)),subtract:(...t)=>Sh(wL(e,...t)),multiply:(...t)=>Sh(a7(e,...t)),divide:(...t)=>Sh(CL(e,...t)),negate:()=>Sh(_L(e)),toString:()=>e.toString()}),{add:xL,subtract:wL,multiply:a7,divide:CL,negate:_L});function Mte(e,t="-"){return e.replace(/\s+/g,t)}function Ite(e){const t=Mte(e.toString());return Dte(Rte(t))}function Rte(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function Dte(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function Nte(e,t=""){return[t,e].filter(Boolean).join("-")}function jte(e,t){return`var(${e}${t?`, ${t}`:""})`}function Bte(e,t=""){return Ite(`--${Nte(e,t)}`)}function Vn(e,t,n){const r=Bte(e,n);return{variable:r,reference:jte(r,t)}}function $te(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function Fte(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function s7(e){if(e==null)return e;const{unitless:t}=Fte(e);return t||typeof e=="number"?`${e}px`:e}var Ej=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,C_=e=>Object.fromEntries(Object.entries(e).sort(Ej));function kL(e){const t=C_(e);return Object.assign(Object.values(t),t)}function zte(e){const t=Object.keys(C_(e));return new Set(t)}function EL(e){if(!e)return e;e=s7(e)??e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function yv(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${s7(e)})`),t&&n.push("and",`(max-width: ${s7(t)})`),n.join(" ")}function Hte(e){if(!e)return null;e.base=e.base??"0px";const t=kL(e),n=Object.entries(e).sort(Ej).map(([o,a],s,l)=>{let[,u]=l[s+1]??[];return u=parseFloat(u)>0?EL(u):void 0,{_minW:EL(a),breakpoint:o,minW:a,maxW:u,maxWQuery:yv(null,u),minWQuery:yv(a),minMaxQuery:yv(a,u)}}),r=zte(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(o){const a=Object.keys(o);return a.length>0&&a.every(s=>r.has(s))},asObject:C_(e),asArray:kL(e),details:n,media:[null,...t.map(o=>yv(o)).slice(1)],toArrayValue(o){if(!qs(o))throw new Error("toArrayValue: value must be an object");const a=i.map(s=>o[s]??null);for(;$te(a)===null;)a.pop();return a},toObjectValue(o){if(!Array.isArray(o))throw new Error("toObjectValue: value must be an array");return o.reduce((a,s,l)=>{const u=i[l];return u!=null&&s!=null&&(a[u]=s),a},{})}}}var zi={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},ad=e=>Pj(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Bu=e=>Pj(t=>e(t,"~ &"),"[data-peer]",".peer"),Pj=(e,...t)=>t.map(e).join(", "),xS={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:ad(zi.hover),_peerHover:Bu(zi.hover),_groupFocus:ad(zi.focus),_peerFocus:Bu(zi.focus),_groupFocusVisible:ad(zi.focusVisible),_peerFocusVisible:Bu(zi.focusVisible),_groupActive:ad(zi.active),_peerActive:Bu(zi.active),_groupDisabled:ad(zi.disabled),_peerDisabled:Bu(zi.disabled),_groupInvalid:ad(zi.invalid),_peerInvalid:Bu(zi.invalid),_groupChecked:ad(zi.checked),_peerChecked:Bu(zi.checked),_groupFocusWithin:ad(zi.focusWithin),_peerFocusWithin:Bu(zi.focusWithin),_peerPlaceholderShown:Bu(zi.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},Vte=Object.keys(xS);function PL(e,t){return Vn(String(e).replace(/\./g,"-"),void 0,t)}function Wte(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=PL(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[v,...b]=m,S=`${v}.-${b.join(".")}`,_=Sh.negate(s),E=Sh.negate(u);r[S]={value:_,var:l,varRef:E}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const d=m=>{const b=[String(i).split(".")[0],m].join(".");if(!e[b])return m;const{reference:_}=PL(b,t==null?void 0:t.cssVarPrefix);return _},h=qs(s)?s:{default:s};n=Gl(n,Object.entries(h).reduce((m,[v,b])=>{var S;const _=d(b);if(v==="default")return m[l]=_,m;const E=((S=xS)==null?void 0:S[v])??v;return m[E]={[l]:_},m},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function Ute(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Gte(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var qte=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function Yte(e){return Gte(e,qte)}function Kte(e){return e.semanticTokens}function Xte(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function Zte({tokens:e,semanticTokens:t}){const n=Object.entries(l7(e)??{}).map(([i,o])=>[i,{isSemantic:!1,value:o}]),r=Object.entries(l7(t,1)??{}).map(([i,o])=>[i,{isSemantic:!0,value:o}]);return Object.fromEntries([...n,...r])}function l7(e,t=1/0){return!qs(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(qs(i)||Array.isArray(i)?Object.entries(l7(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function Qte(e){var t;const n=Xte(e),r=Yte(n),i=Kte(n),o=Zte({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=Wte(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:Hte(n.breakpoints)}),n}var __=Gl({},a4,Cn,mte,G4,Za,vte,Ete,yte,_j,kte,Bv,o7,sr,Ote,Ate,Pte,Tte,bte,Lte),Jte=Object.assign({},sr,Za,G4,_j,Bv),Tj=Object.keys(Jte),ene=[...Object.keys(__),...Vte],tne={...__,...xS},nne=e=>e in tne,rne=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=Ch(e[a],t);if(s==null)continue;if(s=qs(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!one(t),sne=(e,t)=>{if(t==null)return t;const n=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.varRef},r=a=>n(a)??a,[i,o]=ine(t);return t=n(i)??r(o)??r(t),t};function lne(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s;const l=Ch(o,r),u=rne(l)(r);let d={};for(let h in u){const m=u[h];let v=Ch(m,r);h in n&&(h=n[h]),ane(h,v)&&(v=sne(r,v));let b=t[h];if(b===!0&&(b={property:h}),qs(v)){d[h]=d[h]??{},d[h]=Gl({},d[h],i(v,!0));continue}let S=((s=b==null?void 0:b.transform)==null?void 0:s.call(b,v,r,l))??v;S=b!=null&&b.processResult?i(S,!0):S;const _=Ch(b==null?void 0:b.property,r);if(!a&&(b!=null&&b.static)){const E=Ch(b.static,r);d=Gl({},d,E)}if(_&&Array.isArray(_)){for(const E of _)d[E]=S;continue}if(_){_==="&"&&qs(S)?d=Gl({},d,S):d[_]=S;continue}if(qs(S)){d=Gl({},d,S);continue}d[h]=S}return d};return i}var Lj=e=>t=>lne({theme:t,pseudos:xS,configs:__})(e);function hr(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function une(e,t){if(Array.isArray(e))return e;if(qs(e))return t(e);if(e!=null)return[e]}function cne(e,t){for(let n=t+1;n{Gl(u,{[T]:m?k[T]:{[E]:k[T]}})});continue}if(!v){m?Gl(u,k):u[E]=k;continue}u[E]=k}}return u}}function fne(e){return t=>{const{variant:n,size:r,theme:i}=t,o=dne(i);return Gl({},Ch(e.baseStyle??{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function hne(e,t,n){var r,i;return((i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)??n}function Sn(e){return Ute(e,["styleConfig","size","variant","colorScheme"])}function pne(e){if(e.sheet)return e.sheet;for(var t=0;t0?Ui(g0,--ra):0,Wm--,ii===10&&(Wm=1,CS--),ii}function Ta(){return ii=ra2||S2(ii)>3?"":" "}function Ene(e,t){for(;--t&&Ta()&&!(ii<48||ii>102||ii>57&&ii<65||ii>70&&ii<97););return my(e,s4()+(t<6&&Xl()==32&&Ta()==32))}function c7(e){for(;Ta();)switch(ii){case e:return ra;case 34:case 39:e!==34&&e!==39&&c7(ii);break;case 40:e===41&&c7(e);break;case 92:Ta();break}return ra}function Pne(e,t){for(;Ta()&&e+ii!==47+10;)if(e+ii===42+42&&Xl()===47)break;return"/*"+my(t,ra-1)+"*"+wS(e===47?e:Ta())}function Tne(e){for(;!S2(Xl());)Ta();return my(e,ra)}function Lne(e){return Dj(u4("",null,null,null,[""],e=Rj(e),0,[0],e))}function u4(e,t,n,r,i,o,a,s,l){for(var u=0,d=0,h=a,m=0,v=0,b=0,S=1,_=1,E=1,k=0,T="",A=i,M=o,R=r,D=T;_;)switch(b=k,k=Ta()){case 40:if(b!=108&&Ui(D,h-1)==58){u7(D+=On(l4(k),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:D+=l4(k);break;case 9:case 10:case 13:case 32:D+=kne(b);break;case 92:D+=Ene(s4()-1,7);continue;case 47:switch(Xl()){case 42:case 47:V3(Ane(Pne(Ta(),s4()),t,n),l);break;default:D+="/"}break;case 123*S:s[u++]=Fl(D)*E;case 125*S:case 59:case 0:switch(k){case 0:case 125:_=0;case 59+d:v>0&&Fl(D)-h&&V3(v>32?LL(D+";",r,n,h-1):LL(On(D," ","")+";",r,n,h-2),l);break;case 59:D+=";";default:if(V3(R=TL(D,t,n,u,d,i,s,T,A=[],M=[],h),o),k===123)if(d===0)u4(D,t,R,R,A,o,h,s,M);else switch(m===99&&Ui(D,3)===110?100:m){case 100:case 109:case 115:u4(e,R,R,r&&V3(TL(e,R,R,0,0,i,s,T,i,A=[],h),M),i,M,h,s,r?A:M);break;default:u4(D,R,R,R,[""],M,0,s,M)}}u=d=v=0,S=E=1,T=D="",h=a;break;case 58:h=1+Fl(D),v=b;default:if(S<1){if(k==123)--S;else if(k==125&&S++==0&&_ne()==125)continue}switch(D+=wS(k),k*S){case 38:E=d>0?1:(D+="\f",-1);break;case 44:s[u++]=(Fl(D)-1)*E,E=1;break;case 64:Xl()===45&&(D+=l4(Ta())),m=Xl(),d=h=Fl(T=D+=Tne(s4())),k++;break;case 45:b===45&&Fl(D)==2&&(S=0)}}return o}function TL(e,t,n,r,i,o,a,s,l,u,d){for(var h=i-1,m=i===0?o:[""],v=P_(m),b=0,S=0,_=0;b0?m[E]+" "+k:On(k,/&\f/g,m[E])))&&(l[_++]=T);return _S(e,t,n,i===0?k_:s,l,u,d)}function Ane(e,t,n){return _S(e,t,n,Aj,wS(Cne()),b2(e,2,-2),0)}function LL(e,t,n,r){return _S(e,t,n,E_,b2(e,0,r),b2(e,r+1,-1),r)}function mm(e,t){for(var n="",r=P_(e),i=0;i6)switch(Ui(e,t+1)){case 109:if(Ui(e,t+4)!==45)break;case 102:return On(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+q4+(Ui(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~u7(e,"stretch")?jj(On(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ui(e,t+1)!==115)break;case 6444:switch(Ui(e,Fl(e)-3-(~u7(e,"!important")&&10))){case 107:return On(e,":",":"+_n)+e;case 101:return On(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Ui(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+eo+"$2box$3")+e}break;case 5936:switch(Ui(e,t+11)){case 114:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+eo+e+e}return e}var $ne=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case E_:t.return=jj(t.value,t.length);break;case Oj:return mm([H1(t,{value:On(t.value,"@","@"+_n)})],i);case k_:if(t.length)return wne(t.props,function(o){switch(xne(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return mm([H1(t,{props:[On(o,/:(read-\w+)/,":"+q4+"$1")]})],i);case"::placeholder":return mm([H1(t,{props:[On(o,/:(plac\w+)/,":"+_n+"input-$1")]}),H1(t,{props:[On(o,/:(plac\w+)/,":"+q4+"$1")]}),H1(t,{props:[On(o,/:(plac\w+)/,eo+"input-$1")]})],i)}return""})}},Fne=[$ne],Bj=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(S){var _=S.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(S),S.setAttribute("data-s",""))})}var i=t.stylisPlugins||Fne,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(S){for(var _=S.getAttribute("data-emotion").split(" "),E=1;E<_.length;E++)o[_[E]]=!0;s.push(S)});var l,u=[jne,Bne];{var d,h=[One,Ine(function(S){d.insert(S)})],m=Mne(u.concat(i,h)),v=function(_){return mm(Lne(_),m)};l=function(_,E,k,T){d=k,v(_?_+"{"+E.styles+"}":E.styles),T&&(b.inserted[E.name]=!0)}}var b={key:n,sheet:new mne({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return b.sheet.hydrate(s),b};function bn(){return bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?z3.dark:z3.light),document.body.classList.remove(r?z3.light:z3.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){return n.query().matches??r==="dark"?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var Yee="chakra-ui-color-mode";function Kee(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var Xee=Kee(Yee),bL=()=>{};function SL(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function Sj(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=Xee}=e,s=i==="dark"?"dark":"light",[l,u]=w.useState(()=>SL(a,s)),[d,h]=w.useState(()=>SL(a)),{getSystemTheme:m,setClassName:y,setDataset:b,addListener:x}=w.useMemo(()=>qee({preventTransition:o}),[o]),k=i==="system"&&!l?d:l,E=w.useCallback(A=>{const M=A==="system"?m():A;u(M),y(M==="dark"),b(M),a.set(M)},[a,m,y,b]);Gs(()=>{i==="system"&&h(m())},[]),w.useEffect(()=>{const A=a.get();if(A){E(A);return}if(i==="system"){E("system");return}E(s)},[a,s,i,E]);const _=w.useCallback(()=>{E(k==="dark"?"light":"dark")},[k,E]);w.useEffect(()=>{if(r)return x(E)},[r,x,E]);const P=w.useMemo(()=>({colorMode:t??k,toggleColorMode:t?bL:_,setColorMode:t?bL:E,forced:t!==void 0}),[k,_,E,t]);return N.createElement(w_.Provider,{value:P},n)}Sj.displayName="ColorModeProvider";var U4={},Zee={get exports(){return U4},set exports(e){U4=e}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",m="[object Error]",y="[object Function]",b="[object GeneratorFunction]",x="[object Map]",k="[object Number]",E="[object Null]",_="[object Object]",P="[object Proxy]",A="[object RegExp]",M="[object Set]",R="[object String]",D="[object Undefined]",j="[object WeakMap]",z="[object ArrayBuffer]",H="[object DataView]",K="[object Float32Array]",te="[object Float64Array]",G="[object Int8Array]",F="[object Int16Array]",W="[object Int32Array]",X="[object Uint8Array]",Z="[object Uint8ClampedArray]",U="[object Uint16Array]",Q="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Ee=/^(?:0|[1-9]\d*)$/,be={};be[K]=be[te]=be[G]=be[F]=be[W]=be[X]=be[Z]=be[U]=be[Q]=!0,be[s]=be[l]=be[z]=be[d]=be[H]=be[h]=be[m]=be[y]=be[x]=be[k]=be[_]=be[A]=be[M]=be[R]=be[j]=!1;var ye=typeof _o=="object"&&_o&&_o.Object===Object&&_o,ze=typeof self=="object"&&self&&self.Object===Object&&self,Me=ye||ze||Function("return this")(),rt=t&&!t.nodeType&&t,We=rt&&!0&&e&&!e.nodeType&&e,Be=We&&We.exports===rt,wt=Be&&ye.process,Fe=function(){try{var Y=We&&We.require&&We.require("util").types;return Y||wt&&wt.binding&&wt.binding("util")}catch{}}(),at=Fe&&Fe.isTypedArray;function bt(Y,ie,ge){switch(ge.length){case 0:return Y.call(ie);case 1:return Y.call(ie,ge[0]);case 2:return Y.call(ie,ge[0],ge[1]);case 3:return Y.call(ie,ge[0],ge[1],ge[2])}return Y.apply(ie,ge)}function Le(Y,ie){for(var ge=-1,st=Array(Y);++ge-1}function F0(Y,ie){var ge=this.__data__,st=ys(ge,Y);return st<0?(++this.size,ge.push([Y,ie])):ge[st][1]=ie,this}oa.prototype.clear=Sf,oa.prototype.delete=B0,oa.prototype.get=xc,oa.prototype.has=xf,oa.prototype.set=F0;function al(Y){var ie=-1,ge=Y==null?0:Y.length;for(this.clear();++ie1?ge[Wt-1]:void 0,kt=Wt>2?ge[2]:void 0;for(xn=Y.length>3&&typeof xn=="function"?(Wt--,xn):void 0,kt&&Rp(ge[0],ge[1],kt)&&(xn=Wt<3?void 0:xn,Wt=1),ie=Object(ie);++st-1&&Y%1==0&&Y0){if(++ie>=i)return arguments[0]}else ie=0;return Y.apply(void 0,arguments)}}function Ec(Y){if(Y!=null){try{return Ke.call(Y)}catch{}try{return Y+""}catch{}}return""}function $a(Y,ie){return Y===ie||Y!==Y&&ie!==ie}var Ef=xu(function(){return arguments}())?xu:function(Y){return Kn(Y)&&Xe.call(Y,"callee")&&!Ze.call(Y,"callee")},_u=Array.isArray;function Kt(Y){return Y!=null&&Np(Y.length)&&!Tc(Y)}function Dp(Y){return Kn(Y)&&Kt(Y)}var Pc=rn||Q0;function Tc(Y){if(!ua(Y))return!1;var ie=ll(Y);return ie==y||ie==b||ie==u||ie==P}function Np(Y){return typeof Y=="number"&&Y>-1&&Y%1==0&&Y<=a}function ua(Y){var ie=typeof Y;return Y!=null&&(ie=="object"||ie=="function")}function Kn(Y){return Y!=null&&typeof Y=="object"}function Pf(Y){if(!Kn(Y)||ll(Y)!=_)return!1;var ie=nn(Y);if(ie===null)return!0;var ge=Xe.call(ie,"constructor")&&ie.constructor;return typeof ge=="function"&&ge instanceof ge&&Ke.call(ge)==Ct}var jp=at?ut(at):Cc;function Tf(Y){return ui(Y,Bp(Y))}function Bp(Y){return Kt(Y)?K0(Y,!0):ul(Y)}var gn=bs(function(Y,ie,ge,st){aa(Y,ie,ge,st)});function Xt(Y){return function(){return Y}}function Fp(Y){return Y}function Q0(){return!1}e.exports=gn})(Zee,U4);const Gl=U4;function qs(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function _h(e,...t){return Qee(e)?e(...t):e}var Qee=e=>typeof e=="function",Jee=e=>/!(important)?$/.test(e),xL=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,r7=(e,t)=>n=>{const r=String(t),i=Jee(r),o=xL(r),a=e?`${e}.${o}`:o;let s=qs(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=xL(s),i?`${s} !important`:s};function y2(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{const s=r7(t,o)(a);let l=(n==null?void 0:n(s,a))??s;return r&&(l=r(l,a)),l}}var H3=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Ms(e,t){return n=>{const r={property:n,scale:e};return r.transform=y2({scale:e,transform:t}),r}}var ete=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function tte(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:ete(t),transform:n?y2({scale:n,compose:r}):r}}var xj=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function nte(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...xj].join(" ")}function rte(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...xj].join(" ")}var ite={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},ote={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function ate(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var ste={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},wj="& > :not(style) ~ :not(style)",lte={[wj]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},ute={[wj]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},i7={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},cte=new Set(Object.values(i7)),Cj=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),dte=e=>e.trim();function fte(e,t){var n;if(e==null||Cj.has(e))return e;const r=/(?^[a-z-A-Z]+)\((?(.*))\)/g,{type:i,values:o}=((n=r.exec(e))==null?void 0:n.groups)??{};if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(dte).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in i7?i7[s]:s;l.unshift(u);const d=l.map(h=>{if(cte.has(h))return h;const m=h.indexOf(" "),[y,b]=m!==-1?[h.substr(0,m),h.substr(m+1)]:[h],x=_j(b)?b:b&&b.split(" "),k=`colors.${y}`,E=k in t.__cssMap?t.__cssMap[k].varRef:y;return x?[E,...Array.isArray(x)?x:[x]].join(" "):E});return`${a}(${d.join(", ")})`}var _j=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),hte=(e,t)=>fte(e,t??{});function pte(e){return/^var\(--.+\)$/.test(e)}var gte=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Al=e=>t=>`${e}(${t})`,hn={filter(e){return e!=="auto"?e:ite},backdropFilter(e){return e!=="auto"?e:ote},ring(e){return ate(hn.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?nte():e==="auto-gpu"?rte():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=gte(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(pte(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:hte,blur:Al("blur"),opacity:Al("opacity"),brightness:Al("brightness"),contrast:Al("contrast"),dropShadow:Al("drop-shadow"),grayscale:Al("grayscale"),hueRotate:Al("hue-rotate"),invert:Al("invert"),saturate:Al("saturate"),sepia:Al("sepia"),bgImage(e){return e==null||_j(e)||Cj.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=ste[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},se={borderWidths:Ms("borderWidths"),borderStyles:Ms("borderStyles"),colors:Ms("colors"),borders:Ms("borders"),radii:Ms("radii",hn.px),space:Ms("space",H3(hn.vh,hn.px)),spaceT:Ms("space",H3(hn.vh,hn.px)),degreeT(e){return{property:e,transform:hn.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:y2({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Ms("sizes",H3(hn.vh,hn.px)),sizesT:Ms("sizes",H3(hn.vh,hn.fraction)),shadows:Ms("shadows"),logical:tte,blur:Ms("blur",hn.blur)},a4={background:se.colors("background"),backgroundColor:se.colors("backgroundColor"),backgroundImage:se.propT("backgroundImage",hn.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:hn.bgClip},bgSize:se.prop("backgroundSize"),bgPosition:se.prop("backgroundPosition"),bg:se.colors("background"),bgColor:se.colors("backgroundColor"),bgPos:se.prop("backgroundPosition"),bgRepeat:se.prop("backgroundRepeat"),bgAttachment:se.prop("backgroundAttachment"),bgGradient:se.propT("backgroundImage",hn.gradient),bgClip:{transform:hn.bgClip}};Object.assign(a4,{bgImage:a4.backgroundImage,bgImg:a4.backgroundImage});var Cn={border:se.borders("border"),borderWidth:se.borderWidths("borderWidth"),borderStyle:se.borderStyles("borderStyle"),borderColor:se.colors("borderColor"),borderRadius:se.radii("borderRadius"),borderTop:se.borders("borderTop"),borderBlockStart:se.borders("borderBlockStart"),borderTopLeftRadius:se.radii("borderTopLeftRadius"),borderStartStartRadius:se.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:se.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:se.radii("borderTopRightRadius"),borderStartEndRadius:se.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:se.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:se.borders("borderRight"),borderInlineEnd:se.borders("borderInlineEnd"),borderBottom:se.borders("borderBottom"),borderBlockEnd:se.borders("borderBlockEnd"),borderBottomLeftRadius:se.radii("borderBottomLeftRadius"),borderBottomRightRadius:se.radii("borderBottomRightRadius"),borderLeft:se.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:se.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:se.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:se.borders(["borderLeft","borderRight"]),borderInline:se.borders("borderInline"),borderY:se.borders(["borderTop","borderBottom"]),borderBlock:se.borders("borderBlock"),borderTopWidth:se.borderWidths("borderTopWidth"),borderBlockStartWidth:se.borderWidths("borderBlockStartWidth"),borderTopColor:se.colors("borderTopColor"),borderBlockStartColor:se.colors("borderBlockStartColor"),borderTopStyle:se.borderStyles("borderTopStyle"),borderBlockStartStyle:se.borderStyles("borderBlockStartStyle"),borderBottomWidth:se.borderWidths("borderBottomWidth"),borderBlockEndWidth:se.borderWidths("borderBlockEndWidth"),borderBottomColor:se.colors("borderBottomColor"),borderBlockEndColor:se.colors("borderBlockEndColor"),borderBottomStyle:se.borderStyles("borderBottomStyle"),borderBlockEndStyle:se.borderStyles("borderBlockEndStyle"),borderLeftWidth:se.borderWidths("borderLeftWidth"),borderInlineStartWidth:se.borderWidths("borderInlineStartWidth"),borderLeftColor:se.colors("borderLeftColor"),borderInlineStartColor:se.colors("borderInlineStartColor"),borderLeftStyle:se.borderStyles("borderLeftStyle"),borderInlineStartStyle:se.borderStyles("borderInlineStartStyle"),borderRightWidth:se.borderWidths("borderRightWidth"),borderInlineEndWidth:se.borderWidths("borderInlineEndWidth"),borderRightColor:se.colors("borderRightColor"),borderInlineEndColor:se.colors("borderInlineEndColor"),borderRightStyle:se.borderStyles("borderRightStyle"),borderInlineEndStyle:se.borderStyles("borderInlineEndStyle"),borderTopRadius:se.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:se.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:se.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:se.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Cn,{rounded:Cn.borderRadius,roundedTop:Cn.borderTopRadius,roundedTopLeft:Cn.borderTopLeftRadius,roundedTopRight:Cn.borderTopRightRadius,roundedTopStart:Cn.borderStartStartRadius,roundedTopEnd:Cn.borderStartEndRadius,roundedBottom:Cn.borderBottomRadius,roundedBottomLeft:Cn.borderBottomLeftRadius,roundedBottomRight:Cn.borderBottomRightRadius,roundedBottomStart:Cn.borderEndStartRadius,roundedBottomEnd:Cn.borderEndEndRadius,roundedLeft:Cn.borderLeftRadius,roundedRight:Cn.borderRightRadius,roundedStart:Cn.borderInlineStartRadius,roundedEnd:Cn.borderInlineEndRadius,borderStart:Cn.borderInlineStart,borderEnd:Cn.borderInlineEnd,borderTopStartRadius:Cn.borderStartStartRadius,borderTopEndRadius:Cn.borderStartEndRadius,borderBottomStartRadius:Cn.borderEndStartRadius,borderBottomEndRadius:Cn.borderEndEndRadius,borderStartRadius:Cn.borderInlineStartRadius,borderEndRadius:Cn.borderInlineEndRadius,borderStartWidth:Cn.borderInlineStartWidth,borderEndWidth:Cn.borderInlineEndWidth,borderStartColor:Cn.borderInlineStartColor,borderEndColor:Cn.borderInlineEndColor,borderStartStyle:Cn.borderInlineStartStyle,borderEndStyle:Cn.borderInlineEndStyle});var mte={color:se.colors("color"),textColor:se.colors("color"),fill:se.colors("fill"),stroke:se.colors("stroke")},o7={boxShadow:se.shadows("boxShadow"),mixBlendMode:!0,blendMode:se.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:se.prop("backgroundBlendMode"),opacity:!0};Object.assign(o7,{shadow:o7.boxShadow});var vte={filter:{transform:hn.filter},blur:se.blur("--chakra-blur"),brightness:se.propT("--chakra-brightness",hn.brightness),contrast:se.propT("--chakra-contrast",hn.contrast),hueRotate:se.degreeT("--chakra-hue-rotate"),invert:se.propT("--chakra-invert",hn.invert),saturate:se.propT("--chakra-saturate",hn.saturate),dropShadow:se.propT("--chakra-drop-shadow",hn.dropShadow),backdropFilter:{transform:hn.backdropFilter},backdropBlur:se.blur("--chakra-backdrop-blur"),backdropBrightness:se.propT("--chakra-backdrop-brightness",hn.brightness),backdropContrast:se.propT("--chakra-backdrop-contrast",hn.contrast),backdropHueRotate:se.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:se.propT("--chakra-backdrop-invert",hn.invert),backdropSaturate:se.propT("--chakra-backdrop-saturate",hn.saturate)},G4={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:hn.flexDirection},experimental_spaceX:{static:lte,transform:y2({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:ute,transform:y2({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:se.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:se.space("gap"),rowGap:se.space("rowGap"),columnGap:se.space("columnGap")};Object.assign(G4,{flexDir:G4.flexDirection});var kj={gridGap:se.space("gridGap"),gridColumnGap:se.space("gridColumnGap"),gridRowGap:se.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},yte={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:hn.outline},outlineOffset:!0,outlineColor:se.colors("outlineColor")},Za={width:se.sizesT("width"),inlineSize:se.sizesT("inlineSize"),height:se.sizes("height"),blockSize:se.sizes("blockSize"),boxSize:se.sizes(["width","height"]),minWidth:se.sizes("minWidth"),minInlineSize:se.sizes("minInlineSize"),minHeight:se.sizes("minHeight"),minBlockSize:se.sizes("minBlockSize"),maxWidth:se.sizes("maxWidth"),maxInlineSize:se.sizes("maxInlineSize"),maxHeight:se.sizes("maxHeight"),maxBlockSize:se.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:se.propT("float",hn.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Za,{w:Za.width,h:Za.height,minW:Za.minWidth,maxW:Za.maxWidth,minH:Za.minHeight,maxH:Za.maxHeight,overscroll:Za.overscrollBehavior,overscrollX:Za.overscrollBehaviorX,overscrollY:Za.overscrollBehaviorY});var bte={listStyleType:!0,listStylePosition:!0,listStylePos:se.prop("listStylePosition"),listStyleImage:!0,listStyleImg:se.prop("listStyleImage")};function Ste(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},wte=xte(Ste),Cte={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},_te={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Xw=(e,t,n)=>{const r={},i=wte(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},kte={srOnly:{transform(e){return e===!0?Cte:e==="focusable"?_te:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Xw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Xw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Xw(t,e,n)}},Bv={position:!0,pos:se.prop("position"),zIndex:se.prop("zIndex","zIndices"),inset:se.spaceT("inset"),insetX:se.spaceT(["left","right"]),insetInline:se.spaceT("insetInline"),insetY:se.spaceT(["top","bottom"]),insetBlock:se.spaceT("insetBlock"),top:se.spaceT("top"),insetBlockStart:se.spaceT("insetBlockStart"),bottom:se.spaceT("bottom"),insetBlockEnd:se.spaceT("insetBlockEnd"),left:se.spaceT("left"),insetInlineStart:se.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:se.spaceT("right"),insetInlineEnd:se.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Bv,{insetStart:Bv.insetInlineStart,insetEnd:Bv.insetInlineEnd});var Ete={ring:{transform:hn.ring},ringColor:se.colors("--chakra-ring-color"),ringOffset:se.prop("--chakra-ring-offset-width"),ringOffsetColor:se.colors("--chakra-ring-offset-color"),ringInset:se.prop("--chakra-ring-inset")},sr={margin:se.spaceT("margin"),marginTop:se.spaceT("marginTop"),marginBlockStart:se.spaceT("marginBlockStart"),marginRight:se.spaceT("marginRight"),marginInlineEnd:se.spaceT("marginInlineEnd"),marginBottom:se.spaceT("marginBottom"),marginBlockEnd:se.spaceT("marginBlockEnd"),marginLeft:se.spaceT("marginLeft"),marginInlineStart:se.spaceT("marginInlineStart"),marginX:se.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:se.spaceT("marginInline"),marginY:se.spaceT(["marginTop","marginBottom"]),marginBlock:se.spaceT("marginBlock"),padding:se.space("padding"),paddingTop:se.space("paddingTop"),paddingBlockStart:se.space("paddingBlockStart"),paddingRight:se.space("paddingRight"),paddingBottom:se.space("paddingBottom"),paddingBlockEnd:se.space("paddingBlockEnd"),paddingLeft:se.space("paddingLeft"),paddingInlineStart:se.space("paddingInlineStart"),paddingInlineEnd:se.space("paddingInlineEnd"),paddingX:se.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:se.space("paddingInline"),paddingY:se.space(["paddingTop","paddingBottom"]),paddingBlock:se.space("paddingBlock")};Object.assign(sr,{m:sr.margin,mt:sr.marginTop,mr:sr.marginRight,me:sr.marginInlineEnd,marginEnd:sr.marginInlineEnd,mb:sr.marginBottom,ml:sr.marginLeft,ms:sr.marginInlineStart,marginStart:sr.marginInlineStart,mx:sr.marginX,my:sr.marginY,p:sr.padding,pt:sr.paddingTop,py:sr.paddingY,px:sr.paddingX,pb:sr.paddingBottom,pl:sr.paddingLeft,ps:sr.paddingInlineStart,paddingStart:sr.paddingInlineStart,pr:sr.paddingRight,pe:sr.paddingInlineEnd,paddingEnd:sr.paddingInlineEnd});var Pte={textDecorationColor:se.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:se.shadows("textShadow")},Tte={clipPath:!0,transform:se.propT("transform",hn.transform),transformOrigin:!0,translateX:se.spaceT("--chakra-translate-x"),translateY:se.spaceT("--chakra-translate-y"),skewX:se.degreeT("--chakra-skew-x"),skewY:se.degreeT("--chakra-skew-y"),scaleX:se.prop("--chakra-scale-x"),scaleY:se.prop("--chakra-scale-y"),scale:se.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:se.degreeT("--chakra-rotate")},Lte={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:se.prop("transitionDuration","transition.duration"),transitionProperty:se.prop("transitionProperty","transition.property"),transitionTimingFunction:se.prop("transitionTimingFunction","transition.easing")},Ate={fontFamily:se.prop("fontFamily","fonts"),fontSize:se.prop("fontSize","fontSizes",hn.px),fontWeight:se.prop("fontWeight","fontWeights"),lineHeight:se.prop("lineHeight","lineHeights"),letterSpacing:se.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},Ote={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:se.spaceT("scrollMargin"),scrollMarginTop:se.spaceT("scrollMarginTop"),scrollMarginBottom:se.spaceT("scrollMarginBottom"),scrollMarginLeft:se.spaceT("scrollMarginLeft"),scrollMarginRight:se.spaceT("scrollMarginRight"),scrollMarginX:se.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:se.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:se.spaceT("scrollPadding"),scrollPaddingTop:se.spaceT("scrollPaddingTop"),scrollPaddingBottom:se.spaceT("scrollPaddingBottom"),scrollPaddingLeft:se.spaceT("scrollPaddingLeft"),scrollPaddingRight:se.spaceT("scrollPaddingRight"),scrollPaddingX:se.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:se.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function Ej(e){return qs(e)&&e.reference?e.reference:String(e)}var SS=(e,...t)=>t.map(Ej).join(` ${e} `).replace(/calc/g,""),wL=(...e)=>`calc(${SS("+",...e)})`,CL=(...e)=>`calc(${SS("-",...e)})`,a7=(...e)=>`calc(${SS("*",...e)})`,_L=(...e)=>`calc(${SS("/",...e)})`,kL=e=>{const t=Ej(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:a7(t,-1)},xh=Object.assign(e=>({add:(...t)=>xh(wL(e,...t)),subtract:(...t)=>xh(CL(e,...t)),multiply:(...t)=>xh(a7(e,...t)),divide:(...t)=>xh(_L(e,...t)),negate:()=>xh(kL(e)),toString:()=>e.toString()}),{add:wL,subtract:CL,multiply:a7,divide:_L,negate:kL});function Mte(e,t="-"){return e.replace(/\s+/g,t)}function Ite(e){const t=Mte(e.toString());return Dte(Rte(t))}function Rte(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function Dte(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function Nte(e,t=""){return[t,e].filter(Boolean).join("-")}function jte(e,t){return`var(${e}${t?`, ${t}`:""})`}function Bte(e,t=""){return Ite(`--${Nte(e,t)}`)}function Vn(e,t,n){const r=Bte(e,n);return{variable:r,reference:jte(r,t)}}function Fte(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function $te(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function s7(e){if(e==null)return e;const{unitless:t}=$te(e);return t||typeof e=="number"?`${e}px`:e}var Pj=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,C_=e=>Object.fromEntries(Object.entries(e).sort(Pj));function EL(e){const t=C_(e);return Object.assign(Object.values(t),t)}function zte(e){const t=Object.keys(C_(e));return new Set(t)}function PL(e){if(!e)return e;e=s7(e)??e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function bv(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${s7(e)})`),t&&n.push("and",`(max-width: ${s7(t)})`),n.join(" ")}function Hte(e){if(!e)return null;e.base=e.base??"0px";const t=EL(e),n=Object.entries(e).sort(Pj).map(([o,a],s,l)=>{let[,u]=l[s+1]??[];return u=parseFloat(u)>0?PL(u):void 0,{_minW:PL(a),breakpoint:o,minW:a,maxW:u,maxWQuery:bv(null,u),minWQuery:bv(a),minMaxQuery:bv(a,u)}}),r=zte(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(o){const a=Object.keys(o);return a.length>0&&a.every(s=>r.has(s))},asObject:C_(e),asArray:EL(e),details:n,media:[null,...t.map(o=>bv(o)).slice(1)],toArrayValue(o){if(!qs(o))throw new Error("toArrayValue: value must be an object");const a=i.map(s=>o[s]??null);for(;Fte(a)===null;)a.pop();return a},toObjectValue(o){if(!Array.isArray(o))throw new Error("toObjectValue: value must be an array");return o.reduce((a,s,l)=>{const u=i[l];return u!=null&&s!=null&&(a[u]=s),a},{})}}}var zi={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},ad=e=>Tj(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Bu=e=>Tj(t=>e(t,"~ &"),"[data-peer]",".peer"),Tj=(e,...t)=>t.map(e).join(", "),xS={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:ad(zi.hover),_peerHover:Bu(zi.hover),_groupFocus:ad(zi.focus),_peerFocus:Bu(zi.focus),_groupFocusVisible:ad(zi.focusVisible),_peerFocusVisible:Bu(zi.focusVisible),_groupActive:ad(zi.active),_peerActive:Bu(zi.active),_groupDisabled:ad(zi.disabled),_peerDisabled:Bu(zi.disabled),_groupInvalid:ad(zi.invalid),_peerInvalid:Bu(zi.invalid),_groupChecked:ad(zi.checked),_peerChecked:Bu(zi.checked),_groupFocusWithin:ad(zi.focusWithin),_peerFocusWithin:Bu(zi.focusWithin),_peerPlaceholderShown:Bu(zi.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},Vte=Object.keys(xS);function TL(e,t){return Vn(String(e).replace(/\./g,"-"),void 0,t)}function Wte(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=TL(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[y,...b]=m,x=`${y}.-${b.join(".")}`,k=xh.negate(s),E=xh.negate(u);r[x]={value:k,var:l,varRef:E}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const d=m=>{const b=[String(i).split(".")[0],m].join(".");if(!e[b])return m;const{reference:k}=TL(b,t==null?void 0:t.cssVarPrefix);return k},h=qs(s)?s:{default:s};n=Gl(n,Object.entries(h).reduce((m,[y,b])=>{var x;const k=d(b);if(y==="default")return m[l]=k,m;const E=((x=xS)==null?void 0:x[y])??y;return m[E]={[l]:k},m},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function Ute(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Gte(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var qte=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function Yte(e){return Gte(e,qte)}function Kte(e){return e.semanticTokens}function Xte(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function Zte({tokens:e,semanticTokens:t}){const n=Object.entries(l7(e)??{}).map(([i,o])=>[i,{isSemantic:!1,value:o}]),r=Object.entries(l7(t,1)??{}).map(([i,o])=>[i,{isSemantic:!0,value:o}]);return Object.fromEntries([...n,...r])}function l7(e,t=1/0){return!qs(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(qs(i)||Array.isArray(i)?Object.entries(l7(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function Qte(e){var t;const n=Xte(e),r=Yte(n),i=Kte(n),o=Zte({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=Wte(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:Hte(n.breakpoints)}),n}var __=Gl({},a4,Cn,mte,G4,Za,vte,Ete,yte,kj,kte,Bv,o7,sr,Ote,Ate,Pte,Tte,bte,Lte),Jte=Object.assign({},sr,Za,G4,kj,Bv),Lj=Object.keys(Jte),ene=[...Object.keys(__),...Vte],tne={...__,...xS},nne=e=>e in tne,rne=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=_h(e[a],t);if(s==null)continue;if(s=qs(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!one(t),sne=(e,t)=>{if(t==null)return t;const n=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.varRef},r=a=>n(a)??a,[i,o]=ine(t);return t=n(i)??r(o)??r(t),t};function lne(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s;const l=_h(o,r),u=rne(l)(r);let d={};for(let h in u){const m=u[h];let y=_h(m,r);h in n&&(h=n[h]),ane(h,y)&&(y=sne(r,y));let b=t[h];if(b===!0&&(b={property:h}),qs(y)){d[h]=d[h]??{},d[h]=Gl({},d[h],i(y,!0));continue}let x=((s=b==null?void 0:b.transform)==null?void 0:s.call(b,y,r,l))??y;x=b!=null&&b.processResult?i(x,!0):x;const k=_h(b==null?void 0:b.property,r);if(!a&&(b!=null&&b.static)){const E=_h(b.static,r);d=Gl({},d,E)}if(k&&Array.isArray(k)){for(const E of k)d[E]=x;continue}if(k){k==="&"&&qs(x)?d=Gl({},d,x):d[k]=x;continue}if(qs(x)){d=Gl({},d,x);continue}d[h]=x}return d};return i}var Aj=e=>t=>lne({theme:t,pseudos:xS,configs:__})(e);function pr(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function une(e,t){if(Array.isArray(e))return e;if(qs(e))return t(e);if(e!=null)return[e]}function cne(e,t){for(let n=t+1;n{Gl(u,{[P]:m?_[P]:{[E]:_[P]}})});continue}if(!y){m?Gl(u,_):u[E]=_;continue}u[E]=_}}return u}}function fne(e){return t=>{const{variant:n,size:r,theme:i}=t,o=dne(i);return Gl({},_h(e.baseStyle??{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function hne(e,t,n){var r,i;return((i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)??n}function Sn(e){return Ute(e,["styleConfig","size","variant","colorScheme"])}function pne(e){if(e.sheet)return e.sheet;for(var t=0;t0?Ui(m0,--ra):0,Um--,ii===10&&(Um=1,CS--),ii}function Ta(){return ii=ra2||S2(ii)>3?"":" "}function Ene(e,t){for(;--t&&Ta()&&!(ii<48||ii>102||ii>57&&ii<65||ii>70&&ii<97););return my(e,s4()+(t<6&&Xl()==32&&Ta()==32))}function c7(e){for(;Ta();)switch(ii){case e:return ra;case 34:case 39:e!==34&&e!==39&&c7(ii);break;case 40:e===41&&c7(e);break;case 92:Ta();break}return ra}function Pne(e,t){for(;Ta()&&e+ii!==47+10;)if(e+ii===42+42&&Xl()===47)break;return"/*"+my(t,ra-1)+"*"+wS(e===47?e:Ta())}function Tne(e){for(;!S2(Xl());)Ta();return my(e,ra)}function Lne(e){return Nj(u4("",null,null,null,[""],e=Dj(e),0,[0],e))}function u4(e,t,n,r,i,o,a,s,l){for(var u=0,d=0,h=a,m=0,y=0,b=0,x=1,k=1,E=1,_=0,P="",A=i,M=o,R=r,D=P;k;)switch(b=_,_=Ta()){case 40:if(b!=108&&Ui(D,h-1)==58){u7(D+=On(l4(_),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:D+=l4(_);break;case 9:case 10:case 13:case 32:D+=kne(b);break;case 92:D+=Ene(s4()-1,7);continue;case 47:switch(Xl()){case 42:case 47:V3(Ane(Pne(Ta(),s4()),t,n),l);break;default:D+="/"}break;case 123*x:s[u++]=$l(D)*E;case 125*x:case 59:case 0:switch(_){case 0:case 125:k=0;case 59+d:y>0&&$l(D)-h&&V3(y>32?AL(D+";",r,n,h-1):AL(On(D," ","")+";",r,n,h-2),l);break;case 59:D+=";";default:if(V3(R=LL(D,t,n,u,d,i,s,P,A=[],M=[],h),o),_===123)if(d===0)u4(D,t,R,R,A,o,h,s,M);else switch(m===99&&Ui(D,3)===110?100:m){case 100:case 109:case 115:u4(e,R,R,r&&V3(LL(e,R,R,0,0,i,s,P,i,A=[],h),M),i,M,h,s,r?A:M);break;default:u4(D,R,R,R,[""],M,0,s,M)}}u=d=y=0,x=E=1,P=D="",h=a;break;case 58:h=1+$l(D),y=b;default:if(x<1){if(_==123)--x;else if(_==125&&x++==0&&_ne()==125)continue}switch(D+=wS(_),_*x){case 38:E=d>0?1:(D+="\f",-1);break;case 44:s[u++]=($l(D)-1)*E,E=1;break;case 64:Xl()===45&&(D+=l4(Ta())),m=Xl(),d=h=$l(P=D+=Tne(s4())),_++;break;case 45:b===45&&$l(D)==2&&(x=0)}}return o}function LL(e,t,n,r,i,o,a,s,l,u,d){for(var h=i-1,m=i===0?o:[""],y=P_(m),b=0,x=0,k=0;b0?m[E]+" "+_:On(_,/&\f/g,m[E])))&&(l[k++]=P);return _S(e,t,n,i===0?k_:s,l,u,d)}function Ane(e,t,n){return _S(e,t,n,Oj,wS(Cne()),b2(e,2,-2),0)}function AL(e,t,n,r){return _S(e,t,n,E_,b2(e,0,r),b2(e,r+1,-1),r)}function vm(e,t){for(var n="",r=P_(e),i=0;i6)switch(Ui(e,t+1)){case 109:if(Ui(e,t+4)!==45)break;case 102:return On(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+q4+(Ui(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~u7(e,"stretch")?Bj(On(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ui(e,t+1)!==115)break;case 6444:switch(Ui(e,$l(e)-3-(~u7(e,"!important")&&10))){case 107:return On(e,":",":"+_n)+e;case 101:return On(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Ui(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+eo+"$2box$3")+e}break;case 5936:switch(Ui(e,t+11)){case 114:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+eo+e+e}return e}var Fne=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case E_:t.return=Bj(t.value,t.length);break;case Mj:return vm([V1(t,{value:On(t.value,"@","@"+_n)})],i);case k_:if(t.length)return wne(t.props,function(o){switch(xne(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return vm([V1(t,{props:[On(o,/:(read-\w+)/,":"+q4+"$1")]})],i);case"::placeholder":return vm([V1(t,{props:[On(o,/:(plac\w+)/,":"+_n+"input-$1")]}),V1(t,{props:[On(o,/:(plac\w+)/,":"+q4+"$1")]}),V1(t,{props:[On(o,/:(plac\w+)/,eo+"input-$1")]})],i)}return""})}},$ne=[Fne],Fj=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(x){var k=x.getAttribute("data-emotion");k.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var i=t.stylisPlugins||$ne,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var k=x.getAttribute("data-emotion").split(" "),E=1;E=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Qne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Jne=/[A-Z]|^ms/g,ere=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Wj=function(t){return t.charCodeAt(1)===45},ML=function(t){return t!=null&&typeof t!="boolean"},Zw=Nj(function(e){return Wj(e)?e:e.replace(Jne,"-$&").toLowerCase()}),IL=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(ere,function(r,i,o){return zl={name:i,styles:o,next:zl},i})}return Qne[t]!==1&&!Wj(t)&&typeof n=="number"&&n!==0?n+"px":n};function x2(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return zl={name:n.name,styles:n.styles,next:zl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)zl={name:r.name,styles:r.styles,next:zl},r=r.next;var i=n.styles+";";return i}return tre(e,t,n)}case"function":{if(e!==void 0){var o=zl,a=n(e);return zl=o,x2(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function tre(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{t.includes(r)||(n[r]=e[r])}),n}function yre(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},Zj=bre(yre);function Qj(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var Jj=e=>Qj(e,t=>t!=null);function Sre(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var xre=Sre();function eB(e,...t){return mre(e)?e(...t):e}function wre(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Cre(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=w.createContext(void 0);i.displayName=r;function o(){var a;const s=w.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}var _re=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,kre=Nj(function(e){return _re.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Ere=kre,Pre=function(t){return t!=="theme"},jL=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Ere:Pre},BL=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},Tre=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Hj(n,r,i),rre(function(){return Vj(n,r,i)}),null},Lre=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=BL(t,n,r),l=s||jL(i),u=!l("as");return function(){var d=arguments,h=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)h.push.apply(h,d);else{h.push(d[0][0]);for(var m=d.length,v=1;v[h,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([h,m])=>[h,m.className]))}function l(d){const v=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:v,selector:`.${v}`,toString:()=>d}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var Ore=Mn("accordion").parts("root","container","button","panel").extend("icon"),Mre=Mn("alert").parts("title","description","container").extend("icon","spinner"),Ire=Mn("avatar").parts("label","badge","container").extend("excessLabel","group"),Rre=Mn("breadcrumb").parts("link","item","container").extend("separator");Mn("button").parts();var Dre=Mn("checkbox").parts("control","icon","container").extend("label");Mn("progress").parts("track","filledTrack").extend("label");var Nre=Mn("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),jre=Mn("editable").parts("preview","input","textarea"),Bre=Mn("form").parts("container","requiredIndicator","helperText"),$re=Mn("formError").parts("text","icon"),Fre=Mn("input").parts("addon","field","element"),zre=Mn("list").parts("container","item","icon"),Hre=Mn("menu").parts("button","list","item").extend("groupTitle","command","divider"),Vre=Mn("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Wre=Mn("numberinput").parts("root","field","stepperGroup","stepper");Mn("pininput").parts("field");var Ure=Mn("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Gre=Mn("progress").parts("label","filledTrack","track"),qre=Mn("radio").parts("container","control","label"),Yre=Mn("select").parts("field","icon"),Kre=Mn("slider").parts("container","track","thumb","filledTrack","mark"),Xre=Mn("stat").parts("container","label","helpText","number","icon"),Zre=Mn("switch").parts("container","track","thumb"),Qre=Mn("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),Jre=Mn("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),eie=Mn("tag").parts("container","label","closeButton"),tie=Mn("card").parts("container","header","body","footer");function Gi(e,t){nie(e)&&(e="100%");var n=rie(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function W3(e){return Math.min(1,Math.max(0,e))}function nie(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function rie(e){return typeof e=="string"&&e.indexOf("%")!==-1}function tB(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function U3(e){return e<=1?"".concat(Number(e)*100,"%"):e}function _h(e){return e.length===1?"0"+e:String(e)}function iie(e,t,n){return{r:Gi(e,255)*255,g:Gi(t,255)*255,b:Gi(n,255)*255}}function $L(e,t,n){e=Gi(e,255),t=Gi(t,255),n=Gi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=0,s=(r+i)/2;if(r===i)a=0,o=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function oie(e,t,n){var r,i,o;if(e=Gi(e,360),t=Gi(t,100),n=Gi(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Qw(s,a,e+1/3),i=Qw(s,a,e),o=Qw(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function FL(e,t,n){e=Gi(e,255),t=Gi(t,255),n=Gi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var g7={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function cie(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=hie(e)),typeof e=="object"&&($u(e.r)&&$u(e.g)&&$u(e.b)?(t=iie(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):$u(e.h)&&$u(e.s)&&$u(e.v)?(r=U3(e.s),i=U3(e.v),t=aie(e.h,r,i),a=!0,s="hsv"):$u(e.h)&&$u(e.s)&&$u(e.l)&&(r=U3(e.s),o=U3(e.l),t=oie(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=tB(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var die="[-\\+]?\\d+%?",fie="[-\\+]?\\d*\\.\\d+%?",Cd="(?:".concat(fie,")|(?:").concat(die,")"),Jw="[\\s|\\(]+(".concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")\\s*\\)?"),e6="[\\s|\\(]+(".concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")\\s*\\)?"),Bs={CSS_UNIT:new RegExp(Cd),rgb:new RegExp("rgb"+Jw),rgba:new RegExp("rgba"+e6),hsl:new RegExp("hsl"+Jw),hsla:new RegExp("hsla"+e6),hsv:new RegExp("hsv"+Jw),hsva:new RegExp("hsva"+e6),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function hie(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(g7[e])e=g7[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Bs.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Bs.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Bs.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Bs.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Bs.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Bs.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Bs.hex8.exec(e),n?{r:_a(n[1]),g:_a(n[2]),b:_a(n[3]),a:HL(n[4]),format:t?"name":"hex8"}:(n=Bs.hex6.exec(e),n?{r:_a(n[1]),g:_a(n[2]),b:_a(n[3]),format:t?"name":"hex"}:(n=Bs.hex4.exec(e),n?{r:_a(n[1]+n[1]),g:_a(n[2]+n[2]),b:_a(n[3]+n[3]),a:HL(n[4]+n[4]),format:t?"name":"hex8"}:(n=Bs.hex3.exec(e),n?{r:_a(n[1]+n[1]),g:_a(n[2]+n[2]),b:_a(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function $u(e){return Boolean(Bs.CSS_UNIT.exec(String(e)))}var vy=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=uie(t)),this.originalInput=t;var i=cie(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,a=t.g/255,s=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=tB(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=FL(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=FL(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=$L(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=$L(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),zL(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),sie(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(Gi(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(Gi(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+zL(this.r,this.g,this.b,!1),n=0,r=Object.entries(g7);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=W3(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=W3(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=W3(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=W3(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:i,v:o})),o=(o+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(nB(e));return e.count=t,n}var r=pie(e.hue,e.seed),i=gie(r,e),o=mie(r,i,e),a={h:r,s:i,v:o};return e.alpha!==void 0&&(a.a=e.alpha),new vy(a)}function pie(e,t){var n=yie(e),r=Y4(n,t);return r<0&&(r=360+r),r}function gie(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return Y4([0,100],t.seed);var n=rB(e).saturationRange,r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55;break}return Y4([r,i],t.seed)}function mie(e,t,n){var r=vie(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100;break}return Y4([r,i],n.seed)}function vie(e,t){for(var n=rB(e).lowerBounds,r=0;r=i&&t<=a){var l=(s-o)/(a-i),u=o-l*i;return l*t+u}}return 0}function yie(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=oB.find(function(a){return a.name===e});if(n){var r=iB(n);if(r.hueRange)return r.hueRange}var i=new vy(e);if(i.isValid){var o=i.toHsv().h;return[o,o]}}return[0,360]}function rB(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=oB;t=i.hueRange[0]&&e<=i.hueRange[1])return i}throw Error("Color not found")}function Y4(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var i=t/233280;return Math.floor(r+i*(n-r))}function iB(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],i=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,i]}}var oB=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function bie(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,ko=(e,t,n)=>{const r=bie(e,`colors.${t}`,t),{isValid:i}=new vy(r);return i?r:n},xie=e=>t=>{const n=ko(t,e);return new vy(n).isDark()?"dark":"light"},wie=e=>t=>xie(e)(t)==="dark",Um=(e,t)=>n=>{const r=ko(n,e);return new vy(r).setAlpha(t).toRgbString()};function VL(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + */var Ai=typeof Symbol=="function"&&Symbol.for,T_=Ai?Symbol.for("react.element"):60103,L_=Ai?Symbol.for("react.portal"):60106,kS=Ai?Symbol.for("react.fragment"):60107,ES=Ai?Symbol.for("react.strict_mode"):60108,PS=Ai?Symbol.for("react.profiler"):60114,TS=Ai?Symbol.for("react.provider"):60109,LS=Ai?Symbol.for("react.context"):60110,A_=Ai?Symbol.for("react.async_mode"):60111,AS=Ai?Symbol.for("react.concurrent_mode"):60111,OS=Ai?Symbol.for("react.forward_ref"):60112,MS=Ai?Symbol.for("react.suspense"):60113,Hne=Ai?Symbol.for("react.suspense_list"):60120,IS=Ai?Symbol.for("react.memo"):60115,RS=Ai?Symbol.for("react.lazy"):60116,Vne=Ai?Symbol.for("react.block"):60121,Wne=Ai?Symbol.for("react.fundamental"):60117,Une=Ai?Symbol.for("react.responder"):60118,Gne=Ai?Symbol.for("react.scope"):60119;function Da(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case T_:switch(e=e.type,e){case A_:case AS:case kS:case PS:case ES:case MS:return e;default:switch(e=e&&e.$$typeof,e){case LS:case OS:case RS:case IS:case TS:return e;default:return t}}case L_:return t}}}function $j(e){return Da(e)===AS}Fn.AsyncMode=A_;Fn.ConcurrentMode=AS;Fn.ContextConsumer=LS;Fn.ContextProvider=TS;Fn.Element=T_;Fn.ForwardRef=OS;Fn.Fragment=kS;Fn.Lazy=RS;Fn.Memo=IS;Fn.Portal=L_;Fn.Profiler=PS;Fn.StrictMode=ES;Fn.Suspense=MS;Fn.isAsyncMode=function(e){return $j(e)||Da(e)===A_};Fn.isConcurrentMode=$j;Fn.isContextConsumer=function(e){return Da(e)===LS};Fn.isContextProvider=function(e){return Da(e)===TS};Fn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===T_};Fn.isForwardRef=function(e){return Da(e)===OS};Fn.isFragment=function(e){return Da(e)===kS};Fn.isLazy=function(e){return Da(e)===RS};Fn.isMemo=function(e){return Da(e)===IS};Fn.isPortal=function(e){return Da(e)===L_};Fn.isProfiler=function(e){return Da(e)===PS};Fn.isStrictMode=function(e){return Da(e)===ES};Fn.isSuspense=function(e){return Da(e)===MS};Fn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kS||e===AS||e===PS||e===ES||e===MS||e===Hne||typeof e=="object"&&e!==null&&(e.$$typeof===RS||e.$$typeof===IS||e.$$typeof===TS||e.$$typeof===LS||e.$$typeof===OS||e.$$typeof===Wne||e.$$typeof===Une||e.$$typeof===Gne||e.$$typeof===Vne)};Fn.typeOf=Da;(function(e){e.exports=Fn})(zne);var zj=d7,qne={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Yne={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Hj={};Hj[zj.ForwardRef]=qne;Hj[zj.Memo]=Yne;var Kne=!0;function Xne(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var Vj=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||Kne===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},Wj=function(t,n,r){Vj(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+i:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function Zne(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Qne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Jne=/[A-Z]|^ms/g,ere=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Uj=function(t){return t.charCodeAt(1)===45},IL=function(t){return t!=null&&typeof t!="boolean"},Zw=jj(function(e){return Uj(e)?e:e.replace(Jne,"-$&").toLowerCase()}),RL=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(ere,function(r,i,o){return zl={name:i,styles:o,next:zl},i})}return Qne[t]!==1&&!Uj(t)&&typeof n=="number"&&n!==0?n+"px":n};function x2(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return zl={name:n.name,styles:n.styles,next:zl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)zl={name:r.name,styles:r.styles,next:zl},r=r.next;var i=n.styles+";";return i}return tre(e,t,n)}case"function":{if(e!==void 0){var o=zl,a=n(e);return zl=o,x2(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function tre(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{t.includes(r)||(n[r]=e[r])}),n}function yre(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},Qj=bre(yre);function Jj(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var eB=e=>Jj(e,t=>t!=null);function Sre(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var xre=Sre();function tB(e,...t){return mre(e)?e(...t):e}function wre(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Cre(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=w.createContext(void 0);i.displayName=r;function o(){var a;const s=w.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}var _re=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,kre=jj(function(e){return _re.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Ere=kre,Pre=function(t){return t!=="theme"},BL=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Ere:Pre},FL=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},Tre=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Vj(n,r,i),rre(function(){return Wj(n,r,i)}),null},Lre=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=FL(t,n,r),l=s||BL(i),u=!l("as");return function(){var d=arguments,h=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)h.push.apply(h,d);else{h.push(d[0][0]);for(var m=d.length,y=1;y[h,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([h,m])=>[h,m.className]))}function l(d){const y=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:y,selector:`.${y}`,toString:()=>d}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var Ore=Mn("accordion").parts("root","container","button","panel").extend("icon"),Mre=Mn("alert").parts("title","description","container").extend("icon","spinner"),Ire=Mn("avatar").parts("label","badge","container").extend("excessLabel","group"),Rre=Mn("breadcrumb").parts("link","item","container").extend("separator");Mn("button").parts();var Dre=Mn("checkbox").parts("control","icon","container").extend("label");Mn("progress").parts("track","filledTrack").extend("label");var Nre=Mn("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),jre=Mn("editable").parts("preview","input","textarea"),Bre=Mn("form").parts("container","requiredIndicator","helperText"),Fre=Mn("formError").parts("text","icon"),$re=Mn("input").parts("addon","field","element"),zre=Mn("list").parts("container","item","icon"),Hre=Mn("menu").parts("button","list","item").extend("groupTitle","command","divider"),Vre=Mn("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Wre=Mn("numberinput").parts("root","field","stepperGroup","stepper");Mn("pininput").parts("field");var Ure=Mn("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Gre=Mn("progress").parts("label","filledTrack","track"),qre=Mn("radio").parts("container","control","label"),Yre=Mn("select").parts("field","icon"),Kre=Mn("slider").parts("container","track","thumb","filledTrack","mark"),Xre=Mn("stat").parts("container","label","helpText","number","icon"),Zre=Mn("switch").parts("container","track","thumb"),Qre=Mn("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),Jre=Mn("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),eie=Mn("tag").parts("container","label","closeButton"),tie=Mn("card").parts("container","header","body","footer");function Gi(e,t){nie(e)&&(e="100%");var n=rie(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function W3(e){return Math.min(1,Math.max(0,e))}function nie(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function rie(e){return typeof e=="string"&&e.indexOf("%")!==-1}function nB(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function U3(e){return e<=1?"".concat(Number(e)*100,"%"):e}function kh(e){return e.length===1?"0"+e:String(e)}function iie(e,t,n){return{r:Gi(e,255)*255,g:Gi(t,255)*255,b:Gi(n,255)*255}}function $L(e,t,n){e=Gi(e,255),t=Gi(t,255),n=Gi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=0,s=(r+i)/2;if(r===i)a=0,o=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function oie(e,t,n){var r,i,o;if(e=Gi(e,360),t=Gi(t,100),n=Gi(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Qw(s,a,e+1/3),i=Qw(s,a,e),o=Qw(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function zL(e,t,n){e=Gi(e,255),t=Gi(t,255),n=Gi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var g7={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function cie(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=hie(e)),typeof e=="object"&&(Fu(e.r)&&Fu(e.g)&&Fu(e.b)?(t=iie(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Fu(e.h)&&Fu(e.s)&&Fu(e.v)?(r=U3(e.s),i=U3(e.v),t=aie(e.h,r,i),a=!0,s="hsv"):Fu(e.h)&&Fu(e.s)&&Fu(e.l)&&(r=U3(e.s),o=U3(e.l),t=oie(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=nB(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var die="[-\\+]?\\d+%?",fie="[-\\+]?\\d*\\.\\d+%?",Cd="(?:".concat(fie,")|(?:").concat(die,")"),Jw="[\\s|\\(]+(".concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")\\s*\\)?"),e6="[\\s|\\(]+(".concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")\\s*\\)?"),Bs={CSS_UNIT:new RegExp(Cd),rgb:new RegExp("rgb"+Jw),rgba:new RegExp("rgba"+e6),hsl:new RegExp("hsl"+Jw),hsla:new RegExp("hsla"+e6),hsv:new RegExp("hsv"+Jw),hsva:new RegExp("hsva"+e6),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function hie(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(g7[e])e=g7[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Bs.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Bs.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Bs.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Bs.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Bs.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Bs.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Bs.hex8.exec(e),n?{r:_a(n[1]),g:_a(n[2]),b:_a(n[3]),a:VL(n[4]),format:t?"name":"hex8"}:(n=Bs.hex6.exec(e),n?{r:_a(n[1]),g:_a(n[2]),b:_a(n[3]),format:t?"name":"hex"}:(n=Bs.hex4.exec(e),n?{r:_a(n[1]+n[1]),g:_a(n[2]+n[2]),b:_a(n[3]+n[3]),a:VL(n[4]+n[4]),format:t?"name":"hex8"}:(n=Bs.hex3.exec(e),n?{r:_a(n[1]+n[1]),g:_a(n[2]+n[2]),b:_a(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function Fu(e){return Boolean(Bs.CSS_UNIT.exec(String(e)))}var vy=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=uie(t)),this.originalInput=t;var i=cie(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,a=t.g/255,s=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=nB(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=zL(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=zL(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=$L(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=$L(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),HL(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),sie(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(Gi(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(Gi(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+HL(this.r,this.g,this.b,!1),n=0,r=Object.entries(g7);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=W3(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=W3(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=W3(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=W3(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:i,v:o})),o=(o+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(rB(e));return e.count=t,n}var r=pie(e.hue,e.seed),i=gie(r,e),o=mie(r,i,e),a={h:r,s:i,v:o};return e.alpha!==void 0&&(a.a=e.alpha),new vy(a)}function pie(e,t){var n=yie(e),r=Y4(n,t);return r<0&&(r=360+r),r}function gie(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return Y4([0,100],t.seed);var n=iB(e).saturationRange,r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55;break}return Y4([r,i],t.seed)}function mie(e,t,n){var r=vie(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100;break}return Y4([r,i],n.seed)}function vie(e,t){for(var n=iB(e).lowerBounds,r=0;r=i&&t<=a){var l=(s-o)/(a-i),u=o-l*i;return l*t+u}}return 0}function yie(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=aB.find(function(a){return a.name===e});if(n){var r=oB(n);if(r.hueRange)return r.hueRange}var i=new vy(e);if(i.isValid){var o=i.toHsv().h;return[o,o]}}return[0,360]}function iB(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=aB;t=i.hueRange[0]&&e<=i.hueRange[1])return i}throw Error("Color not found")}function Y4(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var i=t/233280;return Math.floor(r+i*(n-r))}function oB(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],i=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,i]}}var aB=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function bie(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,ko=(e,t,n)=>{const r=bie(e,`colors.${t}`,t),{isValid:i}=new vy(r);return i?r:n},xie=e=>t=>{const n=ko(t,e);return new vy(n).isDark()?"dark":"light"},wie=e=>t=>xie(e)(t)==="dark",Gm=(e,t)=>n=>{const r=ko(n,e);return new vy(r).setAlpha(t).toRgbString()};function WL(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( 45deg, ${t} 25%, transparent 25%, @@ -30,12 +30,12 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con ${t} 75%, transparent 75%, transparent - )`,backgroundSize:`${e} ${e}`}}function Cie(e){const t=nB().toHexString();return!e||Sie(e)?t:e.string&&e.colors?kie(e.string,e.colors):e.string&&!e.colors?_ie(e.string):e.colors&&!e.string?Eie(e.colors):t}function _ie(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function kie(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function I_(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function Pie(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function aB(e){return Pie(e)&&e.reference?e.reference:String(e)}var jS=(e,...t)=>t.map(aB).join(` ${e} `).replace(/calc/g,""),WL=(...e)=>`calc(${jS("+",...e)})`,UL=(...e)=>`calc(${jS("-",...e)})`,m7=(...e)=>`calc(${jS("*",...e)})`,GL=(...e)=>`calc(${jS("/",...e)})`,qL=e=>{const t=aB(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:m7(t,-1)},Uu=Object.assign(e=>({add:(...t)=>Uu(WL(e,...t)),subtract:(...t)=>Uu(UL(e,...t)),multiply:(...t)=>Uu(m7(e,...t)),divide:(...t)=>Uu(GL(e,...t)),negate:()=>Uu(qL(e)),toString:()=>e.toString()}),{add:WL,subtract:UL,multiply:m7,divide:GL,negate:qL});function Tie(e){return!Number.isInteger(parseFloat(e.toString()))}function Lie(e,t="-"){return e.replace(/\s+/g,t)}function sB(e){const t=Lie(e.toString());return t.includes("\\.")?e:Tie(e)?t.replace(".","\\."):e}function Aie(e,t=""){return[t,sB(e)].filter(Boolean).join("-")}function Oie(e,t){return`var(${sB(e)}${t?`, ${t}`:""})`}function Mie(e,t=""){return`--${Aie(e,t)}`}function yi(e,t){const n=Mie(e,t==null?void 0:t.prefix);return{variable:n,reference:Oie(n,Iie(t==null?void 0:t.fallback))}}function Iie(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{definePartsStyle:Rie,defineMultiStyleConfig:Die}=hr(Ore.keys),Nie={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},jie={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Bie={pt:"2",px:"4",pb:"5"},$ie={fontSize:"1.25em"},Fie=Rie({container:Nie,button:jie,panel:Bie,icon:$ie}),zie=Die({baseStyle:Fie}),{definePartsStyle:yy,defineMultiStyleConfig:Hie}=hr(Mre.keys),La=Vn("alert-fg"),ec=Vn("alert-bg"),Vie=yy({container:{bg:ec.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:La.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:La.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function R_(e){const{theme:t,colorScheme:n}=e,r=Um(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Wie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark}}}}),Uie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:La.reference}}}),Gie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:La.reference}}}),qie=yy(e=>{const{colorScheme:t}=e;return{container:{[La.variable]:"colors.white",[ec.variable]:`colors.${t}.500`,_dark:{[La.variable]:"colors.gray.900",[ec.variable]:`colors.${t}.200`},color:La.reference}}}),Yie={subtle:Wie,"left-accent":Uie,"top-accent":Gie,solid:qie},Kie=Hie({baseStyle:Vie,variants:Yie,defaultProps:{variant:"subtle",colorScheme:"blue"}}),lB={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Xie={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},Zie={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},Qie={...lB,...Xie,container:Zie},uB=Qie,Jie=e=>typeof e=="function";function To(e,...t){return Jie(e)?e(...t):e}var{definePartsStyle:cB,defineMultiStyleConfig:eoe}=hr(Ire.keys),vm=Vn("avatar-border-color"),t6=Vn("avatar-bg"),toe={borderRadius:"full",border:"0.2em solid",[vm.variable]:"white",_dark:{[vm.variable]:"colors.gray.800"},borderColor:vm.reference},noe={[t6.variable]:"colors.gray.200",_dark:{[t6.variable]:"colors.whiteAlpha.400"},bgColor:t6.reference},YL=Vn("avatar-background"),roe=e=>{const{name:t,theme:n}=e,r=t?Cie({string:t}):"colors.gray.400",i=wie(r)(n);let o="white";return i||(o="gray.800"),{bg:YL.reference,"&:not([data-loaded])":{[YL.variable]:r},color:o,[vm.variable]:"colors.white",_dark:{[vm.variable]:"colors.gray.800"},borderColor:vm.reference,verticalAlign:"top"}},ioe=cB(e=>({badge:To(toe,e),excessLabel:To(noe,e),container:To(roe,e)}));function sd(e){const t=e!=="100%"?uB[e]:void 0;return cB({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var ooe={"2xs":sd(4),xs:sd(6),sm:sd(8),md:sd(12),lg:sd(16),xl:sd(24),"2xl":sd(32),full:sd("100%")},aoe=eoe({baseStyle:ioe,sizes:ooe,defaultProps:{size:"md"}}),soe={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},ym=Vn("badge-bg"),ql=Vn("badge-color"),loe=e=>{const{colorScheme:t,theme:n}=e,r=Um(`${t}.500`,.6)(n);return{[ym.variable]:`colors.${t}.500`,[ql.variable]:"colors.white",_dark:{[ym.variable]:r,[ql.variable]:"colors.whiteAlpha.800"},bg:ym.reference,color:ql.reference}},uoe=e=>{const{colorScheme:t,theme:n}=e,r=Um(`${t}.200`,.16)(n);return{[ym.variable]:`colors.${t}.100`,[ql.variable]:`colors.${t}.800`,_dark:{[ym.variable]:r,[ql.variable]:`colors.${t}.200`},bg:ym.reference,color:ql.reference}},coe=e=>{const{colorScheme:t,theme:n}=e,r=Um(`${t}.200`,.8)(n);return{[ql.variable]:`colors.${t}.500`,_dark:{[ql.variable]:r},color:ql.reference,boxShadow:`inset 0 0 0px 1px ${ql.reference}`}},doe={solid:loe,subtle:uoe,outline:coe},Fv={baseStyle:soe,variants:doe,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:foe,definePartsStyle:hoe}=hr(Rre.keys),poe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},goe=hoe({link:poe}),moe=foe({baseStyle:goe}),voe={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},dB=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Et("inherit","whiteAlpha.900")(e),_hover:{bg:Et("gray.100","whiteAlpha.200")(e)},_active:{bg:Et("gray.200","whiteAlpha.300")(e)}};const r=Um(`${t}.200`,.12)(n),i=Um(`${t}.200`,.24)(n);return{color:Et(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Et(`${t}.50`,r)(e)},_active:{bg:Et(`${t}.100`,i)(e)}}},yoe=e=>{const{colorScheme:t}=e,n=Et("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...To(dB,e)}},boe={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Soe=e=>{const{colorScheme:t}=e;if(t==="gray"){const s=Et("gray.100","whiteAlpha.200")(e);return{bg:s,_hover:{bg:Et("gray.200","whiteAlpha.300")(e),_disabled:{bg:s}},_active:{bg:Et("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=boe[t]??{},a=Et(n,`${t}.200`)(e);return{bg:a,color:Et(r,"gray.800")(e),_hover:{bg:Et(i,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:Et(o,`${t}.400`)(e)}}},xoe=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Et(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Et(`${t}.700`,`${t}.500`)(e)}}},woe={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},Coe={ghost:dB,outline:yoe,solid:Soe,link:xoe,unstyled:woe},_oe={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},koe={baseStyle:voe,variants:Coe,sizes:_oe,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Mh,defineMultiStyleConfig:Eoe}=hr(tie.keys),K4=Vn("card-bg"),bm=Vn("card-padding"),Poe=Mh({container:{[K4.variable]:"chakra-body-bg",backgroundColor:K4.reference,color:"chakra-body-text"},body:{padding:bm.reference,flex:"1 1 0%"},header:{padding:bm.reference},footer:{padding:bm.reference}}),Toe={sm:Mh({container:{borderRadius:"base",[bm.variable]:"space.3"}}),md:Mh({container:{borderRadius:"md",[bm.variable]:"space.5"}}),lg:Mh({container:{borderRadius:"xl",[bm.variable]:"space.7"}})},Loe={elevated:Mh({container:{boxShadow:"base",_dark:{[K4.variable]:"colors.gray.700"}}}),outline:Mh({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:Mh({container:{[K4.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},Aoe=Eoe({baseStyle:Poe,variants:Loe,sizes:Toe,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:c4,defineMultiStyleConfig:Ooe}=hr(Dre.keys),zv=Vn("checkbox-size"),Moe=e=>{const{colorScheme:t}=e;return{w:zv.reference,h:zv.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e),_hover:{bg:Et(`${t}.600`,`${t}.300`)(e),borderColor:Et(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Et("gray.200","transparent")(e),bg:Et("gray.200","whiteAlpha.300")(e),color:Et("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e)},_disabled:{bg:Et("gray.100","whiteAlpha.100")(e),borderColor:Et("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Et("red.500","red.300")(e)}}},Ioe={_disabled:{cursor:"not-allowed"}},Roe={userSelect:"none",_disabled:{opacity:.4}},Doe={transitionProperty:"transform",transitionDuration:"normal"},Noe=c4(e=>({icon:Doe,container:Ioe,control:To(Moe,e),label:Roe})),joe={sm:c4({control:{[zv.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:c4({control:{[zv.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:c4({control:{[zv.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},X4=Ooe({baseStyle:Noe,sizes:joe,defaultProps:{size:"md",colorScheme:"blue"}}),Hv=yi("close-button-size"),V1=yi("close-button-bg"),Boe={w:[Hv.reference],h:[Hv.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[V1.variable]:"colors.blackAlpha.100",_dark:{[V1.variable]:"colors.whiteAlpha.100"}},_active:{[V1.variable]:"colors.blackAlpha.200",_dark:{[V1.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:V1.reference},$oe={lg:{[Hv.variable]:"sizes.10",fontSize:"md"},md:{[Hv.variable]:"sizes.8",fontSize:"xs"},sm:{[Hv.variable]:"sizes.6",fontSize:"2xs"}},Foe={baseStyle:Boe,sizes:$oe,defaultProps:{size:"md"}},{variants:zoe,defaultProps:Hoe}=Fv,Voe={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Woe={baseStyle:Voe,variants:zoe,defaultProps:Hoe},Uoe={w:"100%",mx:"auto",maxW:"prose",px:"4"},Goe={baseStyle:Uoe},qoe={opacity:.6,borderColor:"inherit"},Yoe={borderStyle:"solid"},Koe={borderStyle:"dashed"},Xoe={solid:Yoe,dashed:Koe},Zoe={baseStyle:qoe,variants:Xoe,defaultProps:{variant:"solid"}},{definePartsStyle:v7,defineMultiStyleConfig:Qoe}=hr(Nre.keys),n6=Vn("drawer-bg"),r6=Vn("drawer-box-shadow");function _g(e){return v7(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Joe={bg:"blackAlpha.600",zIndex:"overlay"},eae={display:"flex",zIndex:"modal",justifyContent:"center"},tae=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[n6.variable]:"colors.white",[r6.variable]:"shadows.lg",_dark:{[n6.variable]:"colors.gray.700",[r6.variable]:"shadows.dark-lg"},bg:n6.reference,boxShadow:r6.reference}},nae={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},rae={position:"absolute",top:"2",insetEnd:"3"},iae={px:"6",py:"2",flex:"1",overflow:"auto"},oae={px:"6",py:"4"},aae=v7(e=>({overlay:Joe,dialogContainer:eae,dialog:To(tae,e),header:nae,closeButton:rae,body:iae,footer:oae})),sae={xs:_g("xs"),sm:_g("md"),md:_g("lg"),lg:_g("2xl"),xl:_g("4xl"),full:_g("full")},lae=Qoe({baseStyle:aae,sizes:sae,defaultProps:{size:"xs"}}),{definePartsStyle:uae,defineMultiStyleConfig:cae}=hr(jre.keys),dae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},fae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},hae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},pae=uae({preview:dae,input:fae,textarea:hae}),gae=cae({baseStyle:pae}),{definePartsStyle:mae,defineMultiStyleConfig:vae}=hr(Bre.keys),Sm=Vn("form-control-color"),yae={marginStart:"1",[Sm.variable]:"colors.red.500",_dark:{[Sm.variable]:"colors.red.300"},color:Sm.reference},bae={mt:"2",[Sm.variable]:"colors.gray.600",_dark:{[Sm.variable]:"colors.whiteAlpha.600"},color:Sm.reference,lineHeight:"normal",fontSize:"sm"},Sae=mae({container:{width:"100%",position:"relative"},requiredIndicator:yae,helperText:bae}),xae=vae({baseStyle:Sae}),{definePartsStyle:wae,defineMultiStyleConfig:Cae}=hr($re.keys),xm=Vn("form-error-color"),_ae={[xm.variable]:"colors.red.500",_dark:{[xm.variable]:"colors.red.300"},color:xm.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},kae={marginEnd:"0.5em",[xm.variable]:"colors.red.500",_dark:{[xm.variable]:"colors.red.300"},color:xm.reference},Eae=wae({text:_ae,icon:kae}),Pae=Cae({baseStyle:Eae}),Tae={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Lae={baseStyle:Tae},Aae={fontFamily:"heading",fontWeight:"bold"},Oae={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},Mae={baseStyle:Aae,sizes:Oae,defaultProps:{size:"xl"}},{definePartsStyle:Gu,defineMultiStyleConfig:Iae}=hr(Fre.keys),Rae=Gu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),ld={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},Dae={lg:Gu({field:ld.lg,addon:ld.lg}),md:Gu({field:ld.md,addon:ld.md}),sm:Gu({field:ld.sm,addon:ld.sm}),xs:Gu({field:ld.xs,addon:ld.xs})};function D_(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Et("blue.500","blue.300")(e),errorBorderColor:n||Et("red.500","red.300")(e)}}var Nae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Et("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r),boxShadow:`0 0 0 1px ${ko(t,r)}`},_focusVisible:{zIndex:1,borderColor:ko(t,n),boxShadow:`0 0 0 1px ${ko(t,n)}`}},addon:{border:"1px solid",borderColor:Et("inherit","whiteAlpha.50")(e),bg:Et("gray.100","whiteAlpha.300")(e)}}}),jae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e),_hover:{bg:Et("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r)},_focusVisible:{bg:"transparent",borderColor:ko(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e)}}}),Bae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r),boxShadow:`0px 1px 0px 0px ${ko(t,r)}`},_focusVisible:{borderColor:ko(t,n),boxShadow:`0px 1px 0px 0px ${ko(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),$ae=Gu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),Fae={outline:Nae,filled:jae,flushed:Bae,unstyled:$ae},kn=Iae({baseStyle:Rae,sizes:Dae,variants:Fae,defaultProps:{size:"md",variant:"outline"}}),i6=Vn("kbd-bg"),zae={[i6.variable]:"colors.gray.100",_dark:{[i6.variable]:"colors.whiteAlpha.100"},bg:i6.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Hae={baseStyle:zae},Vae={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Wae={baseStyle:Vae},{defineMultiStyleConfig:Uae,definePartsStyle:Gae}=hr(zre.keys),qae={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Yae=Gae({icon:qae}),Kae=Uae({baseStyle:Yae}),{defineMultiStyleConfig:Xae,definePartsStyle:Zae}=hr(Hre.keys),$l=Vn("menu-bg"),o6=Vn("menu-shadow"),Qae={[$l.variable]:"#fff",[o6.variable]:"shadows.sm",_dark:{[$l.variable]:"colors.gray.700",[o6.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:$l.reference,boxShadow:o6.reference},Jae={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[$l.variable]:"colors.gray.100",_dark:{[$l.variable]:"colors.whiteAlpha.100"}},_active:{[$l.variable]:"colors.gray.200",_dark:{[$l.variable]:"colors.whiteAlpha.200"}},_expanded:{[$l.variable]:"colors.gray.100",_dark:{[$l.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:$l.reference},ese={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},tse={opacity:.6},nse={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},rse={transitionProperty:"common",transitionDuration:"normal"},ise=Zae({button:rse,list:Qae,item:Jae,groupTitle:ese,command:tse,divider:nse}),ose=Xae({baseStyle:ise}),{defineMultiStyleConfig:ase,definePartsStyle:y7}=hr(Vre.keys),sse={bg:"blackAlpha.600",zIndex:"modal"},lse=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},use=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:Et("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:Et("lg","dark-lg")(e)}},cse={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},dse={position:"absolute",top:"2",insetEnd:"3"},fse=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},hse={px:"6",py:"4"},pse=y7(e=>({overlay:sse,dialogContainer:To(lse,e),dialog:To(use,e),header:cse,closeButton:dse,body:To(fse,e),footer:hse}));function Is(e){return y7(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var gse={xs:Is("xs"),sm:Is("sm"),md:Is("md"),lg:Is("lg"),xl:Is("xl"),"2xl":Is("2xl"),"3xl":Is("3xl"),"4xl":Is("4xl"),"5xl":Is("5xl"),"6xl":Is("6xl"),full:Is("full")},mse=ase({baseStyle:pse,sizes:gse,defaultProps:{size:"md"}}),vse={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},fB=vse,{defineMultiStyleConfig:yse,definePartsStyle:hB}=hr(Wre.keys),N_=yi("number-input-stepper-width"),pB=yi("number-input-input-padding"),bse=Uu(N_).add("0.5rem").toString(),a6=yi("number-input-bg"),s6=yi("number-input-color"),l6=yi("number-input-border-color"),Sse={[N_.variable]:"sizes.6",[pB.variable]:bse},xse=e=>{var t;return((t=To(kn.baseStyle,e))==null?void 0:t.field)??{}},wse={width:N_.reference},Cse={borderStart:"1px solid",borderStartColor:l6.reference,color:s6.reference,bg:a6.reference,[s6.variable]:"colors.chakra-body-text",[l6.variable]:"colors.chakra-border-color",_dark:{[s6.variable]:"colors.whiteAlpha.800",[l6.variable]:"colors.whiteAlpha.300"},_active:{[a6.variable]:"colors.gray.200",_dark:{[a6.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},_se=hB(e=>({root:Sse,field:To(xse,e)??{},stepperGroup:wse,stepper:Cse}));function G3(e){var t,n;const r=(t=kn.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},o=((n=r.field)==null?void 0:n.fontSize)??"md",a=fB.fontSizes[o];return hB({field:{...r.field,paddingInlineEnd:pB.reference,verticalAlign:"top"},stepper:{fontSize:Uu(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var kse={xs:G3("xs"),sm:G3("sm"),md:G3("md"),lg:G3("lg")},Ese=yse({baseStyle:_se,sizes:kse,variants:kn.variants,defaultProps:kn.defaultProps}),KL,Pse={...(KL=kn.baseStyle)==null?void 0:KL.field,textAlign:"center"},Tse={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},XL,Lse={outline:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((XL=kn.variants)==null?void 0:XL.unstyled.field)??{}},Ase={baseStyle:Pse,sizes:Tse,variants:Lse,defaultProps:kn.defaultProps},{defineMultiStyleConfig:Ose,definePartsStyle:Mse}=hr(Ure.keys),q3=yi("popper-bg"),Ise=yi("popper-arrow-bg"),ZL=yi("popper-arrow-shadow-color"),Rse={zIndex:10},Dse={[q3.variable]:"colors.white",bg:q3.reference,[Ise.variable]:q3.reference,[ZL.variable]:"colors.gray.200",_dark:{[q3.variable]:"colors.gray.700",[ZL.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},Nse={px:3,py:2,borderBottomWidth:"1px"},jse={px:3,py:2},Bse={px:3,py:2,borderTopWidth:"1px"},$se={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},Fse=Mse({popper:Rse,content:Dse,header:Nse,body:jse,footer:Bse,closeButton:$se}),zse=Ose({baseStyle:Fse}),{defineMultiStyleConfig:Hse,definePartsStyle:bv}=hr(Gre.keys),Vse=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=Et(VL(),VL("1rem","rgba(0,0,0,0.1)"))(e),a=Et(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( + )`,backgroundSize:`${e} ${e}`}}function Cie(e){const t=rB().toHexString();return!e||Sie(e)?t:e.string&&e.colors?kie(e.string,e.colors):e.string&&!e.colors?_ie(e.string):e.colors&&!e.string?Eie(e.colors):t}function _ie(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function kie(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function I_(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function Pie(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function sB(e){return Pie(e)&&e.reference?e.reference:String(e)}var jS=(e,...t)=>t.map(sB).join(` ${e} `).replace(/calc/g,""),UL=(...e)=>`calc(${jS("+",...e)})`,GL=(...e)=>`calc(${jS("-",...e)})`,m7=(...e)=>`calc(${jS("*",...e)})`,qL=(...e)=>`calc(${jS("/",...e)})`,YL=e=>{const t=sB(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:m7(t,-1)},Uu=Object.assign(e=>({add:(...t)=>Uu(UL(e,...t)),subtract:(...t)=>Uu(GL(e,...t)),multiply:(...t)=>Uu(m7(e,...t)),divide:(...t)=>Uu(qL(e,...t)),negate:()=>Uu(YL(e)),toString:()=>e.toString()}),{add:UL,subtract:GL,multiply:m7,divide:qL,negate:YL});function Tie(e){return!Number.isInteger(parseFloat(e.toString()))}function Lie(e,t="-"){return e.replace(/\s+/g,t)}function lB(e){const t=Lie(e.toString());return t.includes("\\.")?e:Tie(e)?t.replace(".","\\."):e}function Aie(e,t=""){return[t,lB(e)].filter(Boolean).join("-")}function Oie(e,t){return`var(${lB(e)}${t?`, ${t}`:""})`}function Mie(e,t=""){return`--${Aie(e,t)}`}function yi(e,t){const n=Mie(e,t==null?void 0:t.prefix);return{variable:n,reference:Oie(n,Iie(t==null?void 0:t.fallback))}}function Iie(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{definePartsStyle:Rie,defineMultiStyleConfig:Die}=pr(Ore.keys),Nie={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},jie={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Bie={pt:"2",px:"4",pb:"5"},Fie={fontSize:"1.25em"},$ie=Rie({container:Nie,button:jie,panel:Bie,icon:Fie}),zie=Die({baseStyle:$ie}),{definePartsStyle:yy,defineMultiStyleConfig:Hie}=pr(Mre.keys),La=Vn("alert-fg"),ec=Vn("alert-bg"),Vie=yy({container:{bg:ec.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:La.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:La.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function R_(e){const{theme:t,colorScheme:n}=e,r=Gm(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Wie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark}}}}),Uie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:La.reference}}}),Gie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:La.reference}}}),qie=yy(e=>{const{colorScheme:t}=e;return{container:{[La.variable]:"colors.white",[ec.variable]:`colors.${t}.500`,_dark:{[La.variable]:"colors.gray.900",[ec.variable]:`colors.${t}.200`},color:La.reference}}}),Yie={subtle:Wie,"left-accent":Uie,"top-accent":Gie,solid:qie},Kie=Hie({baseStyle:Vie,variants:Yie,defaultProps:{variant:"subtle",colorScheme:"blue"}}),uB={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Xie={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},Zie={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},Qie={...uB,...Xie,container:Zie},cB=Qie,Jie=e=>typeof e=="function";function To(e,...t){return Jie(e)?e(...t):e}var{definePartsStyle:dB,defineMultiStyleConfig:eoe}=pr(Ire.keys),ym=Vn("avatar-border-color"),t6=Vn("avatar-bg"),toe={borderRadius:"full",border:"0.2em solid",[ym.variable]:"white",_dark:{[ym.variable]:"colors.gray.800"},borderColor:ym.reference},noe={[t6.variable]:"colors.gray.200",_dark:{[t6.variable]:"colors.whiteAlpha.400"},bgColor:t6.reference},KL=Vn("avatar-background"),roe=e=>{const{name:t,theme:n}=e,r=t?Cie({string:t}):"colors.gray.400",i=wie(r)(n);let o="white";return i||(o="gray.800"),{bg:KL.reference,"&:not([data-loaded])":{[KL.variable]:r},color:o,[ym.variable]:"colors.white",_dark:{[ym.variable]:"colors.gray.800"},borderColor:ym.reference,verticalAlign:"top"}},ioe=dB(e=>({badge:To(toe,e),excessLabel:To(noe,e),container:To(roe,e)}));function sd(e){const t=e!=="100%"?cB[e]:void 0;return dB({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var ooe={"2xs":sd(4),xs:sd(6),sm:sd(8),md:sd(12),lg:sd(16),xl:sd(24),"2xl":sd(32),full:sd("100%")},aoe=eoe({baseStyle:ioe,sizes:ooe,defaultProps:{size:"md"}}),soe={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},bm=Vn("badge-bg"),ql=Vn("badge-color"),loe=e=>{const{colorScheme:t,theme:n}=e,r=Gm(`${t}.500`,.6)(n);return{[bm.variable]:`colors.${t}.500`,[ql.variable]:"colors.white",_dark:{[bm.variable]:r,[ql.variable]:"colors.whiteAlpha.800"},bg:bm.reference,color:ql.reference}},uoe=e=>{const{colorScheme:t,theme:n}=e,r=Gm(`${t}.200`,.16)(n);return{[bm.variable]:`colors.${t}.100`,[ql.variable]:`colors.${t}.800`,_dark:{[bm.variable]:r,[ql.variable]:`colors.${t}.200`},bg:bm.reference,color:ql.reference}},coe=e=>{const{colorScheme:t,theme:n}=e,r=Gm(`${t}.200`,.8)(n);return{[ql.variable]:`colors.${t}.500`,_dark:{[ql.variable]:r},color:ql.reference,boxShadow:`inset 0 0 0px 1px ${ql.reference}`}},doe={solid:loe,subtle:uoe,outline:coe},$v={baseStyle:soe,variants:doe,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:foe,definePartsStyle:hoe}=pr(Rre.keys),poe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},goe=hoe({link:poe}),moe=foe({baseStyle:goe}),voe={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},fB=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Et("inherit","whiteAlpha.900")(e),_hover:{bg:Et("gray.100","whiteAlpha.200")(e)},_active:{bg:Et("gray.200","whiteAlpha.300")(e)}};const r=Gm(`${t}.200`,.12)(n),i=Gm(`${t}.200`,.24)(n);return{color:Et(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Et(`${t}.50`,r)(e)},_active:{bg:Et(`${t}.100`,i)(e)}}},yoe=e=>{const{colorScheme:t}=e,n=Et("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...To(fB,e)}},boe={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Soe=e=>{const{colorScheme:t}=e;if(t==="gray"){const s=Et("gray.100","whiteAlpha.200")(e);return{bg:s,_hover:{bg:Et("gray.200","whiteAlpha.300")(e),_disabled:{bg:s}},_active:{bg:Et("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=boe[t]??{},a=Et(n,`${t}.200`)(e);return{bg:a,color:Et(r,"gray.800")(e),_hover:{bg:Et(i,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:Et(o,`${t}.400`)(e)}}},xoe=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Et(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Et(`${t}.700`,`${t}.500`)(e)}}},woe={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},Coe={ghost:fB,outline:yoe,solid:Soe,link:xoe,unstyled:woe},_oe={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},koe={baseStyle:voe,variants:Coe,sizes:_oe,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Ih,defineMultiStyleConfig:Eoe}=pr(tie.keys),K4=Vn("card-bg"),Sm=Vn("card-padding"),Poe=Ih({container:{[K4.variable]:"chakra-body-bg",backgroundColor:K4.reference,color:"chakra-body-text"},body:{padding:Sm.reference,flex:"1 1 0%"},header:{padding:Sm.reference},footer:{padding:Sm.reference}}),Toe={sm:Ih({container:{borderRadius:"base",[Sm.variable]:"space.3"}}),md:Ih({container:{borderRadius:"md",[Sm.variable]:"space.5"}}),lg:Ih({container:{borderRadius:"xl",[Sm.variable]:"space.7"}})},Loe={elevated:Ih({container:{boxShadow:"base",_dark:{[K4.variable]:"colors.gray.700"}}}),outline:Ih({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:Ih({container:{[K4.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},Aoe=Eoe({baseStyle:Poe,variants:Loe,sizes:Toe,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:c4,defineMultiStyleConfig:Ooe}=pr(Dre.keys),zv=Vn("checkbox-size"),Moe=e=>{const{colorScheme:t}=e;return{w:zv.reference,h:zv.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e),_hover:{bg:Et(`${t}.600`,`${t}.300`)(e),borderColor:Et(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Et("gray.200","transparent")(e),bg:Et("gray.200","whiteAlpha.300")(e),color:Et("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e)},_disabled:{bg:Et("gray.100","whiteAlpha.100")(e),borderColor:Et("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Et("red.500","red.300")(e)}}},Ioe={_disabled:{cursor:"not-allowed"}},Roe={userSelect:"none",_disabled:{opacity:.4}},Doe={transitionProperty:"transform",transitionDuration:"normal"},Noe=c4(e=>({icon:Doe,container:Ioe,control:To(Moe,e),label:Roe})),joe={sm:c4({control:{[zv.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:c4({control:{[zv.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:c4({control:{[zv.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},X4=Ooe({baseStyle:Noe,sizes:joe,defaultProps:{size:"md",colorScheme:"blue"}}),Hv=yi("close-button-size"),W1=yi("close-button-bg"),Boe={w:[Hv.reference],h:[Hv.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[W1.variable]:"colors.blackAlpha.100",_dark:{[W1.variable]:"colors.whiteAlpha.100"}},_active:{[W1.variable]:"colors.blackAlpha.200",_dark:{[W1.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:W1.reference},Foe={lg:{[Hv.variable]:"sizes.10",fontSize:"md"},md:{[Hv.variable]:"sizes.8",fontSize:"xs"},sm:{[Hv.variable]:"sizes.6",fontSize:"2xs"}},$oe={baseStyle:Boe,sizes:Foe,defaultProps:{size:"md"}},{variants:zoe,defaultProps:Hoe}=$v,Voe={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Woe={baseStyle:Voe,variants:zoe,defaultProps:Hoe},Uoe={w:"100%",mx:"auto",maxW:"prose",px:"4"},Goe={baseStyle:Uoe},qoe={opacity:.6,borderColor:"inherit"},Yoe={borderStyle:"solid"},Koe={borderStyle:"dashed"},Xoe={solid:Yoe,dashed:Koe},Zoe={baseStyle:qoe,variants:Xoe,defaultProps:{variant:"solid"}},{definePartsStyle:v7,defineMultiStyleConfig:Qoe}=pr(Nre.keys),n6=Vn("drawer-bg"),r6=Vn("drawer-box-shadow");function kg(e){return v7(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Joe={bg:"blackAlpha.600",zIndex:"overlay"},eae={display:"flex",zIndex:"modal",justifyContent:"center"},tae=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[n6.variable]:"colors.white",[r6.variable]:"shadows.lg",_dark:{[n6.variable]:"colors.gray.700",[r6.variable]:"shadows.dark-lg"},bg:n6.reference,boxShadow:r6.reference}},nae={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},rae={position:"absolute",top:"2",insetEnd:"3"},iae={px:"6",py:"2",flex:"1",overflow:"auto"},oae={px:"6",py:"4"},aae=v7(e=>({overlay:Joe,dialogContainer:eae,dialog:To(tae,e),header:nae,closeButton:rae,body:iae,footer:oae})),sae={xs:kg("xs"),sm:kg("md"),md:kg("lg"),lg:kg("2xl"),xl:kg("4xl"),full:kg("full")},lae=Qoe({baseStyle:aae,sizes:sae,defaultProps:{size:"xs"}}),{definePartsStyle:uae,defineMultiStyleConfig:cae}=pr(jre.keys),dae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},fae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},hae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},pae=uae({preview:dae,input:fae,textarea:hae}),gae=cae({baseStyle:pae}),{definePartsStyle:mae,defineMultiStyleConfig:vae}=pr(Bre.keys),xm=Vn("form-control-color"),yae={marginStart:"1",[xm.variable]:"colors.red.500",_dark:{[xm.variable]:"colors.red.300"},color:xm.reference},bae={mt:"2",[xm.variable]:"colors.gray.600",_dark:{[xm.variable]:"colors.whiteAlpha.600"},color:xm.reference,lineHeight:"normal",fontSize:"sm"},Sae=mae({container:{width:"100%",position:"relative"},requiredIndicator:yae,helperText:bae}),xae=vae({baseStyle:Sae}),{definePartsStyle:wae,defineMultiStyleConfig:Cae}=pr(Fre.keys),wm=Vn("form-error-color"),_ae={[wm.variable]:"colors.red.500",_dark:{[wm.variable]:"colors.red.300"},color:wm.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},kae={marginEnd:"0.5em",[wm.variable]:"colors.red.500",_dark:{[wm.variable]:"colors.red.300"},color:wm.reference},Eae=wae({text:_ae,icon:kae}),Pae=Cae({baseStyle:Eae}),Tae={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Lae={baseStyle:Tae},Aae={fontFamily:"heading",fontWeight:"bold"},Oae={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},Mae={baseStyle:Aae,sizes:Oae,defaultProps:{size:"xl"}},{definePartsStyle:Gu,defineMultiStyleConfig:Iae}=pr($re.keys),Rae=Gu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),ld={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},Dae={lg:Gu({field:ld.lg,addon:ld.lg}),md:Gu({field:ld.md,addon:ld.md}),sm:Gu({field:ld.sm,addon:ld.sm}),xs:Gu({field:ld.xs,addon:ld.xs})};function D_(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Et("blue.500","blue.300")(e),errorBorderColor:n||Et("red.500","red.300")(e)}}var Nae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Et("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r),boxShadow:`0 0 0 1px ${ko(t,r)}`},_focusVisible:{zIndex:1,borderColor:ko(t,n),boxShadow:`0 0 0 1px ${ko(t,n)}`}},addon:{border:"1px solid",borderColor:Et("inherit","whiteAlpha.50")(e),bg:Et("gray.100","whiteAlpha.300")(e)}}}),jae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e),_hover:{bg:Et("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r)},_focusVisible:{bg:"transparent",borderColor:ko(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e)}}}),Bae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r),boxShadow:`0px 1px 0px 0px ${ko(t,r)}`},_focusVisible:{borderColor:ko(t,n),boxShadow:`0px 1px 0px 0px ${ko(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),Fae=Gu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),$ae={outline:Nae,filled:jae,flushed:Bae,unstyled:Fae},kn=Iae({baseStyle:Rae,sizes:Dae,variants:$ae,defaultProps:{size:"md",variant:"outline"}}),i6=Vn("kbd-bg"),zae={[i6.variable]:"colors.gray.100",_dark:{[i6.variable]:"colors.whiteAlpha.100"},bg:i6.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Hae={baseStyle:zae},Vae={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Wae={baseStyle:Vae},{defineMultiStyleConfig:Uae,definePartsStyle:Gae}=pr(zre.keys),qae={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Yae=Gae({icon:qae}),Kae=Uae({baseStyle:Yae}),{defineMultiStyleConfig:Xae,definePartsStyle:Zae}=pr(Hre.keys),Fl=Vn("menu-bg"),o6=Vn("menu-shadow"),Qae={[Fl.variable]:"#fff",[o6.variable]:"shadows.sm",_dark:{[Fl.variable]:"colors.gray.700",[o6.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Fl.reference,boxShadow:o6.reference},Jae={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Fl.variable]:"colors.gray.100",_dark:{[Fl.variable]:"colors.whiteAlpha.100"}},_active:{[Fl.variable]:"colors.gray.200",_dark:{[Fl.variable]:"colors.whiteAlpha.200"}},_expanded:{[Fl.variable]:"colors.gray.100",_dark:{[Fl.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Fl.reference},ese={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},tse={opacity:.6},nse={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},rse={transitionProperty:"common",transitionDuration:"normal"},ise=Zae({button:rse,list:Qae,item:Jae,groupTitle:ese,command:tse,divider:nse}),ose=Xae({baseStyle:ise}),{defineMultiStyleConfig:ase,definePartsStyle:y7}=pr(Vre.keys),sse={bg:"blackAlpha.600",zIndex:"modal"},lse=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},use=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:Et("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:Et("lg","dark-lg")(e)}},cse={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},dse={position:"absolute",top:"2",insetEnd:"3"},fse=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},hse={px:"6",py:"4"},pse=y7(e=>({overlay:sse,dialogContainer:To(lse,e),dialog:To(use,e),header:cse,closeButton:dse,body:To(fse,e),footer:hse}));function Is(e){return y7(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var gse={xs:Is("xs"),sm:Is("sm"),md:Is("md"),lg:Is("lg"),xl:Is("xl"),"2xl":Is("2xl"),"3xl":Is("3xl"),"4xl":Is("4xl"),"5xl":Is("5xl"),"6xl":Is("6xl"),full:Is("full")},mse=ase({baseStyle:pse,sizes:gse,defaultProps:{size:"md"}}),vse={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},hB=vse,{defineMultiStyleConfig:yse,definePartsStyle:pB}=pr(Wre.keys),N_=yi("number-input-stepper-width"),gB=yi("number-input-input-padding"),bse=Uu(N_).add("0.5rem").toString(),a6=yi("number-input-bg"),s6=yi("number-input-color"),l6=yi("number-input-border-color"),Sse={[N_.variable]:"sizes.6",[gB.variable]:bse},xse=e=>{var t;return((t=To(kn.baseStyle,e))==null?void 0:t.field)??{}},wse={width:N_.reference},Cse={borderStart:"1px solid",borderStartColor:l6.reference,color:s6.reference,bg:a6.reference,[s6.variable]:"colors.chakra-body-text",[l6.variable]:"colors.chakra-border-color",_dark:{[s6.variable]:"colors.whiteAlpha.800",[l6.variable]:"colors.whiteAlpha.300"},_active:{[a6.variable]:"colors.gray.200",_dark:{[a6.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},_se=pB(e=>({root:Sse,field:To(xse,e)??{},stepperGroup:wse,stepper:Cse}));function G3(e){var t,n;const r=(t=kn.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},o=((n=r.field)==null?void 0:n.fontSize)??"md",a=hB.fontSizes[o];return pB({field:{...r.field,paddingInlineEnd:gB.reference,verticalAlign:"top"},stepper:{fontSize:Uu(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var kse={xs:G3("xs"),sm:G3("sm"),md:G3("md"),lg:G3("lg")},Ese=yse({baseStyle:_se,sizes:kse,variants:kn.variants,defaultProps:kn.defaultProps}),XL,Pse={...(XL=kn.baseStyle)==null?void 0:XL.field,textAlign:"center"},Tse={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},ZL,Lse={outline:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((ZL=kn.variants)==null?void 0:ZL.unstyled.field)??{}},Ase={baseStyle:Pse,sizes:Tse,variants:Lse,defaultProps:kn.defaultProps},{defineMultiStyleConfig:Ose,definePartsStyle:Mse}=pr(Ure.keys),q3=yi("popper-bg"),Ise=yi("popper-arrow-bg"),QL=yi("popper-arrow-shadow-color"),Rse={zIndex:10},Dse={[q3.variable]:"colors.white",bg:q3.reference,[Ise.variable]:q3.reference,[QL.variable]:"colors.gray.200",_dark:{[q3.variable]:"colors.gray.700",[QL.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},Nse={px:3,py:2,borderBottomWidth:"1px"},jse={px:3,py:2},Bse={px:3,py:2,borderTopWidth:"1px"},Fse={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},$se=Mse({popper:Rse,content:Dse,header:Nse,body:jse,footer:Bse,closeButton:Fse}),zse=Ose({baseStyle:$se}),{defineMultiStyleConfig:Hse,definePartsStyle:Sv}=pr(Gre.keys),Vse=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=Et(WL(),WL("1rem","rgba(0,0,0,0.1)"))(e),a=Et(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( to right, transparent 0%, ${ko(n,a)} 50%, transparent 100% - )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},Wse={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Use=e=>({bg:Et("gray.100","whiteAlpha.300")(e)}),Gse=e=>({transitionProperty:"common",transitionDuration:"slow",...Vse(e)}),qse=bv(e=>({label:Wse,filledTrack:Gse(e),track:Use(e)})),Yse={xs:bv({track:{h:"1"}}),sm:bv({track:{h:"2"}}),md:bv({track:{h:"3"}}),lg:bv({track:{h:"4"}})},Kse=Hse({sizes:Yse,baseStyle:qse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Xse,definePartsStyle:d4}=hr(qre.keys),Zse=e=>{var t;const n=(t=To(X4.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Qse=d4(e=>{var t,n,r,i;return{label:(n=(t=X4).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=X4).baseStyle)==null?void 0:i.call(r,e).container,control:Zse(e)}}),Jse={md:d4({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:d4({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:d4({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},ele=Xse({baseStyle:Qse,sizes:Jse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:tle,definePartsStyle:nle}=hr(Yre.keys),Y3=Vn("select-bg"),QL,rle={...(QL=kn.baseStyle)==null?void 0:QL.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Y3.reference,[Y3.variable]:"colors.white",_dark:{[Y3.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Y3.reference}},ile={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},ole=nle({field:rle,icon:ile}),K3={paddingInlineEnd:"8"},JL,eA,tA,nA,rA,iA,oA,aA,ale={lg:{...(JL=kn.sizes)==null?void 0:JL.lg,field:{...(eA=kn.sizes)==null?void 0:eA.lg.field,...K3}},md:{...(tA=kn.sizes)==null?void 0:tA.md,field:{...(nA=kn.sizes)==null?void 0:nA.md.field,...K3}},sm:{...(rA=kn.sizes)==null?void 0:rA.sm,field:{...(iA=kn.sizes)==null?void 0:iA.sm.field,...K3}},xs:{...(oA=kn.sizes)==null?void 0:oA.xs,field:{...(aA=kn.sizes)==null?void 0:aA.xs.field,...K3},icon:{insetEnd:"1"}}},sle=tle({baseStyle:ole,sizes:ale,variants:kn.variants,defaultProps:kn.defaultProps}),u6=Vn("skeleton-start-color"),c6=Vn("skeleton-end-color"),lle={[u6.variable]:"colors.gray.100",[c6.variable]:"colors.gray.400",_dark:{[u6.variable]:"colors.gray.800",[c6.variable]:"colors.gray.600"},background:u6.reference,borderColor:c6.reference,opacity:.7,borderRadius:"sm"},ule={baseStyle:lle},d6=Vn("skip-link-bg"),cle={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[d6.variable]:"colors.white",_dark:{[d6.variable]:"colors.gray.700"},bg:d6.reference}},dle={baseStyle:cle},{defineMultiStyleConfig:fle,definePartsStyle:BS}=hr(Kre.keys),_2=Vn("slider-thumb-size"),k2=Vn("slider-track-size"),bd=Vn("slider-bg"),hle=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...I_({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},ple=e=>({...I_({orientation:e.orientation,horizontal:{h:k2.reference},vertical:{w:k2.reference}}),overflow:"hidden",borderRadius:"sm",[bd.variable]:"colors.gray.200",_dark:{[bd.variable]:"colors.whiteAlpha.200"},_disabled:{[bd.variable]:"colors.gray.300",_dark:{[bd.variable]:"colors.whiteAlpha.300"}},bg:bd.reference}),gle=e=>{const{orientation:t}=e;return{...I_({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:_2.reference,h:_2.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},mle=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[bd.variable]:`colors.${t}.500`,_dark:{[bd.variable]:`colors.${t}.200`},bg:bd.reference}},vle=BS(e=>({container:hle(e),track:ple(e),thumb:gle(e),filledTrack:mle(e)})),yle=BS({container:{[_2.variable]:"sizes.4",[k2.variable]:"sizes.1"}}),ble=BS({container:{[_2.variable]:"sizes.3.5",[k2.variable]:"sizes.1"}}),Sle=BS({container:{[_2.variable]:"sizes.2.5",[k2.variable]:"sizes.0.5"}}),xle={lg:yle,md:ble,sm:Sle},wle=fle({baseStyle:vle,sizes:xle,defaultProps:{size:"md",colorScheme:"blue"}}),xh=yi("spinner-size"),Cle={width:[xh.reference],height:[xh.reference]},_le={xs:{[xh.variable]:"sizes.3"},sm:{[xh.variable]:"sizes.4"},md:{[xh.variable]:"sizes.6"},lg:{[xh.variable]:"sizes.8"},xl:{[xh.variable]:"sizes.12"}},kle={baseStyle:Cle,sizes:_le,defaultProps:{size:"md"}},{defineMultiStyleConfig:Ele,definePartsStyle:gB}=hr(Xre.keys),Ple={fontWeight:"medium"},Tle={opacity:.8,marginBottom:"2"},Lle={verticalAlign:"baseline",fontWeight:"semibold"},Ale={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},Ole=gB({container:{},label:Ple,helpText:Tle,number:Lle,icon:Ale}),Mle={md:gB({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},Ile=Ele({baseStyle:Ole,sizes:Mle,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Rle,definePartsStyle:f4}=hr(Zre.keys),Vv=yi("switch-track-width"),Ih=yi("switch-track-height"),f6=yi("switch-track-diff"),Dle=Uu.subtract(Vv,Ih),b7=yi("switch-thumb-x"),W1=yi("switch-bg"),Nle=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Vv.reference],height:[Ih.reference],transitionProperty:"common",transitionDuration:"fast",[W1.variable]:"colors.gray.300",_dark:{[W1.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[W1.variable]:`colors.${t}.500`,_dark:{[W1.variable]:`colors.${t}.200`}},bg:W1.reference}},jle={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Ih.reference],height:[Ih.reference],_checked:{transform:`translateX(${b7.reference})`}},Ble=f4(e=>({container:{[f6.variable]:Dle,[b7.variable]:f6.reference,_rtl:{[b7.variable]:Uu(f6).negate().toString()}},track:Nle(e),thumb:jle})),$le={sm:f4({container:{[Vv.variable]:"1.375rem",[Ih.variable]:"sizes.3"}}),md:f4({container:{[Vv.variable]:"1.875rem",[Ih.variable]:"sizes.4"}}),lg:f4({container:{[Vv.variable]:"2.875rem",[Ih.variable]:"sizes.6"}})},Fle=Rle({baseStyle:Ble,sizes:$le,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:zle,definePartsStyle:wm}=hr(Qre.keys),Hle=wm({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Z4={"&[data-is-numeric=true]":{textAlign:"end"}},Vle=wm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},caption:{color:Et("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Wle=wm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},caption:{color:Et("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e)},td:{background:Et(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Ule={simple:Vle,striped:Wle,unstyled:{}},Gle={sm:wm({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:wm({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:wm({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},qle=zle({baseStyle:Hle,variants:Ule,sizes:Gle,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Xo=Vn("tabs-color"),Vs=Vn("tabs-bg"),X3=Vn("tabs-border-color"),{defineMultiStyleConfig:Yle,definePartsStyle:Zl}=hr(Jre.keys),Kle=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},Xle=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Zle=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},Qle={p:4},Jle=Zl(e=>({root:Kle(e),tab:Xle(e),tablist:Zle(e),tabpanel:Qle})),eue={sm:Zl({tab:{py:1,px:4,fontSize:"sm"}}),md:Zl({tab:{fontSize:"md",py:2,px:4}}),lg:Zl({tab:{fontSize:"lg",py:3,px:4}})},tue=Zl(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Xo.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Vs.variable]:"colors.gray.200",_dark:{[Vs.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Xo.reference,bg:Vs.reference}}}),nue=Zl(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[X3.reference]:"transparent",_selected:{[Xo.variable]:`colors.${t}.600`,[X3.variable]:"colors.white",_dark:{[Xo.variable]:`colors.${t}.300`,[X3.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:X3.reference},color:Xo.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),rue=Zl(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Vs.variable]:"colors.gray.50",_dark:{[Vs.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Vs.variable]:"colors.white",[Xo.variable]:`colors.${t}.600`,_dark:{[Vs.variable]:"colors.gray.800",[Xo.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Xo.reference,bg:Vs.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),iue=Zl(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ko(n,`${t}.700`),bg:ko(n,`${t}.100`)}}}}),oue=Zl(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Xo.variable]:"colors.gray.600",_dark:{[Xo.variable]:"inherit"},_selected:{[Xo.variable]:"colors.white",[Vs.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:"colors.gray.800",[Vs.variable]:`colors.${t}.300`}},color:Xo.reference,bg:Vs.reference}}}),aue=Zl({}),sue={line:tue,enclosed:nue,"enclosed-colored":rue,"soft-rounded":iue,"solid-rounded":oue,unstyled:aue},lue=Yle({baseStyle:Jle,sizes:eue,variants:sue,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:uue,definePartsStyle:Rh}=hr(eie.keys),cue={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},due={lineHeight:1.2,overflow:"visible"},fue={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},hue=Rh({container:cue,label:due,closeButton:fue}),pue={sm:Rh({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Rh({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Rh({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},gue={subtle:Rh(e=>{var t;return{container:(t=Fv.variants)==null?void 0:t.subtle(e)}}),solid:Rh(e=>{var t;return{container:(t=Fv.variants)==null?void 0:t.solid(e)}}),outline:Rh(e=>{var t;return{container:(t=Fv.variants)==null?void 0:t.outline(e)}})},mue=uue({variants:gue,baseStyle:hue,sizes:pue,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),sA,vue={...(sA=kn.baseStyle)==null?void 0:sA.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},lA,yue={outline:e=>{var t;return((t=kn.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=kn.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=kn.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((lA=kn.variants)==null?void 0:lA.unstyled.field)??{}},uA,cA,dA,fA,bue={xs:((uA=kn.sizes)==null?void 0:uA.xs.field)??{},sm:((cA=kn.sizes)==null?void 0:cA.sm.field)??{},md:((dA=kn.sizes)==null?void 0:dA.md.field)??{},lg:((fA=kn.sizes)==null?void 0:fA.lg.field)??{}},Sue={baseStyle:vue,sizes:bue,variants:yue,defaultProps:{size:"md",variant:"outline"}},Z3=yi("tooltip-bg"),h6=yi("tooltip-fg"),xue=yi("popper-arrow-bg"),wue={bg:Z3.reference,color:h6.reference,[Z3.variable]:"colors.gray.700",[h6.variable]:"colors.whiteAlpha.900",_dark:{[Z3.variable]:"colors.gray.300",[h6.variable]:"colors.gray.900"},[xue.variable]:Z3.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},Cue={baseStyle:wue},_ue={Accordion:zie,Alert:Kie,Avatar:aoe,Badge:Fv,Breadcrumb:moe,Button:koe,Checkbox:X4,CloseButton:Foe,Code:Woe,Container:Goe,Divider:Zoe,Drawer:lae,Editable:gae,Form:xae,FormError:Pae,FormLabel:Lae,Heading:Mae,Input:kn,Kbd:Hae,Link:Wae,List:Kae,Menu:ose,Modal:mse,NumberInput:Ese,PinInput:Ase,Popover:zse,Progress:Kse,Radio:ele,Select:sle,Skeleton:ule,SkipLink:dle,Slider:wle,Spinner:kle,Stat:Ile,Switch:Fle,Table:qle,Tabs:lue,Tag:mue,Textarea:Sue,Tooltip:Cue,Card:Aoe},kue={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Eue=kue,Pue={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Tue=Pue,Lue={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},Aue=Lue,Oue={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Mue=Oue,Iue={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},Rue=Iue,Due={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Nue={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},jue={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Bue={property:Due,easing:Nue,duration:jue},$ue=Bue,Fue={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},zue=Fue,Hue={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Vue=Hue,Wue={breakpoints:Tue,zIndices:zue,radii:Mue,blur:Vue,colors:Aue,...fB,sizes:uB,shadows:Rue,space:lB,borders:Eue,transition:$ue},Uue={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},Gue={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},que="ltr",Yue={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},Kue={semanticTokens:Uue,direction:que,...Wue,components:_ue,styles:Gue,config:Yue},Xue=typeof Element<"u",Zue=typeof Map=="function",Que=typeof Set=="function",Jue=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function h4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!h4(e[r],t[r]))return!1;return!0}var o;if(Zue&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!h4(r.value[1],t.get(r.value[0])))return!1;return!0}if(Que&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Jue&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(Xue&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!h4(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var ece=function(t,n){try{return h4(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function m0(){const e=w.useContext(w2);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function mB(){const e=gy(),t=m0();return{...e,theme:t}}function tce(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__breakpoints)==null?void 0:o.asArray)==null?void 0:a[i]};return r(t)??r(n)??n}function nce(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__cssMap)==null?void 0:o[i])==null?void 0:a.value};return r(t)??r(n)??n}function rce(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{if(e==="breakpoints")return tce(o,l,a[u]??l);const d=`${e}.${l}`;return nce(o,d,a[u]??l)});return Array.isArray(t)?s:s[0]}}function ice(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=w.useMemo(()=>Qte(n),[n]);return N.createElement(sre,{theme:i},N.createElement(oce,{root:t}),r)}function oce({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return N.createElement(DS,{styles:n=>({[t]:n.__cssVars})})}Cre({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function ace(){const{colorMode:e}=gy();return N.createElement(DS,{styles:t=>{const n=Zj(t,"styles.global"),r=eB(n,{theme:t,colorMode:e});return r?Lj(r)(t):void 0}})}var sce=new Set([...ene,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),lce=new Set(["htmlWidth","htmlHeight","htmlSize"]);function uce(e){return lce.has(e)||!sce.has(e)}var cce=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=Qj(a,(h,m)=>nne(m)),l=eB(e,t),u=Object.assign({},i,l,Jj(s),o),d=Lj(u)(t.theme);return r?[d,r]:d};function p6(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=uce);const i=cce({baseStyle:n}),o=p7(e,r)(i);return N.forwardRef(function(l,u){const{colorMode:d,forced:h}=gy();return N.createElement(o,{ref:u,"data-theme":h?d:void 0,...l})})}function Ae(e){return w.forwardRef(e)}function vB(e,t={}){const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=mB(),a=e?Zj(i,`components.${e}`):void 0,s=n||a,l=Gl({theme:i,colorMode:o},(s==null?void 0:s.defaultProps)??{},Jj(vre(r,["children"]))),u=w.useRef({});if(s){const h=fne(s)(l);ece(u.current,h)||(u.current=h)}return u.current}function Oo(e,t={}){return vB(e,t)}function Oi(e,t={}){return vB(e,t)}function dce(){const e=new Map;return new Proxy(p6,{apply(t,n,r){return p6(...r)},get(t,n){return e.has(n)||e.set(n,p6(n)),e.get(n)}})}var Ce=dce();function fce(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Pn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o}=e,a=w.createContext(void 0);a.displayName=t;function s(){var l;const u=w.useContext(a);if(!u&&n){const d=new Error(o??fce(r,i));throw d.name="ContextError",(l=Error.captureStackTrace)==null||l.call(Error,d,s),d}return u}return[a.Provider,s,a]}function hce(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Hn(...e){return t=>{e.forEach(n=>{hce(n,t)})}}function pce(...e){return w.useMemo(()=>Hn(...e),e)}function hA(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var gce=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function pA(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function gA(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var S7=typeof window<"u"?w.useLayoutEffect:w.useEffect,Q4=e=>e,mce=class{constructor(){sn(this,"descendants",new Map);sn(this,"register",e=>{if(e!=null)return gce(e)?this.registerNode(e):t=>{this.registerNode(t,e)}});sn(this,"unregister",e=>{this.descendants.delete(e);const t=hA(Array.from(this.descendants.keys()));this.assignIndex(t)});sn(this,"destroy",()=>{this.descendants.clear()});sn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})});sn(this,"count",()=>this.descendants.size);sn(this,"enabledCount",()=>this.enabledValues().length);sn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index));sn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled));sn(this,"item",e=>{if(this.count()!==0)return this.values()[e]});sn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]});sn(this,"first",()=>this.item(0));sn(this,"firstEnabled",()=>this.enabledItem(0));sn(this,"last",()=>this.item(this.descendants.size-1));sn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)});sn(this,"indexOf",e=>{var t;return e?((t=this.descendants.get(e))==null?void 0:t.index)??-1:-1});sn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e)));sn(this,"next",(e,t=!0)=>{const n=pA(e,this.count(),t);return this.item(n)});sn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=pA(r,this.enabledCount(),t);return this.enabledItem(i)});sn(this,"prev",(e,t=!0)=>{const n=gA(e,this.count()-1,t);return this.item(n)});sn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=gA(r,this.enabledCount()-1,t);return this.enabledItem(i)});sn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=hA(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function vce(){const e=w.useRef(new mce);return S7(()=>()=>e.current.destroy()),e.current}var[yce,yB]=Pn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function bce(e){const t=yB(),[n,r]=w.useState(-1),i=w.useRef(null);S7(()=>()=>{i.current&&t.unregister(i.current)},[]),S7(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=Q4(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:Hn(o,i)}}function bB(){return[Q4(yce),()=>Q4(yB()),()=>vce(),i=>bce(i)]}var Qr=(...e)=>e.filter(Boolean).join(" "),mA={path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})),viewBox:"0 0 24 24"},Na=Ae((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,d=Qr("chakra-icon",s),h={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},m={ref:t,focusable:o,className:d,__css:h},v=r??mA.viewBox;if(n&&typeof n!="string")return N.createElement(Ce.svg,{as:n,...m,...u});const b=a??mA.path;return N.createElement(Ce.svg,{verticalAlign:"middle",viewBox:v,...m,...u},b)});Na.displayName="Icon";function yt(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=w.Children.toArray(e.path),a=Ae((s,l)=>N.createElement(Na,{ref:l,viewBox:t,...i,...s},o.length?o:N.createElement("path",{fill:"currentColor",d:n})));return a.displayName=r,a}function Er(e,t=[]){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function $S(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,v)=>m!==v}=e,o=Er(r),a=Er(i),[s,l]=w.useState(n),u=t!==void 0,d=u?t:s,h=Er(m=>{const b=typeof m=="function"?m(d):m;a(d,b)&&(u||l(b),o(b))},[u,o,d,a]);return[d,h]}const j_=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),FS=w.createContext({});function Sce(){return w.useContext(FS).visualElement}const v0=w.createContext(null),ip=typeof document<"u",J4=ip?w.useLayoutEffect:w.useEffect,SB=w.createContext({strict:!1});function xce(e,t,n,r){const i=Sce(),o=w.useContext(SB),a=w.useContext(v0),s=w.useContext(j_).reducedMotion,l=w.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return J4(()=>{u&&u.render()}),w.useEffect(()=>{u&&u.animationState&&u.animationState.animateChanges()}),J4(()=>()=>u&&u.notify("Unmount"),[]),u}function Ug(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wce(e,t,n){return w.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ug(n)&&(n.current=r))},[t])}function E2(e){return typeof e=="string"||Array.isArray(e)}function zS(e){return typeof e=="object"&&typeof e.start=="function"}const Cce=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function HS(e){return zS(e.animate)||Cce.some(t=>E2(e[t]))}function xB(e){return Boolean(HS(e)||e.variants)}function _ce(e,t){if(HS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||E2(n)?n:void 0,animate:E2(r)?r:void 0}}return e.inherit!==!1?t:{}}function kce(e){const{initial:t,animate:n}=_ce(e,w.useContext(FS));return w.useMemo(()=>({initial:t,animate:n}),[vA(t),vA(n)])}function vA(e){return Array.isArray(e)?e.join(" "):e}const Fu=e=>({isEnabled:t=>e.some(n=>!!t[n])}),P2={measureLayout:Fu(["layout","layoutId","drag"]),animation:Fu(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:Fu(["exit"]),drag:Fu(["drag","dragControls"]),focus:Fu(["whileFocus"]),hover:Fu(["whileHover","onHoverStart","onHoverEnd"]),tap:Fu(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Fu(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:Fu(["whileInView","onViewportEnter","onViewportLeave"])};function Ece(e){for(const t in e)t==="projectionNodeConstructor"?P2.projectionNodeConstructor=e[t]:P2[t].Component=e[t]}function VS(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Wv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Pce=1;function Tce(){return VS(()=>{if(Wv.hasEverUpdated)return Pce++})}const B_=w.createContext({});class Lce extends N.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const wB=w.createContext({}),Ace=Symbol.for("motionComponentSymbol");function Oce({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&Ece(e);function a(l,u){const d={...w.useContext(j_),...l,layoutId:Mce(l)},{isStatic:h}=d;let m=null;const v=kce(l),b=h?void 0:Tce(),S=i(l,h);if(!h&&ip){v.visualElement=xce(o,S,d,t);const _=w.useContext(SB).strict,E=w.useContext(wB);v.visualElement&&(m=v.visualElement.loadFeatures(d,_,e,b,n||P2.projectionNodeConstructor,E))}return w.createElement(Lce,{visualElement:v.visualElement,props:d},m,w.createElement(FS.Provider,{value:v},r(o,l,b,wce(S,v.visualElement,u),S,h,v.visualElement)))}const s=w.forwardRef(a);return s[Ace]=o,s}function Mce({layoutId:e}){const t=w.useContext(B_).id;return t&&e!==void 0?t+"-"+e:e}function Ice(e){function t(r,i={}){return Oce(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const Rce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function $_(e){return typeof e!="string"||e.includes("-")?!1:!!(Rce.indexOf(e)>-1||/[A-Z]/.test(e))}const e5={};function Dce(e){Object.assign(e5,e)}const t5=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],y0=new Set(t5);function CB(e,{layout:t,layoutId:n}){return y0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!e5[e]||e==="opacity")}const su=e=>!!(e!=null&&e.getVelocity),Nce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jce=(e,t)=>t5.indexOf(e)-t5.indexOf(t);function Bce({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";t.sort(jce);for(const s of t)a+=`${Nce[s]||s}(${e[s]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}function _B(e){return e.startsWith("--")}const $ce=(e,t)=>t&&typeof e=="number"?t.transform(e):e,kB=(e,t)=>n=>Math.max(Math.min(n,t),e),Uv=e=>e%1?Number(e.toFixed(5)):e,T2=/(-)?([\d]*\.?[\d])+/g,x7=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Fce=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function by(e){return typeof e=="string"}const op={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Gv=Object.assign(Object.assign({},op),{transform:kB(0,1)}),Q3=Object.assign(Object.assign({},op),{default:1}),Sy=e=>({test:t=>by(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),fd=Sy("deg"),Ql=Sy("%"),Lt=Sy("px"),zce=Sy("vh"),Hce=Sy("vw"),yA=Object.assign(Object.assign({},Ql),{parse:e=>Ql.parse(e)/100,transform:e=>Ql.transform(e*100)}),F_=(e,t)=>n=>Boolean(by(n)&&Fce.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),EB=(e,t,n)=>r=>{if(!by(r))return r;const[i,o,a,s]=r.match(T2);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},kh={test:F_("hsl","hue"),parse:EB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ql.transform(Uv(t))+", "+Ql.transform(Uv(n))+", "+Uv(Gv.transform(r))+")"},Vce=kB(0,255),g6=Object.assign(Object.assign({},op),{transform:e=>Math.round(Vce(e))}),_d={test:F_("rgb","red"),parse:EB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+g6.transform(e)+", "+g6.transform(t)+", "+g6.transform(n)+", "+Uv(Gv.transform(r))+")"};function Wce(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const w7={test:F_("#"),parse:Wce,transform:_d.transform},wo={test:e=>_d.test(e)||w7.test(e)||kh.test(e),parse:e=>_d.test(e)?_d.parse(e):kh.test(e)?kh.parse(e):w7.parse(e),transform:e=>by(e)?e:e.hasOwnProperty("red")?_d.transform(e):kh.transform(e)},PB="${c}",TB="${n}";function Uce(e){var t,n,r,i;return isNaN(e)&&by(e)&&((n=(t=e.match(T2))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((i=(r=e.match(x7))===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0}function LB(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(x7);r&&(n=r.length,e=e.replace(x7,PB),t.push(...r.map(wo.parse)));const i=e.match(T2);return i&&(e=e.replace(T2,TB),t.push(...i.map(op.parse))),{values:t,numColors:n,tokenised:e}}function AB(e){return LB(e).values}function OB(e){const{values:t,numColors:n,tokenised:r}=LB(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function qce(e){const t=AB(e);return OB(e)(t.map(Gce))}const tc={test:Uce,parse:AB,createTransformer:OB,getAnimatableNone:qce},Yce=new Set(["brightness","contrast","saturate","opacity"]);function Kce(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(T2)||[];if(!r)return e;const i=n.replace(r,"");let o=Yce.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const Xce=/([a-z-]*)\(.*?\)/g,C7=Object.assign(Object.assign({},tc),{getAnimatableNone:e=>{const t=e.match(Xce);return t?t.map(Kce).join(" "):e}}),bA={...op,transform:Math.round},MB={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,size:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,rotate:fd,rotateX:fd,rotateY:fd,rotateZ:fd,scale:Q3,scaleX:Q3,scaleY:Q3,scaleZ:Q3,skew:fd,skewX:fd,skewY:fd,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:Gv,originX:yA,originY:yA,originZ:Lt,zIndex:bA,fillOpacity:Gv,strokeOpacity:Gv,numOctaves:bA};function z_(e,t,n,r){const{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let u=!1,d=!1,h=!0;for(const m in t){const v=t[m];if(_B(m)){o[m]=v;continue}const b=MB[m],S=$ce(v,b);if(y0.has(m)){if(u=!0,a[m]=S,s.push(m),!h)continue;v!==(b.default||0)&&(h=!1)}else m.startsWith("origin")?(d=!0,l[m]=S):i[m]=S}if(t.transform||(u||r?i.transform=Bce(e,n,h,r):i.transform&&(i.transform="none")),d){const{originX:m="50%",originY:v="50%",originZ:b=0}=l;i.transformOrigin=`${m} ${v} ${b}`}}const H_=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function IB(e,t,n){for(const r in t)!su(t[r])&&!CB(r,n)&&(e[r]=t[r])}function Zce({transformTemplate:e},t,n){return w.useMemo(()=>{const r=H_();return z_(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function Qce(e,t,n){const r=e.style||{},i={};return IB(i,r,e),Object.assign(i,Zce(e,t,n)),e.transformValues?e.transformValues(i):i}function Jce(e,t,n){const r={},i=Qce(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),r.style=i,r}const ede=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],tde=["whileTap","onTap","onTapStart","onTapCancel"],nde=["onPan","onPanStart","onPanSessionStart","onPanEnd"],rde=["whileInView","onViewportEnter","onViewportLeave","viewport"],ide=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...rde,...tde,...ede,...nde]);function n5(e){return ide.has(e)}let RB=e=>!n5(e);function ode(e){e&&(RB=t=>t.startsWith("on")?!n5(t):e(t))}try{ode(require("@emotion/is-prop-valid").default)}catch{}function ade(e,t,n){const r={};for(const i in e)(RB(i)||n===!0&&n5(i)||!t&&!n5(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function SA(e,t,n){return typeof e=="string"?e:Lt.transform(t+n*e)}function sde(e,t,n){const r=SA(t,e.x,e.width),i=SA(n,e.y,e.height);return`${r} ${i}`}const lde={offset:"stroke-dashoffset",array:"stroke-dasharray"},ude={offset:"strokeDashoffset",array:"strokeDasharray"};function cde(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?lde:ude;e[o.offset]=Lt.transform(-r);const a=Lt.transform(t),s=Lt.transform(n);e[o.array]=`${a} ${s}`}function V_(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,d){z_(e,l,u,d),e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=sde(v,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),o!==void 0&&cde(h,o,a,s,!1)}const DB=()=>({...H_(),attrs:{}});function dde(e,t){const n=w.useMemo(()=>{const r=DB();return V_(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};IB(r,e.style,e),n.style={...r,...n.style}}return n}function fde(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=($_(n)?dde:Jce)(r,a,s),h={...ade(r,typeof n=="string",e),...u,ref:o};return i&&(h["data-projection-id"]=i),w.createElement(n,h)}}const NB=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function jB(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const BB=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function $B(e,t,n,r){jB(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(BB.has(i)?i:NB(i),t.attrs[i])}function W_(e){const{style:t}=e,n={};for(const r in t)(su(t[r])||CB(r,e))&&(n[r]=t[r]);return n}function FB(e){const t=W_(e);for(const n in e)if(su(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function U_(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const L2=e=>Array.isArray(e),hde=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),zB=e=>L2(e)?e[e.length-1]||0:e;function p4(e){const t=su(e)?e.get():e;return hde(t)?t.toValue():t}function pde({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:gde(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const HB=e=>(t,n)=>{const r=w.useContext(FS),i=w.useContext(v0),o=()=>pde(e,t,r,i);return n?o():VS(o)};function gde(e,t,n,r){const i={},o=r(e);for(const m in o)i[m]=p4(o[m]);let{initial:a,animate:s}=e;const l=HS(e),u=xB(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?s:a;return h&&typeof h!="boolean"&&!zS(h)&&(Array.isArray(h)?h:[h]).forEach(v=>{const b=U_(e,v);if(!b)return;const{transitionEnd:S,transition:_,...E}=b;for(const k in E){let T=E[k];if(Array.isArray(T)){const A=d?T.length-1:0;T=T[A]}T!==null&&(i[k]=T)}for(const k in S)i[k]=S[k]}),i}const mde={useVisualState:HB({scrapeMotionValuesFromProps:FB,createRenderState:DB,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}V_(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),$B(t,n)}})},vde={useVisualState:HB({scrapeMotionValuesFromProps:W_,createRenderState:H_})};function yde(e,{forwardMotionProps:t=!1},n,r,i){return{...$_(e)?mde:vde,preloadedFeatures:n,useRender:fde(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}}var tr;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(tr||(tr={}));function WS(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function _7(e,t,n,r){w.useEffect(()=>{const i=e.current;if(n&&i)return WS(i,t,n,r)},[e,t,n,r])}function bde({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(tr.Focus,!0)},i=()=>{n&&n.setActive(tr.Focus,!1)};_7(t,"focus",e?r:void 0),_7(t,"blur",e?i:void 0)}function VB(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function WB(e){return!!e.touches}function Sde(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const xde={pageX:0,pageY:0};function wde(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||xde;return{x:r[t+"X"],y:r[t+"Y"]}}function Cde(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function G_(e,t="page"){return{point:WB(e)?wde(e,t):Cde(e,t)}}const UB=(e,t=!1)=>{const n=r=>e(r,G_(r));return t?Sde(n):n},_de=()=>ip&&window.onpointerdown===null,kde=()=>ip&&window.ontouchstart===null,Ede=()=>ip&&window.onmousedown===null,Pde={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Tde={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function GB(e){return _de()?e:kde()?Tde[e]:Ede()?Pde[e]:e}function Cm(e,t,n,r){return WS(e,GB(t),UB(n,t==="pointerdown"),r)}function r5(e,t,n,r){return _7(e,GB(t),n&&UB(n,t==="pointerdown"),r)}function qB(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const xA=qB("dragHorizontal"),wA=qB("dragVertical");function YB(e){let t=!1;if(e==="y")t=wA();else if(e==="x")t=xA();else{const n=xA(),r=wA();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function KB(){const e=YB(!0);return e?(e(),!1):!0}function CA(e,t,n){return(r,i)=>{!VB(r)||KB()||(e.animationState&&e.animationState.setActive(tr.Hover,t),n&&n(r,i))}}function Lde({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){r5(r,"pointerenter",e||n?CA(r,!0,e):void 0,{passive:!e}),r5(r,"pointerleave",t||n?CA(r,!1,t):void 0,{passive:!t})}const XB=(e,t)=>t?e===t?!0:XB(e,t.parentElement):!1;function q_(e){return w.useEffect(()=>()=>e(),[])}function ZB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),m6=.001,Ode=.01,_A=10,Mde=.05,Ide=1;function Rde({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;Ade(e<=_A*1e3);let a=1-t;a=o5(Mde,Ide,a),e=o5(Ode,_A,e/1e3),a<1?(i=u=>{const d=u*a,h=d*e,m=d-n,v=k7(u,a),b=Math.exp(-h);return m6-m/v*b},o=u=>{const h=u*a*e,m=h*n+n,v=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-h),S=k7(Math.pow(u,2),a);return(-i(u)+m6>0?-1:1)*((m-v)*b)/S}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-m6+d*h},o=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const s=5/e,l=Nde(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const Dde=12;function Nde(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function $de(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!kA(e,Bde)&&kA(e,jde)){const n=Rde(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function Y_(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=ZB(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:s,damping:l,mass:u,velocity:d,duration:h,isResolvedFromDuration:m}=$de(o),v=EA,b=EA;function S(){const _=d?-(d/1e3):0,E=n-t,k=l/(2*Math.sqrt(s*u)),T=Math.sqrt(s/u)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),k<1){const A=k7(T,k);v=M=>{const R=Math.exp(-k*T*M);return n-R*((_+k*T*E)/A*Math.sin(A*M)+E*Math.cos(A*M))},b=M=>{const R=Math.exp(-k*T*M);return k*T*R*(Math.sin(A*M)*(_+k*T*E)/A+E*Math.cos(A*M))-R*(Math.cos(A*M)*(_+k*T*E)-A*E*Math.sin(A*M))}}else if(k===1)v=A=>n-Math.exp(-T*A)*(E+(_+T*E)*A);else{const A=T*Math.sqrt(k*k-1);v=M=>{const R=Math.exp(-k*T*M),D=Math.min(A*M,300);return n-R*((_+k*T*E)*Math.sinh(D)+A*E*Math.cosh(D))/A}}}return S(),{next:_=>{const E=v(_);if(m)a.done=_>=h;else{const k=b(_)*1e3,T=Math.abs(k)<=r,A=Math.abs(n-E)<=i;a.done=T&&A}return a.value=a.done?n:E,a},flipTarget:()=>{d=-d,[t,n]=[n,t],S()}}}Y_.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const EA=e=>0,A2=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},zr=(e,t,n)=>-n*e+n*t+e;function v6(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function PA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=v6(l,s,e+1/3),o=v6(l,s,e),a=v6(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const Fde=(e,t,n)=>{const r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},zde=[w7,_d,kh],TA=e=>zde.find(t=>t.test(e)),QB=(e,t)=>{let n=TA(e),r=TA(t),i=n.parse(e),o=r.parse(t);n===kh&&(i=PA(i),n=_d),r===kh&&(o=PA(o),r=_d);const a=Object.assign({},i);return s=>{for(const l in a)l!=="alpha"&&(a[l]=Fde(i[l],o[l],s));return a.alpha=zr(i.alpha,o.alpha,s),n.transform(a)}},E7=e=>typeof e=="number",Hde=(e,t)=>n=>t(e(n)),US=(...e)=>e.reduce(Hde);function JB(e,t){return E7(e)?n=>zr(e,t,n):wo.test(e)?QB(e,t):t$(e,t)}const e$=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>JB(o,t[a]));return o=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=JB(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}};function LA(e){const t=tc.parse(e),n=t.length;let r=0,i=0,o=0;for(let a=0;a{const n=tc.createTransformer(t),r=LA(e),i=LA(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?US(e$(r.parsed,i.parsed),n):a=>`${a>0?t:e}`},Wde=(e,t)=>n=>zr(e,t,n);function Ude(e){if(typeof e=="number")return Wde;if(typeof e=="string")return wo.test(e)?QB:t$;if(Array.isArray(e))return e$;if(typeof e=="object")return Vde}function Gde(e,t,n){const r=[],i=n||Ude(e[0]),o=e.length-1;for(let a=0;an(A2(e,t,r))}function Yde(e,t){const n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let l=1;for(;li||l===r);l++);o=l-1}const s=A2(e[o],e[o+1],i);return t[o](s)}}function n$(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;i5(o===t.length),i5(!r||!Array.isArray(r)||r.length===o-1),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=Gde(t,r,i),s=o===2?qde(e,a):Yde(e,a);return n?l=>s(o5(e[0],e[o-1],l)):s}const GS=e=>t=>1-e(1-t),K_=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Kde=e=>t=>Math.pow(t,e),r$=e=>t=>t*t*((e+1)*t-e),Xde=e=>{const t=r$(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},i$=1.525,Zde=4/11,Qde=8/11,Jde=9/10,X_=e=>e,Z_=Kde(2),efe=GS(Z_),o$=K_(Z_),a$=e=>1-Math.sin(Math.acos(e)),Q_=GS(a$),tfe=K_(Q_),J_=r$(i$),nfe=GS(J_),rfe=K_(J_),ife=Xde(i$),ofe=4356/361,afe=35442/1805,sfe=16061/1805,a5=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-a5(1-e*2)):.5*a5(e*2-1)+.5;function cfe(e,t){return e.map(()=>t||o$).splice(0,e.length-1)}function dfe(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function ffe(e,t){return e.map(n=>n*t)}function g4({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){const o={done:!1,value:e},a=Array.isArray(t)?t:[e,t],s=ffe(r&&r.length===a.length?r:dfe(a),i);function l(){return n$(s,a,{ease:Array.isArray(n)?n:cfe(a,n)})}let u=l();return{next:d=>(o.value=u(d),o.done=d>=i,o),flipTarget:()=>{a.reverse(),u=l()}}}function hfe({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a={done:!1,value:t};let s=n*e;const l=t+s,u=o===void 0?l:o(l);return u!==l&&(s=u-t),{next:d=>{const h=-s*Math.exp(-d/r);return a.done=!(h>i||h<-i),a.value=a.done?u:u+h,a},flipTarget:()=>{}}}const AA={keyframes:g4,spring:Y_,decay:hfe};function pfe(e){if(Array.isArray(e.to))return g4;if(AA[e.type])return AA[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?g4:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Y_:g4}const s$=1/60*1e3,gfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),l$=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(gfe()),s$);function mfe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=mfe(()=>O2=!0),e),{}),yfe=xy.reduce((e,t)=>{const n=qS[t];return e[t]=(r,i=!1,o=!1)=>(O2||xfe(),n.schedule(r,i,o)),e},{}),bfe=xy.reduce((e,t)=>(e[t]=qS[t].cancel,e),{});xy.reduce((e,t)=>(e[t]=()=>qS[t].process(_m),e),{});const Sfe=e=>qS[e].process(_m),u$=e=>{O2=!1,_m.delta=P7?s$:Math.max(Math.min(e-_m.timestamp,vfe),1),_m.timestamp=e,T7=!0,xy.forEach(Sfe),T7=!1,O2&&(P7=!1,l$(u$))},xfe=()=>{O2=!0,P7=!0,T7||l$(u$)},wfe=()=>_m;function c$(e,t,n=0){return e-t-n}function Cfe(e,t,n=0,r=!0){return r?c$(t+-e,t,n):t-(e-t)+n}function _fe(e,t,n,r){return r?e>=t+n:e<=-n}const kfe=e=>{const t=({delta:n})=>e(n);return{start:()=>yfe.update(t,!0),stop:()=>bfe.update(t)}};function d$(e){var t,n,{from:r,autoplay:i=!0,driver:o=kfe,elapsed:a=0,repeat:s=0,repeatType:l="loop",repeatDelay:u=0,onPlay:d,onStop:h,onComplete:m,onRepeat:v,onUpdate:b}=e,S=ZB(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:_}=S,E,k=0,T=S.duration,A,M=!1,R=!0,D;const j=pfe(S);!((n=(t=j).needsInterpolation)===null||n===void 0)&&n.call(t,r,_)&&(D=n$([0,100],[r,_],{clamp:!1}),r=0,_=100);const z=j(Object.assign(Object.assign({},S),{from:r,to:_}));function H(){k++,l==="reverse"?(R=k%2===0,a=Cfe(a,T,u,R)):(a=c$(a,T,u),l==="mirror"&&z.flipTarget()),M=!1,v&&v()}function K(){E.stop(),m&&m()}function te($){if(R||($=-$),a+=$,!M){const W=z.next(Math.max(0,a));A=W.value,D&&(A=D(A)),M=R?W.done:a<=0}b==null||b(A),M&&(k===0&&(T??(T=a)),k{h==null||h(),E.stop()}}}function f$(e,t){return t?e*(1e3/t):0}function Efe({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:d,onUpdate:h,onComplete:m,onStop:v}){let b;function S(T){return n!==void 0&&Tr}function _(T){return n===void 0?r:r===void 0||Math.abs(n-T){var M;h==null||h(A),(M=T.onUpdate)===null||M===void 0||M.call(T,A)},onComplete:m,onStop:v}))}function k(T){E(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},T))}if(S(e))k({from:e,velocity:t,to:_(e)});else{let T=i*t+e;typeof u<"u"&&(T=u(T));const A=_(T),M=A===n?-1:1;let R,D;const j=z=>{R=D,D=z,t=f$(z-R,wfe().delta),(M===1&&z>A||M===-1&&zb==null?void 0:b.stop()}}const L7=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),OA=e=>L7(e)&&e.hasOwnProperty("z"),J3=(e,t)=>Math.abs(e-t);function ek(e,t){if(E7(e)&&E7(t))return J3(e,t);if(L7(e)&&L7(t)){const n=J3(e.x,t.x),r=J3(e.y,t.y),i=OA(e)&&OA(t)?J3(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}const h$=(e,t)=>1-3*t+3*e,p$=(e,t)=>3*t-6*e,g$=e=>3*e,s5=(e,t,n)=>((h$(t,n)*e+p$(t,n))*e+g$(t))*e,m$=(e,t,n)=>3*h$(t,n)*e*e+2*p$(t,n)*e+g$(t),Pfe=1e-7,Tfe=10;function Lfe(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=s5(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>Pfe&&++s=Ofe?Mfe(a,h,e,n):m===0?h:Lfe(a,s,s+eb,e,n)}return a=>a===0||a===1?a:s5(o(a),t,r)}function Rfe({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(!1),s=w.useRef(null),l={passive:!(t||e||n||v)};function u(){s.current&&s.current(),s.current=null}function d(){return u(),a.current=!1,i.animationState&&i.animationState.setActive(tr.Tap,!1),!KB()}function h(b,S){d()&&(XB(i.current,b.target)?e&&e(b,S):n&&n(b,S))}function m(b,S){d()&&n&&n(b,S)}function v(b,S){u(),!a.current&&(a.current=!0,s.current=US(Cm(window,"pointerup",h,l),Cm(window,"pointercancel",m,l)),i.animationState&&i.animationState.setActive(tr.Tap,!0),t&&t(b,S))}r5(i,"pointerdown",o?v:void 0,l),q_(u)}const Dfe="production",v$=typeof process>"u"||process.env===void 0?Dfe:"production",MA=new Set;function y$(e,t,n){e||MA.has(t)||(console.warn(t),n&&console.warn(n),MA.add(t))}const A7=new WeakMap,y6=new WeakMap,Nfe=e=>{const t=A7.get(e.target);t&&t(e)},jfe=e=>{e.forEach(Nfe)};function Bfe({root:e,...t}){const n=e||document;y6.has(n)||y6.set(n,{});const r=y6.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(jfe,{root:e,...t})),r[i]}function $fe(e,t,n){const r=Bfe(t);return A7.set(e,n),r.observe(e),()=>{A7.delete(e),r.unobserve(e)}}function Ffe({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){const o=w.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?Vfe:Hfe)(a,o.current,e,i)}const zfe={some:0,all:1};function Hfe(e,t,n,{root:r,margin:i,amount:o="some",once:a}){w.useEffect(()=>{if(!e||!n.current)return;const s={root:r==null?void 0:r.current,rootMargin:i,threshold:typeof o=="number"?o:zfe[o]},l=u=>{const{isIntersecting:d}=u;if(t.isInView===d||(t.isInView=d,a&&!d&&t.hasEnteredView))return;d&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(tr.InView,d);const h=n.getProps(),m=d?h.onViewportEnter:h.onViewportLeave;m&&m(u)};return $fe(n.current,s,l)},[e,r,i,o])}function Vfe(e,t,n,{fallback:r=!0}){w.useEffect(()=>{!e||!r||(v$!=="production"&&y$(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:i}=n.getProps();i&&i(null),n.animationState&&n.animationState.setActive(tr.InView,!0)}))},[e])}const kd=e=>t=>(e(t),null),Wfe={inView:kd(Ffe),tap:kd(Rfe),focus:kd(bde),hover:kd(Lde)};function tk(){const e=w.useContext(v0);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=w.useId();return w.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function Ufe(){return Gfe(w.useContext(v0))}function Gfe(e){return e===null?!0:e.isPresent}function b$(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,qfe={linear:X_,easeIn:Z_,easeInOut:o$,easeOut:efe,circIn:a$,circInOut:tfe,circOut:Q_,backIn:J_,backInOut:rfe,backOut:nfe,anticipate:ife,bounceIn:lfe,bounceInOut:ufe,bounceOut:a5},IA=e=>{if(Array.isArray(e)){i5(e.length===4);const[t,n,r,i]=e;return Ife(t,n,r,i)}else if(typeof e=="string")return qfe[e];return e},Yfe=e=>Array.isArray(e)&&typeof e[0]!="number",RA=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&tc.test(t)&&!t.startsWith("url(")),oh=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),tb=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),b6=()=>({type:"keyframes",ease:"linear",duration:.3}),Kfe=e=>({type:"keyframes",duration:.8,values:e}),DA={x:oh,y:oh,z:oh,rotate:oh,rotateX:oh,rotateY:oh,rotateZ:oh,scaleX:tb,scaleY:tb,scale:tb,opacity:b6,backgroundColor:b6,color:b6,default:tb},Xfe=(e,t)=>{let n;return L2(t)?n=Kfe:n=DA[e]||DA.default,{to:t,...n(t)}},Zfe={...MB,color:wo,backgroundColor:wo,outlineColor:wo,fill:wo,stroke:wo,borderColor:wo,borderTopColor:wo,borderRightColor:wo,borderBottomColor:wo,borderLeftColor:wo,filter:C7,WebkitFilter:C7},nk=e=>Zfe[e];function rk(e,t){var n;let r=nk(e);return r!==C7&&(r=tc),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const Qfe={current:!1},S$=1/60*1e3,Jfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),x$=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Jfe()),S$);function ehe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=ehe(()=>M2=!0),e),{}),Ys=wy.reduce((e,t)=>{const n=YS[t];return e[t]=(r,i=!1,o=!1)=>(M2||rhe(),n.schedule(r,i,o)),e},{}),Uh=wy.reduce((e,t)=>(e[t]=YS[t].cancel,e),{}),S6=wy.reduce((e,t)=>(e[t]=()=>YS[t].process(km),e),{}),nhe=e=>YS[e].process(km),w$=e=>{M2=!1,km.delta=O7?S$:Math.max(Math.min(e-km.timestamp,the),1),km.timestamp=e,M7=!0,wy.forEach(nhe),M7=!1,M2&&(O7=!1,x$(w$))},rhe=()=>{M2=!0,O7=!0,M7||x$(w$)},I7=()=>km;function C$(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Uh.read(r),e(o-t))};return Ys.read(r,!0),()=>Uh.read(r)}function ihe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...u}){return!!Object.keys(u).length}function ohe({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){const a={...o};return t&&(a.offset=t),o.duration&&(a.duration=l5(o.duration)),o.repeatDelay&&(a.repeatDelay=l5(o.repeatDelay)),e&&(a.ease=Yfe(e)?e.map(IA):IA(e)),o.type==="tween"&&(a.type="keyframes"),(n||i||r)&&(n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),o.type!=="spring"&&(a.type="keyframes"),a}function ahe(e,t){var n,r;return(r=(n=(ik(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function she(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function lhe(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),she(t),ihe(e)||(e={...e,...Xfe(n,t.to)}),{...t,...ohe(e)}}function uhe(e,t,n,r,i){const o=ik(r,e)||{};let a=o.from!==void 0?o.from:t.get();const s=RA(e,n);a==="none"&&s&&typeof n=="string"?a=rk(e,n):NA(a)&&typeof n=="string"?a=jA(n):!Array.isArray(n)&&NA(n)&&typeof a=="string"&&(n=jA(a));const l=RA(e,a);function u(){const h={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:m=>t.set(m)};return o.type==="inertia"||o.type==="decay"?Efe({...h,...o}):d$({...lhe(o,h,e),onUpdate:m=>{h.onUpdate(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{h.onComplete(),o.onComplete&&o.onComplete()}})}function d(){const h=zB(n);return t.set(h),i(),o.onUpdate&&o.onUpdate(h),o.onComplete&&o.onComplete(),{stop:()=>{}}}return!l||!s||o.type===!1?d:u}function NA(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function jA(e){return typeof e=="number"?0:rk("",e)}function ik(e,t){return e[t]||e.default||e}function ok(e,t,n,r={}){return Qfe.current&&(r={type:!1}),t.start(i=>{let o;const a=uhe(e,t,n,r,i),s=ahe(r,e),l=()=>o=a();let u;return s?u=C$(l,l5(s)):l(),()=>{u&&u(),o&&o.stop()}})}const che=e=>/^\-?\d*\.?\d+$/.test(e),dhe=e=>/^0[^.\s]+$/.test(e);function ak(e,t){e.indexOf(t)===-1&&e.push(t)}function sk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class qv{constructor(){this.subscriptions=[]}add(t){return ak(this.subscriptions,t),()=>sk(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class hhe{constructor(t){this.version="7.6.9",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new qv,this.velocityUpdateSubscribers=new qv,this.renderSubscribers=new qv,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=I7();this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,Ys.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Ys.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=fhe(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?f$(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Gm(e){return new hhe(e)}const _$=e=>t=>t.test(e),phe={test:e=>e==="auto",parse:e=>e},k$=[op,Lt,Ql,fd,Hce,zce,phe],U1=e=>k$.find(_$(e)),ghe=[...k$,wo,tc],mhe=e=>ghe.find(_$(e));function vhe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function yhe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function KS(e,t,n){const r=e.getProps();return U_(r,t,n!==void 0?n:r.custom,vhe(e),yhe(e))}function bhe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Gm(n))}function She(e,t){const n=KS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=zB(o[a]);bhe(e,a,s)}}function xhe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;sR7(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=R7(e,t,n);else{const i=typeof t=="function"?KS(e,t,n.custom):t;r=E$(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function R7(e,t,n={}){var r;const i=KS(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const a=i?()=>E$(e,i,n):()=>Promise.resolve(),s=!((r=e.variantChildren)===null||r===void 0)&&r.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=o;return khe(e,t,d+u,h,m,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[a,s]:[s,a];return u().then(d)}else return Promise.all([a(),s(n.delay)])}function E$(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const u=e.getValue("willChange");r&&(a=r);const d=[],h=i&&((o=e.animationState)===null||o===void 0?void 0:o.getState()[i]);for(const m in l){const v=e.getValue(m),b=l[m];if(!v||b===void 0||h&&Phe(h,m))continue;let S={delay:n,...a};e.shouldReduceMotion&&y0.has(m)&&(S={...S,type:!1,delay:0});let _=ok(m,v,b,S);u5(u)&&(u.add(m),_=_.then(()=>u.remove(m))),d.push(_)}return Promise.all(d).then(()=>{s&&She(e,s)})}function khe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(Ehe).forEach((u,d)=>{a.push(R7(u,t,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function Ehe(e,t){return e.sortNodePosition(t)}function Phe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const lk=[tr.Animate,tr.InView,tr.Focus,tr.Hover,tr.Tap,tr.Drag,tr.Exit],The=[...lk].reverse(),Lhe=lk.length;function Ahe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>_he(e,n,r)))}function Ohe(e){let t=Ahe(e);const n=Ihe();let r=!0;const i=(l,u)=>{const d=KS(e,u);if(d){const{transition:h,transitionEnd:m,...v}=d;l={...l,...v,...m}}return l};function o(l){t=l(e)}function a(l,u){var d;const h=e.getProps(),m=e.getVariantContext(!0)||{},v=[],b=new Set;let S={},_=1/0;for(let k=0;k_&&R;const K=Array.isArray(M)?M:[M];let te=K.reduce(i,{});D===!1&&(te={});const{prevResolvedValues:G={}}=A,$={...G,...te},W=X=>{H=!0,b.delete(X),A.needsAnimating[X]=!0};for(const X in $){const Z=te[X],U=G[X];S.hasOwnProperty(X)||(Z!==U?L2(Z)&&L2(U)?!b$(Z,U)||z?W(X):A.protectedKeys[X]=!0:Z!==void 0?W(X):b.add(X):Z!==void 0&&b.has(X)?W(X):A.protectedKeys[X]=!0)}A.prevProp=M,A.prevResolvedValues=te,A.isActive&&(S={...S,...te}),r&&e.blockInitialAnimation&&(H=!1),H&&!j&&v.push(...K.map(X=>({animation:X,options:{type:T,...l}})))}if(b.size){const k={};b.forEach(T=>{const A=e.getBaseTarget(T);A!==void 0&&(k[T]=A)}),v.push({animation:k})}let E=Boolean(v.length);return r&&h.initial===!1&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,E?t(v):Promise.resolve()}function s(l,u,d){var h;if(n[l].isActive===u)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(v=>{var b;return(b=v.animationState)===null||b===void 0?void 0:b.setActive(l,u)}),n[l].isActive=u;const m=a(d,l);for(const v in n)n[v].protectedKeys={};return m}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function Mhe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!b$(t,e):!1}function ah(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ihe(){return{[tr.Animate]:ah(!0),[tr.InView]:ah(),[tr.Hover]:ah(),[tr.Tap]:ah(),[tr.Drag]:ah(),[tr.Focus]:ah(),[tr.Exit]:ah()}}const Rhe={animation:kd(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=Ohe(e)),zS(t)&&w.useEffect(()=>t.subscribe(e),[t])}),exit:kd(e=>{const{custom:t,visualElement:n}=e,[r,i]=tk(),o=w.useContext(v0);w.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(tr.Exit,!r,{custom:o&&o.custom||t});a&&!r&&a.then(i)},[r])})};class P${constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=w6(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=ek(u.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:m}=u,{timestamp:v}=I7();this.history.push({...m,timestamp:v});const{onStart:b,onMove:S}=this.handlers;d||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{if(this.lastMoveEvent=u,this.lastMoveEventInfo=x6(d,this.transformPagePoint),VB(u)&&u.buttons===0){this.handlePointerUp(u,d);return}Ys.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{this.end();const{onEnd:h,onSessionEnd:m}=this.handlers,v=w6(x6(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,v),m&&m(u,v)},WB(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const i=G_(t),o=x6(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=I7();this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,w6(o,this.history)),this.removeListeners=US(Cm(window,"pointermove",this.handlePointerMove),Cm(window,"pointerup",this.handlePointerUp),Cm(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Uh.update(this.updatePoint)}}function x6(e,t){return t?{point:t(e.point)}:e}function BA(e,t){return{x:e.x-t.x,y:e.y-t.y}}function w6({point:e},t){return{point:e,delta:BA(e,T$(t)),offset:BA(e,Dhe(t)),velocity:Nhe(t,.1)}}function Dhe(e){return e[0]}function T$(e){return e[e.length-1]}function Nhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=T$(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>l5(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Ma(e){return e.max-e.min}function $A(e,t=0,n=.01){return ek(e,t)n&&(e=r?zr(n,e,r.max):Math.min(e,n)),e}function VA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function $he(e,{top:t,left:n,bottom:r,right:i}){return{x:VA(e.x,n,i),y:VA(e.y,t,r)}}function WA(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=A2(t.min,t.max-r,e.min):r>i&&(n=A2(e.min,e.max-i,t.min)),o5(0,1,n)}function Hhe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const D7=.35;function Vhe(e=D7){return e===!1?e=0:e===!0&&(e=D7),{x:UA(e,"left","right"),y:UA(e,"top","bottom")}}function UA(e,t,n){return{min:GA(e,t),max:GA(e,n)}}function GA(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const qA=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xv=()=>({x:qA(),y:qA()}),YA=()=>({min:0,max:0}),pi=()=>({x:YA(),y:YA()});function Nl(e){return[e("x"),e("y")]}function L$({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Whe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Uhe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function C6(e){return e===void 0||e===1}function N7({scale:e,scaleX:t,scaleY:n}){return!C6(e)||!C6(t)||!C6(n)}function fh(e){return N7(e)||A$(e)||e.z||e.rotate||e.rotateX||e.rotateY}function A$(e){return KA(e.x)||KA(e.y)}function KA(e){return e&&e!=="0%"}function c5(e,t,n){const r=e-n,i=t*r;return n+i}function XA(e,t,n,r,i){return i!==void 0&&(e=c5(e,i,r)),c5(e,n,r)+t}function j7(e,t=0,n=1,r,i){e.min=XA(e.min,t,n,r,i),e.max=XA(e.max,t,n,r,i)}function O$(e,{x:t,y:n}){j7(e.x,t.translate,t.scale,t.originPoint),j7(e.y,n.translate,n.scale,n.originPoint)}function Ghe(e,t,n,r=!1){var i,o;const a=n.length;if(!a)return;t.x=t.y=1;let s,l;for(let u=0;u{this.stopAnimation(),n&&this.snapToCursor(G_(s,"page").point)},i=(s,l)=>{var u;const{drag:d,dragPropagation:h,onDragStart:m}=this.getProps();d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=YB(d),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nl(v=>{var b,S;let _=this.getAxisMotionValue(v).get()||0;if(Ql.test(_)){const E=(S=(b=this.visualElement.projection)===null||b===void 0?void 0:b.layout)===null||S===void 0?void 0:S.layoutBox[v];E&&(_=Ma(E)*(parseFloat(_)/100))}this.originPoint[v]=_}),m==null||m(s,l),(u=this.visualElement.animationState)===null||u===void 0||u.setActive(tr.Drag,!0))},o=(s,l)=>{const{dragPropagation:u,dragDirectionLock:d,onDirectionLock:h,onDrag:m}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:v}=l;if(d&&this.currentDirection===null){this.currentDirection=Qhe(v),this.currentDirection!==null&&(h==null||h(this.currentDirection));return}this.updateAxis("x",l.point,v),this.updateAxis("y",l.point,v),this.visualElement.render(),m==null||m(s,l)},a=(s,l)=>this.stop(s,l);this.panSession=new P$(t,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o==null||o(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(tr.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!nb(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Bhe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Ug(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=$he(r.layoutBox,t):this.constraints=!1,this.elastic=Vhe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Nl(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Hhe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ug(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Khe(r,i.root,this.visualElement.getTransformPagePoint());let a=Fhe(i.layout.layoutBox,o);if(n){const s=n(Whe(a));this.hasMutatedConstraints=!!s,s&&(a=L$(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Nl(d=>{var h;if(!nb(d,n,this.currentDirection))return;let m=(h=l==null?void 0:l[d])!==null&&h!==void 0?h:{};a&&(m={min:0,max:0});const v=i?200:1e6,b=i?40:1e7,S={type:"inertia",velocity:r?t[d]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(d,S)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ok(t,r,0,n)}stopAnimation(){Nl(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){Nl(n=>{const{drag:r}=this.getProps();if(!nb(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-zr(a,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!Ug(r)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Nl(s=>{const l=this.getAxisMotionValue(s);if(l){const u=l.get();o[s]=zhe({min:u,max:u},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",(t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Nl(s=>{if(!nb(s,n,null))return;const l=this.getAxisMotionValue(s),{min:u,max:d}=this.constraints[s];l.set(zr(u,d,o[s]))})}addListeners(){var t;if(!this.visualElement.current)return;Xhe.set(this.visualElement,this);const n=this.visualElement.current,r=Cm(n,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps();d&&h&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();Ug(u)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",i);o&&!o.layout&&((t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout()),i();const s=WS(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Nl(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=u[h].translate,m.set(m.get()+u[h].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),l==null||l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=D7,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function nb(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Qhe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function Jhe(e){const{dragControls:t,visualElement:n}=e,r=VS(()=>new Zhe(n));w.useEffect(()=>t&&t.subscribe(r),[r,t]),w.useEffect(()=>r.addListeners(),[r])}function epe({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(null),{transformPagePoint:s}=w.useContext(j_),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(d,h)=>{a.current=null,n&&n(d,h)}};w.useEffect(()=>{a.current!==null&&a.current.updateHandlers(l)});function u(d){a.current=new P$(d,l,{transformPagePoint:s})}r5(i,"pointerdown",o&&u),q_(()=>a.current&&a.current.end())}const tpe={pan:kd(epe),drag:kd(Jhe)};function B7(e){return typeof e=="string"&&e.startsWith("var(--")}const I$=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function npe(e){const t=I$.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function $7(e,t,n=1){const[r,i]=npe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():B7(i)?$7(i,t,n+1):i}function rpe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!B7(o))return;const a=$7(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!B7(o))continue;const a=$7(o,r);a&&(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const ipe=new Set(["width","height","top","left","right","bottom","x","y"]),R$=e=>ipe.has(e),ope=e=>Object.keys(e).some(R$),D$=(e,t)=>{e.set(t,!1),e.set(t)},QA=e=>e===op||e===Lt;var JA;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(JA||(JA={}));const eO=(e,t)=>parseFloat(e.split(", ")[t]),tO=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return eO(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?eO(o[1],e):0}},ape=new Set(["x","y","z"]),spe=t5.filter(e=>!ape.has(e));function lpe(e){const t=[];return spe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const nO={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:tO(4,13),y:tO(5,14)},upe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=nO[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const d=t.getValue(u);D$(d,s[u]),e[u]=nO[u](l,o)}),e},cpe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(R$);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],h=U1(d);const m=t[l];let v;if(L2(m)){const b=m.length,S=m[0]===null?1:0;d=m[S],h=U1(d);for(let _=S;_=0?window.pageYOffset:null,u=upe(t,e,s);return o.length&&o.forEach(([d,h])=>{e.getValue(d).set(h)}),e.render(),ip&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function dpe(e,t,n,r){return ope(t)?cpe(e,t,n,r):{target:t,transitionEnd:r}}const fpe=(e,t,n,r)=>{const i=rpe(e,t,r);return t=i.target,r=i.transitionEnd,dpe(e,t,n,r)},F7={current:null},N$={current:!1};function hpe(){if(N$.current=!0,!!ip)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>F7.current=e.matches;e.addListener(t),t()}else F7.current=!1}function ppe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(su(o))e.addValue(i,o),u5(r)&&r.add(i);else if(su(a))e.addValue(i,Gm(o)),u5(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,Gm(s!==void 0?s:o))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const j$=Object.keys(P2),gpe=j$.length,rO=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class mpe{constructor({parent:t,props:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Ys.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=s,this.parent=t,this.props=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=HS(n),this.isVariantNode=xB(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n);for(const d in u){const h=u[d];a[d]!==void 0&&su(h)&&(h.set(a[d],!1),u5(l)&&l.add(d))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var n;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(n=this.parent)===null||n===void 0?void 0:n.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),N$.current||hpe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:F7.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,n,r;(t=this.projection)===null||t===void 0||t.unmount(),Uh.update(this.notifyUpdate),Uh.render(this.render),this.valueSubscriptions.forEach(i=>i()),(n=this.removeFromVariantTree)===null||n===void 0||n.call(this),(r=this.parent)===null||r===void 0||r.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(t,n){const r=y0.has(t),i=n.onChange(a=>{this.latestValues[t]=a,this.props.onUpdate&&Ys.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isProjectionDirty=!0)}),o=n.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures(t,n,r,i,o,a){const s=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:m})}return s}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let n=0;nr.variantChildren.delete(t)}addValue(t,n){this.hasValue(t)&&this.removeValue(t),this.values.set(t,n),this.latestValues[t]=n.get(),this.bindToMotionValue(t,n)}removeValue(t){var n;this.values.delete(t),(n=this.valueSubscriptions.get(t))===null||n===void 0||n(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Gm(n),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=U_(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!su(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new qv),this.events[t].add(n)}notify(t,...n){var r;(r=this.events[t])===null||r===void 0||r.notify(...n)}}const B$=["initial",...lk],vpe=B$.length;class $$ extends mpe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){var r;return(r=t.style)===null||r===void 0?void 0:r[n]}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=Che(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){xhe(this,r,a);const s=fpe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function ype(e){return window.getComputedStyle(e)}class bpe extends $${readValueFromInstance(t,n){if(y0.has(n)){const r=nk(n);return r&&r.default||0}else{const r=ype(t),i=(_B(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return M$(t,n)}build(t,n,r,i){z_(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t){return W_(t)}renderInstance(t,n,r,i){jB(t,n,r,i)}}class Spe extends $${getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){var r;return y0.has(n)?((r=nk(n))===null||r===void 0?void 0:r.default)||0:(n=BB.has(n)?n:NB(n),t.getAttribute(n))}measureInstanceViewportBox(){return pi()}scrapeMotionValuesFromProps(t){return FB(t)}build(t,n,r,i){V_(t,n,r,i.transformTemplate)}renderInstance(t,n,r,i){$B(t,n,r,i)}}const xpe=(e,t)=>$_(e)?new Spe(t,{enableHardwareAcceleration:!1}):new bpe(t,{enableHardwareAcceleration:!0});function iO(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const G1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Lt.test(e))e=parseFloat(e);else return e;const n=iO(e,t.target.x),r=iO(e,t.target.y);return`${n}% ${r}%`}},oO="_$css",wpe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(I$,v=>(o.push(v),oO)));const a=tc.parse(e);if(a.length>5)return r;const s=tc.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=d;const h=zr(u,d,.5);typeof a[2+l]=="number"&&(a[2+l]/=h),typeof a[3+l]=="number"&&(a[3+l]/=h);let m=s(a);if(i){let v=0;m=m.replace(oO,()=>{const b=o[v];return v++,b})}return m}};class Cpe extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;Dce(kpe),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Wv.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Ys.postRender(()=>{var s;!((s=a.getStack())===null||s===void 0)&&s.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(i),r!=null&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t==null||t()}render(){return null}}function _pe(e){const[t,n]=tk(),r=w.useContext(B_);return N.createElement(Cpe,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(wB),isPresent:t,safeToRemove:n})}const kpe={borderRadius:{...G1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:G1,borderTopRightRadius:G1,borderBottomLeftRadius:G1,borderBottomRightRadius:G1,boxShadow:wpe},Epe={measureLayout:_pe};function Ppe(e,t,n={}){const r=su(e)?e:Gm(e);return ok("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const F$=["TopLeft","TopRight","BottomLeft","BottomRight"],Tpe=F$.length,aO=e=>typeof e=="string"?parseFloat(e):e,sO=e=>typeof e=="number"||Lt.test(e);function Lpe(e,t,n,r,i,o){var a,s,l,u;i?(e.opacity=zr(0,(a=n.opacity)!==null&&a!==void 0?a:1,Ape(r)),e.opacityExit=zr((s=t.opacity)!==null&&s!==void 0?s:1,0,Ope(r))):o&&(e.opacity=zr((l=t.opacity)!==null&&l!==void 0?l:1,(u=n.opacity)!==null&&u!==void 0?u:1,r));for(let d=0;drt?1:n(A2(e,t,r))}function uO(e,t){e.min=t.min,e.max=t.max}function Rs(e,t){uO(e.x,t.x),uO(e.y,t.y)}function cO(e,t,n,r,i){return e-=t,e=c5(e,1/n,r),i!==void 0&&(e=c5(e,1/i,r)),e}function Mpe(e,t=0,n=1,r=.5,i,o=e,a=e){if(Ql.test(t)&&(t=parseFloat(t),t=zr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=zr(o.min,o.max,r);e===o&&(s-=t),e.min=cO(e.min,t,n,s,i),e.max=cO(e.max,t,n,s,i)}function dO(e,t,[n,r,i],o,a){Mpe(e,t[n],t[r],t[i],t.scale,o,a)}const Ipe=["x","scaleX","originX"],Rpe=["y","scaleY","originY"];function fO(e,t,n,r){dO(e.x,t,Ipe,n==null?void 0:n.x,r==null?void 0:r.x),dO(e.y,t,Rpe,n==null?void 0:n.y,r==null?void 0:r.y)}function hO(e){return e.translate===0&&e.scale===1}function H$(e){return hO(e.x)&&hO(e.y)}function V$(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function pO(e){return Ma(e.x)/Ma(e.y)}function Dpe(e,t,n=.1){return ek(e,t)<=n}class Npe{constructor(){this.members=[]}add(t){ak(this.members,t),t.scheduleRender()}remove(t){if(sk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){var r;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(i=t.resumingFrom)===null||i===void 0?void 0:(o=i.options).onExitComplete)===null||a===void 0||a.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gO(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),d&&(r+=`rotateY(${d}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const jpe=(e,t)=>e.depth-t.depth;class Bpe{constructor(){this.children=[],this.isDirty=!1}add(t){ak(this.children,t),this.isDirty=!0}remove(t){sk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jpe),this.isDirty=!1,this.children.forEach(t)}}const mO=["","X","Y","Z"],vO=1e3;let $pe=0;function W$({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=$pe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Wpe),this.nodes.forEach(Upe)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=C$(v,250),Wv.hasAnimatedSinceResize&&(Wv.hasAnimatedSinceResize=!1,this.nodes.forEach(bO))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&h&&(u||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:v,hasRelativeTargetChanged:b,layout:S})=>{var _,E,k,T,A;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const M=(E=(_=this.options.transition)!==null&&_!==void 0?_:h.getDefaultTransition())!==null&&E!==void 0?E:Xpe,{onLayoutAnimationStart:R,onLayoutAnimationComplete:D}=h.getProps(),j=!this.targetLayout||!V$(this.targetLayout,S)||b,z=!v&&b;if(!((k=this.resumeFrom)===null||k===void 0)&&k.instance||z||v&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,z);const H={...ik(M,"layout"),onPlay:R,onComplete:D};h.shouldReduceMotion&&(H.delay=0,H.type=!1),this.startAnimation(H)}else!v&&this.animationProgress===0&&bO(this),this.isLead()&&((A=(T=this.options).onExitComplete)===null||A===void 0||A.call(T));this.targetLayout=S})}unmount(){var a,s;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(s=this.parent)===null||s===void 0||s.children.delete(this),this.instance=void 0,Uh.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(Gpe),this.animationId++)}willUpdate(a=!0){var s,l,u;if(this.root.isUpdateBlocked()){(l=(s=this.options).onExitComplete)===null||l===void 0||l.call(s);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var T;const A=k/1e3;SO(v.x,a.x,A),SO(v.y,a.y,A),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((T=this.relativeParent)===null||T===void 0)&&T.layout)&&(Kv(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ype(this.relativeTarget,this.relativeTargetOrigin,b,A)),S&&(this.animationValues=m,Lpe(m,h,this.latestValues,A,E,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(0)}startAnimation(a){var s,l;this.notifyListeners("animationStart"),(s=this.currentAnimation)===null||s===void 0||s.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(Uh.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ys.update(()=>{Wv.hasAnimatedSinceResize=!0,this.currentAnimation=Ppe(0,vO,{...a,onUpdate:u=>{var d;this.mixTargetDelta(u),(d=a.onUpdate)===null||d===void 0||d.call(a,u)},onComplete:()=>{var u;(u=a.onComplete)===null||u===void 0||u.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,vO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:d}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&U$(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||pi();const h=Ma(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+h;const m=Ma(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}Rs(s,l),Gg(s,d),Yv(this.projectionDeltaWithTransform,this.layoutCorrected,s,d)}}registerSharedNode(a,s){var l,u,d;this.sharedNodes.has(a)||this.sharedNodes.set(a,new Npe),this.sharedNodes.get(a).add(s),s.promote({transition:(l=s.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(d=(u=s.options.initialPromotionConfig)===null||u===void 0?void 0:u.shouldPreserveFollowOpacity)===null||d===void 0?void 0:d.call(u,s)})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(yO),this.root.sharedNodes.clear()}}}function Fpe(e){e.updateLayout()}function zpe(e){var t,n,r;const i=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:a}=e.layout,{animationType:s}=e.options,l=i.source!==e.layout.source;s==="size"?Nl(v=>{const b=l?i.measuredBox[v]:i.layoutBox[v],S=Ma(b);b.min=o[v].min,b.max=b.min+S}):U$(s,i.layoutBox,o)&&Nl(v=>{const b=l?i.measuredBox[v]:i.layoutBox[v],S=Ma(o[v]);b.max=b.min+S});const u=Xv();Yv(u,o,i.layoutBox);const d=Xv();l?Yv(d,e.applyTransform(a,!0),i.measuredBox):Yv(d,o,i.layoutBox);const h=!H$(u);let m=!1;if(!e.resumeFrom){const v=e.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:b,layout:S}=v;if(b&&S){const _=pi();Kv(_,i.layoutBox,b.layoutBox);const E=pi();Kv(E,o,S.layoutBox),V$(_,E)||(m=!0)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:d,layoutDelta:u,hasLayoutChanged:h,hasRelativeTargetChanged:m})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function Hpe(e){e.clearSnapshot()}function yO(e){e.clearMeasurements()}function Vpe(e){const{visualElement:t}=e.options;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function bO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Wpe(e){e.resolveTargetDelta()}function Upe(e){e.calcProjection()}function Gpe(e){e.resetRotation()}function qpe(e){e.removeLeadSnapshot()}function SO(e,t,n){e.translate=zr(t.translate,0,n),e.scale=zr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xO(e,t,n,r){e.min=zr(t.min,n.min,r),e.max=zr(t.max,n.max,r)}function Ype(e,t,n,r){xO(e.x,t.x,n.x,r),xO(e.y,t.y,n.y,r)}function Kpe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Xpe={duration:.45,ease:[.4,0,.1,1]};function Zpe(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function wO(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function Qpe(e){wO(e.x),wO(e.y)}function U$(e,t,n){return e==="position"||e==="preserve-aspect"&&!Dpe(pO(t),pO(n),.2)}const Jpe=W$({attachResizeListener:(e,t)=>WS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_6={current:void 0},ege=W$({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_6.current){const e=new Jpe(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),_6.current=e}return _6.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),tge={...Rhe,...Wfe,...tpe,...Epe},hu=Ice((e,t)=>yde(e,t,tge,xpe,ege));function G$(){const e=w.useRef(!1);return J4(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function nge(){const e=G$(),[t,n]=w.useState(0),r=w.useCallback(()=>{e.current&&n(t+1)},[t]);return[w.useCallback(()=>Ys.postRender(r),[r]),t]}class rge extends w.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ige({children:e,isPresent:t}){const n=w.useId(),r=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0});return w.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` + )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},Wse={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Use=e=>({bg:Et("gray.100","whiteAlpha.300")(e)}),Gse=e=>({transitionProperty:"common",transitionDuration:"slow",...Vse(e)}),qse=Sv(e=>({label:Wse,filledTrack:Gse(e),track:Use(e)})),Yse={xs:Sv({track:{h:"1"}}),sm:Sv({track:{h:"2"}}),md:Sv({track:{h:"3"}}),lg:Sv({track:{h:"4"}})},Kse=Hse({sizes:Yse,baseStyle:qse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Xse,definePartsStyle:d4}=pr(qre.keys),Zse=e=>{var t;const n=(t=To(X4.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Qse=d4(e=>{var t,n,r,i;return{label:(n=(t=X4).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=X4).baseStyle)==null?void 0:i.call(r,e).container,control:Zse(e)}}),Jse={md:d4({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:d4({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:d4({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},ele=Xse({baseStyle:Qse,sizes:Jse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:tle,definePartsStyle:nle}=pr(Yre.keys),Y3=Vn("select-bg"),JL,rle={...(JL=kn.baseStyle)==null?void 0:JL.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Y3.reference,[Y3.variable]:"colors.white",_dark:{[Y3.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Y3.reference}},ile={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},ole=nle({field:rle,icon:ile}),K3={paddingInlineEnd:"8"},eA,tA,nA,rA,iA,oA,aA,sA,ale={lg:{...(eA=kn.sizes)==null?void 0:eA.lg,field:{...(tA=kn.sizes)==null?void 0:tA.lg.field,...K3}},md:{...(nA=kn.sizes)==null?void 0:nA.md,field:{...(rA=kn.sizes)==null?void 0:rA.md.field,...K3}},sm:{...(iA=kn.sizes)==null?void 0:iA.sm,field:{...(oA=kn.sizes)==null?void 0:oA.sm.field,...K3}},xs:{...(aA=kn.sizes)==null?void 0:aA.xs,field:{...(sA=kn.sizes)==null?void 0:sA.xs.field,...K3},icon:{insetEnd:"1"}}},sle=tle({baseStyle:ole,sizes:ale,variants:kn.variants,defaultProps:kn.defaultProps}),u6=Vn("skeleton-start-color"),c6=Vn("skeleton-end-color"),lle={[u6.variable]:"colors.gray.100",[c6.variable]:"colors.gray.400",_dark:{[u6.variable]:"colors.gray.800",[c6.variable]:"colors.gray.600"},background:u6.reference,borderColor:c6.reference,opacity:.7,borderRadius:"sm"},ule={baseStyle:lle},d6=Vn("skip-link-bg"),cle={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[d6.variable]:"colors.white",_dark:{[d6.variable]:"colors.gray.700"},bg:d6.reference}},dle={baseStyle:cle},{defineMultiStyleConfig:fle,definePartsStyle:BS}=pr(Kre.keys),_2=Vn("slider-thumb-size"),k2=Vn("slider-track-size"),bd=Vn("slider-bg"),hle=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...I_({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},ple=e=>({...I_({orientation:e.orientation,horizontal:{h:k2.reference},vertical:{w:k2.reference}}),overflow:"hidden",borderRadius:"sm",[bd.variable]:"colors.gray.200",_dark:{[bd.variable]:"colors.whiteAlpha.200"},_disabled:{[bd.variable]:"colors.gray.300",_dark:{[bd.variable]:"colors.whiteAlpha.300"}},bg:bd.reference}),gle=e=>{const{orientation:t}=e;return{...I_({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:_2.reference,h:_2.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},mle=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[bd.variable]:`colors.${t}.500`,_dark:{[bd.variable]:`colors.${t}.200`},bg:bd.reference}},vle=BS(e=>({container:hle(e),track:ple(e),thumb:gle(e),filledTrack:mle(e)})),yle=BS({container:{[_2.variable]:"sizes.4",[k2.variable]:"sizes.1"}}),ble=BS({container:{[_2.variable]:"sizes.3.5",[k2.variable]:"sizes.1"}}),Sle=BS({container:{[_2.variable]:"sizes.2.5",[k2.variable]:"sizes.0.5"}}),xle={lg:yle,md:ble,sm:Sle},wle=fle({baseStyle:vle,sizes:xle,defaultProps:{size:"md",colorScheme:"blue"}}),wh=yi("spinner-size"),Cle={width:[wh.reference],height:[wh.reference]},_le={xs:{[wh.variable]:"sizes.3"},sm:{[wh.variable]:"sizes.4"},md:{[wh.variable]:"sizes.6"},lg:{[wh.variable]:"sizes.8"},xl:{[wh.variable]:"sizes.12"}},kle={baseStyle:Cle,sizes:_le,defaultProps:{size:"md"}},{defineMultiStyleConfig:Ele,definePartsStyle:mB}=pr(Xre.keys),Ple={fontWeight:"medium"},Tle={opacity:.8,marginBottom:"2"},Lle={verticalAlign:"baseline",fontWeight:"semibold"},Ale={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},Ole=mB({container:{},label:Ple,helpText:Tle,number:Lle,icon:Ale}),Mle={md:mB({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},Ile=Ele({baseStyle:Ole,sizes:Mle,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Rle,definePartsStyle:f4}=pr(Zre.keys),Vv=yi("switch-track-width"),Rh=yi("switch-track-height"),f6=yi("switch-track-diff"),Dle=Uu.subtract(Vv,Rh),b7=yi("switch-thumb-x"),U1=yi("switch-bg"),Nle=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Vv.reference],height:[Rh.reference],transitionProperty:"common",transitionDuration:"fast",[U1.variable]:"colors.gray.300",_dark:{[U1.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[U1.variable]:`colors.${t}.500`,_dark:{[U1.variable]:`colors.${t}.200`}},bg:U1.reference}},jle={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Rh.reference],height:[Rh.reference],_checked:{transform:`translateX(${b7.reference})`}},Ble=f4(e=>({container:{[f6.variable]:Dle,[b7.variable]:f6.reference,_rtl:{[b7.variable]:Uu(f6).negate().toString()}},track:Nle(e),thumb:jle})),Fle={sm:f4({container:{[Vv.variable]:"1.375rem",[Rh.variable]:"sizes.3"}}),md:f4({container:{[Vv.variable]:"1.875rem",[Rh.variable]:"sizes.4"}}),lg:f4({container:{[Vv.variable]:"2.875rem",[Rh.variable]:"sizes.6"}})},$le=Rle({baseStyle:Ble,sizes:Fle,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:zle,definePartsStyle:Cm}=pr(Qre.keys),Hle=Cm({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Z4={"&[data-is-numeric=true]":{textAlign:"end"}},Vle=Cm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},caption:{color:Et("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Wle=Cm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},caption:{color:Et("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e)},td:{background:Et(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Ule={simple:Vle,striped:Wle,unstyled:{}},Gle={sm:Cm({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:Cm({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:Cm({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},qle=zle({baseStyle:Hle,variants:Ule,sizes:Gle,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Xo=Vn("tabs-color"),Vs=Vn("tabs-bg"),X3=Vn("tabs-border-color"),{defineMultiStyleConfig:Yle,definePartsStyle:Zl}=pr(Jre.keys),Kle=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},Xle=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Zle=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},Qle={p:4},Jle=Zl(e=>({root:Kle(e),tab:Xle(e),tablist:Zle(e),tabpanel:Qle})),eue={sm:Zl({tab:{py:1,px:4,fontSize:"sm"}}),md:Zl({tab:{fontSize:"md",py:2,px:4}}),lg:Zl({tab:{fontSize:"lg",py:3,px:4}})},tue=Zl(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Xo.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Vs.variable]:"colors.gray.200",_dark:{[Vs.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Xo.reference,bg:Vs.reference}}}),nue=Zl(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[X3.reference]:"transparent",_selected:{[Xo.variable]:`colors.${t}.600`,[X3.variable]:"colors.white",_dark:{[Xo.variable]:`colors.${t}.300`,[X3.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:X3.reference},color:Xo.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),rue=Zl(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Vs.variable]:"colors.gray.50",_dark:{[Vs.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Vs.variable]:"colors.white",[Xo.variable]:`colors.${t}.600`,_dark:{[Vs.variable]:"colors.gray.800",[Xo.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Xo.reference,bg:Vs.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),iue=Zl(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ko(n,`${t}.700`),bg:ko(n,`${t}.100`)}}}}),oue=Zl(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Xo.variable]:"colors.gray.600",_dark:{[Xo.variable]:"inherit"},_selected:{[Xo.variable]:"colors.white",[Vs.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:"colors.gray.800",[Vs.variable]:`colors.${t}.300`}},color:Xo.reference,bg:Vs.reference}}}),aue=Zl({}),sue={line:tue,enclosed:nue,"enclosed-colored":rue,"soft-rounded":iue,"solid-rounded":oue,unstyled:aue},lue=Yle({baseStyle:Jle,sizes:eue,variants:sue,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:uue,definePartsStyle:Dh}=pr(eie.keys),cue={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},due={lineHeight:1.2,overflow:"visible"},fue={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},hue=Dh({container:cue,label:due,closeButton:fue}),pue={sm:Dh({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Dh({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Dh({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},gue={subtle:Dh(e=>{var t;return{container:(t=$v.variants)==null?void 0:t.subtle(e)}}),solid:Dh(e=>{var t;return{container:(t=$v.variants)==null?void 0:t.solid(e)}}),outline:Dh(e=>{var t;return{container:(t=$v.variants)==null?void 0:t.outline(e)}})},mue=uue({variants:gue,baseStyle:hue,sizes:pue,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),lA,vue={...(lA=kn.baseStyle)==null?void 0:lA.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},uA,yue={outline:e=>{var t;return((t=kn.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=kn.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=kn.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((uA=kn.variants)==null?void 0:uA.unstyled.field)??{}},cA,dA,fA,hA,bue={xs:((cA=kn.sizes)==null?void 0:cA.xs.field)??{},sm:((dA=kn.sizes)==null?void 0:dA.sm.field)??{},md:((fA=kn.sizes)==null?void 0:fA.md.field)??{},lg:((hA=kn.sizes)==null?void 0:hA.lg.field)??{}},Sue={baseStyle:vue,sizes:bue,variants:yue,defaultProps:{size:"md",variant:"outline"}},Z3=yi("tooltip-bg"),h6=yi("tooltip-fg"),xue=yi("popper-arrow-bg"),wue={bg:Z3.reference,color:h6.reference,[Z3.variable]:"colors.gray.700",[h6.variable]:"colors.whiteAlpha.900",_dark:{[Z3.variable]:"colors.gray.300",[h6.variable]:"colors.gray.900"},[xue.variable]:Z3.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},Cue={baseStyle:wue},_ue={Accordion:zie,Alert:Kie,Avatar:aoe,Badge:$v,Breadcrumb:moe,Button:koe,Checkbox:X4,CloseButton:$oe,Code:Woe,Container:Goe,Divider:Zoe,Drawer:lae,Editable:gae,Form:xae,FormError:Pae,FormLabel:Lae,Heading:Mae,Input:kn,Kbd:Hae,Link:Wae,List:Kae,Menu:ose,Modal:mse,NumberInput:Ese,PinInput:Ase,Popover:zse,Progress:Kse,Radio:ele,Select:sle,Skeleton:ule,SkipLink:dle,Slider:wle,Spinner:kle,Stat:Ile,Switch:$le,Table:qle,Tabs:lue,Tag:mue,Textarea:Sue,Tooltip:Cue,Card:Aoe},kue={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Eue=kue,Pue={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Tue=Pue,Lue={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},Aue=Lue,Oue={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Mue=Oue,Iue={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},Rue=Iue,Due={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Nue={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},jue={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Bue={property:Due,easing:Nue,duration:jue},Fue=Bue,$ue={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},zue=$ue,Hue={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Vue=Hue,Wue={breakpoints:Tue,zIndices:zue,radii:Mue,blur:Vue,colors:Aue,...hB,sizes:cB,shadows:Rue,space:uB,borders:Eue,transition:Fue},Uue={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},Gue={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},que="ltr",Yue={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},Kue={semanticTokens:Uue,direction:que,...Wue,components:_ue,styles:Gue,config:Yue},Xue=typeof Element<"u",Zue=typeof Map=="function",Que=typeof Set=="function",Jue=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function h4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!h4(e[r],t[r]))return!1;return!0}var o;if(Zue&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!h4(r.value[1],t.get(r.value[0])))return!1;return!0}if(Que&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Jue&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(Xue&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!h4(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var ece=function(t,n){try{return h4(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function v0(){const e=w.useContext(w2);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function vB(){const e=gy(),t=v0();return{...e,theme:t}}function tce(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__breakpoints)==null?void 0:o.asArray)==null?void 0:a[i]};return r(t)??r(n)??n}function nce(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__cssMap)==null?void 0:o[i])==null?void 0:a.value};return r(t)??r(n)??n}function rce(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{if(e==="breakpoints")return tce(o,l,a[u]??l);const d=`${e}.${l}`;return nce(o,d,a[u]??l)});return Array.isArray(t)?s:s[0]}}function ice(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=w.useMemo(()=>Qte(n),[n]);return N.createElement(sre,{theme:i},N.createElement(oce,{root:t}),r)}function oce({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return N.createElement(DS,{styles:n=>({[t]:n.__cssVars})})}Cre({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function ace(){const{colorMode:e}=gy();return N.createElement(DS,{styles:t=>{const n=Qj(t,"styles.global"),r=tB(n,{theme:t,colorMode:e});return r?Aj(r)(t):void 0}})}var sce=new Set([...ene,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),lce=new Set(["htmlWidth","htmlHeight","htmlSize"]);function uce(e){return lce.has(e)||!sce.has(e)}var cce=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=Jj(a,(h,m)=>nne(m)),l=tB(e,t),u=Object.assign({},i,l,eB(s),o),d=Aj(u)(t.theme);return r?[d,r]:d};function p6(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=uce);const i=cce({baseStyle:n}),o=p7(e,r)(i);return N.forwardRef(function(l,u){const{colorMode:d,forced:h}=gy();return N.createElement(o,{ref:u,"data-theme":h?d:void 0,...l})})}function Ae(e){return w.forwardRef(e)}function yB(e,t={}){const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=vB(),a=e?Qj(i,`components.${e}`):void 0,s=n||a,l=Gl({theme:i,colorMode:o},(s==null?void 0:s.defaultProps)??{},eB(vre(r,["children"]))),u=w.useRef({});if(s){const h=fne(s)(l);ece(u.current,h)||(u.current=h)}return u.current}function Oo(e,t={}){return yB(e,t)}function Oi(e,t={}){return yB(e,t)}function dce(){const e=new Map;return new Proxy(p6,{apply(t,n,r){return p6(...r)},get(t,n){return e.has(n)||e.set(n,p6(n)),e.get(n)}})}var Ce=dce();function fce(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Pn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o}=e,a=w.createContext(void 0);a.displayName=t;function s(){var l;const u=w.useContext(a);if(!u&&n){const d=new Error(o??fce(r,i));throw d.name="ContextError",(l=Error.captureStackTrace)==null||l.call(Error,d,s),d}return u}return[a.Provider,s,a]}function hce(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Hn(...e){return t=>{e.forEach(n=>{hce(n,t)})}}function pce(...e){return w.useMemo(()=>Hn(...e),e)}function pA(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var gce=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function gA(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function mA(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var S7=typeof window<"u"?w.useLayoutEffect:w.useEffect,Q4=e=>e,mce=class{constructor(){sn(this,"descendants",new Map);sn(this,"register",e=>{if(e!=null)return gce(e)?this.registerNode(e):t=>{this.registerNode(t,e)}});sn(this,"unregister",e=>{this.descendants.delete(e);const t=pA(Array.from(this.descendants.keys()));this.assignIndex(t)});sn(this,"destroy",()=>{this.descendants.clear()});sn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})});sn(this,"count",()=>this.descendants.size);sn(this,"enabledCount",()=>this.enabledValues().length);sn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index));sn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled));sn(this,"item",e=>{if(this.count()!==0)return this.values()[e]});sn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]});sn(this,"first",()=>this.item(0));sn(this,"firstEnabled",()=>this.enabledItem(0));sn(this,"last",()=>this.item(this.descendants.size-1));sn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)});sn(this,"indexOf",e=>{var t;return e?((t=this.descendants.get(e))==null?void 0:t.index)??-1:-1});sn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e)));sn(this,"next",(e,t=!0)=>{const n=gA(e,this.count(),t);return this.item(n)});sn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=gA(r,this.enabledCount(),t);return this.enabledItem(i)});sn(this,"prev",(e,t=!0)=>{const n=mA(e,this.count()-1,t);return this.item(n)});sn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=mA(r,this.enabledCount()-1,t);return this.enabledItem(i)});sn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=pA(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function vce(){const e=w.useRef(new mce);return S7(()=>()=>e.current.destroy()),e.current}var[yce,bB]=Pn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function bce(e){const t=bB(),[n,r]=w.useState(-1),i=w.useRef(null);S7(()=>()=>{i.current&&t.unregister(i.current)},[]),S7(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=Q4(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:Hn(o,i)}}function SB(){return[Q4(yce),()=>Q4(bB()),()=>vce(),i=>bce(i)]}var Qr=(...e)=>e.filter(Boolean).join(" "),vA={path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})),viewBox:"0 0 24 24"},Na=Ae((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,d=Qr("chakra-icon",s),h={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},m={ref:t,focusable:o,className:d,__css:h},y=r??vA.viewBox;if(n&&typeof n!="string")return N.createElement(Ce.svg,{as:n,...m,...u});const b=a??vA.path;return N.createElement(Ce.svg,{verticalAlign:"middle",viewBox:y,...m,...u},b)});Na.displayName="Icon";function yt(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=w.Children.toArray(e.path),a=Ae((s,l)=>N.createElement(Na,{ref:l,viewBox:t,...i,...s},o.length?o:N.createElement("path",{fill:"currentColor",d:n})));return a.displayName=r,a}function Er(e,t=[]){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function FS(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,y)=>m!==y}=e,o=Er(r),a=Er(i),[s,l]=w.useState(n),u=t!==void 0,d=u?t:s,h=Er(m=>{const b=typeof m=="function"?m(d):m;a(d,b)&&(u||l(b),o(b))},[u,o,d,a]);return[d,h]}const j_=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),$S=w.createContext({});function Sce(){return w.useContext($S).visualElement}const y0=w.createContext(null),op=typeof document<"u",J4=op?w.useLayoutEffect:w.useEffect,xB=w.createContext({strict:!1});function xce(e,t,n,r){const i=Sce(),o=w.useContext(xB),a=w.useContext(y0),s=w.useContext(j_).reducedMotion,l=w.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return J4(()=>{u&&u.render()}),w.useEffect(()=>{u&&u.animationState&&u.animationState.animateChanges()}),J4(()=>()=>u&&u.notify("Unmount"),[]),u}function Gg(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wce(e,t,n){return w.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Gg(n)&&(n.current=r))},[t])}function E2(e){return typeof e=="string"||Array.isArray(e)}function zS(e){return typeof e=="object"&&typeof e.start=="function"}const Cce=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function HS(e){return zS(e.animate)||Cce.some(t=>E2(e[t]))}function wB(e){return Boolean(HS(e)||e.variants)}function _ce(e,t){if(HS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||E2(n)?n:void 0,animate:E2(r)?r:void 0}}return e.inherit!==!1?t:{}}function kce(e){const{initial:t,animate:n}=_ce(e,w.useContext($S));return w.useMemo(()=>({initial:t,animate:n}),[yA(t),yA(n)])}function yA(e){return Array.isArray(e)?e.join(" "):e}const $u=e=>({isEnabled:t=>e.some(n=>!!t[n])}),P2={measureLayout:$u(["layout","layoutId","drag"]),animation:$u(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:$u(["exit"]),drag:$u(["drag","dragControls"]),focus:$u(["whileFocus"]),hover:$u(["whileHover","onHoverStart","onHoverEnd"]),tap:$u(["whileTap","onTap","onTapStart","onTapCancel"]),pan:$u(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:$u(["whileInView","onViewportEnter","onViewportLeave"])};function Ece(e){for(const t in e)t==="projectionNodeConstructor"?P2.projectionNodeConstructor=e[t]:P2[t].Component=e[t]}function VS(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Wv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Pce=1;function Tce(){return VS(()=>{if(Wv.hasEverUpdated)return Pce++})}const B_=w.createContext({});class Lce extends N.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const CB=w.createContext({}),Ace=Symbol.for("motionComponentSymbol");function Oce({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&Ece(e);function a(l,u){const d={...w.useContext(j_),...l,layoutId:Mce(l)},{isStatic:h}=d;let m=null;const y=kce(l),b=h?void 0:Tce(),x=i(l,h);if(!h&&op){y.visualElement=xce(o,x,d,t);const k=w.useContext(xB).strict,E=w.useContext(CB);y.visualElement&&(m=y.visualElement.loadFeatures(d,k,e,b,n||P2.projectionNodeConstructor,E))}return w.createElement(Lce,{visualElement:y.visualElement,props:d},m,w.createElement($S.Provider,{value:y},r(o,l,b,wce(x,y.visualElement,u),x,h,y.visualElement)))}const s=w.forwardRef(a);return s[Ace]=o,s}function Mce({layoutId:e}){const t=w.useContext(B_).id;return t&&e!==void 0?t+"-"+e:e}function Ice(e){function t(r,i={}){return Oce(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const Rce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function F_(e){return typeof e!="string"||e.includes("-")?!1:!!(Rce.indexOf(e)>-1||/[A-Z]/.test(e))}const e5={};function Dce(e){Object.assign(e5,e)}const t5=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],b0=new Set(t5);function _B(e,{layout:t,layoutId:n}){return b0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!e5[e]||e==="opacity")}const su=e=>!!(e!=null&&e.getVelocity),Nce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jce=(e,t)=>t5.indexOf(e)-t5.indexOf(t);function Bce({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";t.sort(jce);for(const s of t)a+=`${Nce[s]||s}(${e[s]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}function kB(e){return e.startsWith("--")}const Fce=(e,t)=>t&&typeof e=="number"?t.transform(e):e,EB=(e,t)=>n=>Math.max(Math.min(n,t),e),Uv=e=>e%1?Number(e.toFixed(5)):e,T2=/(-)?([\d]*\.?[\d])+/g,x7=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,$ce=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function by(e){return typeof e=="string"}const ap={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Gv=Object.assign(Object.assign({},ap),{transform:EB(0,1)}),Q3=Object.assign(Object.assign({},ap),{default:1}),Sy=e=>({test:t=>by(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),fd=Sy("deg"),Ql=Sy("%"),Lt=Sy("px"),zce=Sy("vh"),Hce=Sy("vw"),bA=Object.assign(Object.assign({},Ql),{parse:e=>Ql.parse(e)/100,transform:e=>Ql.transform(e*100)}),$_=(e,t)=>n=>Boolean(by(n)&&$ce.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),PB=(e,t,n)=>r=>{if(!by(r))return r;const[i,o,a,s]=r.match(T2);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},Eh={test:$_("hsl","hue"),parse:PB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ql.transform(Uv(t))+", "+Ql.transform(Uv(n))+", "+Uv(Gv.transform(r))+")"},Vce=EB(0,255),g6=Object.assign(Object.assign({},ap),{transform:e=>Math.round(Vce(e))}),_d={test:$_("rgb","red"),parse:PB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+g6.transform(e)+", "+g6.transform(t)+", "+g6.transform(n)+", "+Uv(Gv.transform(r))+")"};function Wce(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const w7={test:$_("#"),parse:Wce,transform:_d.transform},wo={test:e=>_d.test(e)||w7.test(e)||Eh.test(e),parse:e=>_d.test(e)?_d.parse(e):Eh.test(e)?Eh.parse(e):w7.parse(e),transform:e=>by(e)?e:e.hasOwnProperty("red")?_d.transform(e):Eh.transform(e)},TB="${c}",LB="${n}";function Uce(e){var t,n,r,i;return isNaN(e)&&by(e)&&((n=(t=e.match(T2))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((i=(r=e.match(x7))===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0}function AB(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(x7);r&&(n=r.length,e=e.replace(x7,TB),t.push(...r.map(wo.parse)));const i=e.match(T2);return i&&(e=e.replace(T2,LB),t.push(...i.map(ap.parse))),{values:t,numColors:n,tokenised:e}}function OB(e){return AB(e).values}function MB(e){const{values:t,numColors:n,tokenised:r}=AB(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function qce(e){const t=OB(e);return MB(e)(t.map(Gce))}const tc={test:Uce,parse:OB,createTransformer:MB,getAnimatableNone:qce},Yce=new Set(["brightness","contrast","saturate","opacity"]);function Kce(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(T2)||[];if(!r)return e;const i=n.replace(r,"");let o=Yce.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const Xce=/([a-z-]*)\(.*?\)/g,C7=Object.assign(Object.assign({},tc),{getAnimatableNone:e=>{const t=e.match(Xce);return t?t.map(Kce).join(" "):e}}),SA={...ap,transform:Math.round},IB={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,size:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,rotate:fd,rotateX:fd,rotateY:fd,rotateZ:fd,scale:Q3,scaleX:Q3,scaleY:Q3,scaleZ:Q3,skew:fd,skewX:fd,skewY:fd,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:Gv,originX:bA,originY:bA,originZ:Lt,zIndex:SA,fillOpacity:Gv,strokeOpacity:Gv,numOctaves:SA};function z_(e,t,n,r){const{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let u=!1,d=!1,h=!0;for(const m in t){const y=t[m];if(kB(m)){o[m]=y;continue}const b=IB[m],x=Fce(y,b);if(b0.has(m)){if(u=!0,a[m]=x,s.push(m),!h)continue;y!==(b.default||0)&&(h=!1)}else m.startsWith("origin")?(d=!0,l[m]=x):i[m]=x}if(t.transform||(u||r?i.transform=Bce(e,n,h,r):i.transform&&(i.transform="none")),d){const{originX:m="50%",originY:y="50%",originZ:b=0}=l;i.transformOrigin=`${m} ${y} ${b}`}}const H_=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function RB(e,t,n){for(const r in t)!su(t[r])&&!_B(r,n)&&(e[r]=t[r])}function Zce({transformTemplate:e},t,n){return w.useMemo(()=>{const r=H_();return z_(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function Qce(e,t,n){const r=e.style||{},i={};return RB(i,r,e),Object.assign(i,Zce(e,t,n)),e.transformValues?e.transformValues(i):i}function Jce(e,t,n){const r={},i=Qce(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),r.style=i,r}const ede=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],tde=["whileTap","onTap","onTapStart","onTapCancel"],nde=["onPan","onPanStart","onPanSessionStart","onPanEnd"],rde=["whileInView","onViewportEnter","onViewportLeave","viewport"],ide=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...rde,...tde,...ede,...nde]);function n5(e){return ide.has(e)}let DB=e=>!n5(e);function ode(e){e&&(DB=t=>t.startsWith("on")?!n5(t):e(t))}try{ode(require("@emotion/is-prop-valid").default)}catch{}function ade(e,t,n){const r={};for(const i in e)(DB(i)||n===!0&&n5(i)||!t&&!n5(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function xA(e,t,n){return typeof e=="string"?e:Lt.transform(t+n*e)}function sde(e,t,n){const r=xA(t,e.x,e.width),i=xA(n,e.y,e.height);return`${r} ${i}`}const lde={offset:"stroke-dashoffset",array:"stroke-dasharray"},ude={offset:"strokeDashoffset",array:"strokeDasharray"};function cde(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?lde:ude;e[o.offset]=Lt.transform(-r);const a=Lt.transform(t),s=Lt.transform(n);e[o.array]=`${a} ${s}`}function V_(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,d){z_(e,l,u,d),e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:y}=e;h.transform&&(y&&(m.transform=h.transform),delete h.transform),y&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=sde(y,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),o!==void 0&&cde(h,o,a,s,!1)}const NB=()=>({...H_(),attrs:{}});function dde(e,t){const n=w.useMemo(()=>{const r=NB();return V_(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};RB(r,e.style,e),n.style={...r,...n.style}}return n}function fde(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=(F_(n)?dde:Jce)(r,a,s),h={...ade(r,typeof n=="string",e),...u,ref:o};return i&&(h["data-projection-id"]=i),w.createElement(n,h)}}const jB=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function BB(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const FB=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function $B(e,t,n,r){BB(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(FB.has(i)?i:jB(i),t.attrs[i])}function W_(e){const{style:t}=e,n={};for(const r in t)(su(t[r])||_B(r,e))&&(n[r]=t[r]);return n}function zB(e){const t=W_(e);for(const n in e)if(su(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function U_(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const L2=e=>Array.isArray(e),hde=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),HB=e=>L2(e)?e[e.length-1]||0:e;function p4(e){const t=su(e)?e.get():e;return hde(t)?t.toValue():t}function pde({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:gde(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const VB=e=>(t,n)=>{const r=w.useContext($S),i=w.useContext(y0),o=()=>pde(e,t,r,i);return n?o():VS(o)};function gde(e,t,n,r){const i={},o=r(e);for(const m in o)i[m]=p4(o[m]);let{initial:a,animate:s}=e;const l=HS(e),u=wB(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?s:a;return h&&typeof h!="boolean"&&!zS(h)&&(Array.isArray(h)?h:[h]).forEach(y=>{const b=U_(e,y);if(!b)return;const{transitionEnd:x,transition:k,...E}=b;for(const _ in E){let P=E[_];if(Array.isArray(P)){const A=d?P.length-1:0;P=P[A]}P!==null&&(i[_]=P)}for(const _ in x)i[_]=x[_]}),i}const mde={useVisualState:VB({scrapeMotionValuesFromProps:zB,createRenderState:NB,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}V_(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),$B(t,n)}})},vde={useVisualState:VB({scrapeMotionValuesFromProps:W_,createRenderState:H_})};function yde(e,{forwardMotionProps:t=!1},n,r,i){return{...F_(e)?mde:vde,preloadedFeatures:n,useRender:fde(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}}var tr;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(tr||(tr={}));function WS(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function _7(e,t,n,r){w.useEffect(()=>{const i=e.current;if(n&&i)return WS(i,t,n,r)},[e,t,n,r])}function bde({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(tr.Focus,!0)},i=()=>{n&&n.setActive(tr.Focus,!1)};_7(t,"focus",e?r:void 0),_7(t,"blur",e?i:void 0)}function WB(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function UB(e){return!!e.touches}function Sde(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const xde={pageX:0,pageY:0};function wde(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||xde;return{x:r[t+"X"],y:r[t+"Y"]}}function Cde(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function G_(e,t="page"){return{point:UB(e)?wde(e,t):Cde(e,t)}}const GB=(e,t=!1)=>{const n=r=>e(r,G_(r));return t?Sde(n):n},_de=()=>op&&window.onpointerdown===null,kde=()=>op&&window.ontouchstart===null,Ede=()=>op&&window.onmousedown===null,Pde={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Tde={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function qB(e){return _de()?e:kde()?Tde[e]:Ede()?Pde[e]:e}function _m(e,t,n,r){return WS(e,qB(t),GB(n,t==="pointerdown"),r)}function r5(e,t,n,r){return _7(e,qB(t),n&&GB(n,t==="pointerdown"),r)}function YB(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const wA=YB("dragHorizontal"),CA=YB("dragVertical");function KB(e){let t=!1;if(e==="y")t=CA();else if(e==="x")t=wA();else{const n=wA(),r=CA();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function XB(){const e=KB(!0);return e?(e(),!1):!0}function _A(e,t,n){return(r,i)=>{!WB(r)||XB()||(e.animationState&&e.animationState.setActive(tr.Hover,t),n&&n(r,i))}}function Lde({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){r5(r,"pointerenter",e||n?_A(r,!0,e):void 0,{passive:!e}),r5(r,"pointerleave",t||n?_A(r,!1,t):void 0,{passive:!t})}const ZB=(e,t)=>t?e===t?!0:ZB(e,t.parentElement):!1;function q_(e){return w.useEffect(()=>()=>e(),[])}function QB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),m6=.001,Ode=.01,kA=10,Mde=.05,Ide=1;function Rde({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;Ade(e<=kA*1e3);let a=1-t;a=o5(Mde,Ide,a),e=o5(Ode,kA,e/1e3),a<1?(i=u=>{const d=u*a,h=d*e,m=d-n,y=k7(u,a),b=Math.exp(-h);return m6-m/y*b},o=u=>{const h=u*a*e,m=h*n+n,y=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-h),x=k7(Math.pow(u,2),a);return(-i(u)+m6>0?-1:1)*((m-y)*b)/x}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-m6+d*h},o=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const s=5/e,l=Nde(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const Dde=12;function Nde(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function Fde(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!EA(e,Bde)&&EA(e,jde)){const n=Rde(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function Y_(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=QB(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:s,damping:l,mass:u,velocity:d,duration:h,isResolvedFromDuration:m}=Fde(o),y=PA,b=PA;function x(){const k=d?-(d/1e3):0,E=n-t,_=l/(2*Math.sqrt(s*u)),P=Math.sqrt(s/u)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),_<1){const A=k7(P,_);y=M=>{const R=Math.exp(-_*P*M);return n-R*((k+_*P*E)/A*Math.sin(A*M)+E*Math.cos(A*M))},b=M=>{const R=Math.exp(-_*P*M);return _*P*R*(Math.sin(A*M)*(k+_*P*E)/A+E*Math.cos(A*M))-R*(Math.cos(A*M)*(k+_*P*E)-A*E*Math.sin(A*M))}}else if(_===1)y=A=>n-Math.exp(-P*A)*(E+(k+P*E)*A);else{const A=P*Math.sqrt(_*_-1);y=M=>{const R=Math.exp(-_*P*M),D=Math.min(A*M,300);return n-R*((k+_*P*E)*Math.sinh(D)+A*E*Math.cosh(D))/A}}}return x(),{next:k=>{const E=y(k);if(m)a.done=k>=h;else{const _=b(k)*1e3,P=Math.abs(_)<=r,A=Math.abs(n-E)<=i;a.done=P&&A}return a.value=a.done?n:E,a},flipTarget:()=>{d=-d,[t,n]=[n,t],x()}}}Y_.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const PA=e=>0,A2=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},zr=(e,t,n)=>-n*e+n*t+e;function v6(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function TA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=v6(l,s,e+1/3),o=v6(l,s,e),a=v6(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const $de=(e,t,n)=>{const r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},zde=[w7,_d,Eh],LA=e=>zde.find(t=>t.test(e)),JB=(e,t)=>{let n=LA(e),r=LA(t),i=n.parse(e),o=r.parse(t);n===Eh&&(i=TA(i),n=_d),r===Eh&&(o=TA(o),r=_d);const a=Object.assign({},i);return s=>{for(const l in a)l!=="alpha"&&(a[l]=$de(i[l],o[l],s));return a.alpha=zr(i.alpha,o.alpha,s),n.transform(a)}},E7=e=>typeof e=="number",Hde=(e,t)=>n=>t(e(n)),US=(...e)=>e.reduce(Hde);function eF(e,t){return E7(e)?n=>zr(e,t,n):wo.test(e)?JB(e,t):nF(e,t)}const tF=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>eF(o,t[a]));return o=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=eF(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}};function AA(e){const t=tc.parse(e),n=t.length;let r=0,i=0,o=0;for(let a=0;a{const n=tc.createTransformer(t),r=AA(e),i=AA(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?US(tF(r.parsed,i.parsed),n):a=>`${a>0?t:e}`},Wde=(e,t)=>n=>zr(e,t,n);function Ude(e){if(typeof e=="number")return Wde;if(typeof e=="string")return wo.test(e)?JB:nF;if(Array.isArray(e))return tF;if(typeof e=="object")return Vde}function Gde(e,t,n){const r=[],i=n||Ude(e[0]),o=e.length-1;for(let a=0;an(A2(e,t,r))}function Yde(e,t){const n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let l=1;for(;li||l===r);l++);o=l-1}const s=A2(e[o],e[o+1],i);return t[o](s)}}function rF(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;i5(o===t.length),i5(!r||!Array.isArray(r)||r.length===o-1),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=Gde(t,r,i),s=o===2?qde(e,a):Yde(e,a);return n?l=>s(o5(e[0],e[o-1],l)):s}const GS=e=>t=>1-e(1-t),K_=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Kde=e=>t=>Math.pow(t,e),iF=e=>t=>t*t*((e+1)*t-e),Xde=e=>{const t=iF(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},oF=1.525,Zde=4/11,Qde=8/11,Jde=9/10,X_=e=>e,Z_=Kde(2),efe=GS(Z_),aF=K_(Z_),sF=e=>1-Math.sin(Math.acos(e)),Q_=GS(sF),tfe=K_(Q_),J_=iF(oF),nfe=GS(J_),rfe=K_(J_),ife=Xde(oF),ofe=4356/361,afe=35442/1805,sfe=16061/1805,a5=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-a5(1-e*2)):.5*a5(e*2-1)+.5;function cfe(e,t){return e.map(()=>t||aF).splice(0,e.length-1)}function dfe(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function ffe(e,t){return e.map(n=>n*t)}function g4({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){const o={done:!1,value:e},a=Array.isArray(t)?t:[e,t],s=ffe(r&&r.length===a.length?r:dfe(a),i);function l(){return rF(s,a,{ease:Array.isArray(n)?n:cfe(a,n)})}let u=l();return{next:d=>(o.value=u(d),o.done=d>=i,o),flipTarget:()=>{a.reverse(),u=l()}}}function hfe({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a={done:!1,value:t};let s=n*e;const l=t+s,u=o===void 0?l:o(l);return u!==l&&(s=u-t),{next:d=>{const h=-s*Math.exp(-d/r);return a.done=!(h>i||h<-i),a.value=a.done?u:u+h,a},flipTarget:()=>{}}}const OA={keyframes:g4,spring:Y_,decay:hfe};function pfe(e){if(Array.isArray(e.to))return g4;if(OA[e.type])return OA[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?g4:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Y_:g4}const lF=1/60*1e3,gfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),uF=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(gfe()),lF);function mfe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=mfe(()=>O2=!0),e),{}),yfe=xy.reduce((e,t)=>{const n=qS[t];return e[t]=(r,i=!1,o=!1)=>(O2||xfe(),n.schedule(r,i,o)),e},{}),bfe=xy.reduce((e,t)=>(e[t]=qS[t].cancel,e),{});xy.reduce((e,t)=>(e[t]=()=>qS[t].process(km),e),{});const Sfe=e=>qS[e].process(km),cF=e=>{O2=!1,km.delta=P7?lF:Math.max(Math.min(e-km.timestamp,vfe),1),km.timestamp=e,T7=!0,xy.forEach(Sfe),T7=!1,O2&&(P7=!1,uF(cF))},xfe=()=>{O2=!0,P7=!0,T7||uF(cF)},wfe=()=>km;function dF(e,t,n=0){return e-t-n}function Cfe(e,t,n=0,r=!0){return r?dF(t+-e,t,n):t-(e-t)+n}function _fe(e,t,n,r){return r?e>=t+n:e<=-n}const kfe=e=>{const t=({delta:n})=>e(n);return{start:()=>yfe.update(t,!0),stop:()=>bfe.update(t)}};function fF(e){var t,n,{from:r,autoplay:i=!0,driver:o=kfe,elapsed:a=0,repeat:s=0,repeatType:l="loop",repeatDelay:u=0,onPlay:d,onStop:h,onComplete:m,onRepeat:y,onUpdate:b}=e,x=QB(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:k}=x,E,_=0,P=x.duration,A,M=!1,R=!0,D;const j=pfe(x);!((n=(t=j).needsInterpolation)===null||n===void 0)&&n.call(t,r,k)&&(D=rF([0,100],[r,k],{clamp:!1}),r=0,k=100);const z=j(Object.assign(Object.assign({},x),{from:r,to:k}));function H(){_++,l==="reverse"?(R=_%2===0,a=Cfe(a,P,u,R)):(a=dF(a,P,u),l==="mirror"&&z.flipTarget()),M=!1,y&&y()}function K(){E.stop(),m&&m()}function te(F){if(R||(F=-F),a+=F,!M){const W=z.next(Math.max(0,a));A=W.value,D&&(A=D(A)),M=R?W.done:a<=0}b==null||b(A),M&&(_===0&&(P??(P=a)),_{h==null||h(),E.stop()}}}function hF(e,t){return t?e*(1e3/t):0}function Efe({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:d,onUpdate:h,onComplete:m,onStop:y}){let b;function x(P){return n!==void 0&&Pr}function k(P){return n===void 0?r:r===void 0||Math.abs(n-P){var M;h==null||h(A),(M=P.onUpdate)===null||M===void 0||M.call(P,A)},onComplete:m,onStop:y}))}function _(P){E(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},P))}if(x(e))_({from:e,velocity:t,to:k(e)});else{let P=i*t+e;typeof u<"u"&&(P=u(P));const A=k(P),M=A===n?-1:1;let R,D;const j=z=>{R=D,D=z,t=hF(z-R,wfe().delta),(M===1&&z>A||M===-1&&zb==null?void 0:b.stop()}}const L7=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),MA=e=>L7(e)&&e.hasOwnProperty("z"),J3=(e,t)=>Math.abs(e-t);function ek(e,t){if(E7(e)&&E7(t))return J3(e,t);if(L7(e)&&L7(t)){const n=J3(e.x,t.x),r=J3(e.y,t.y),i=MA(e)&&MA(t)?J3(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}const pF=(e,t)=>1-3*t+3*e,gF=(e,t)=>3*t-6*e,mF=e=>3*e,s5=(e,t,n)=>((pF(t,n)*e+gF(t,n))*e+mF(t))*e,vF=(e,t,n)=>3*pF(t,n)*e*e+2*gF(t,n)*e+mF(t),Pfe=1e-7,Tfe=10;function Lfe(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=s5(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>Pfe&&++s=Ofe?Mfe(a,h,e,n):m===0?h:Lfe(a,s,s+eb,e,n)}return a=>a===0||a===1?a:s5(o(a),t,r)}function Rfe({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(!1),s=w.useRef(null),l={passive:!(t||e||n||y)};function u(){s.current&&s.current(),s.current=null}function d(){return u(),a.current=!1,i.animationState&&i.animationState.setActive(tr.Tap,!1),!XB()}function h(b,x){d()&&(ZB(i.current,b.target)?e&&e(b,x):n&&n(b,x))}function m(b,x){d()&&n&&n(b,x)}function y(b,x){u(),!a.current&&(a.current=!0,s.current=US(_m(window,"pointerup",h,l),_m(window,"pointercancel",m,l)),i.animationState&&i.animationState.setActive(tr.Tap,!0),t&&t(b,x))}r5(i,"pointerdown",o?y:void 0,l),q_(u)}const Dfe="production",yF=typeof process>"u"||process.env===void 0?Dfe:"production",IA=new Set;function bF(e,t,n){e||IA.has(t)||(console.warn(t),n&&console.warn(n),IA.add(t))}const A7=new WeakMap,y6=new WeakMap,Nfe=e=>{const t=A7.get(e.target);t&&t(e)},jfe=e=>{e.forEach(Nfe)};function Bfe({root:e,...t}){const n=e||document;y6.has(n)||y6.set(n,{});const r=y6.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(jfe,{root:e,...t})),r[i]}function Ffe(e,t,n){const r=Bfe(t);return A7.set(e,n),r.observe(e),()=>{A7.delete(e),r.unobserve(e)}}function $fe({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){const o=w.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?Vfe:Hfe)(a,o.current,e,i)}const zfe={some:0,all:1};function Hfe(e,t,n,{root:r,margin:i,amount:o="some",once:a}){w.useEffect(()=>{if(!e||!n.current)return;const s={root:r==null?void 0:r.current,rootMargin:i,threshold:typeof o=="number"?o:zfe[o]},l=u=>{const{isIntersecting:d}=u;if(t.isInView===d||(t.isInView=d,a&&!d&&t.hasEnteredView))return;d&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(tr.InView,d);const h=n.getProps(),m=d?h.onViewportEnter:h.onViewportLeave;m&&m(u)};return Ffe(n.current,s,l)},[e,r,i,o])}function Vfe(e,t,n,{fallback:r=!0}){w.useEffect(()=>{!e||!r||(yF!=="production"&&bF(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:i}=n.getProps();i&&i(null),n.animationState&&n.animationState.setActive(tr.InView,!0)}))},[e])}const kd=e=>t=>(e(t),null),Wfe={inView:kd($fe),tap:kd(Rfe),focus:kd(bde),hover:kd(Lde)};function tk(){const e=w.useContext(y0);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=w.useId();return w.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function Ufe(){return Gfe(w.useContext(y0))}function Gfe(e){return e===null?!0:e.isPresent}function SF(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,qfe={linear:X_,easeIn:Z_,easeInOut:aF,easeOut:efe,circIn:sF,circInOut:tfe,circOut:Q_,backIn:J_,backInOut:rfe,backOut:nfe,anticipate:ife,bounceIn:lfe,bounceInOut:ufe,bounceOut:a5},RA=e=>{if(Array.isArray(e)){i5(e.length===4);const[t,n,r,i]=e;return Ife(t,n,r,i)}else if(typeof e=="string")return qfe[e];return e},Yfe=e=>Array.isArray(e)&&typeof e[0]!="number",DA=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&tc.test(t)&&!t.startsWith("url(")),ah=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),tb=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),b6=()=>({type:"keyframes",ease:"linear",duration:.3}),Kfe=e=>({type:"keyframes",duration:.8,values:e}),NA={x:ah,y:ah,z:ah,rotate:ah,rotateX:ah,rotateY:ah,rotateZ:ah,scaleX:tb,scaleY:tb,scale:tb,opacity:b6,backgroundColor:b6,color:b6,default:tb},Xfe=(e,t)=>{let n;return L2(t)?n=Kfe:n=NA[e]||NA.default,{to:t,...n(t)}},Zfe={...IB,color:wo,backgroundColor:wo,outlineColor:wo,fill:wo,stroke:wo,borderColor:wo,borderTopColor:wo,borderRightColor:wo,borderBottomColor:wo,borderLeftColor:wo,filter:C7,WebkitFilter:C7},nk=e=>Zfe[e];function rk(e,t){var n;let r=nk(e);return r!==C7&&(r=tc),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const Qfe={current:!1},xF=1/60*1e3,Jfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),wF=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Jfe()),xF);function ehe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=ehe(()=>M2=!0),e),{}),Ys=wy.reduce((e,t)=>{const n=YS[t];return e[t]=(r,i=!1,o=!1)=>(M2||rhe(),n.schedule(r,i,o)),e},{}),Gh=wy.reduce((e,t)=>(e[t]=YS[t].cancel,e),{}),S6=wy.reduce((e,t)=>(e[t]=()=>YS[t].process(Em),e),{}),nhe=e=>YS[e].process(Em),CF=e=>{M2=!1,Em.delta=O7?xF:Math.max(Math.min(e-Em.timestamp,the),1),Em.timestamp=e,M7=!0,wy.forEach(nhe),M7=!1,M2&&(O7=!1,wF(CF))},rhe=()=>{M2=!0,O7=!0,M7||wF(CF)},I7=()=>Em;function _F(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Gh.read(r),e(o-t))};return Ys.read(r,!0),()=>Gh.read(r)}function ihe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...u}){return!!Object.keys(u).length}function ohe({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){const a={...o};return t&&(a.offset=t),o.duration&&(a.duration=l5(o.duration)),o.repeatDelay&&(a.repeatDelay=l5(o.repeatDelay)),e&&(a.ease=Yfe(e)?e.map(RA):RA(e)),o.type==="tween"&&(a.type="keyframes"),(n||i||r)&&(n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),o.type!=="spring"&&(a.type="keyframes"),a}function ahe(e,t){var n,r;return(r=(n=(ik(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function she(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function lhe(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),she(t),ihe(e)||(e={...e,...Xfe(n,t.to)}),{...t,...ohe(e)}}function uhe(e,t,n,r,i){const o=ik(r,e)||{};let a=o.from!==void 0?o.from:t.get();const s=DA(e,n);a==="none"&&s&&typeof n=="string"?a=rk(e,n):jA(a)&&typeof n=="string"?a=BA(n):!Array.isArray(n)&&jA(n)&&typeof a=="string"&&(n=BA(a));const l=DA(e,a);function u(){const h={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:m=>t.set(m)};return o.type==="inertia"||o.type==="decay"?Efe({...h,...o}):fF({...lhe(o,h,e),onUpdate:m=>{h.onUpdate(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{h.onComplete(),o.onComplete&&o.onComplete()}})}function d(){const h=HB(n);return t.set(h),i(),o.onUpdate&&o.onUpdate(h),o.onComplete&&o.onComplete(),{stop:()=>{}}}return!l||!s||o.type===!1?d:u}function jA(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function BA(e){return typeof e=="number"?0:rk("",e)}function ik(e,t){return e[t]||e.default||e}function ok(e,t,n,r={}){return Qfe.current&&(r={type:!1}),t.start(i=>{let o;const a=uhe(e,t,n,r,i),s=ahe(r,e),l=()=>o=a();let u;return s?u=_F(l,l5(s)):l(),()=>{u&&u(),o&&o.stop()}})}const che=e=>/^\-?\d*\.?\d+$/.test(e),dhe=e=>/^0[^.\s]+$/.test(e);function ak(e,t){e.indexOf(t)===-1&&e.push(t)}function sk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class qv{constructor(){this.subscriptions=[]}add(t){return ak(this.subscriptions,t),()=>sk(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class hhe{constructor(t){this.version="7.6.9",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new qv,this.velocityUpdateSubscribers=new qv,this.renderSubscribers=new qv,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=I7();this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,Ys.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Ys.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=fhe(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?hF(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function qm(e){return new hhe(e)}const kF=e=>t=>t.test(e),phe={test:e=>e==="auto",parse:e=>e},EF=[ap,Lt,Ql,fd,Hce,zce,phe],G1=e=>EF.find(kF(e)),ghe=[...EF,wo,tc],mhe=e=>ghe.find(kF(e));function vhe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function yhe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function KS(e,t,n){const r=e.getProps();return U_(r,t,n!==void 0?n:r.custom,vhe(e),yhe(e))}function bhe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,qm(n))}function She(e,t){const n=KS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=HB(o[a]);bhe(e,a,s)}}function xhe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;sR7(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=R7(e,t,n);else{const i=typeof t=="function"?KS(e,t,n.custom):t;r=PF(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function R7(e,t,n={}){var r;const i=KS(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const a=i?()=>PF(e,i,n):()=>Promise.resolve(),s=!((r=e.variantChildren)===null||r===void 0)&&r.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=o;return khe(e,t,d+u,h,m,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[a,s]:[s,a];return u().then(d)}else return Promise.all([a(),s(n.delay)])}function PF(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const u=e.getValue("willChange");r&&(a=r);const d=[],h=i&&((o=e.animationState)===null||o===void 0?void 0:o.getState()[i]);for(const m in l){const y=e.getValue(m),b=l[m];if(!y||b===void 0||h&&Phe(h,m))continue;let x={delay:n,...a};e.shouldReduceMotion&&b0.has(m)&&(x={...x,type:!1,delay:0});let k=ok(m,y,b,x);u5(u)&&(u.add(m),k=k.then(()=>u.remove(m))),d.push(k)}return Promise.all(d).then(()=>{s&&She(e,s)})}function khe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(Ehe).forEach((u,d)=>{a.push(R7(u,t,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function Ehe(e,t){return e.sortNodePosition(t)}function Phe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const lk=[tr.Animate,tr.InView,tr.Focus,tr.Hover,tr.Tap,tr.Drag,tr.Exit],The=[...lk].reverse(),Lhe=lk.length;function Ahe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>_he(e,n,r)))}function Ohe(e){let t=Ahe(e);const n=Ihe();let r=!0;const i=(l,u)=>{const d=KS(e,u);if(d){const{transition:h,transitionEnd:m,...y}=d;l={...l,...y,...m}}return l};function o(l){t=l(e)}function a(l,u){var d;const h=e.getProps(),m=e.getVariantContext(!0)||{},y=[],b=new Set;let x={},k=1/0;for(let _=0;_k&&R;const K=Array.isArray(M)?M:[M];let te=K.reduce(i,{});D===!1&&(te={});const{prevResolvedValues:G={}}=A,F={...G,...te},W=X=>{H=!0,b.delete(X),A.needsAnimating[X]=!0};for(const X in F){const Z=te[X],U=G[X];x.hasOwnProperty(X)||(Z!==U?L2(Z)&&L2(U)?!SF(Z,U)||z?W(X):A.protectedKeys[X]=!0:Z!==void 0?W(X):b.add(X):Z!==void 0&&b.has(X)?W(X):A.protectedKeys[X]=!0)}A.prevProp=M,A.prevResolvedValues=te,A.isActive&&(x={...x,...te}),r&&e.blockInitialAnimation&&(H=!1),H&&!j&&y.push(...K.map(X=>({animation:X,options:{type:P,...l}})))}if(b.size){const _={};b.forEach(P=>{const A=e.getBaseTarget(P);A!==void 0&&(_[P]=A)}),y.push({animation:_})}let E=Boolean(y.length);return r&&h.initial===!1&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,E?t(y):Promise.resolve()}function s(l,u,d){var h;if(n[l].isActive===u)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(y=>{var b;return(b=y.animationState)===null||b===void 0?void 0:b.setActive(l,u)}),n[l].isActive=u;const m=a(d,l);for(const y in n)n[y].protectedKeys={};return m}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function Mhe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!SF(t,e):!1}function sh(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ihe(){return{[tr.Animate]:sh(!0),[tr.InView]:sh(),[tr.Hover]:sh(),[tr.Tap]:sh(),[tr.Drag]:sh(),[tr.Focus]:sh(),[tr.Exit]:sh()}}const Rhe={animation:kd(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=Ohe(e)),zS(t)&&w.useEffect(()=>t.subscribe(e),[t])}),exit:kd(e=>{const{custom:t,visualElement:n}=e,[r,i]=tk(),o=w.useContext(y0);w.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(tr.Exit,!r,{custom:o&&o.custom||t});a&&!r&&a.then(i)},[r])})};class TF{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=w6(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=ek(u.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:m}=u,{timestamp:y}=I7();this.history.push({...m,timestamp:y});const{onStart:b,onMove:x}=this.handlers;d||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{if(this.lastMoveEvent=u,this.lastMoveEventInfo=x6(d,this.transformPagePoint),WB(u)&&u.buttons===0){this.handlePointerUp(u,d);return}Ys.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{this.end();const{onEnd:h,onSessionEnd:m}=this.handlers,y=w6(x6(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),m&&m(u,y)},UB(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const i=G_(t),o=x6(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=I7();this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,w6(o,this.history)),this.removeListeners=US(_m(window,"pointermove",this.handlePointerMove),_m(window,"pointerup",this.handlePointerUp),_m(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Gh.update(this.updatePoint)}}function x6(e,t){return t?{point:t(e.point)}:e}function FA(e,t){return{x:e.x-t.x,y:e.y-t.y}}function w6({point:e},t){return{point:e,delta:FA(e,LF(t)),offset:FA(e,Dhe(t)),velocity:Nhe(t,.1)}}function Dhe(e){return e[0]}function LF(e){return e[e.length-1]}function Nhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=LF(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>l5(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Ma(e){return e.max-e.min}function $A(e,t=0,n=.01){return ek(e,t)n&&(e=r?zr(n,e,r.max):Math.min(e,n)),e}function WA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Fhe(e,{top:t,left:n,bottom:r,right:i}){return{x:WA(e.x,n,i),y:WA(e.y,t,r)}}function UA(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=A2(t.min,t.max-r,e.min):r>i&&(n=A2(e.min,e.max-i,t.min)),o5(0,1,n)}function Hhe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const D7=.35;function Vhe(e=D7){return e===!1?e=0:e===!0&&(e=D7),{x:GA(e,"left","right"),y:GA(e,"top","bottom")}}function GA(e,t,n){return{min:qA(e,t),max:qA(e,n)}}function qA(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const YA=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xv=()=>({x:YA(),y:YA()}),KA=()=>({min:0,max:0}),pi=()=>({x:KA(),y:KA()});function Nl(e){return[e("x"),e("y")]}function AF({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Whe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Uhe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function C6(e){return e===void 0||e===1}function N7({scale:e,scaleX:t,scaleY:n}){return!C6(e)||!C6(t)||!C6(n)}function hh(e){return N7(e)||OF(e)||e.z||e.rotate||e.rotateX||e.rotateY}function OF(e){return XA(e.x)||XA(e.y)}function XA(e){return e&&e!=="0%"}function c5(e,t,n){const r=e-n,i=t*r;return n+i}function ZA(e,t,n,r,i){return i!==void 0&&(e=c5(e,i,r)),c5(e,n,r)+t}function j7(e,t=0,n=1,r,i){e.min=ZA(e.min,t,n,r,i),e.max=ZA(e.max,t,n,r,i)}function MF(e,{x:t,y:n}){j7(e.x,t.translate,t.scale,t.originPoint),j7(e.y,n.translate,n.scale,n.originPoint)}function Ghe(e,t,n,r=!1){var i,o;const a=n.length;if(!a)return;t.x=t.y=1;let s,l;for(let u=0;u{this.stopAnimation(),n&&this.snapToCursor(G_(s,"page").point)},i=(s,l)=>{var u;const{drag:d,dragPropagation:h,onDragStart:m}=this.getProps();d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=KB(d),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nl(y=>{var b,x;let k=this.getAxisMotionValue(y).get()||0;if(Ql.test(k)){const E=(x=(b=this.visualElement.projection)===null||b===void 0?void 0:b.layout)===null||x===void 0?void 0:x.layoutBox[y];E&&(k=Ma(E)*(parseFloat(k)/100))}this.originPoint[y]=k}),m==null||m(s,l),(u=this.visualElement.animationState)===null||u===void 0||u.setActive(tr.Drag,!0))},o=(s,l)=>{const{dragPropagation:u,dragDirectionLock:d,onDirectionLock:h,onDrag:m}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:y}=l;if(d&&this.currentDirection===null){this.currentDirection=Qhe(y),this.currentDirection!==null&&(h==null||h(this.currentDirection));return}this.updateAxis("x",l.point,y),this.updateAxis("y",l.point,y),this.visualElement.render(),m==null||m(s,l)},a=(s,l)=>this.stop(s,l);this.panSession=new TF(t,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o==null||o(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(tr.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!nb(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Bhe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Gg(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Fhe(r.layoutBox,t):this.constraints=!1,this.elastic=Vhe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Nl(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Hhe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Gg(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Khe(r,i.root,this.visualElement.getTransformPagePoint());let a=$he(i.layout.layoutBox,o);if(n){const s=n(Whe(a));this.hasMutatedConstraints=!!s,s&&(a=AF(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Nl(d=>{var h;if(!nb(d,n,this.currentDirection))return;let m=(h=l==null?void 0:l[d])!==null&&h!==void 0?h:{};a&&(m={min:0,max:0});const y=i?200:1e6,b=i?40:1e7,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:y,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(d,x)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ok(t,r,0,n)}stopAnimation(){Nl(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){Nl(n=>{const{drag:r}=this.getProps();if(!nb(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-zr(a,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!Gg(r)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Nl(s=>{const l=this.getAxisMotionValue(s);if(l){const u=l.get();o[s]=zhe({min:u,max:u},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",(t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Nl(s=>{if(!nb(s,n,null))return;const l=this.getAxisMotionValue(s),{min:u,max:d}=this.constraints[s];l.set(zr(u,d,o[s]))})}addListeners(){var t;if(!this.visualElement.current)return;Xhe.set(this.visualElement,this);const n=this.visualElement.current,r=_m(n,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps();d&&h&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();Gg(u)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",i);o&&!o.layout&&((t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout()),i();const s=WS(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Nl(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=u[h].translate,m.set(m.get()+u[h].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),l==null||l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=D7,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function nb(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Qhe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function Jhe(e){const{dragControls:t,visualElement:n}=e,r=VS(()=>new Zhe(n));w.useEffect(()=>t&&t.subscribe(r),[r,t]),w.useEffect(()=>r.addListeners(),[r])}function epe({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(null),{transformPagePoint:s}=w.useContext(j_),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(d,h)=>{a.current=null,n&&n(d,h)}};w.useEffect(()=>{a.current!==null&&a.current.updateHandlers(l)});function u(d){a.current=new TF(d,l,{transformPagePoint:s})}r5(i,"pointerdown",o&&u),q_(()=>a.current&&a.current.end())}const tpe={pan:kd(epe),drag:kd(Jhe)};function B7(e){return typeof e=="string"&&e.startsWith("var(--")}const RF=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function npe(e){const t=RF.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function F7(e,t,n=1){const[r,i]=npe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():B7(i)?F7(i,t,n+1):i}function rpe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!B7(o))return;const a=F7(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!B7(o))continue;const a=F7(o,r);a&&(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const ipe=new Set(["width","height","top","left","right","bottom","x","y"]),DF=e=>ipe.has(e),ope=e=>Object.keys(e).some(DF),NF=(e,t)=>{e.set(t,!1),e.set(t)},JA=e=>e===ap||e===Lt;var eO;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(eO||(eO={}));const tO=(e,t)=>parseFloat(e.split(", ")[t]),nO=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return tO(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?tO(o[1],e):0}},ape=new Set(["x","y","z"]),spe=t5.filter(e=>!ape.has(e));function lpe(e){const t=[];return spe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const rO={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:nO(4,13),y:nO(5,14)},upe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=rO[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const d=t.getValue(u);NF(d,s[u]),e[u]=rO[u](l,o)}),e},cpe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(DF);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],h=G1(d);const m=t[l];let y;if(L2(m)){const b=m.length,x=m[0]===null?1:0;d=m[x],h=G1(d);for(let k=x;k=0?window.pageYOffset:null,u=upe(t,e,s);return o.length&&o.forEach(([d,h])=>{e.getValue(d).set(h)}),e.render(),op&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function dpe(e,t,n,r){return ope(t)?cpe(e,t,n,r):{target:t,transitionEnd:r}}const fpe=(e,t,n,r)=>{const i=rpe(e,t,r);return t=i.target,r=i.transitionEnd,dpe(e,t,n,r)},$7={current:null},jF={current:!1};function hpe(){if(jF.current=!0,!!op)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$7.current=e.matches;e.addListener(t),t()}else $7.current=!1}function ppe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(su(o))e.addValue(i,o),u5(r)&&r.add(i);else if(su(a))e.addValue(i,qm(o)),u5(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,qm(s!==void 0?s:o))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const BF=Object.keys(P2),gpe=BF.length,iO=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class mpe{constructor({parent:t,props:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Ys.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=s,this.parent=t,this.props=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=HS(n),this.isVariantNode=wB(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n);for(const d in u){const h=u[d];a[d]!==void 0&&su(h)&&(h.set(a[d],!1),u5(l)&&l.add(d))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var n;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(n=this.parent)===null||n===void 0?void 0:n.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),jF.current||hpe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:$7.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,n,r;(t=this.projection)===null||t===void 0||t.unmount(),Gh.update(this.notifyUpdate),Gh.render(this.render),this.valueSubscriptions.forEach(i=>i()),(n=this.removeFromVariantTree)===null||n===void 0||n.call(this),(r=this.parent)===null||r===void 0||r.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(t,n){const r=b0.has(t),i=n.onChange(a=>{this.latestValues[t]=a,this.props.onUpdate&&Ys.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isProjectionDirty=!0)}),o=n.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures(t,n,r,i,o,a){const s=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:m})}return s}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let n=0;nr.variantChildren.delete(t)}addValue(t,n){this.hasValue(t)&&this.removeValue(t),this.values.set(t,n),this.latestValues[t]=n.get(),this.bindToMotionValue(t,n)}removeValue(t){var n;this.values.delete(t),(n=this.valueSubscriptions.get(t))===null||n===void 0||n(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=qm(n),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=U_(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!su(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new qv),this.events[t].add(n)}notify(t,...n){var r;(r=this.events[t])===null||r===void 0||r.notify(...n)}}const FF=["initial",...lk],vpe=FF.length;class $F extends mpe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){var r;return(r=t.style)===null||r===void 0?void 0:r[n]}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=Che(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){xhe(this,r,a);const s=fpe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function ype(e){return window.getComputedStyle(e)}class bpe extends $F{readValueFromInstance(t,n){if(b0.has(n)){const r=nk(n);return r&&r.default||0}else{const r=ype(t),i=(kB(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return IF(t,n)}build(t,n,r,i){z_(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t){return W_(t)}renderInstance(t,n,r,i){BB(t,n,r,i)}}class Spe extends $F{getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){var r;return b0.has(n)?((r=nk(n))===null||r===void 0?void 0:r.default)||0:(n=FB.has(n)?n:jB(n),t.getAttribute(n))}measureInstanceViewportBox(){return pi()}scrapeMotionValuesFromProps(t){return zB(t)}build(t,n,r,i){V_(t,n,r,i.transformTemplate)}renderInstance(t,n,r,i){$B(t,n,r,i)}}const xpe=(e,t)=>F_(e)?new Spe(t,{enableHardwareAcceleration:!1}):new bpe(t,{enableHardwareAcceleration:!0});function oO(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const q1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Lt.test(e))e=parseFloat(e);else return e;const n=oO(e,t.target.x),r=oO(e,t.target.y);return`${n}% ${r}%`}},aO="_$css",wpe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(RF,y=>(o.push(y),aO)));const a=tc.parse(e);if(a.length>5)return r;const s=tc.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=d;const h=zr(u,d,.5);typeof a[2+l]=="number"&&(a[2+l]/=h),typeof a[3+l]=="number"&&(a[3+l]/=h);let m=s(a);if(i){let y=0;m=m.replace(aO,()=>{const b=o[y];return y++,b})}return m}};class Cpe extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;Dce(kpe),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Wv.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Ys.postRender(()=>{var s;!((s=a.getStack())===null||s===void 0)&&s.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(i),r!=null&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t==null||t()}render(){return null}}function _pe(e){const[t,n]=tk(),r=w.useContext(B_);return N.createElement(Cpe,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(CB),isPresent:t,safeToRemove:n})}const kpe={borderRadius:{...q1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:q1,borderTopRightRadius:q1,borderBottomLeftRadius:q1,borderBottomRightRadius:q1,boxShadow:wpe},Epe={measureLayout:_pe};function Ppe(e,t,n={}){const r=su(e)?e:qm(e);return ok("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const zF=["TopLeft","TopRight","BottomLeft","BottomRight"],Tpe=zF.length,sO=e=>typeof e=="string"?parseFloat(e):e,lO=e=>typeof e=="number"||Lt.test(e);function Lpe(e,t,n,r,i,o){var a,s,l,u;i?(e.opacity=zr(0,(a=n.opacity)!==null&&a!==void 0?a:1,Ape(r)),e.opacityExit=zr((s=t.opacity)!==null&&s!==void 0?s:1,0,Ope(r))):o&&(e.opacity=zr((l=t.opacity)!==null&&l!==void 0?l:1,(u=n.opacity)!==null&&u!==void 0?u:1,r));for(let d=0;drt?1:n(A2(e,t,r))}function cO(e,t){e.min=t.min,e.max=t.max}function Rs(e,t){cO(e.x,t.x),cO(e.y,t.y)}function dO(e,t,n,r,i){return e-=t,e=c5(e,1/n,r),i!==void 0&&(e=c5(e,1/i,r)),e}function Mpe(e,t=0,n=1,r=.5,i,o=e,a=e){if(Ql.test(t)&&(t=parseFloat(t),t=zr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=zr(o.min,o.max,r);e===o&&(s-=t),e.min=dO(e.min,t,n,s,i),e.max=dO(e.max,t,n,s,i)}function fO(e,t,[n,r,i],o,a){Mpe(e,t[n],t[r],t[i],t.scale,o,a)}const Ipe=["x","scaleX","originX"],Rpe=["y","scaleY","originY"];function hO(e,t,n,r){fO(e.x,t,Ipe,n==null?void 0:n.x,r==null?void 0:r.x),fO(e.y,t,Rpe,n==null?void 0:n.y,r==null?void 0:r.y)}function pO(e){return e.translate===0&&e.scale===1}function VF(e){return pO(e.x)&&pO(e.y)}function WF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function gO(e){return Ma(e.x)/Ma(e.y)}function Dpe(e,t,n=.1){return ek(e,t)<=n}class Npe{constructor(){this.members=[]}add(t){ak(this.members,t),t.scheduleRender()}remove(t){if(sk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){var r;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(i=t.resumingFrom)===null||i===void 0?void 0:(o=i.options).onExitComplete)===null||a===void 0||a.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function mO(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),d&&(r+=`rotateY(${d}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const jpe=(e,t)=>e.depth-t.depth;class Bpe{constructor(){this.children=[],this.isDirty=!1}add(t){ak(this.children,t),this.isDirty=!0}remove(t){sk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jpe),this.isDirty=!1,this.children.forEach(t)}}const vO=["","X","Y","Z"],yO=1e3;let Fpe=0;function UF({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=Fpe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Wpe),this.nodes.forEach(Upe)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=_F(y,250),Wv.hasAnimatedSinceResize&&(Wv.hasAnimatedSinceResize=!1,this.nodes.forEach(SO))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&h&&(u||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeTargetChanged:b,layout:x})=>{var k,E,_,P,A;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const M=(E=(k=this.options.transition)!==null&&k!==void 0?k:h.getDefaultTransition())!==null&&E!==void 0?E:Xpe,{onLayoutAnimationStart:R,onLayoutAnimationComplete:D}=h.getProps(),j=!this.targetLayout||!WF(this.targetLayout,x)||b,z=!y&&b;if(!((_=this.resumeFrom)===null||_===void 0)&&_.instance||z||y&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,z);const H={...ik(M,"layout"),onPlay:R,onComplete:D};h.shouldReduceMotion&&(H.delay=0,H.type=!1),this.startAnimation(H)}else!y&&this.animationProgress===0&&SO(this),this.isLead()&&((A=(P=this.options).onExitComplete)===null||A===void 0||A.call(P));this.targetLayout=x})}unmount(){var a,s;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(s=this.parent)===null||s===void 0||s.children.delete(this),this.instance=void 0,Gh.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(Gpe),this.animationId++)}willUpdate(a=!0){var s,l,u;if(this.root.isUpdateBlocked()){(l=(s=this.options).onExitComplete)===null||l===void 0||l.call(s);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var P;const A=_/1e3;xO(y.x,a.x,A),xO(y.y,a.y,A),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((P=this.relativeParent)===null||P===void 0)&&P.layout)&&(Kv(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ype(this.relativeTarget,this.relativeTargetOrigin,b,A)),x&&(this.animationValues=m,Lpe(m,h,this.latestValues,A,E,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(0)}startAnimation(a){var s,l;this.notifyListeners("animationStart"),(s=this.currentAnimation)===null||s===void 0||s.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(Gh.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ys.update(()=>{Wv.hasAnimatedSinceResize=!0,this.currentAnimation=Ppe(0,yO,{...a,onUpdate:u=>{var d;this.mixTargetDelta(u),(d=a.onUpdate)===null||d===void 0||d.call(a,u)},onComplete:()=>{var u;(u=a.onComplete)===null||u===void 0||u.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,yO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:d}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&GF(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||pi();const h=Ma(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+h;const m=Ma(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}Rs(s,l),qg(s,d),Yv(this.projectionDeltaWithTransform,this.layoutCorrected,s,d)}}registerSharedNode(a,s){var l,u,d;this.sharedNodes.has(a)||this.sharedNodes.set(a,new Npe),this.sharedNodes.get(a).add(s),s.promote({transition:(l=s.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(d=(u=s.options.initialPromotionConfig)===null||u===void 0?void 0:u.shouldPreserveFollowOpacity)===null||d===void 0?void 0:d.call(u,s)})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(bO),this.root.sharedNodes.clear()}}}function $pe(e){e.updateLayout()}function zpe(e){var t,n,r;const i=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:a}=e.layout,{animationType:s}=e.options,l=i.source!==e.layout.source;s==="size"?Nl(y=>{const b=l?i.measuredBox[y]:i.layoutBox[y],x=Ma(b);b.min=o[y].min,b.max=b.min+x}):GF(s,i.layoutBox,o)&&Nl(y=>{const b=l?i.measuredBox[y]:i.layoutBox[y],x=Ma(o[y]);b.max=b.min+x});const u=Xv();Yv(u,o,i.layoutBox);const d=Xv();l?Yv(d,e.applyTransform(a,!0),i.measuredBox):Yv(d,o,i.layoutBox);const h=!VF(u);let m=!1;if(!e.resumeFrom){const y=e.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:b,layout:x}=y;if(b&&x){const k=pi();Kv(k,i.layoutBox,b.layoutBox);const E=pi();Kv(E,o,x.layoutBox),WF(k,E)||(m=!0)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:d,layoutDelta:u,hasLayoutChanged:h,hasRelativeTargetChanged:m})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function Hpe(e){e.clearSnapshot()}function bO(e){e.clearMeasurements()}function Vpe(e){const{visualElement:t}=e.options;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function SO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Wpe(e){e.resolveTargetDelta()}function Upe(e){e.calcProjection()}function Gpe(e){e.resetRotation()}function qpe(e){e.removeLeadSnapshot()}function xO(e,t,n){e.translate=zr(t.translate,0,n),e.scale=zr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function wO(e,t,n,r){e.min=zr(t.min,n.min,r),e.max=zr(t.max,n.max,r)}function Ype(e,t,n,r){wO(e.x,t.x,n.x,r),wO(e.y,t.y,n.y,r)}function Kpe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Xpe={duration:.45,ease:[.4,0,.1,1]};function Zpe(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function CO(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function Qpe(e){CO(e.x),CO(e.y)}function GF(e,t,n){return e==="position"||e==="preserve-aspect"&&!Dpe(gO(t),gO(n),.2)}const Jpe=UF({attachResizeListener:(e,t)=>WS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_6={current:void 0},ege=UF({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_6.current){const e=new Jpe(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),_6.current=e}return _6.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),tge={...Rhe,...Wfe,...tpe,...Epe},hu=Ice((e,t)=>yde(e,t,tge,xpe,ege));function qF(){const e=w.useRef(!1);return J4(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function nge(){const e=qF(),[t,n]=w.useState(0),r=w.useCallback(()=>{e.current&&n(t+1)},[t]);return[w.useCallback(()=>Ys.postRender(r),[r]),t]}class rge extends w.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ige({children:e,isPresent:t}){const n=w.useId(),r=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0});return w.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${o}px !important; @@ -43,8 +43,8 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con top: ${s}px !important; left: ${l}px !important; } - `),()=>{document.head.removeChild(u)}},[t]),w.createElement(rge,{isPresent:t,childRef:r,sizeRef:i},w.cloneElement(e,{ref:r}))}const k6=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=VS(oge),l=w.useId(),u=w.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:d=>{s.set(d,!0);for(const h of s.values())if(!h)return;r&&r()},register:d=>(s.set(d,!1),()=>s.delete(d))}),o?void 0:[n]);return w.useMemo(()=>{s.forEach((d,h)=>s.set(h,!1))},[n]),w.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=w.createElement(ige,{isPresent:n},e)),w.createElement(v0.Provider,{value:u},e)};function oge(){return new Map}const zg=e=>e.key||"";function age(e,t){e.forEach(n=>{const r=zg(n);t.set(r,n)})}function sge(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const of=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",y$(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=nge();const l=w.useContext(B_).forceRender;l&&(s=l);const u=G$(),d=sge(e);let h=d;const m=new Set,v=w.useRef(h),b=w.useRef(new Map).current,S=w.useRef(!0);if(J4(()=>{S.current=!1,age(d,b),v.current=h}),q_(()=>{S.current=!0,b.clear(),m.clear()}),S.current)return w.createElement(w.Fragment,null,h.map(T=>w.createElement(k6,{key:zg(T),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},T)));h=[...h];const _=v.current.map(zg),E=d.map(zg),k=_.length;for(let T=0;T{if(E.indexOf(T)!==-1)return;const A=b.get(T);if(!A)return;const M=_.indexOf(T),R=()=>{b.delete(T),m.delete(T);const D=v.current.findIndex(j=>j.key===T);if(v.current.splice(D,1),!m.size){if(v.current=d,u.current===!1)return;s(),r&&r()}};h.splice(M,0,w.createElement(k6,{key:zg(A),isPresent:!1,onExitComplete:R,custom:t,presenceAffectsLayout:o,mode:a},A))}),h=h.map(T=>{const A=T.key;return m.has(A)?T:w.createElement(k6,{key:zg(T),isPresent:!0,presenceAffectsLayout:o,mode:a},T)}),v$!=="production"&&a==="wait"&&h.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),w.createElement(w.Fragment,null,m.size?h:h.map(T=>w.cloneElement(T)))};var Hl=function(){return Hl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function z7(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function lge(){return!1}var uge=e=>{const{condition:t,message:n}=e;t&&lge()&&console.warn(n)},Eh={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},q1={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function H7(e){switch((e==null?void 0:e.direction)??"right"){case"right":return q1.slideRight;case"left":return q1.slideLeft;case"bottom":return q1.slideDown;case"top":return q1.slideUp;default:return q1.slideRight}}var Dh={enter:{duration:.2,ease:Eh.easeOut},exit:{duration:.1,ease:Eh.easeIn}},Ks={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},cge=e=>e!=null&&parseInt(e.toString(),10)>0,_O={exit:{height:{duration:.2,ease:Eh.ease},opacity:{duration:.3,ease:Eh.ease}},enter:{height:{duration:.3,ease:Eh.ease},opacity:{duration:.4,ease:Eh.ease}}},dge={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:cge(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(n==null?void 0:n.exit)??Ks.exit(_O.exit,i)}),enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(n==null?void 0:n.enter)??Ks.enter(_O.enter,i)})},Y$=w.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:d,...h}=e,[m,v]=w.useState(!1);w.useEffect(()=>{const k=setTimeout(()=>{v(!0)});return()=>clearTimeout(k)},[]),uge({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,S={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:d==null?void 0:d.enter,exit:r?d==null?void 0:d.exit:{...d==null?void 0:d.exit,display:b?"block":"none"}}},_=r?n:!0,E=n||r?"enter":"exit";return N.createElement(of,{initial:!1,custom:S},_&&N.createElement(hu.div,{ref:t,...h,className:Cy("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:S,variants:dge,initial:r?"exit":!1,animate:E,exit:"exit"}))});Y$.displayName="Collapse";var fge={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??Ks.enter(Dh.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??Ks.exit(Dh.exit,n),transitionEnd:t==null?void 0:t.exit})},K$={initial:"exit",animate:"enter",exit:"exit",variants:fge},hge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,d=i||r?"enter":"exit",h=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return N.createElement(of,{custom:m},h&&N.createElement(hu.div,{ref:n,className:Cy("chakra-fade",o),custom:m,...K$,animate:d,...u}))});hge.displayName="Fade";var pge={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(n==null?void 0:n.exit)??Ks.exit(Dh.exit,i)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??Ks.enter(Dh.enter,n),transitionEnd:e==null?void 0:e.enter})},X$={initial:"exit",animate:"enter",exit:"exit",variants:pge},gge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:d,...h}=t,m=r?i&&r:!0,v=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:d};return N.createElement(of,{custom:b},m&&N.createElement(hu.div,{ref:n,className:Cy("chakra-offset-slide",s),...X$,animate:v,custom:b,...h}))});gge.displayName="ScaleFade";var kO={exit:{duration:.15,ease:Eh.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},mge={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{const{exit:i}=H7({direction:e});return{...i,transition:(t==null?void 0:t.exit)??Ks.exit(kO.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{const{enter:i}=H7({direction:e});return{...i,transition:(n==null?void 0:n.enter)??Ks.enter(kO.enter,r),transitionEnd:t==null?void 0:t.enter}}},Z$=w.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:d,motionProps:h,...m}=t,v=H7({direction:r}),b=Object.assign({position:"fixed"},v.position,i),S=o?a&&o:!0,_=a||o?"enter":"exit",E={transitionEnd:u,transition:l,direction:r,delay:d};return N.createElement(of,{custom:E},S&&N.createElement(hu.div,{...m,ref:n,initial:"exit",className:Cy("chakra-slide",s),animate:_,exit:"exit",custom:E,variants:mge,style:b,...h}))});Z$.displayName="Slide";var vge={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,x:e,y:t,transition:(n==null?void 0:n.exit)??Ks.exit(Dh.exit,i),transitionEnd:r==null?void 0:r.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??Ks.enter(Dh.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{const a={x:t,y:e};return{opacity:0,transition:(n==null?void 0:n.exit)??Ks.exit(Dh.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},V7={initial:"initial",animate:"enter",exit:"exit",variants:vge},yge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:d,delay:h,...m}=t,v=r?i&&r:!0,b=i||r?"enter":"exit",S={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:d,delay:h};return N.createElement(of,{custom:S},v&&N.createElement(hu.div,{ref:n,className:Cy("chakra-offset-slide",a),custom:S,...V7,animate:b,...m}))});yge.displayName="SlideFade";var _y=(...e)=>e.filter(Boolean).join(" ");function bge(){return!1}var XS=e=>{const{condition:t,message:n}=e;t&&bge()&&console.warn(n)};function E6(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Sge,ZS]=Pn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[xge,uk]=Pn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[wge,pze,Cge,_ge]=bB(),qg=Ae(function(t,n){const{getButtonProps:r}=uk(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...ZS().button};return N.createElement(Ce.button,{...i,className:_y("chakra-accordion__button",t.className),__css:a})});qg.displayName="AccordionButton";function kge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Tge(e),Lge(e);const s=Cge(),[l,u]=w.useState(-1);w.useEffect(()=>()=>{u(-1)},[]);const[d,h]=$S({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:d,setIndex:h,htmlProps:a,getAccordionItemProps:v=>{let b=!1;return v!==null&&(b=Array.isArray(d)?d.includes(v):d===v),{isOpen:b,onChange:_=>{if(v!==null)if(i&&Array.isArray(d)){const E=_?d.concat(v):d.filter(k=>k!==v);h(E)}else _?h(v):o&&h(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[Ege,ck]=Pn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Pge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=ck(),s=w.useRef(null),l=w.useId(),u=r??l,d=`accordion-button-${u}`,h=`accordion-panel-${u}`;Age(e);const{register:m,index:v,descendants:b}=_ge({disabled:t&&!n}),{isOpen:S,onChange:_}=o(v===-1?null:v);Oge({isOpen:S,isDisabled:t});const E=()=>{_==null||_(!0)},k=()=>{_==null||_(!1)},T=w.useCallback(()=>{_==null||_(!S),a(v)},[v,a,S,_]),A=w.useCallback(j=>{const H={ArrowDown:()=>{const K=b.nextEnabled(v);K==null||K.node.focus()},ArrowUp:()=>{const K=b.prevEnabled(v);K==null||K.node.focus()},Home:()=>{const K=b.firstEnabled();K==null||K.node.focus()},End:()=>{const K=b.lastEnabled();K==null||K.node.focus()}}[j.key];H&&(j.preventDefault(),H(j))},[b,v]),M=w.useCallback(()=>{a(v)},[a,v]),R=w.useCallback(function(z={},H=null){return{...z,type:"button",ref:Hn(m,s,H),id:d,disabled:!!t,"aria-expanded":!!S,"aria-controls":h,onClick:E6(z.onClick,T),onFocus:E6(z.onFocus,M),onKeyDown:E6(z.onKeyDown,A)}},[d,t,S,T,M,A,h,m]),D=w.useCallback(function(z={},H=null){return{...z,ref:H,role:"region",id:h,"aria-labelledby":d,hidden:!S}},[d,S,h]);return{isOpen:S,isDisabled:t,isFocusable:n,onOpen:E,onClose:k,getButtonProps:R,getPanelProps:D,htmlProps:i}}function Tge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;XS({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function Lge(e){XS({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function Age(e){XS({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. - `})}function Oge(e){XS({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Yg(e){const{isOpen:t,isDisabled:n}=uk(),{reduceMotion:r}=ck(),i=_y("chakra-accordion__icon",e.className),o=ZS(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return N.createElement(Na,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))}Yg.displayName="AccordionIcon";var Kg=Ae(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Pge(t),l={...ZS().container,overflowAnchor:"none"},u=w.useMemo(()=>a,[a]);return N.createElement(xge,{value:u},N.createElement(Ce.div,{ref:n,...o,className:_y("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});Kg.displayName="AccordionItem";var Xg=Ae(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=ck(),{getPanelProps:s,isOpen:l}=uk(),u=s(o,n),d=_y("chakra-accordion__panel",r),h=ZS();a||delete u.hidden;const m=N.createElement(Ce.div,{...u,__css:h.panel,className:d});return a?m:N.createElement(Y$,{in:l,...i},m)});Xg.displayName="AccordionPanel";var dk=Ae(function({children:t,reduceMotion:n,...r},i){const o=Oi("Accordion",r),a=Sn(r),{htmlProps:s,descendants:l,...u}=kge(a),d=w.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return N.createElement(wge,{value:l},N.createElement(Ege,{value:d},N.createElement(Sge,{value:o},N.createElement(Ce.div,{ref:i,...s,className:_y("chakra-accordion",r.className),__css:o.root},t))))});dk.displayName="Accordion";var Mge=(...e)=>e.filter(Boolean).join(" "),Ige=rf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),ky=Ae((e,t)=>{const n=Oo("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=Sn(e),u=Mge("chakra-spinner",s),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${Ige} ${o} linear infinite`,...n};return N.createElement(Ce.div,{ref:t,__css:d,className:u,...l},r&&N.createElement(Ce.span,{srOnly:!0},r))});ky.displayName="Spinner";var QS=(...e)=>e.filter(Boolean).join(" ");function Rge(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}))}function Dge(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}))}function EO(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))}var[Nge,jge]=Pn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[Bge,fk]=Pn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),Q$={info:{icon:Dge,colorScheme:"blue"},warning:{icon:EO,colorScheme:"orange"},success:{icon:Rge,colorScheme:"green"},error:{icon:EO,colorScheme:"red"},loading:{icon:ky,colorScheme:"blue"}};function $ge(e){return Q$[e].colorScheme}function Fge(e){return Q$[e].icon}var J$=Ae(function(t,n){const{status:r="info",addRole:i=!0,...o}=Sn(t),a=t.colorScheme??$ge(r),s=Oi("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return N.createElement(Nge,{value:{status:r}},N.createElement(Bge,{value:s},N.createElement(Ce.div,{role:i?"alert":void 0,ref:n,...o,className:QS("chakra-alert",t.className),__css:l})))});J$.displayName="Alert";var eF=Ae(function(t,n){const i={display:"inline",...fk().description};return N.createElement(Ce.div,{ref:n,...t,className:QS("chakra-alert__desc",t.className),__css:i})});eF.displayName="AlertDescription";function tF(e){const{status:t}=jge(),n=Fge(t),r=fk(),i=t==="loading"?r.spinner:r.icon;return N.createElement(Ce.span,{display:"inherit",...e,className:QS("chakra-alert__icon",e.className),__css:i},e.children||N.createElement(n,{h:"100%",w:"100%"}))}tF.displayName="AlertIcon";var nF=Ae(function(t,n){const r=fk();return N.createElement(Ce.div,{ref:n,...t,className:QS("chakra-alert__title",t.className),__css:r.title})});nF.displayName="AlertTitle";function zge(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Hge(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,d]=w.useState("pending");w.useEffect(()=>{d(n?"loading":"pending")},[n]);const h=w.useRef(),m=w.useCallback(()=>{if(!n)return;v();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=S=>{v(),d("loaded"),i==null||i(S)},b.onerror=S=>{v(),d("failed"),o==null||o(S)},h.current=b},[n,a,r,s,i,o,t]),v=()=>{h.current&&(h.current.onload=null,h.current.onerror=null,h.current=null)};return Gs(()=>{if(!l)return u==="loading"&&m(),()=>{v()}},[u,m,l]),l?"loaded":u}var Vge=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",d5=Ae(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return N.createElement("img",{width:r,height:i,ref:n,alt:o,...a})});d5.displayName="NativeImage";var JS=Ae(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:d,crossOrigin:h,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:v,...b}=t,S=r!==void 0||i!==void 0,_=u!=null||d||!S,E=Hge({...t,ignoreFallback:_}),k=Vge(E,m),T={ref:n,objectFit:l,objectPosition:s,..._?b:zge(b,["onError","onLoad"])};return k?i||N.createElement(Ce.img,{as:d5,className:"chakra-image__placeholder",src:r,...T}):N.createElement(Ce.img,{as:d5,src:o,srcSet:a,crossOrigin:h,loading:u,referrerPolicy:v,className:"chakra-image",...T})});JS.displayName="Image";Ae((e,t)=>N.createElement(Ce.img,{ref:t,as:d5,className:"chakra-image",...e}));function ex(e){return w.Children.toArray(e).filter(t=>w.isValidElement(t))}var tx=(...e)=>e.filter(Boolean).join(" "),PO=e=>e?"":void 0,[Wge,Uge]=Pn({strict:!1,name:"ButtonGroupContext"});function W7(e){const{children:t,className:n,...r}=e,i=w.isValidElement(t)?w.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=tx("chakra-button__icon",n);return N.createElement(Ce.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}W7.displayName="ButtonIcon";function U7(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=N.createElement(ky,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=tx("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",d=w.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return N.createElement(Ce.div,{className:l,...s,__css:d},i)}U7.displayName="ButtonSpinner";function Gge(e){const[t,n]=w.useState(!e);return{ref:w.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var ls=Ae((e,t)=>{const n=Uge(),r=Oo("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:d,iconSpacing:h="0.5rem",type:m,spinner:v,spinnerPlacement:b="start",className:S,as:_,...E}=Sn(e),k=w.useMemo(()=>{const R={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:R}}},[r,n]),{ref:T,type:A}=Gge(_),M={rightIcon:u,leftIcon:l,iconSpacing:h,children:s};return N.createElement(Ce.button,{disabled:i||o,ref:pce(t,T),as:_,type:m??A,"data-active":PO(a),"data-loading":PO(o),__css:k,className:tx("chakra-button",S),...E},o&&b==="start"&&N.createElement(U7,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:h},v),o?d||N.createElement(Ce.span,{opacity:0},N.createElement(TO,{...M})):N.createElement(TO,{...M}),o&&b==="end"&&N.createElement(U7,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:h},v))});ls.displayName="Button";function TO(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return N.createElement(N.Fragment,null,t&&N.createElement(W7,{marginEnd:i},t),r,n&&N.createElement(W7,{marginStart:i},n))}var oo=Ae(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...d}=t,h=tx("chakra-button__group",a),m=w.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let v={display:"inline-flex"};return l?v={...v,"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}}:v={...v,"& > *:not(style) ~ *:not(style)":{marginStart:s}},N.createElement(Wge,{value:m},N.createElement(Ce.div,{ref:n,role:"group",__css:v,className:h,"data-attached":l?"":void 0,...d}))});oo.displayName="ButtonGroup";var us=Ae((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=w.isValidElement(s)?w.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return N.createElement(ls,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a},l)});us.displayName="IconButton";var x0=(...e)=>e.filter(Boolean).join(" "),rb=e=>e?"":void 0,P6=e=>e?!0:void 0;function LO(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[qge,rF]=Pn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Yge,ap]=Pn({strict:!1,name:"FormControlContext"});function Kge(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=w.useId(),l=t||`field-${s}`,u=`${l}-label`,d=`${l}-feedback`,h=`${l}-helptext`,[m,v]=w.useState(!1),[b,S]=w.useState(!1),[_,E]=w.useState(!1),k=w.useCallback((D={},j=null)=>({id:h,...D,ref:Hn(j,z=>{z&&S(!0)})}),[h]),T=w.useCallback((D={},j=null)=>({...D,ref:j,"data-focus":rb(_),"data-disabled":rb(i),"data-invalid":rb(r),"data-readonly":rb(o),id:D.id??u,htmlFor:D.htmlFor??l}),[l,i,_,r,o,u]),A=w.useCallback((D={},j=null)=>({id:d,...D,ref:Hn(j,z=>{z&&v(!0)}),"aria-live":"polite"}),[d]),M=w.useCallback((D={},j=null)=>({...D,...a,ref:j,role:"group"}),[a]),R=w.useCallback((D={},j=null)=>({...D,ref:j,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!_,onFocus:()=>E(!0),onBlur:()=>E(!1),hasFeedbackText:m,setHasFeedbackText:v,hasHelpText:b,setHasHelpText:S,id:l,labelId:u,feedbackId:d,helpTextId:h,htmlProps:a,getHelpTextProps:k,getErrorMessageProps:A,getRootProps:M,getLabelProps:T,getRequiredIndicatorProps:R}}var fn=Ae(function(t,n){const r=Oi("Form",t),i=Sn(t),{getRootProps:o,htmlProps:a,...s}=Kge(i),l=x0("chakra-form-control",t.className);return N.createElement(Yge,{value:s},N.createElement(qge,{value:r},N.createElement(Ce.div,{...o({},n),className:l,__css:r.container})))});fn.displayName="FormControl";var ur=Ae(function(t,n){const r=ap(),i=rF(),o=x0("chakra-form__helper-text",t.className);return N.createElement(Ce.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});ur.displayName="FormHelperText";function hk(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=pk(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":P6(n),"aria-required":P6(i),"aria-readonly":P6(r)}}function pk(e){const t=ap(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:d,onBlur:h,...m}=e,v=e["aria-describedby"]?[e["aria-describedby"]]:[];return t!=null&&t.hasFeedbackText&&(t!=null&&t.isInvalid)&&v.push(t.feedbackId),t!=null&&t.hasHelpText&&v.push(t.helpTextId),{...m,"aria-describedby":v.join(" ")||void 0,id:n??(t==null?void 0:t.id),isDisabled:r??u??(t==null?void 0:t.isDisabled),isReadOnly:i??l??(t==null?void 0:t.isReadOnly),isRequired:o??a??(t==null?void 0:t.isRequired),isInvalid:s??(t==null?void 0:t.isInvalid),onFocus:LO(t==null?void 0:t.onFocus,d),onBlur:LO(t==null?void 0:t.onBlur,h)}}var[Xge,Zge]=Pn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),cr=Ae((e,t)=>{const n=Oi("FormError",e),r=Sn(e),i=ap();return i!=null&&i.isInvalid?N.createElement(Xge,{value:n},N.createElement(Ce.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:x0("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});cr.displayName="FormErrorMessage";var Qge=Ae((e,t)=>{const n=Zge(),r=ap();if(!(r!=null&&r.isInvalid))return null;const i=x0("chakra-form__error-icon",e.className);return N.createElement(Na,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))});Qge.displayName="FormErrorIcon";var En=Ae(function(t,n){const r=Oo("FormLabel",t),i=Sn(t),{className:o,children:a,requiredIndicator:s=N.createElement(iF,null),optionalIndicator:l=null,...u}=i,d=ap(),h=(d==null?void 0:d.getLabelProps(u,n))??{ref:n,...u};return N.createElement(Ce.label,{...h,className:x0("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,d!=null&&d.isRequired?s:l)});En.displayName="FormLabel";var iF=Ae(function(t,n){const r=ap(),i=rF();if(!(r!=null&&r.isRequired))return null;const o=x0("chakra-form__required-indicator",t.className);return N.createElement(Ce.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});iF.displayName="RequiredIndicator";function Ud(e,t){const n=w.useRef(!1),r=w.useRef(!1);w.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var gk={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},Jge=Ce("span",{baseStyle:gk});Jge.displayName="VisuallyHidden";var eme=Ce("input",{baseStyle:gk});eme.displayName="VisuallyHiddenInput";var AO=!1,nx=null,qm=!1,G7=new Set,tme=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function nme(e){return!(e.metaKey||!tme&&e.altKey||e.ctrlKey)}function mk(e,t){G7.forEach(n=>n(e,t))}function OO(e){qm=!0,nme(e)&&(nx="keyboard",mk("keyboard",e))}function kg(e){nx="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(qm=!0,mk("pointer",e))}function rme(e){e.target===window||e.target===document||(qm||(nx="keyboard",mk("keyboard",e)),qm=!1)}function ime(){qm=!1}function MO(){return nx!=="pointer"}function ome(){if(typeof window>"u"||AO)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){qm=!0,e.apply(this,n)},document.addEventListener("keydown",OO,!0),document.addEventListener("keyup",OO,!0),window.addEventListener("focus",rme,!0),window.addEventListener("blur",ime,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",kg,!0),document.addEventListener("pointermove",kg,!0),document.addEventListener("pointerup",kg,!0)):(document.addEventListener("mousedown",kg,!0),document.addEventListener("mousemove",kg,!0),document.addEventListener("mouseup",kg,!0)),AO=!0}function oF(e){ome(),e(MO());const t=()=>e(MO());return G7.add(t),()=>{G7.delete(t)}}var[gze,ame]=Pn({name:"CheckboxGroupContext",strict:!1}),sme=(...e)=>e.filter(Boolean).join(" "),bo=e=>e?"":void 0;function Ka(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function lme(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function ume(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},N.createElement("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function cme(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},N.createElement("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function dme(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?cme:ume;return n||t?N.createElement(Ce.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},N.createElement(i,{...r})):null}function fme(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function aF(e={}){const t=pk(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:d,isChecked:h,isFocusable:m,onChange:v,isIndeterminate:b,name:S,value:_,tabIndex:E=void 0,"aria-label":k,"aria-labelledby":T,"aria-invalid":A,...M}=e,R=fme(M,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=Er(v),j=Er(s),z=Er(l),[H,K]=w.useState(!1),[te,G]=w.useState(!1),[$,W]=w.useState(!1),[X,Z]=w.useState(!1);w.useEffect(()=>oF(K),[]);const U=w.useRef(null),[Q,re]=w.useState(!0),[fe,Ee]=w.useState(!!d),be=h!==void 0,ye=be?h:fe,Fe=w.useCallback(Le=>{if(r||n){Le.preventDefault();return}be||Ee(ye?Le.target.checked:b?!0:Le.target.checked),D==null||D(Le)},[r,n,ye,be,b,D]);Gs(()=>{U.current&&(U.current.indeterminate=Boolean(b))},[b]),Ud(()=>{n&&G(!1)},[n,G]),Gs(()=>{const Le=U.current;Le!=null&&Le.form&&(Le.form.onreset=()=>{Ee(!!d)})},[]);const Me=n&&!m,rt=w.useCallback(Le=>{Le.key===" "&&Z(!0)},[Z]),Ve=w.useCallback(Le=>{Le.key===" "&&Z(!1)},[Z]);Gs(()=>{if(!U.current)return;U.current.checked!==ye&&Ee(U.current.checked)},[U.current]);const je=w.useCallback((Le={},ut=null)=>{const Mt=ct=>{te&&ct.preventDefault(),Z(!0)};return{...Le,ref:ut,"data-active":bo(X),"data-hover":bo($),"data-checked":bo(ye),"data-focus":bo(te),"data-focus-visible":bo(te&&H),"data-indeterminate":bo(b),"data-disabled":bo(n),"data-invalid":bo(o),"data-readonly":bo(r),"aria-hidden":!0,onMouseDown:Ka(Le.onMouseDown,Mt),onMouseUp:Ka(Le.onMouseUp,()=>Z(!1)),onMouseEnter:Ka(Le.onMouseEnter,()=>W(!0)),onMouseLeave:Ka(Le.onMouseLeave,()=>W(!1))}},[X,ye,n,te,H,$,b,o,r]),wt=w.useCallback((Le={},ut=null)=>({...R,...Le,ref:Hn(ut,Mt=>{Mt&&re(Mt.tagName==="LABEL")}),onClick:Ka(Le.onClick,()=>{var Mt;Q||((Mt=U.current)==null||Mt.click(),requestAnimationFrame(()=>{var ct;(ct=U.current)==null||ct.focus()}))}),"data-disabled":bo(n),"data-checked":bo(ye),"data-invalid":bo(o)}),[R,n,ye,o,Q]),Be=w.useCallback((Le={},ut=null)=>({...Le,ref:Hn(U,ut),type:"checkbox",name:S,value:_,id:a,tabIndex:E,onChange:Ka(Le.onChange,Fe),onBlur:Ka(Le.onBlur,j,()=>G(!1)),onFocus:Ka(Le.onFocus,z,()=>G(!0)),onKeyDown:Ka(Le.onKeyDown,rt),onKeyUp:Ka(Le.onKeyUp,Ve),required:i,checked:ye,disabled:Me,readOnly:r,"aria-label":k,"aria-labelledby":T,"aria-invalid":A?Boolean(A):o,"aria-describedby":u,"aria-disabled":n,style:gk}),[S,_,a,Fe,j,z,rt,Ve,i,ye,Me,r,k,T,A,o,u,n,E]),at=w.useCallback((Le={},ut=null)=>({...Le,ref:ut,onMouseDown:Ka(Le.onMouseDown,IO),onTouchStart:Ka(Le.onTouchStart,IO),"data-disabled":bo(n),"data-checked":bo(ye),"data-invalid":bo(o)}),[ye,n,o]);return{state:{isInvalid:o,isFocused:te,isChecked:ye,isActive:X,isHovered:$,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:wt,getCheckboxProps:je,getInputProps:Be,getLabelProps:at,htmlProps:R}}function IO(e){e.preventDefault(),e.stopPropagation()}var hme={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},pme={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},gme=rf({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),mme=rf({from:{opacity:0},to:{opacity:1}}),vme=rf({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),sF=Ae(function(t,n){const r=ame(),i={...r,...t},o=Oi("Checkbox",i),a=Sn(t),{spacing:s="0.5rem",className:l,children:u,iconColor:d,iconSize:h,icon:m=N.createElement(dme,null),isChecked:v,isDisabled:b=r==null?void 0:r.isDisabled,onChange:S,inputProps:_,...E}=a;let k=v;r!=null&&r.value&&a.value&&(k=r.value.includes(a.value));let T=S;r!=null&&r.onChange&&a.value&&(T=lme(r.onChange,S));const{state:A,getInputProps:M,getCheckboxProps:R,getLabelProps:D,getRootProps:j}=aF({...E,isDisabled:b,isChecked:k,onChange:T}),z=w.useMemo(()=>({animation:A.isIndeterminate?`${mme} 20ms linear, ${vme} 200ms linear`:`${gme} 200ms linear`,fontSize:h,color:d,...o.icon}),[d,h,,A.isIndeterminate,o.icon]),H=w.cloneElement(m,{__css:z,isIndeterminate:A.isIndeterminate,isChecked:A.isChecked});return N.createElement(Ce.label,{__css:{...pme,...o.container},className:sme("chakra-checkbox",l),...j()},N.createElement("input",{className:"chakra-checkbox__input",...M(_,n)}),N.createElement(Ce.span,{__css:{...hme,...o.control},className:"chakra-checkbox__control",...R()},H),u&&N.createElement(Ce.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:s,...o.label}},u))});sF.displayName="Checkbox";function yme(e){return N.createElement(Na,{focusable:"false","aria-hidden":!0,...e},N.createElement("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}))}var rx=Ae(function(t,n){const r=Oo("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=Sn(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return N.createElement(Ce.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||N.createElement(yme,{width:"1em",height:"1em"}))});rx.displayName="CloseButton";function bme(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function vk(e,t){let n=bme(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function q7(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function f5(e,t,n){return(e-t)*100/(n-t)}function lF(e,t,n){return(n-t)*e+t}function Y7(e,t,n){const r=Math.round((e-t)/n)*n+t,i=q7(n);return vk(r,i)}function Em(e,t,n){return e==null?e:(nr==null?"":T6(r,o,n)??""),m=typeof i<"u",v=m?i:d,b=uF(hd(v),o),S=n??b,_=w.useCallback(H=>{H!==v&&(m||h(H.toString()),u==null||u(H.toString(),hd(H)))},[u,m,v]),E=w.useCallback(H=>{let K=H;return l&&(K=Em(K,a,s)),vk(K,S)},[S,l,s,a]),k=w.useCallback((H=o)=>{let K;v===""?K=hd(H):K=hd(v)+H,K=E(K),_(K)},[E,o,_,v]),T=w.useCallback((H=o)=>{let K;v===""?K=hd(-H):K=hd(v)-H,K=E(K),_(K)},[E,o,_,v]),A=w.useCallback(()=>{let H;r==null?H="":H=T6(r,o,n)??a,_(H)},[r,n,o,_,a]),M=w.useCallback(H=>{const K=T6(H,o,S)??a;_(K)},[S,o,_,a]),R=hd(v);return{isOutOfRange:R>s||R{document.head.removeChild(u)}},[t]),w.createElement(rge,{isPresent:t,childRef:r,sizeRef:i},w.cloneElement(e,{ref:r}))}const k6=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=VS(oge),l=w.useId(),u=w.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:d=>{s.set(d,!0);for(const h of s.values())if(!h)return;r&&r()},register:d=>(s.set(d,!1),()=>s.delete(d))}),o?void 0:[n]);return w.useMemo(()=>{s.forEach((d,h)=>s.set(h,!1))},[n]),w.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=w.createElement(ige,{isPresent:n},e)),w.createElement(y0.Provider,{value:u},e)};function oge(){return new Map}const Hg=e=>e.key||"";function age(e,t){e.forEach(n=>{const r=Hg(n);t.set(r,n)})}function sge(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const af=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",bF(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=nge();const l=w.useContext(B_).forceRender;l&&(s=l);const u=qF(),d=sge(e);let h=d;const m=new Set,y=w.useRef(h),b=w.useRef(new Map).current,x=w.useRef(!0);if(J4(()=>{x.current=!1,age(d,b),y.current=h}),q_(()=>{x.current=!0,b.clear(),m.clear()}),x.current)return w.createElement(w.Fragment,null,h.map(P=>w.createElement(k6,{key:Hg(P),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},P)));h=[...h];const k=y.current.map(Hg),E=d.map(Hg),_=k.length;for(let P=0;P<_;P++){const A=k[P];E.indexOf(A)===-1&&m.add(A)}return a==="wait"&&m.size&&(h=[]),m.forEach(P=>{if(E.indexOf(P)!==-1)return;const A=b.get(P);if(!A)return;const M=k.indexOf(P),R=()=>{b.delete(P),m.delete(P);const D=y.current.findIndex(j=>j.key===P);if(y.current.splice(D,1),!m.size){if(y.current=d,u.current===!1)return;s(),r&&r()}};h.splice(M,0,w.createElement(k6,{key:Hg(A),isPresent:!1,onExitComplete:R,custom:t,presenceAffectsLayout:o,mode:a},A))}),h=h.map(P=>{const A=P.key;return m.has(A)?P:w.createElement(k6,{key:Hg(P),isPresent:!0,presenceAffectsLayout:o,mode:a},P)}),yF!=="production"&&a==="wait"&&h.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),w.createElement(w.Fragment,null,m.size?h:h.map(P=>w.cloneElement(P)))};var Hl=function(){return Hl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function z7(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function lge(){return!1}var uge=e=>{const{condition:t,message:n}=e;t&&lge()&&console.warn(n)},Ph={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Y1={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function H7(e){switch((e==null?void 0:e.direction)??"right"){case"right":return Y1.slideRight;case"left":return Y1.slideLeft;case"bottom":return Y1.slideDown;case"top":return Y1.slideUp;default:return Y1.slideRight}}var Nh={enter:{duration:.2,ease:Ph.easeOut},exit:{duration:.1,ease:Ph.easeIn}},Ks={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},cge=e=>e!=null&&parseInt(e.toString(),10)>0,kO={exit:{height:{duration:.2,ease:Ph.ease},opacity:{duration:.3,ease:Ph.ease}},enter:{height:{duration:.3,ease:Ph.ease},opacity:{duration:.4,ease:Ph.ease}}},dge={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:cge(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(n==null?void 0:n.exit)??Ks.exit(kO.exit,i)}),enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(n==null?void 0:n.enter)??Ks.enter(kO.enter,i)})},KF=w.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:d,...h}=e,[m,y]=w.useState(!1);w.useEffect(()=>{const _=setTimeout(()=>{y(!0)});return()=>clearTimeout(_)},[]),uge({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,x={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:d==null?void 0:d.enter,exit:r?d==null?void 0:d.exit:{...d==null?void 0:d.exit,display:b?"block":"none"}}},k=r?n:!0,E=n||r?"enter":"exit";return N.createElement(af,{initial:!1,custom:x},k&&N.createElement(hu.div,{ref:t,...h,className:Cy("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:x,variants:dge,initial:r?"exit":!1,animate:E,exit:"exit"}))});KF.displayName="Collapse";var fge={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??Ks.enter(Nh.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??Ks.exit(Nh.exit,n),transitionEnd:t==null?void 0:t.exit})},XF={initial:"exit",animate:"enter",exit:"exit",variants:fge},hge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,d=i||r?"enter":"exit",h=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return N.createElement(af,{custom:m},h&&N.createElement(hu.div,{ref:n,className:Cy("chakra-fade",o),custom:m,...XF,animate:d,...u}))});hge.displayName="Fade";var pge={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(n==null?void 0:n.exit)??Ks.exit(Nh.exit,i)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??Ks.enter(Nh.enter,n),transitionEnd:e==null?void 0:e.enter})},ZF={initial:"exit",animate:"enter",exit:"exit",variants:pge},gge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:d,...h}=t,m=r?i&&r:!0,y=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:d};return N.createElement(af,{custom:b},m&&N.createElement(hu.div,{ref:n,className:Cy("chakra-offset-slide",s),...ZF,animate:y,custom:b,...h}))});gge.displayName="ScaleFade";var EO={exit:{duration:.15,ease:Ph.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},mge={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{const{exit:i}=H7({direction:e});return{...i,transition:(t==null?void 0:t.exit)??Ks.exit(EO.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{const{enter:i}=H7({direction:e});return{...i,transition:(n==null?void 0:n.enter)??Ks.enter(EO.enter,r),transitionEnd:t==null?void 0:t.enter}}},QF=w.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:d,motionProps:h,...m}=t,y=H7({direction:r}),b=Object.assign({position:"fixed"},y.position,i),x=o?a&&o:!0,k=a||o?"enter":"exit",E={transitionEnd:u,transition:l,direction:r,delay:d};return N.createElement(af,{custom:E},x&&N.createElement(hu.div,{...m,ref:n,initial:"exit",className:Cy("chakra-slide",s),animate:k,exit:"exit",custom:E,variants:mge,style:b,...h}))});QF.displayName="Slide";var vge={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,x:e,y:t,transition:(n==null?void 0:n.exit)??Ks.exit(Nh.exit,i),transitionEnd:r==null?void 0:r.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??Ks.enter(Nh.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{const a={x:t,y:e};return{opacity:0,transition:(n==null?void 0:n.exit)??Ks.exit(Nh.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},V7={initial:"initial",animate:"enter",exit:"exit",variants:vge},yge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:d,delay:h,...m}=t,y=r?i&&r:!0,b=i||r?"enter":"exit",x={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:d,delay:h};return N.createElement(af,{custom:x},y&&N.createElement(hu.div,{ref:n,className:Cy("chakra-offset-slide",a),custom:x,...V7,animate:b,...m}))});yge.displayName="SlideFade";var _y=(...e)=>e.filter(Boolean).join(" ");function bge(){return!1}var XS=e=>{const{condition:t,message:n}=e;t&&bge()&&console.warn(n)};function E6(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Sge,ZS]=Pn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[xge,uk]=Pn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[wge,pze,Cge,_ge]=SB(),Yg=Ae(function(t,n){const{getButtonProps:r}=uk(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...ZS().button};return N.createElement(Ce.button,{...i,className:_y("chakra-accordion__button",t.className),__css:a})});Yg.displayName="AccordionButton";function kge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Tge(e),Lge(e);const s=Cge(),[l,u]=w.useState(-1);w.useEffect(()=>()=>{u(-1)},[]);const[d,h]=FS({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:d,setIndex:h,htmlProps:a,getAccordionItemProps:y=>{let b=!1;return y!==null&&(b=Array.isArray(d)?d.includes(y):d===y),{isOpen:b,onChange:k=>{if(y!==null)if(i&&Array.isArray(d)){const E=k?d.concat(y):d.filter(_=>_!==y);h(E)}else k?h(y):o&&h(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[Ege,ck]=Pn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Pge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=ck(),s=w.useRef(null),l=w.useId(),u=r??l,d=`accordion-button-${u}`,h=`accordion-panel-${u}`;Age(e);const{register:m,index:y,descendants:b}=_ge({disabled:t&&!n}),{isOpen:x,onChange:k}=o(y===-1?null:y);Oge({isOpen:x,isDisabled:t});const E=()=>{k==null||k(!0)},_=()=>{k==null||k(!1)},P=w.useCallback(()=>{k==null||k(!x),a(y)},[y,a,x,k]),A=w.useCallback(j=>{const H={ArrowDown:()=>{const K=b.nextEnabled(y);K==null||K.node.focus()},ArrowUp:()=>{const K=b.prevEnabled(y);K==null||K.node.focus()},Home:()=>{const K=b.firstEnabled();K==null||K.node.focus()},End:()=>{const K=b.lastEnabled();K==null||K.node.focus()}}[j.key];H&&(j.preventDefault(),H(j))},[b,y]),M=w.useCallback(()=>{a(y)},[a,y]),R=w.useCallback(function(z={},H=null){return{...z,type:"button",ref:Hn(m,s,H),id:d,disabled:!!t,"aria-expanded":!!x,"aria-controls":h,onClick:E6(z.onClick,P),onFocus:E6(z.onFocus,M),onKeyDown:E6(z.onKeyDown,A)}},[d,t,x,P,M,A,h,m]),D=w.useCallback(function(z={},H=null){return{...z,ref:H,role:"region",id:h,"aria-labelledby":d,hidden:!x}},[d,x,h]);return{isOpen:x,isDisabled:t,isFocusable:n,onOpen:E,onClose:_,getButtonProps:R,getPanelProps:D,htmlProps:i}}function Tge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;XS({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function Lge(e){XS({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function Age(e){XS({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. + `})}function Oge(e){XS({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Kg(e){const{isOpen:t,isDisabled:n}=uk(),{reduceMotion:r}=ck(),i=_y("chakra-accordion__icon",e.className),o=ZS(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return N.createElement(Na,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))}Kg.displayName="AccordionIcon";var Xg=Ae(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Pge(t),l={...ZS().container,overflowAnchor:"none"},u=w.useMemo(()=>a,[a]);return N.createElement(xge,{value:u},N.createElement(Ce.div,{ref:n,...o,className:_y("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});Xg.displayName="AccordionItem";var Zg=Ae(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=ck(),{getPanelProps:s,isOpen:l}=uk(),u=s(o,n),d=_y("chakra-accordion__panel",r),h=ZS();a||delete u.hidden;const m=N.createElement(Ce.div,{...u,__css:h.panel,className:d});return a?m:N.createElement(KF,{in:l,...i},m)});Zg.displayName="AccordionPanel";var dk=Ae(function({children:t,reduceMotion:n,...r},i){const o=Oi("Accordion",r),a=Sn(r),{htmlProps:s,descendants:l,...u}=kge(a),d=w.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return N.createElement(wge,{value:l},N.createElement(Ege,{value:d},N.createElement(Sge,{value:o},N.createElement(Ce.div,{ref:i,...s,className:_y("chakra-accordion",r.className),__css:o.root},t))))});dk.displayName="Accordion";var Mge=(...e)=>e.filter(Boolean).join(" "),Ige=of({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),ky=Ae((e,t)=>{const n=Oo("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=Sn(e),u=Mge("chakra-spinner",s),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${Ige} ${o} linear infinite`,...n};return N.createElement(Ce.div,{ref:t,__css:d,className:u,...l},r&&N.createElement(Ce.span,{srOnly:!0},r))});ky.displayName="Spinner";var QS=(...e)=>e.filter(Boolean).join(" ");function Rge(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}))}function Dge(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}))}function PO(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))}var[Nge,jge]=Pn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[Bge,fk]=Pn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),JF={info:{icon:Dge,colorScheme:"blue"},warning:{icon:PO,colorScheme:"orange"},success:{icon:Rge,colorScheme:"green"},error:{icon:PO,colorScheme:"red"},loading:{icon:ky,colorScheme:"blue"}};function Fge(e){return JF[e].colorScheme}function $ge(e){return JF[e].icon}var e$=Ae(function(t,n){const{status:r="info",addRole:i=!0,...o}=Sn(t),a=t.colorScheme??Fge(r),s=Oi("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return N.createElement(Nge,{value:{status:r}},N.createElement(Bge,{value:s},N.createElement(Ce.div,{role:i?"alert":void 0,ref:n,...o,className:QS("chakra-alert",t.className),__css:l})))});e$.displayName="Alert";var t$=Ae(function(t,n){const i={display:"inline",...fk().description};return N.createElement(Ce.div,{ref:n,...t,className:QS("chakra-alert__desc",t.className),__css:i})});t$.displayName="AlertDescription";function n$(e){const{status:t}=jge(),n=$ge(t),r=fk(),i=t==="loading"?r.spinner:r.icon;return N.createElement(Ce.span,{display:"inherit",...e,className:QS("chakra-alert__icon",e.className),__css:i},e.children||N.createElement(n,{h:"100%",w:"100%"}))}n$.displayName="AlertIcon";var r$=Ae(function(t,n){const r=fk();return N.createElement(Ce.div,{ref:n,...t,className:QS("chakra-alert__title",t.className),__css:r.title})});r$.displayName="AlertTitle";function zge(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Hge(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,d]=w.useState("pending");w.useEffect(()=>{d(n?"loading":"pending")},[n]);const h=w.useRef(),m=w.useCallback(()=>{if(!n)return;y();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=x=>{y(),d("loaded"),i==null||i(x)},b.onerror=x=>{y(),d("failed"),o==null||o(x)},h.current=b},[n,a,r,s,i,o,t]),y=()=>{h.current&&(h.current.onload=null,h.current.onerror=null,h.current=null)};return Gs(()=>{if(!l)return u==="loading"&&m(),()=>{y()}},[u,m,l]),l?"loaded":u}var Vge=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",d5=Ae(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return N.createElement("img",{width:r,height:i,ref:n,alt:o,...a})});d5.displayName="NativeImage";var JS=Ae(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:d,crossOrigin:h,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:y,...b}=t,x=r!==void 0||i!==void 0,k=u!=null||d||!x,E=Hge({...t,ignoreFallback:k}),_=Vge(E,m),P={ref:n,objectFit:l,objectPosition:s,...k?b:zge(b,["onError","onLoad"])};return _?i||N.createElement(Ce.img,{as:d5,className:"chakra-image__placeholder",src:r,...P}):N.createElement(Ce.img,{as:d5,src:o,srcSet:a,crossOrigin:h,loading:u,referrerPolicy:y,className:"chakra-image",...P})});JS.displayName="Image";Ae((e,t)=>N.createElement(Ce.img,{ref:t,as:d5,className:"chakra-image",...e}));function ex(e){return w.Children.toArray(e).filter(t=>w.isValidElement(t))}var tx=(...e)=>e.filter(Boolean).join(" "),TO=e=>e?"":void 0,[Wge,Uge]=Pn({strict:!1,name:"ButtonGroupContext"});function W7(e){const{children:t,className:n,...r}=e,i=w.isValidElement(t)?w.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=tx("chakra-button__icon",n);return N.createElement(Ce.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}W7.displayName="ButtonIcon";function U7(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=N.createElement(ky,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=tx("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",d=w.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return N.createElement(Ce.div,{className:l,...s,__css:d},i)}U7.displayName="ButtonSpinner";function Gge(e){const[t,n]=w.useState(!e);return{ref:w.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var ls=Ae((e,t)=>{const n=Uge(),r=Oo("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:d,iconSpacing:h="0.5rem",type:m,spinner:y,spinnerPlacement:b="start",className:x,as:k,...E}=Sn(e),_=w.useMemo(()=>{const R={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:R}}},[r,n]),{ref:P,type:A}=Gge(k),M={rightIcon:u,leftIcon:l,iconSpacing:h,children:s};return N.createElement(Ce.button,{disabled:i||o,ref:pce(t,P),as:k,type:m??A,"data-active":TO(a),"data-loading":TO(o),__css:_,className:tx("chakra-button",x),...E},o&&b==="start"&&N.createElement(U7,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:h},y),o?d||N.createElement(Ce.span,{opacity:0},N.createElement(LO,{...M})):N.createElement(LO,{...M}),o&&b==="end"&&N.createElement(U7,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:h},y))});ls.displayName="Button";function LO(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return N.createElement(N.Fragment,null,t&&N.createElement(W7,{marginEnd:i},t),r,n&&N.createElement(W7,{marginStart:i},n))}var oo=Ae(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...d}=t,h=tx("chakra-button__group",a),m=w.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let y={display:"inline-flex"};return l?y={...y,"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}}:y={...y,"& > *:not(style) ~ *:not(style)":{marginStart:s}},N.createElement(Wge,{value:m},N.createElement(Ce.div,{ref:n,role:"group",__css:y,className:h,"data-attached":l?"":void 0,...d}))});oo.displayName="ButtonGroup";var us=Ae((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=w.isValidElement(s)?w.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return N.createElement(ls,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a},l)});us.displayName="IconButton";var w0=(...e)=>e.filter(Boolean).join(" "),rb=e=>e?"":void 0,P6=e=>e?!0:void 0;function AO(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[qge,i$]=Pn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Yge,sp]=Pn({strict:!1,name:"FormControlContext"});function Kge(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=w.useId(),l=t||`field-${s}`,u=`${l}-label`,d=`${l}-feedback`,h=`${l}-helptext`,[m,y]=w.useState(!1),[b,x]=w.useState(!1),[k,E]=w.useState(!1),_=w.useCallback((D={},j=null)=>({id:h,...D,ref:Hn(j,z=>{z&&x(!0)})}),[h]),P=w.useCallback((D={},j=null)=>({...D,ref:j,"data-focus":rb(k),"data-disabled":rb(i),"data-invalid":rb(r),"data-readonly":rb(o),id:D.id??u,htmlFor:D.htmlFor??l}),[l,i,k,r,o,u]),A=w.useCallback((D={},j=null)=>({id:d,...D,ref:Hn(j,z=>{z&&y(!0)}),"aria-live":"polite"}),[d]),M=w.useCallback((D={},j=null)=>({...D,...a,ref:j,role:"group"}),[a]),R=w.useCallback((D={},j=null)=>({...D,ref:j,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!k,onFocus:()=>E(!0),onBlur:()=>E(!1),hasFeedbackText:m,setHasFeedbackText:y,hasHelpText:b,setHasHelpText:x,id:l,labelId:u,feedbackId:d,helpTextId:h,htmlProps:a,getHelpTextProps:_,getErrorMessageProps:A,getRootProps:M,getLabelProps:P,getRequiredIndicatorProps:R}}var fn=Ae(function(t,n){const r=Oi("Form",t),i=Sn(t),{getRootProps:o,htmlProps:a,...s}=Kge(i),l=w0("chakra-form-control",t.className);return N.createElement(Yge,{value:s},N.createElement(qge,{value:r},N.createElement(Ce.div,{...o({},n),className:l,__css:r.container})))});fn.displayName="FormControl";var ur=Ae(function(t,n){const r=sp(),i=i$(),o=w0("chakra-form__helper-text",t.className);return N.createElement(Ce.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});ur.displayName="FormHelperText";function hk(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=pk(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":P6(n),"aria-required":P6(i),"aria-readonly":P6(r)}}function pk(e){const t=sp(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:d,onBlur:h,...m}=e,y=e["aria-describedby"]?[e["aria-describedby"]]:[];return t!=null&&t.hasFeedbackText&&(t!=null&&t.isInvalid)&&y.push(t.feedbackId),t!=null&&t.hasHelpText&&y.push(t.helpTextId),{...m,"aria-describedby":y.join(" ")||void 0,id:n??(t==null?void 0:t.id),isDisabled:r??u??(t==null?void 0:t.isDisabled),isReadOnly:i??l??(t==null?void 0:t.isReadOnly),isRequired:o??a??(t==null?void 0:t.isRequired),isInvalid:s??(t==null?void 0:t.isInvalid),onFocus:AO(t==null?void 0:t.onFocus,d),onBlur:AO(t==null?void 0:t.onBlur,h)}}var[Xge,Zge]=Pn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),cr=Ae((e,t)=>{const n=Oi("FormError",e),r=Sn(e),i=sp();return i!=null&&i.isInvalid?N.createElement(Xge,{value:n},N.createElement(Ce.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:w0("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});cr.displayName="FormErrorMessage";var Qge=Ae((e,t)=>{const n=Zge(),r=sp();if(!(r!=null&&r.isInvalid))return null;const i=w0("chakra-form__error-icon",e.className);return N.createElement(Na,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))});Qge.displayName="FormErrorIcon";var En=Ae(function(t,n){const r=Oo("FormLabel",t),i=Sn(t),{className:o,children:a,requiredIndicator:s=N.createElement(o$,null),optionalIndicator:l=null,...u}=i,d=sp(),h=(d==null?void 0:d.getLabelProps(u,n))??{ref:n,...u};return N.createElement(Ce.label,{...h,className:w0("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,d!=null&&d.isRequired?s:l)});En.displayName="FormLabel";var o$=Ae(function(t,n){const r=sp(),i=i$();if(!(r!=null&&r.isRequired))return null;const o=w0("chakra-form__required-indicator",t.className);return N.createElement(Ce.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});o$.displayName="RequiredIndicator";function Gd(e,t){const n=w.useRef(!1),r=w.useRef(!1);w.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var gk={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},Jge=Ce("span",{baseStyle:gk});Jge.displayName="VisuallyHidden";var eme=Ce("input",{baseStyle:gk});eme.displayName="VisuallyHiddenInput";var OO=!1,nx=null,Ym=!1,G7=new Set,tme=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function nme(e){return!(e.metaKey||!tme&&e.altKey||e.ctrlKey)}function mk(e,t){G7.forEach(n=>n(e,t))}function MO(e){Ym=!0,nme(e)&&(nx="keyboard",mk("keyboard",e))}function Eg(e){nx="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ym=!0,mk("pointer",e))}function rme(e){e.target===window||e.target===document||(Ym||(nx="keyboard",mk("keyboard",e)),Ym=!1)}function ime(){Ym=!1}function IO(){return nx!=="pointer"}function ome(){if(typeof window>"u"||OO)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Ym=!0,e.apply(this,n)},document.addEventListener("keydown",MO,!0),document.addEventListener("keyup",MO,!0),window.addEventListener("focus",rme,!0),window.addEventListener("blur",ime,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Eg,!0),document.addEventListener("pointermove",Eg,!0),document.addEventListener("pointerup",Eg,!0)):(document.addEventListener("mousedown",Eg,!0),document.addEventListener("mousemove",Eg,!0),document.addEventListener("mouseup",Eg,!0)),OO=!0}function a$(e){ome(),e(IO());const t=()=>e(IO());return G7.add(t),()=>{G7.delete(t)}}var[gze,ame]=Pn({name:"CheckboxGroupContext",strict:!1}),sme=(...e)=>e.filter(Boolean).join(" "),bo=e=>e?"":void 0;function Ka(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function lme(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function ume(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},N.createElement("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function cme(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},N.createElement("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function dme(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?cme:ume;return n||t?N.createElement(Ce.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},N.createElement(i,{...r})):null}function fme(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function s$(e={}){const t=pk(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:d,isChecked:h,isFocusable:m,onChange:y,isIndeterminate:b,name:x,value:k,tabIndex:E=void 0,"aria-label":_,"aria-labelledby":P,"aria-invalid":A,...M}=e,R=fme(M,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=Er(y),j=Er(s),z=Er(l),[H,K]=w.useState(!1),[te,G]=w.useState(!1),[F,W]=w.useState(!1),[X,Z]=w.useState(!1);w.useEffect(()=>a$(K),[]);const U=w.useRef(null),[Q,re]=w.useState(!0),[fe,Ee]=w.useState(!!d),be=h!==void 0,ye=be?h:fe,ze=w.useCallback(Le=>{if(r||n){Le.preventDefault();return}be||Ee(ye?Le.target.checked:b?!0:Le.target.checked),D==null||D(Le)},[r,n,ye,be,b,D]);Gs(()=>{U.current&&(U.current.indeterminate=Boolean(b))},[b]),Gd(()=>{n&&G(!1)},[n,G]),Gs(()=>{const Le=U.current;Le!=null&&Le.form&&(Le.form.onreset=()=>{Ee(!!d)})},[]);const Me=n&&!m,rt=w.useCallback(Le=>{Le.key===" "&&Z(!0)},[Z]),We=w.useCallback(Le=>{Le.key===" "&&Z(!1)},[Z]);Gs(()=>{if(!U.current)return;U.current.checked!==ye&&Ee(U.current.checked)},[U.current]);const Be=w.useCallback((Le={},ut=null)=>{const Mt=ct=>{te&&ct.preventDefault(),Z(!0)};return{...Le,ref:ut,"data-active":bo(X),"data-hover":bo(F),"data-checked":bo(ye),"data-focus":bo(te),"data-focus-visible":bo(te&&H),"data-indeterminate":bo(b),"data-disabled":bo(n),"data-invalid":bo(o),"data-readonly":bo(r),"aria-hidden":!0,onMouseDown:Ka(Le.onMouseDown,Mt),onMouseUp:Ka(Le.onMouseUp,()=>Z(!1)),onMouseEnter:Ka(Le.onMouseEnter,()=>W(!0)),onMouseLeave:Ka(Le.onMouseLeave,()=>W(!1))}},[X,ye,n,te,H,F,b,o,r]),wt=w.useCallback((Le={},ut=null)=>({...R,...Le,ref:Hn(ut,Mt=>{Mt&&re(Mt.tagName==="LABEL")}),onClick:Ka(Le.onClick,()=>{var Mt;Q||((Mt=U.current)==null||Mt.click(),requestAnimationFrame(()=>{var ct;(ct=U.current)==null||ct.focus()}))}),"data-disabled":bo(n),"data-checked":bo(ye),"data-invalid":bo(o)}),[R,n,ye,o,Q]),Fe=w.useCallback((Le={},ut=null)=>({...Le,ref:Hn(U,ut),type:"checkbox",name:x,value:k,id:a,tabIndex:E,onChange:Ka(Le.onChange,ze),onBlur:Ka(Le.onBlur,j,()=>G(!1)),onFocus:Ka(Le.onFocus,z,()=>G(!0)),onKeyDown:Ka(Le.onKeyDown,rt),onKeyUp:Ka(Le.onKeyUp,We),required:i,checked:ye,disabled:Me,readOnly:r,"aria-label":_,"aria-labelledby":P,"aria-invalid":A?Boolean(A):o,"aria-describedby":u,"aria-disabled":n,style:gk}),[x,k,a,ze,j,z,rt,We,i,ye,Me,r,_,P,A,o,u,n,E]),at=w.useCallback((Le={},ut=null)=>({...Le,ref:ut,onMouseDown:Ka(Le.onMouseDown,RO),onTouchStart:Ka(Le.onTouchStart,RO),"data-disabled":bo(n),"data-checked":bo(ye),"data-invalid":bo(o)}),[ye,n,o]);return{state:{isInvalid:o,isFocused:te,isChecked:ye,isActive:X,isHovered:F,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:wt,getCheckboxProps:Be,getInputProps:Fe,getLabelProps:at,htmlProps:R}}function RO(e){e.preventDefault(),e.stopPropagation()}var hme={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},pme={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},gme=of({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),mme=of({from:{opacity:0},to:{opacity:1}}),vme=of({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),l$=Ae(function(t,n){const r=ame(),i={...r,...t},o=Oi("Checkbox",i),a=Sn(t),{spacing:s="0.5rem",className:l,children:u,iconColor:d,iconSize:h,icon:m=N.createElement(dme,null),isChecked:y,isDisabled:b=r==null?void 0:r.isDisabled,onChange:x,inputProps:k,...E}=a;let _=y;r!=null&&r.value&&a.value&&(_=r.value.includes(a.value));let P=x;r!=null&&r.onChange&&a.value&&(P=lme(r.onChange,x));const{state:A,getInputProps:M,getCheckboxProps:R,getLabelProps:D,getRootProps:j}=s$({...E,isDisabled:b,isChecked:_,onChange:P}),z=w.useMemo(()=>({animation:A.isIndeterminate?`${mme} 20ms linear, ${vme} 200ms linear`:`${gme} 200ms linear`,fontSize:h,color:d,...o.icon}),[d,h,,A.isIndeterminate,o.icon]),H=w.cloneElement(m,{__css:z,isIndeterminate:A.isIndeterminate,isChecked:A.isChecked});return N.createElement(Ce.label,{__css:{...pme,...o.container},className:sme("chakra-checkbox",l),...j()},N.createElement("input",{className:"chakra-checkbox__input",...M(k,n)}),N.createElement(Ce.span,{__css:{...hme,...o.control},className:"chakra-checkbox__control",...R()},H),u&&N.createElement(Ce.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:s,...o.label}},u))});l$.displayName="Checkbox";function yme(e){return N.createElement(Na,{focusable:"false","aria-hidden":!0,...e},N.createElement("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}))}var rx=Ae(function(t,n){const r=Oo("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=Sn(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return N.createElement(Ce.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||N.createElement(yme,{width:"1em",height:"1em"}))});rx.displayName="CloseButton";function bme(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function vk(e,t){let n=bme(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function q7(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function f5(e,t,n){return(e-t)*100/(n-t)}function u$(e,t,n){return(n-t)*e+t}function Y7(e,t,n){const r=Math.round((e-t)/n)*n+t,i=q7(n);return vk(r,i)}function Pm(e,t,n){return e==null?e:(nr==null?"":T6(r,o,n)??""),m=typeof i<"u",y=m?i:d,b=c$(hd(y),o),x=n??b,k=w.useCallback(H=>{H!==y&&(m||h(H.toString()),u==null||u(H.toString(),hd(H)))},[u,m,y]),E=w.useCallback(H=>{let K=H;return l&&(K=Pm(K,a,s)),vk(K,x)},[x,l,s,a]),_=w.useCallback((H=o)=>{let K;y===""?K=hd(H):K=hd(y)+H,K=E(K),k(K)},[E,o,k,y]),P=w.useCallback((H=o)=>{let K;y===""?K=hd(-H):K=hd(y)-H,K=E(K),k(K)},[E,o,k,y]),A=w.useCallback(()=>{let H;r==null?H="":H=T6(r,o,n)??a,k(H)},[r,n,o,k,a]),M=w.useCallback(H=>{const K=T6(H,o,x)??a;k(K)},[x,o,k,a]),R=hd(y);return{isOutOfRange:R>s||Rt in e?wee(e,t,{enumerable:!0,con --chakra-vh: 100dvh; } } -`,xme=()=>N.createElement(DS,{styles:cF}),wme=()=>N.createElement(DS,{styles:` +`,xme=()=>N.createElement(DS,{styles:d$}),wme=()=>N.createElement(DS,{styles:` html { line-height: 1.5; -webkit-text-size-adjust: 100%; @@ -343,8 +343,8 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con display: none; } - ${cF} - `});function Nh(e,t,n,r){const i=Er(n);return w.useEffect(()=>{const o=typeof e=="function"?e():e??document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e??document;o==null||o.removeEventListener(t,i,r)}}function Cme(e){return"current"in e}var dF=()=>typeof window<"u";function _me(){const e=navigator.userAgentData;return(e==null?void 0:e.platform)??navigator.platform}var kme=e=>dF()&&e.test(navigator.vendor),Eme=e=>dF()&&e.test(_me()),Pme=()=>Eme(/mac|iphone|ipad|ipod/i),Tme=()=>Pme()&&kme(/apple/i);function Lme(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var o;return((o=t.current)==null?void 0:o.ownerDocument)??document};Nh(i,"pointerdown",o=>{if(!Tme()||!r)return;const a=o.target,l=(n??[t]).some(u=>{const d=Cme(u)?u.current:u;return(d==null?void 0:d.contains(a))||d===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}var Ame=xre?w.useLayoutEffect:w.useEffect;function RO(e,t=[]){const n=w.useRef(e);return Ame(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Ome(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Mme(e,t){const n=w.useId();return w.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Gh(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=RO(n),a=RO(t),[s,l]=w.useState(e.defaultIsOpen||!1),[u,d]=Ome(r,s),h=Mme(i,"disclosure"),m=w.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),v=w.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),b=w.useCallback(()=>{(d?m:v)()},[d,v,m]);return{isOpen:!!d,onOpen:v,onClose:m,onToggle:b,isControlled:u,getButtonProps:(S={})=>({...S,"aria-expanded":d,"aria-controls":h,onClick:wre(S.onClick,b)}),getDisclosureProps:(S={})=>({...S,hidden:!d,id:h})}}function yk(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var bk=Ae(function(t,n){const{htmlSize:r,...i}=t,o=Oi("Input",i),a=Sn(i),s=hk(a),l=Qr("chakra-input",t.className);return N.createElement(Ce.input,{size:r,...s,__css:o.field,ref:n,className:l})});bk.displayName="Input";bk.id="Input";var[Ime,fF]=Pn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Rme=Ae(function(t,n){const r=Oi("Input",t),{children:i,className:o,...a}=Sn(t),s=Qr("chakra-input__group",o),l={},u=ex(i),d=r.field;u.forEach(m=>{r&&(d&&m.type.id==="InputLeftElement"&&(l.paddingStart=d.height??d.h),d&&m.type.id==="InputRightElement"&&(l.paddingEnd=d.height??d.h),m.type.id==="InputRightAddon"&&(l.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const h=u.map(m=>{var v,b;const S=yk({size:((v=m.props)==null?void 0:v.size)||t.size,variant:((b=m.props)==null?void 0:b.variant)||t.variant});return m.type.id!=="Input"?w.cloneElement(m,S):w.cloneElement(m,Object.assign(S,l,m.props))});return N.createElement(Ce.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},N.createElement(Ime,{value:r},h))});Rme.displayName="InputGroup";var Dme={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},Nme=Ce("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),Sk=Ae(function(t,n){const{placement:r="left",...i}=t,o=Dme[r]??{},a=fF();return N.createElement(Nme,{ref:n,...i,__css:{...a.addon,...o}})});Sk.displayName="InputAddon";var hF=Ae(function(t,n){return N.createElement(Sk,{ref:n,placement:"left",...t,className:Qr("chakra-input__left-addon",t.className)})});hF.displayName="InputLeftAddon";hF.id="InputLeftAddon";var pF=Ae(function(t,n){return N.createElement(Sk,{ref:n,placement:"right",...t,className:Qr("chakra-input__right-addon",t.className)})});pF.displayName="InputRightAddon";pF.id="InputRightAddon";var jme=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),ix=Ae(function(t,n){const{placement:r="left",...i}=t,o=fF(),a=o.field,l={[r==="left"?"insetStart":"insetEnd"]:"0",width:(a==null?void 0:a.height)??(a==null?void 0:a.h),height:(a==null?void 0:a.height)??(a==null?void 0:a.h),fontSize:a==null?void 0:a.fontSize,...o.element};return N.createElement(jme,{ref:n,__css:l,...i})});ix.id="InputElement";ix.displayName="InputElement";var gF=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__left-element",r);return N.createElement(ix,{ref:n,placement:"left",className:o,...i})});gF.id="InputLeftElement";gF.displayName="InputLeftElement";var mF=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__right-element",r);return N.createElement(ix,{ref:n,placement:"right",className:o,...i})});mF.id="InputRightElement";mF.displayName="InputRightElement";function Bme(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Gd(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Bme(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var $me=Ae(function(e,t){const{ratio:n=4/3,children:r,className:i,...o}=e,a=w.Children.only(r),s=Qr("chakra-aspect-ratio",i);return N.createElement(Ce.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:Gd(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o},a)});$me.displayName="AspectRatio";var Fme=Ae(function(t,n){const r=Oo("Badge",t),{className:i,...o}=Sn(t);return N.createElement(Ce.span,{ref:n,className:Qr("chakra-badge",t.className),...o,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Fme.displayName="Badge";var Eo=Ce("div");Eo.displayName="Box";var vF=Ae(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return N.createElement(Eo,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});vF.displayName="Square";var zme=Ae(function(t,n){const{size:r,...i}=t;return N.createElement(vF,{size:r,ref:n,borderRadius:"9999px",...i})});zme.displayName="Circle";var yF=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});yF.displayName="Center";var Hme={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Ae(function(t,n){const{axis:r="both",...i}=t;return N.createElement(Ce.div,{ref:n,__css:Hme[r],...i,position:"absolute"})});var Vme=Ae(function(t,n){const r=Oo("Code",t),{className:i,...o}=Sn(t);return N.createElement(Ce.code,{ref:n,className:Qr("chakra-code",t.className),...o,__css:{display:"inline-block",...r}})});Vme.displayName="Code";var Wme=Ae(function(t,n){const{className:r,centerContent:i,...o}=Sn(t),a=Oo("Container",t);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-container",r),...o,__css:{...a,...i&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});Wme.displayName="Container";var Ume=Ae(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:o,borderRightWidth:a,borderWidth:s,borderStyle:l,borderColor:u,...d}=Oo("Divider",t),{className:h,orientation:m="horizontal",__css:v,...b}=Sn(t),S={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:i||o||s||"1px",width:"100%"}};return N.createElement(Ce.hr,{ref:n,"aria-orientation":m,...b,__css:{...d,border:"0",borderColor:u,borderStyle:l,...S[m],...v},className:Qr("chakra-divider",h)})});Ume.displayName="Divider";var Ge=Ae(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...d}=t,h={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return N.createElement(Ce.div,{ref:n,__css:h,...d})});Ge.displayName="Flex";var bF=Ae(function(t,n){const{templateAreas:r,gap:i,rowGap:o,columnGap:a,column:s,row:l,autoFlow:u,autoRows:d,templateRows:h,autoColumns:m,templateColumns:v,...b}=t,S={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:o,gridColumnGap:a,gridAutoColumns:m,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:d,gridTemplateRows:h,gridTemplateColumns:v};return N.createElement(Ce.div,{ref:n,__css:S,...b})});bF.displayName="Grid";function DO(e){return Gd(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Gme=Ae(function(t,n){const{area:r,colSpan:i,colStart:o,colEnd:a,rowEnd:s,rowSpan:l,rowStart:u,...d}=t,h=yk({gridArea:r,gridColumn:DO(i),gridRow:DO(l),gridColumnStart:o,gridColumnEnd:a,gridRowStart:u,gridRowEnd:s});return N.createElement(Ce.div,{ref:n,__css:h,...d})});Gme.displayName="GridItem";var jh=Ae(function(t,n){const r=Oo("Heading",t),{className:i,...o}=Sn(t);return N.createElement(Ce.h2,{ref:n,className:Qr("chakra-heading",t.className),...o,__css:r})});jh.displayName="Heading";Ae(function(t,n){const r=Oo("Mark",t),i=Sn(t);return N.createElement(Eo,{ref:n,...i,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var qme=Ae(function(t,n){const r=Oo("Kbd",t),{className:i,...o}=Sn(t);return N.createElement(Ce.kbd,{ref:n,className:Qr("chakra-kbd",i),...o,__css:{fontFamily:"mono",...r}})});qme.displayName="Kbd";var Bh=Ae(function(t,n){const r=Oo("Link",t),{className:i,isExternal:o,...a}=Sn(t);return N.createElement(Ce.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:Qr("chakra-link",i),...a,__css:r})});Bh.displayName="Link";Ae(function(t,n){const{isExternal:r,target:i,rel:o,className:a,...s}=t;return N.createElement(Ce.a,{...s,ref:n,className:Qr("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":o,target:r?"_blank":i,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});Ae(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.div,{ref:n,position:"relative",...i,className:Qr("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[Yme,SF]=Pn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),xk=Ae(function(t,n){const r=Oi("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=Sn(t),u=ex(i),h=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return N.createElement(Yme,{value:r},N.createElement(Ce.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...h},...l},u))});xk.displayName="List";var Kme=Ae((e,t)=>{const{as:n,...r}=e;return N.createElement(xk,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});Kme.displayName="OrderedList";var xF=Ae(function(t,n){const{as:r,...i}=t;return N.createElement(xk,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});xF.displayName="UnorderedList";var Sv=Ae(function(t,n){const r=SF();return N.createElement(Ce.li,{ref:n,...t,__css:r.item})});Sv.displayName="ListItem";var Xme=Ae(function(t,n){const r=SF();return N.createElement(Na,{ref:n,role:"presentation",...t,__css:r.icon})});Xme.displayName="ListIcon";var Zme=Ae(function(t,n){const{columns:r,spacingX:i,spacingY:o,spacing:a,minChildWidth:s,...l}=t,u=m0(),d=s?Jme(s,u):e0e(r);return N.createElement(bF,{ref:n,gap:a,columnGap:i,rowGap:o,templateColumns:d,...l})});Zme.displayName="SimpleGrid";function Qme(e){return typeof e=="number"?`${e}px`:e}function Jme(e,t){return Gd(e,n=>{const r=rce("sizes",n,Qme(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function e0e(e){return Gd(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var wF=Ce("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});wF.displayName="Spacer";var K7="& > *:not(style) ~ *:not(style)";function t0e(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[K7]:Gd(n,i=>r[i])}}function n0e(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":Gd(n,i=>r[i])}}var CF=e=>N.createElement(Ce.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});CF.displayName="StackItem";var wk=Ae((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:d,shouldWrapChildren:h,...m}=e,v=n?"row":r??"column",b=w.useMemo(()=>t0e({direction:v,spacing:a}),[v,a]),S=w.useMemo(()=>n0e({spacing:a,direction:v}),[a,v]),_=!!u,E=!h&&!_,k=w.useMemo(()=>{const A=ex(l);return E?A:A.map((M,R)=>{const D=typeof M.key<"u"?M.key:R,j=R+1===A.length,H=h?N.createElement(CF,{key:D},M):M;if(!_)return H;const K=w.cloneElement(u,{__css:S}),te=j?null:K;return N.createElement(w.Fragment,{key:D},H,te)})},[u,S,_,E,h,l]),T=Qr("chakra-stack",d);return N.createElement(Ce.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:b.flexDirection,flexWrap:s,className:T,__css:_?{}:{[K7]:b[K7]},...m},k)});wk.displayName="Stack";var Ey=Ae((e,t)=>N.createElement(wk,{align:"center",...e,direction:"row",ref:t}));Ey.displayName="HStack";var yn=Ae((e,t)=>N.createElement(wk,{align:"center",...e,direction:"column",ref:t}));yn.displayName="VStack";var Jt=Ae(function(t,n){const r=Oo("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=Sn(t),u=yk({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return N.createElement(Ce.p,{ref:n,className:Qr("chakra-text",t.className),...u,...l,__css:r})});Jt.displayName="Text";function NO(e){return typeof e=="number"?`${e}px`:e}var r0e=Ae(function(t,n){const{spacing:r="0.5rem",spacingX:i,spacingY:o,children:a,justify:s,direction:l,align:u,className:d,shouldWrapChildren:h,...m}=t,v=w.useMemo(()=>{const{spacingX:S=r,spacingY:_=r}={spacingX:i,spacingY:o};return{"--chakra-wrap-x-spacing":E=>Gd(S,k=>NO(r7("space",k)(E))),"--chakra-wrap-y-spacing":E=>Gd(_,k=>NO(r7("space",k)(E))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,i,o,s,u,l]),b=w.useMemo(()=>h?w.Children.map(a,(S,_)=>N.createElement(_F,{key:_},S)):a,[a,h]);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-wrap",d),overflow:"hidden",...m},N.createElement(Ce.ul,{className:"chakra-wrap__list",__css:v},b))});r0e.displayName="Wrap";var _F=Ae(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:Qr("chakra-wrap__listitem",r),...i})});_F.displayName="WrapItem";var i0e={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},kF=i0e,Eg=()=>{},o0e={document:kF,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:Eg,removeEventListener:Eg,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:Eg,removeListener:Eg}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:Eg,setInterval:()=>0,clearInterval:Eg},a0e=o0e,s0e={window:a0e,document:kF},EF=typeof window<"u"?{window,document}:s0e,PF=w.createContext(EF);PF.displayName="EnvironmentContext";function TF(e){const{children:t,environment:n}=e,[r,i]=w.useState(null),[o,a]=w.useState(!1);w.useEffect(()=>a(!0),[]);const s=w.useMemo(()=>{if(n)return n;const l=r==null?void 0:r.ownerDocument,u=r==null?void 0:r.ownerDocument.defaultView;return l?{document:l,window:u}:EF},[r,n]);return N.createElement(PF.Provider,{value:s},t,!n&&o&&N.createElement("span",{id:"__chakra_env",hidden:!0,ref:l=>{w.startTransition(()=>{l&&i(l)})}}))}TF.displayName="EnvironmentProvider";var l0e=e=>e?"":void 0;function u0e(){const e=w.useRef(new Map),t=e.current,n=w.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=w.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return w.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function L6(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function c0e(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:d,tabIndex:h,onMouseOver:m,onMouseLeave:v,...b}=e,[S,_]=w.useState(!0),[E,k]=w.useState(!1),T=u0e(),A=Z=>{Z&&Z.tagName!=="BUTTON"&&_(!1)},M=S?h:h||0,R=n&&!r,D=w.useCallback(Z=>{if(n){Z.stopPropagation(),Z.preventDefault();return}Z.currentTarget.focus(),l==null||l(Z)},[n,l]),j=w.useCallback(Z=>{E&&L6(Z)&&(Z.preventDefault(),Z.stopPropagation(),k(!1),T.remove(document,"keyup",j,!1))},[E,T]),z=w.useCallback(Z=>{if(u==null||u(Z),n||Z.defaultPrevented||Z.metaKey||!L6(Z.nativeEvent)||S)return;const U=i&&Z.key==="Enter";o&&Z.key===" "&&(Z.preventDefault(),k(!0)),U&&(Z.preventDefault(),Z.currentTarget.click()),T.add(document,"keyup",j,!1)},[n,S,u,i,o,T,j]),H=w.useCallback(Z=>{if(d==null||d(Z),n||Z.defaultPrevented||Z.metaKey||!L6(Z.nativeEvent)||S)return;o&&Z.key===" "&&(Z.preventDefault(),k(!1),Z.currentTarget.click())},[o,S,n,d]),K=w.useCallback(Z=>{Z.button===0&&(k(!1),T.remove(document,"mouseup",K,!1))},[T]),te=w.useCallback(Z=>{if(Z.button!==0)return;if(n){Z.stopPropagation(),Z.preventDefault();return}S||k(!0),Z.currentTarget.focus({preventScroll:!0}),T.add(document,"mouseup",K,!1),a==null||a(Z)},[n,S,a,T,K]),G=w.useCallback(Z=>{Z.button===0&&(S||k(!1),s==null||s(Z))},[s,S]),$=w.useCallback(Z=>{if(n){Z.preventDefault();return}m==null||m(Z)},[n,m]),W=w.useCallback(Z=>{E&&(Z.preventDefault(),k(!1)),v==null||v(Z)},[E,v]),X=Hn(t,A);return S?{...b,ref:X,type:"button","aria-disabled":R?void 0:n,disabled:R,onClick:D,onMouseDown:a,onMouseUp:s,onKeyUp:d,onKeyDown:u,onMouseOver:m,onMouseLeave:v}:{...b,ref:X,role:"button","data-active":l0e(E),"aria-disabled":n?"true":void 0,tabIndex:R?void 0:M,onClick:D,onMouseDown:te,onMouseUp:G,onKeyUp:H,onKeyDown:z,onMouseOver:$,onMouseLeave:W}}function LF(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function AF(e){if(!LF(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function d0e(e){var t;return((t=OF(e))==null?void 0:t.defaultView)??window}function OF(e){return LF(e)?e.ownerDocument:document}function f0e(e){return OF(e).activeElement}var MF=e=>e.hasAttribute("tabindex"),h0e=e=>MF(e)&&e.tabIndex===-1;function p0e(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function IF(e){return e.parentElement&&IF(e.parentElement)?!0:e.hidden}function g0e(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function RF(e){if(!AF(e)||IF(e)||p0e(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():g0e(e)?!0:MF(e)}function m0e(e){return e?AF(e)&&RF(e)&&!h0e(e):!1}var v0e=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],y0e=v0e.join(),b0e=e=>e.offsetWidth>0&&e.offsetHeight>0;function DF(e){const t=Array.from(e.querySelectorAll(y0e));return t.unshift(e),t.filter(n=>RF(n)&&b0e(n))}function S0e(e){const t=e.current;if(!t)return!1;const n=f0e(t);return!n||t.contains(n)?!1:!!m0e(n)}function x0e(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;Ud(()=>{if(!o||S0e(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var w0e={preventScroll:!0,shouldFocus:!1};function C0e(e,t=w0e){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=_0e(e)?e.current:e,s=i&&o,l=w.useRef(s),u=w.useRef(o);Gs(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const d=w.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=DF(a);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[o,r,a,n]);Ud(()=>{d()},[d]),Nh(a,"transitionend",d)}function _0e(e){return"current"in e}var Qo="top",cs="bottom",ds="right",Jo="left",Ck="auto",Py=[Qo,cs,ds,Jo],Ym="start",I2="end",k0e="clippingParents",NF="viewport",Y1="popper",E0e="reference",jO=Py.reduce(function(e,t){return e.concat([t+"-"+Ym,t+"-"+I2])},[]),jF=[].concat(Py,[Ck]).reduce(function(e,t){return e.concat([t,t+"-"+Ym,t+"-"+I2])},[]),P0e="beforeRead",T0e="read",L0e="afterRead",A0e="beforeMain",O0e="main",M0e="afterMain",I0e="beforeWrite",R0e="write",D0e="afterWrite",N0e=[P0e,T0e,L0e,A0e,O0e,M0e,I0e,R0e,D0e];function lu(e){return e?(e.nodeName||"").toLowerCase():null}function gs(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qh(e){var t=gs(e).Element;return e instanceof t||e instanceof Element}function as(e){var t=gs(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function _k(e){if(typeof ShadowRoot>"u")return!1;var t=gs(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function j0e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!as(o)||!lu(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function B0e(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!as(i)||!lu(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const $0e={name:"applyStyles",enabled:!0,phase:"write",fn:j0e,effect:B0e,requires:["computeStyles"]};function Jl(e){return e.split("-")[0]}var $h=Math.max,h5=Math.min,Km=Math.round;function X7(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function BF(){return!/^((?!chrome|android).)*safari/i.test(X7())}function Xm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&as(e)&&(i=e.offsetWidth>0&&Km(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Km(r.height)/e.offsetHeight||1);var a=qh(e)?gs(e):window,s=a.visualViewport,l=!BF()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,d=(r.top+(l&&s?s.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:d,right:u+h,bottom:d+m,left:u,x:u,y:d}}function kk(e){var t=Xm(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function $F(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_k(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function nc(e){return gs(e).getComputedStyle(e)}function F0e(e){return["table","td","th"].indexOf(lu(e))>=0}function af(e){return((qh(e)?e.ownerDocument:e.document)||window.document).documentElement}function ox(e){return lu(e)==="html"?e:e.assignedSlot||e.parentNode||(_k(e)?e.host:null)||af(e)}function BO(e){return!as(e)||nc(e).position==="fixed"?null:e.offsetParent}function z0e(e){var t=/firefox/i.test(X7()),n=/Trident/i.test(X7());if(n&&as(e)){var r=nc(e);if(r.position==="fixed")return null}var i=ox(e);for(_k(i)&&(i=i.host);as(i)&&["html","body"].indexOf(lu(i))<0;){var o=nc(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Ty(e){for(var t=gs(e),n=BO(e);n&&F0e(n)&&nc(n).position==="static";)n=BO(n);return n&&(lu(n)==="html"||lu(n)==="body"&&nc(n).position==="static")?t:n||z0e(e)||t}function Ek(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Zv(e,t,n){return $h(e,h5(t,n))}function H0e(e,t,n){var r=Zv(e,t,n);return r>n?n:r}function FF(){return{top:0,right:0,bottom:0,left:0}}function zF(e){return Object.assign({},FF(),e)}function HF(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var V0e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,zF(typeof t!="number"?t:HF(t,Py))};function W0e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Jl(n.placement),l=Ek(s),u=[Jo,ds].indexOf(s)>=0,d=u?"height":"width";if(!(!o||!a)){var h=V0e(i.padding,n),m=kk(o),v=l==="y"?Qo:Jo,b=l==="y"?cs:ds,S=n.rects.reference[d]+n.rects.reference[l]-a[l]-n.rects.popper[d],_=a[l]-n.rects.reference[l],E=Ty(o),k=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,T=S/2-_/2,A=h[v],M=k-m[d]-h[b],R=k/2-m[d]/2+T,D=Zv(A,R,M),j=l;n.modifiersData[r]=(t={},t[j]=D,t.centerOffset=D-R,t)}}function U0e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||$F(t.elements.popper,i)&&(t.elements.arrow=i))}const G0e={name:"arrow",enabled:!0,phase:"main",fn:W0e,effect:U0e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Zm(e){return e.split("-")[1]}var q0e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Y0e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Km(t*i)/i||0,y:Km(n*i)/i||0}}function $O(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,m=a.x,v=m===void 0?0:m,b=a.y,S=b===void 0?0:b,_=typeof d=="function"?d({x:v,y:S}):{x:v,y:S};v=_.x,S=_.y;var E=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),T=Jo,A=Qo,M=window;if(u){var R=Ty(n),D="clientHeight",j="clientWidth";if(R===gs(n)&&(R=af(n),nc(R).position!=="static"&&s==="absolute"&&(D="scrollHeight",j="scrollWidth")),R=R,i===Qo||(i===Jo||i===ds)&&o===I2){A=cs;var z=h&&R===M&&M.visualViewport?M.visualViewport.height:R[D];S-=z-r.height,S*=l?1:-1}if(i===Jo||(i===Qo||i===cs)&&o===I2){T=ds;var H=h&&R===M&&M.visualViewport?M.visualViewport.width:R[j];v-=H-r.width,v*=l?1:-1}}var K=Object.assign({position:s},u&&q0e),te=d===!0?Y0e({x:v,y:S}):{x:v,y:S};if(v=te.x,S=te.y,l){var G;return Object.assign({},K,(G={},G[A]=k?"0":"",G[T]=E?"0":"",G.transform=(M.devicePixelRatio||1)<=1?"translate("+v+"px, "+S+"px)":"translate3d("+v+"px, "+S+"px, 0)",G))}return Object.assign({},K,(t={},t[A]=k?S+"px":"",t[T]=E?v+"px":"",t.transform="",t))}function K0e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Jl(t.placement),variation:Zm(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,$O(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,$O(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const X0e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:K0e,data:{}};var ib={passive:!0};function Z0e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=gs(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,ib)}),s&&l.addEventListener("resize",n.update,ib),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,ib)}),s&&l.removeEventListener("resize",n.update,ib)}}const Q0e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Z0e,data:{}};var J0e={left:"right",right:"left",bottom:"top",top:"bottom"};function v4(e){return e.replace(/left|right|bottom|top/g,function(t){return J0e[t]})}var e1e={start:"end",end:"start"};function FO(e){return e.replace(/start|end/g,function(t){return e1e[t]})}function Pk(e){var t=gs(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Tk(e){return Xm(af(e)).left+Pk(e).scrollLeft}function t1e(e,t){var n=gs(e),r=af(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=BF();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+Tk(e),y:l}}function n1e(e){var t,n=af(e),r=Pk(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=$h(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=$h(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Tk(e),l=-r.scrollTop;return nc(i||n).direction==="rtl"&&(s+=$h(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function Lk(e){var t=nc(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function VF(e){return["html","body","#document"].indexOf(lu(e))>=0?e.ownerDocument.body:as(e)&&Lk(e)?e:VF(ox(e))}function Qv(e,t){var n;t===void 0&&(t=[]);var r=VF(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=gs(r),a=i?[o].concat(o.visualViewport||[],Lk(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Qv(ox(a)))}function Z7(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function r1e(e,t){var n=Xm(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function zO(e,t,n){return t===NF?Z7(t1e(e,n)):qh(t)?r1e(t,n):Z7(n1e(af(e)))}function i1e(e){var t=Qv(ox(e)),n=["absolute","fixed"].indexOf(nc(e).position)>=0,r=n&&as(e)?Ty(e):e;return qh(r)?t.filter(function(i){return qh(i)&&$F(i,r)&&lu(i)!=="body"}):[]}function o1e(e,t,n,r){var i=t==="clippingParents"?i1e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var d=zO(e,u,r);return l.top=$h(d.top,l.top),l.right=h5(d.right,l.right),l.bottom=h5(d.bottom,l.bottom),l.left=$h(d.left,l.left),l},zO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function WF(e){var t=e.reference,n=e.element,r=e.placement,i=r?Jl(r):null,o=r?Zm(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Qo:l={x:a,y:t.y-n.height};break;case cs:l={x:a,y:t.y+t.height};break;case ds:l={x:t.x+t.width,y:s};break;case Jo:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?Ek(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case Ym:l[u]=l[u]-(t[d]/2-n[d]/2);break;case I2:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function R2(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?k0e:s,u=n.rootBoundary,d=u===void 0?NF:u,h=n.elementContext,m=h===void 0?Y1:h,v=n.altBoundary,b=v===void 0?!1:v,S=n.padding,_=S===void 0?0:S,E=zF(typeof _!="number"?_:HF(_,Py)),k=m===Y1?E0e:Y1,T=e.rects.popper,A=e.elements[b?k:m],M=o1e(qh(A)?A:A.contextElement||af(e.elements.popper),l,d,a),R=Xm(e.elements.reference),D=WF({reference:R,element:T,strategy:"absolute",placement:i}),j=Z7(Object.assign({},T,D)),z=m===Y1?j:R,H={top:M.top-z.top+E.top,bottom:z.bottom-M.bottom+E.bottom,left:M.left-z.left+E.left,right:z.right-M.right+E.right},K=e.modifiersData.offset;if(m===Y1&&K){var te=K[i];Object.keys(H).forEach(function(G){var $=[ds,cs].indexOf(G)>=0?1:-1,W=[Qo,cs].indexOf(G)>=0?"y":"x";H[G]+=te[W]*$})}return H}function a1e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?jF:l,d=Zm(r),h=d?s?jO:jO.filter(function(b){return Zm(b)===d}):Py,m=h.filter(function(b){return u.indexOf(b)>=0});m.length===0&&(m=h);var v=m.reduce(function(b,S){return b[S]=R2(e,{placement:S,boundary:i,rootBoundary:o,padding:a})[Jl(S)],b},{});return Object.keys(v).sort(function(b,S){return v[b]-v[S]})}function s1e(e){if(Jl(e)===Ck)return[];var t=v4(e);return[FO(e),t,FO(t)]}function l1e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,v=n.flipVariations,b=v===void 0?!0:v,S=n.allowedAutoPlacements,_=t.options.placement,E=Jl(_),k=E===_,T=l||(k||!b?[v4(_)]:s1e(_)),A=[_].concat(T).reduce(function(ye,Fe){return ye.concat(Jl(Fe)===Ck?a1e(t,{placement:Fe,boundary:d,rootBoundary:h,padding:u,flipVariations:b,allowedAutoPlacements:S}):Fe)},[]),M=t.rects.reference,R=t.rects.popper,D=new Map,j=!0,z=A[0],H=0;H=0,W=$?"width":"height",X=R2(t,{placement:K,boundary:d,rootBoundary:h,altBoundary:m,padding:u}),Z=$?G?ds:Jo:G?cs:Qo;M[W]>R[W]&&(Z=v4(Z));var U=v4(Z),Q=[];if(o&&Q.push(X[te]<=0),s&&Q.push(X[Z]<=0,X[U]<=0),Q.every(function(ye){return ye})){z=K,j=!1;break}D.set(K,Q)}if(j)for(var re=b?3:1,fe=function(Fe){var Me=A.find(function(rt){var Ve=D.get(rt);if(Ve)return Ve.slice(0,Fe).every(function(je){return je})});if(Me)return z=Me,"break"},Ee=re;Ee>0;Ee--){var be=fe(Ee);if(be==="break")break}t.placement!==z&&(t.modifiersData[r]._skip=!0,t.placement=z,t.reset=!0)}}const u1e={name:"flip",enabled:!0,phase:"main",fn:l1e,requiresIfExists:["offset"],data:{_skip:!1}};function HO(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function VO(e){return[Qo,ds,cs,Jo].some(function(t){return e[t]>=0})}function c1e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=R2(t,{elementContext:"reference"}),s=R2(t,{altBoundary:!0}),l=HO(a,r),u=HO(s,i,o),d=VO(l),h=VO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const d1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:c1e};function f1e(e,t,n){var r=Jl(e),i=[Jo,Qo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Jo,ds].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function h1e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=jF.reduce(function(d,h){return d[h]=f1e(h,t.rects,o),d},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const p1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:h1e};function g1e(e){var t=e.state,n=e.name;t.modifiersData[n]=WF({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const m1e={name:"popperOffsets",enabled:!0,phase:"read",fn:g1e,data:{}};function v1e(e){return e==="x"?"y":"x"}function y1e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,m=n.tether,v=m===void 0?!0:m,b=n.tetherOffset,S=b===void 0?0:b,_=R2(t,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),E=Jl(t.placement),k=Zm(t.placement),T=!k,A=Ek(E),M=v1e(A),R=t.modifiersData.popperOffsets,D=t.rects.reference,j=t.rects.popper,z=typeof S=="function"?S(Object.assign({},t.rects,{placement:t.placement})):S,H=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,te={x:0,y:0};if(R){if(o){var G,$=A==="y"?Qo:Jo,W=A==="y"?cs:ds,X=A==="y"?"height":"width",Z=R[A],U=Z+_[$],Q=Z-_[W],re=v?-j[X]/2:0,fe=k===Ym?D[X]:j[X],Ee=k===Ym?-j[X]:-D[X],be=t.elements.arrow,ye=v&&be?kk(be):{width:0,height:0},Fe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:FF(),Me=Fe[$],rt=Fe[W],Ve=Zv(0,D[X],ye[X]),je=T?D[X]/2-re-Ve-Me-H.mainAxis:fe-Ve-Me-H.mainAxis,wt=T?-D[X]/2+re+Ve+rt+H.mainAxis:Ee+Ve+rt+H.mainAxis,Be=t.elements.arrow&&Ty(t.elements.arrow),at=Be?A==="y"?Be.clientTop||0:Be.clientLeft||0:0,bt=(G=K==null?void 0:K[A])!=null?G:0,Le=Z+je-bt-at,ut=Z+wt-bt,Mt=Zv(v?h5(U,Le):U,Z,v?$h(Q,ut):Q);R[A]=Mt,te[A]=Mt-Z}if(s){var ct,_t=A==="x"?Qo:Jo,un=A==="x"?cs:ds,ae=R[M],De=M==="y"?"height":"width",Ke=ae+_[_t],Xe=ae-_[un],xe=[Qo,Jo].indexOf(E)!==-1,Ne=(ct=K==null?void 0:K[M])!=null?ct:0,Ct=xe?Ke:ae-D[De]-j[De]-Ne+H.altAxis,Dt=xe?ae+D[De]+j[De]-Ne-H.altAxis:Xe,Te=v&&xe?H0e(Ct,ae,Dt):Zv(v?Ct:Ke,ae,v?Dt:Xe);R[M]=Te,te[M]=Te-ae}t.modifiersData[r]=te}}const b1e={name:"preventOverflow",enabled:!0,phase:"main",fn:y1e,requiresIfExists:["offset"]};function S1e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function x1e(e){return e===gs(e)||!as(e)?Pk(e):S1e(e)}function w1e(e){var t=e.getBoundingClientRect(),n=Km(t.width)/e.offsetWidth||1,r=Km(t.height)/e.offsetHeight||1;return n!==1||r!==1}function C1e(e,t,n){n===void 0&&(n=!1);var r=as(t),i=as(t)&&w1e(t),o=af(t),a=Xm(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((lu(t)!=="body"||Lk(o))&&(s=x1e(t)),as(t)?(l=Xm(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Tk(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function _1e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function k1e(e){var t=_1e(e);return N0e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function E1e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function P1e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var WO={placement:"bottom",modifiers:[],strategy:"absolute"};function UO(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),oi={arrowShadowColor:Pg("--popper-arrow-shadow-color"),arrowSize:Pg("--popper-arrow-size","8px"),arrowSizeHalf:Pg("--popper-arrow-size-half"),arrowBg:Pg("--popper-arrow-bg"),transformOrigin:Pg("--popper-transform-origin"),arrowOffset:Pg("--popper-arrow-offset")};function O1e(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var M1e={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},I1e=e=>M1e[e],GO={scroll:!0,resize:!0};function R1e(e){let t;return typeof e=="object"?t={enabled:!0,options:{...GO,...e}}:t={enabled:e,options:GO},t}var D1e={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},N1e={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{qO(e)},effect:({state:e})=>()=>{qO(e)}},qO=e=>{e.elements.popper.style.setProperty(oi.transformOrigin.var,I1e(e.placement))},j1e={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{B1e(e)}},B1e=e=>{var t;if(!e.placement)return;const n=$1e(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:oi.arrowSize.varRef,height:oi.arrowSize.varRef,zIndex:-1});const r={[oi.arrowSizeHalf.var]:`calc(${oi.arrowSize.varRef} / 2)`,[oi.arrowOffset.var]:`calc(${oi.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},$1e=e=>{if(e.startsWith("top"))return{property:"bottom",value:oi.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:oi.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:oi.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:oi.arrowOffset.varRef}},F1e={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{YO(e)},effect:({state:e})=>()=>{YO(e)}},YO=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");t&&Object.assign(t.style,{transform:"rotate(45deg)",background:oi.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:O1e(e.placement)})},z1e={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},H1e={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function V1e(e,t="ltr"){var n;const r=((n=z1e[e])==null?void 0:n[t])||e;return t==="ltr"?r:H1e[e]??r}function UF(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:s,gutter:l=8,flip:u=!0,boundary:d="clippingParents",preventOverflow:h=!0,matchWidth:m,direction:v="ltr"}=e,b=w.useRef(null),S=w.useRef(null),_=w.useRef(null),E=V1e(r,v),k=w.useRef(()=>{}),T=w.useCallback(()=>{var H;!t||!b.current||!S.current||((H=k.current)==null||H.call(k),_.current=A1e(b.current,S.current,{placement:E,modifiers:[F1e,j1e,N1e,{...D1e,enabled:!!m},{name:"eventListeners",...R1e(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:d}},...n??[]],strategy:i}),_.current.forceUpdate(),k.current=_.current.destroy)},[E,t,n,m,a,o,s,l,u,h,d,i]);w.useEffect(()=>()=>{var H;!b.current&&!S.current&&((H=_.current)==null||H.destroy(),_.current=null)},[]);const A=w.useCallback(H=>{b.current=H,T()},[T]),M=w.useCallback((H={},K=null)=>({...H,ref:Hn(A,K)}),[A]),R=w.useCallback(H=>{S.current=H,T()},[T]),D=w.useCallback((H={},K=null)=>({...H,ref:Hn(R,K),style:{...H.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,R,m]),j=w.useCallback((H={},K=null)=>{const{size:te,shadowColor:G,bg:$,style:W,...X}=H;return{...X,ref:K,"data-popper-arrow":"",style:W1e(H)}},[]),z=w.useCallback((H={},K=null)=>({...H,ref:K,"data-popper-arrow-inner":""}),[]);return{update(){var H;(H=_.current)==null||H.update()},forceUpdate(){var H;(H=_.current)==null||H.forceUpdate()},transformOrigin:oi.transformOrigin.varRef,referenceRef:A,popperRef:R,getPopperProps:D,getArrowProps:j,getArrowInnerProps:z,getReferenceProps:M}}function W1e(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function GF(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=Er(n),a=Er(t),[s,l]=w.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,d=r!==void 0,h=w.useId(),m=i??`disclosure-${h}`,v=w.useCallback(()=>{d||l(!1),a==null||a()},[d,a]),b=w.useCallback(()=>{d||l(!0),o==null||o()},[d,o]),S=w.useCallback(()=>{u?v():b()},[u,b,v]);function _(k={}){return{...k,"aria-expanded":u,"aria-controls":m,onClick(T){var A;(A=k.onClick)==null||A.call(k,T),S()}}}function E(k={}){return{...k,hidden:!u,id:m}}return{isOpen:u,onOpen:b,onClose:v,onToggle:S,isControlled:d,getButtonProps:_,getDisclosureProps:E}}function U1e(e){const{isOpen:t,ref:n}=e,[r,i]=w.useState(t),[o,a]=w.useState(!1);return w.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),Nh(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=d0e(n.current),d=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(d)}}}function qF(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var el={},G1e={get exports(){return el},set exports(e){el=e}},ja={},Fh={},q1e={get exports(){return Fh},set exports(e){Fh=e}},YF={};/** + ${d$} + `});function jh(e,t,n,r){const i=Er(n);return w.useEffect(()=>{const o=typeof e=="function"?e():e??document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e??document;o==null||o.removeEventListener(t,i,r)}}function Cme(e){return"current"in e}var f$=()=>typeof window<"u";function _me(){const e=navigator.userAgentData;return(e==null?void 0:e.platform)??navigator.platform}var kme=e=>f$()&&e.test(navigator.vendor),Eme=e=>f$()&&e.test(_me()),Pme=()=>Eme(/mac|iphone|ipad|ipod/i),Tme=()=>Pme()&&kme(/apple/i);function Lme(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var o;return((o=t.current)==null?void 0:o.ownerDocument)??document};jh(i,"pointerdown",o=>{if(!Tme()||!r)return;const a=o.target,l=(n??[t]).some(u=>{const d=Cme(u)?u.current:u;return(d==null?void 0:d.contains(a))||d===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}var Ame=xre?w.useLayoutEffect:w.useEffect;function DO(e,t=[]){const n=w.useRef(e);return Ame(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Ome(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Mme(e,t){const n=w.useId();return w.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function qh(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=DO(n),a=DO(t),[s,l]=w.useState(e.defaultIsOpen||!1),[u,d]=Ome(r,s),h=Mme(i,"disclosure"),m=w.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),y=w.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),b=w.useCallback(()=>{(d?m:y)()},[d,y,m]);return{isOpen:!!d,onOpen:y,onClose:m,onToggle:b,isControlled:u,getButtonProps:(x={})=>({...x,"aria-expanded":d,"aria-controls":h,onClick:wre(x.onClick,b)}),getDisclosureProps:(x={})=>({...x,hidden:!d,id:h})}}function yk(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var bk=Ae(function(t,n){const{htmlSize:r,...i}=t,o=Oi("Input",i),a=Sn(i),s=hk(a),l=Qr("chakra-input",t.className);return N.createElement(Ce.input,{size:r,...s,__css:o.field,ref:n,className:l})});bk.displayName="Input";bk.id="Input";var[Ime,h$]=Pn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Rme=Ae(function(t,n){const r=Oi("Input",t),{children:i,className:o,...a}=Sn(t),s=Qr("chakra-input__group",o),l={},u=ex(i),d=r.field;u.forEach(m=>{r&&(d&&m.type.id==="InputLeftElement"&&(l.paddingStart=d.height??d.h),d&&m.type.id==="InputRightElement"&&(l.paddingEnd=d.height??d.h),m.type.id==="InputRightAddon"&&(l.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const h=u.map(m=>{var y,b;const x=yk({size:((y=m.props)==null?void 0:y.size)||t.size,variant:((b=m.props)==null?void 0:b.variant)||t.variant});return m.type.id!=="Input"?w.cloneElement(m,x):w.cloneElement(m,Object.assign(x,l,m.props))});return N.createElement(Ce.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},N.createElement(Ime,{value:r},h))});Rme.displayName="InputGroup";var Dme={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},Nme=Ce("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),Sk=Ae(function(t,n){const{placement:r="left",...i}=t,o=Dme[r]??{},a=h$();return N.createElement(Nme,{ref:n,...i,__css:{...a.addon,...o}})});Sk.displayName="InputAddon";var p$=Ae(function(t,n){return N.createElement(Sk,{ref:n,placement:"left",...t,className:Qr("chakra-input__left-addon",t.className)})});p$.displayName="InputLeftAddon";p$.id="InputLeftAddon";var g$=Ae(function(t,n){return N.createElement(Sk,{ref:n,placement:"right",...t,className:Qr("chakra-input__right-addon",t.className)})});g$.displayName="InputRightAddon";g$.id="InputRightAddon";var jme=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),ix=Ae(function(t,n){const{placement:r="left",...i}=t,o=h$(),a=o.field,l={[r==="left"?"insetStart":"insetEnd"]:"0",width:(a==null?void 0:a.height)??(a==null?void 0:a.h),height:(a==null?void 0:a.height)??(a==null?void 0:a.h),fontSize:a==null?void 0:a.fontSize,...o.element};return N.createElement(jme,{ref:n,__css:l,...i})});ix.id="InputElement";ix.displayName="InputElement";var m$=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__left-element",r);return N.createElement(ix,{ref:n,placement:"left",className:o,...i})});m$.id="InputLeftElement";m$.displayName="InputLeftElement";var v$=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__right-element",r);return N.createElement(ix,{ref:n,placement:"right",className:o,...i})});v$.id="InputRightElement";v$.displayName="InputRightElement";function Bme(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function qd(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Bme(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Fme=Ae(function(e,t){const{ratio:n=4/3,children:r,className:i,...o}=e,a=w.Children.only(r),s=Qr("chakra-aspect-ratio",i);return N.createElement(Ce.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:qd(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o},a)});Fme.displayName="AspectRatio";var $me=Ae(function(t,n){const r=Oo("Badge",t),{className:i,...o}=Sn(t);return N.createElement(Ce.span,{ref:n,className:Qr("chakra-badge",t.className),...o,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});$me.displayName="Badge";var Eo=Ce("div");Eo.displayName="Box";var y$=Ae(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return N.createElement(Eo,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});y$.displayName="Square";var zme=Ae(function(t,n){const{size:r,...i}=t;return N.createElement(y$,{size:r,ref:n,borderRadius:"9999px",...i})});zme.displayName="Circle";var b$=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});b$.displayName="Center";var Hme={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Ae(function(t,n){const{axis:r="both",...i}=t;return N.createElement(Ce.div,{ref:n,__css:Hme[r],...i,position:"absolute"})});var Vme=Ae(function(t,n){const r=Oo("Code",t),{className:i,...o}=Sn(t);return N.createElement(Ce.code,{ref:n,className:Qr("chakra-code",t.className),...o,__css:{display:"inline-block",...r}})});Vme.displayName="Code";var Wme=Ae(function(t,n){const{className:r,centerContent:i,...o}=Sn(t),a=Oo("Container",t);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-container",r),...o,__css:{...a,...i&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});Wme.displayName="Container";var Ume=Ae(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:o,borderRightWidth:a,borderWidth:s,borderStyle:l,borderColor:u,...d}=Oo("Divider",t),{className:h,orientation:m="horizontal",__css:y,...b}=Sn(t),x={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:i||o||s||"1px",width:"100%"}};return N.createElement(Ce.hr,{ref:n,"aria-orientation":m,...b,__css:{...d,border:"0",borderColor:u,borderStyle:l,...x[m],...y},className:Qr("chakra-divider",h)})});Ume.displayName="Divider";var je=Ae(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...d}=t,h={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return N.createElement(Ce.div,{ref:n,__css:h,...d})});je.displayName="Flex";var S$=Ae(function(t,n){const{templateAreas:r,gap:i,rowGap:o,columnGap:a,column:s,row:l,autoFlow:u,autoRows:d,templateRows:h,autoColumns:m,templateColumns:y,...b}=t,x={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:o,gridColumnGap:a,gridAutoColumns:m,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:d,gridTemplateRows:h,gridTemplateColumns:y};return N.createElement(Ce.div,{ref:n,__css:x,...b})});S$.displayName="Grid";function NO(e){return qd(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Gme=Ae(function(t,n){const{area:r,colSpan:i,colStart:o,colEnd:a,rowEnd:s,rowSpan:l,rowStart:u,...d}=t,h=yk({gridArea:r,gridColumn:NO(i),gridRow:NO(l),gridColumnStart:o,gridColumnEnd:a,gridRowStart:u,gridRowEnd:s});return N.createElement(Ce.div,{ref:n,__css:h,...d})});Gme.displayName="GridItem";var Bh=Ae(function(t,n){const r=Oo("Heading",t),{className:i,...o}=Sn(t);return N.createElement(Ce.h2,{ref:n,className:Qr("chakra-heading",t.className),...o,__css:r})});Bh.displayName="Heading";Ae(function(t,n){const r=Oo("Mark",t),i=Sn(t);return N.createElement(Eo,{ref:n,...i,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var qme=Ae(function(t,n){const r=Oo("Kbd",t),{className:i,...o}=Sn(t);return N.createElement(Ce.kbd,{ref:n,className:Qr("chakra-kbd",i),...o,__css:{fontFamily:"mono",...r}})});qme.displayName="Kbd";var Fh=Ae(function(t,n){const r=Oo("Link",t),{className:i,isExternal:o,...a}=Sn(t);return N.createElement(Ce.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:Qr("chakra-link",i),...a,__css:r})});Fh.displayName="Link";Ae(function(t,n){const{isExternal:r,target:i,rel:o,className:a,...s}=t;return N.createElement(Ce.a,{...s,ref:n,className:Qr("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":o,target:r?"_blank":i,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});Ae(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.div,{ref:n,position:"relative",...i,className:Qr("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[Yme,x$]=Pn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),xk=Ae(function(t,n){const r=Oi("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=Sn(t),u=ex(i),h=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return N.createElement(Yme,{value:r},N.createElement(Ce.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...h},...l},u))});xk.displayName="List";var Kme=Ae((e,t)=>{const{as:n,...r}=e;return N.createElement(xk,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});Kme.displayName="OrderedList";var w$=Ae(function(t,n){const{as:r,...i}=t;return N.createElement(xk,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});w$.displayName="UnorderedList";var xv=Ae(function(t,n){const r=x$();return N.createElement(Ce.li,{ref:n,...t,__css:r.item})});xv.displayName="ListItem";var Xme=Ae(function(t,n){const r=x$();return N.createElement(Na,{ref:n,role:"presentation",...t,__css:r.icon})});Xme.displayName="ListIcon";var Zme=Ae(function(t,n){const{columns:r,spacingX:i,spacingY:o,spacing:a,minChildWidth:s,...l}=t,u=v0(),d=s?Jme(s,u):e0e(r);return N.createElement(S$,{ref:n,gap:a,columnGap:i,rowGap:o,templateColumns:d,...l})});Zme.displayName="SimpleGrid";function Qme(e){return typeof e=="number"?`${e}px`:e}function Jme(e,t){return qd(e,n=>{const r=rce("sizes",n,Qme(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function e0e(e){return qd(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var C$=Ce("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});C$.displayName="Spacer";var K7="& > *:not(style) ~ *:not(style)";function t0e(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[K7]:qd(n,i=>r[i])}}function n0e(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":qd(n,i=>r[i])}}var _$=e=>N.createElement(Ce.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});_$.displayName="StackItem";var wk=Ae((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:d,shouldWrapChildren:h,...m}=e,y=n?"row":r??"column",b=w.useMemo(()=>t0e({direction:y,spacing:a}),[y,a]),x=w.useMemo(()=>n0e({spacing:a,direction:y}),[a,y]),k=!!u,E=!h&&!k,_=w.useMemo(()=>{const A=ex(l);return E?A:A.map((M,R)=>{const D=typeof M.key<"u"?M.key:R,j=R+1===A.length,H=h?N.createElement(_$,{key:D},M):M;if(!k)return H;const K=w.cloneElement(u,{__css:x}),te=j?null:K;return N.createElement(w.Fragment,{key:D},H,te)})},[u,x,k,E,h,l]),P=Qr("chakra-stack",d);return N.createElement(Ce.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:b.flexDirection,flexWrap:s,className:P,__css:k?{}:{[K7]:b[K7]},...m},_)});wk.displayName="Stack";var Ey=Ae((e,t)=>N.createElement(wk,{align:"center",...e,direction:"row",ref:t}));Ey.displayName="HStack";var yn=Ae((e,t)=>N.createElement(wk,{align:"center",...e,direction:"column",ref:t}));yn.displayName="VStack";var Yt=Ae(function(t,n){const r=Oo("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=Sn(t),u=yk({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return N.createElement(Ce.p,{ref:n,className:Qr("chakra-text",t.className),...u,...l,__css:r})});Yt.displayName="Text";function jO(e){return typeof e=="number"?`${e}px`:e}var r0e=Ae(function(t,n){const{spacing:r="0.5rem",spacingX:i,spacingY:o,children:a,justify:s,direction:l,align:u,className:d,shouldWrapChildren:h,...m}=t,y=w.useMemo(()=>{const{spacingX:x=r,spacingY:k=r}={spacingX:i,spacingY:o};return{"--chakra-wrap-x-spacing":E=>qd(x,_=>jO(r7("space",_)(E))),"--chakra-wrap-y-spacing":E=>qd(k,_=>jO(r7("space",_)(E))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,i,o,s,u,l]),b=w.useMemo(()=>h?w.Children.map(a,(x,k)=>N.createElement(k$,{key:k},x)):a,[a,h]);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-wrap",d),overflow:"hidden",...m},N.createElement(Ce.ul,{className:"chakra-wrap__list",__css:y},b))});r0e.displayName="Wrap";var k$=Ae(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:Qr("chakra-wrap__listitem",r),...i})});k$.displayName="WrapItem";var i0e={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},E$=i0e,Pg=()=>{},o0e={document:E$,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:Pg,removeEventListener:Pg,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:Pg,removeListener:Pg}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:Pg,setInterval:()=>0,clearInterval:Pg},a0e=o0e,s0e={window:a0e,document:E$},P$=typeof window<"u"?{window,document}:s0e,T$=w.createContext(P$);T$.displayName="EnvironmentContext";function L$(e){const{children:t,environment:n}=e,[r,i]=w.useState(null),[o,a]=w.useState(!1);w.useEffect(()=>a(!0),[]);const s=w.useMemo(()=>{if(n)return n;const l=r==null?void 0:r.ownerDocument,u=r==null?void 0:r.ownerDocument.defaultView;return l?{document:l,window:u}:P$},[r,n]);return N.createElement(T$.Provider,{value:s},t,!n&&o&&N.createElement("span",{id:"__chakra_env",hidden:!0,ref:l=>{w.startTransition(()=>{l&&i(l)})}}))}L$.displayName="EnvironmentProvider";var l0e=e=>e?"":void 0;function u0e(){const e=w.useRef(new Map),t=e.current,n=w.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=w.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return w.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function L6(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function c0e(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:d,tabIndex:h,onMouseOver:m,onMouseLeave:y,...b}=e,[x,k]=w.useState(!0),[E,_]=w.useState(!1),P=u0e(),A=Z=>{Z&&Z.tagName!=="BUTTON"&&k(!1)},M=x?h:h||0,R=n&&!r,D=w.useCallback(Z=>{if(n){Z.stopPropagation(),Z.preventDefault();return}Z.currentTarget.focus(),l==null||l(Z)},[n,l]),j=w.useCallback(Z=>{E&&L6(Z)&&(Z.preventDefault(),Z.stopPropagation(),_(!1),P.remove(document,"keyup",j,!1))},[E,P]),z=w.useCallback(Z=>{if(u==null||u(Z),n||Z.defaultPrevented||Z.metaKey||!L6(Z.nativeEvent)||x)return;const U=i&&Z.key==="Enter";o&&Z.key===" "&&(Z.preventDefault(),_(!0)),U&&(Z.preventDefault(),Z.currentTarget.click()),P.add(document,"keyup",j,!1)},[n,x,u,i,o,P,j]),H=w.useCallback(Z=>{if(d==null||d(Z),n||Z.defaultPrevented||Z.metaKey||!L6(Z.nativeEvent)||x)return;o&&Z.key===" "&&(Z.preventDefault(),_(!1),Z.currentTarget.click())},[o,x,n,d]),K=w.useCallback(Z=>{Z.button===0&&(_(!1),P.remove(document,"mouseup",K,!1))},[P]),te=w.useCallback(Z=>{if(Z.button!==0)return;if(n){Z.stopPropagation(),Z.preventDefault();return}x||_(!0),Z.currentTarget.focus({preventScroll:!0}),P.add(document,"mouseup",K,!1),a==null||a(Z)},[n,x,a,P,K]),G=w.useCallback(Z=>{Z.button===0&&(x||_(!1),s==null||s(Z))},[s,x]),F=w.useCallback(Z=>{if(n){Z.preventDefault();return}m==null||m(Z)},[n,m]),W=w.useCallback(Z=>{E&&(Z.preventDefault(),_(!1)),y==null||y(Z)},[E,y]),X=Hn(t,A);return x?{...b,ref:X,type:"button","aria-disabled":R?void 0:n,disabled:R,onClick:D,onMouseDown:a,onMouseUp:s,onKeyUp:d,onKeyDown:u,onMouseOver:m,onMouseLeave:y}:{...b,ref:X,role:"button","data-active":l0e(E),"aria-disabled":n?"true":void 0,tabIndex:R?void 0:M,onClick:D,onMouseDown:te,onMouseUp:G,onKeyUp:H,onKeyDown:z,onMouseOver:F,onMouseLeave:W}}function A$(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function O$(e){if(!A$(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function d0e(e){var t;return((t=M$(e))==null?void 0:t.defaultView)??window}function M$(e){return A$(e)?e.ownerDocument:document}function f0e(e){return M$(e).activeElement}var I$=e=>e.hasAttribute("tabindex"),h0e=e=>I$(e)&&e.tabIndex===-1;function p0e(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function R$(e){return e.parentElement&&R$(e.parentElement)?!0:e.hidden}function g0e(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function D$(e){if(!O$(e)||R$(e)||p0e(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():g0e(e)?!0:I$(e)}function m0e(e){return e?O$(e)&&D$(e)&&!h0e(e):!1}var v0e=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],y0e=v0e.join(),b0e=e=>e.offsetWidth>0&&e.offsetHeight>0;function N$(e){const t=Array.from(e.querySelectorAll(y0e));return t.unshift(e),t.filter(n=>D$(n)&&b0e(n))}function S0e(e){const t=e.current;if(!t)return!1;const n=f0e(t);return!n||t.contains(n)?!1:!!m0e(n)}function x0e(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;Gd(()=>{if(!o||S0e(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var w0e={preventScroll:!0,shouldFocus:!1};function C0e(e,t=w0e){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=_0e(e)?e.current:e,s=i&&o,l=w.useRef(s),u=w.useRef(o);Gs(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const d=w.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=N$(a);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[o,r,a,n]);Gd(()=>{d()},[d]),jh(a,"transitionend",d)}function _0e(e){return"current"in e}var Qo="top",cs="bottom",ds="right",Jo="left",Ck="auto",Py=[Qo,cs,ds,Jo],Km="start",I2="end",k0e="clippingParents",j$="viewport",K1="popper",E0e="reference",BO=Py.reduce(function(e,t){return e.concat([t+"-"+Km,t+"-"+I2])},[]),B$=[].concat(Py,[Ck]).reduce(function(e,t){return e.concat([t,t+"-"+Km,t+"-"+I2])},[]),P0e="beforeRead",T0e="read",L0e="afterRead",A0e="beforeMain",O0e="main",M0e="afterMain",I0e="beforeWrite",R0e="write",D0e="afterWrite",N0e=[P0e,T0e,L0e,A0e,O0e,M0e,I0e,R0e,D0e];function lu(e){return e?(e.nodeName||"").toLowerCase():null}function gs(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Yh(e){var t=gs(e).Element;return e instanceof t||e instanceof Element}function as(e){var t=gs(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function _k(e){if(typeof ShadowRoot>"u")return!1;var t=gs(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function j0e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!as(o)||!lu(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function B0e(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!as(i)||!lu(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const F0e={name:"applyStyles",enabled:!0,phase:"write",fn:j0e,effect:B0e,requires:["computeStyles"]};function Jl(e){return e.split("-")[0]}var $h=Math.max,h5=Math.min,Xm=Math.round;function X7(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function F$(){return!/^((?!chrome|android).)*safari/i.test(X7())}function Zm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&as(e)&&(i=e.offsetWidth>0&&Xm(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Xm(r.height)/e.offsetHeight||1);var a=Yh(e)?gs(e):window,s=a.visualViewport,l=!F$()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,d=(r.top+(l&&s?s.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:d,right:u+h,bottom:d+m,left:u,x:u,y:d}}function kk(e){var t=Zm(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function $$(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_k(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function nc(e){return gs(e).getComputedStyle(e)}function $0e(e){return["table","td","th"].indexOf(lu(e))>=0}function sf(e){return((Yh(e)?e.ownerDocument:e.document)||window.document).documentElement}function ox(e){return lu(e)==="html"?e:e.assignedSlot||e.parentNode||(_k(e)?e.host:null)||sf(e)}function FO(e){return!as(e)||nc(e).position==="fixed"?null:e.offsetParent}function z0e(e){var t=/firefox/i.test(X7()),n=/Trident/i.test(X7());if(n&&as(e)){var r=nc(e);if(r.position==="fixed")return null}var i=ox(e);for(_k(i)&&(i=i.host);as(i)&&["html","body"].indexOf(lu(i))<0;){var o=nc(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Ty(e){for(var t=gs(e),n=FO(e);n&&$0e(n)&&nc(n).position==="static";)n=FO(n);return n&&(lu(n)==="html"||lu(n)==="body"&&nc(n).position==="static")?t:n||z0e(e)||t}function Ek(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Zv(e,t,n){return $h(e,h5(t,n))}function H0e(e,t,n){var r=Zv(e,t,n);return r>n?n:r}function z$(){return{top:0,right:0,bottom:0,left:0}}function H$(e){return Object.assign({},z$(),e)}function V$(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var V0e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,H$(typeof t!="number"?t:V$(t,Py))};function W0e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Jl(n.placement),l=Ek(s),u=[Jo,ds].indexOf(s)>=0,d=u?"height":"width";if(!(!o||!a)){var h=V0e(i.padding,n),m=kk(o),y=l==="y"?Qo:Jo,b=l==="y"?cs:ds,x=n.rects.reference[d]+n.rects.reference[l]-a[l]-n.rects.popper[d],k=a[l]-n.rects.reference[l],E=Ty(o),_=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,P=x/2-k/2,A=h[y],M=_-m[d]-h[b],R=_/2-m[d]/2+P,D=Zv(A,R,M),j=l;n.modifiersData[r]=(t={},t[j]=D,t.centerOffset=D-R,t)}}function U0e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||$$(t.elements.popper,i)&&(t.elements.arrow=i))}const G0e={name:"arrow",enabled:!0,phase:"main",fn:W0e,effect:U0e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Qm(e){return e.split("-")[1]}var q0e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Y0e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Xm(t*i)/i||0,y:Xm(n*i)/i||0}}function $O(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,m=a.x,y=m===void 0?0:m,b=a.y,x=b===void 0?0:b,k=typeof d=="function"?d({x:y,y:x}):{x:y,y:x};y=k.x,x=k.y;var E=a.hasOwnProperty("x"),_=a.hasOwnProperty("y"),P=Jo,A=Qo,M=window;if(u){var R=Ty(n),D="clientHeight",j="clientWidth";if(R===gs(n)&&(R=sf(n),nc(R).position!=="static"&&s==="absolute"&&(D="scrollHeight",j="scrollWidth")),R=R,i===Qo||(i===Jo||i===ds)&&o===I2){A=cs;var z=h&&R===M&&M.visualViewport?M.visualViewport.height:R[D];x-=z-r.height,x*=l?1:-1}if(i===Jo||(i===Qo||i===cs)&&o===I2){P=ds;var H=h&&R===M&&M.visualViewport?M.visualViewport.width:R[j];y-=H-r.width,y*=l?1:-1}}var K=Object.assign({position:s},u&&q0e),te=d===!0?Y0e({x:y,y:x}):{x:y,y:x};if(y=te.x,x=te.y,l){var G;return Object.assign({},K,(G={},G[A]=_?"0":"",G[P]=E?"0":"",G.transform=(M.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",G))}return Object.assign({},K,(t={},t[A]=_?x+"px":"",t[P]=E?y+"px":"",t.transform="",t))}function K0e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Jl(t.placement),variation:Qm(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,$O(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,$O(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const X0e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:K0e,data:{}};var ib={passive:!0};function Z0e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=gs(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,ib)}),s&&l.addEventListener("resize",n.update,ib),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,ib)}),s&&l.removeEventListener("resize",n.update,ib)}}const Q0e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Z0e,data:{}};var J0e={left:"right",right:"left",bottom:"top",top:"bottom"};function v4(e){return e.replace(/left|right|bottom|top/g,function(t){return J0e[t]})}var e1e={start:"end",end:"start"};function zO(e){return e.replace(/start|end/g,function(t){return e1e[t]})}function Pk(e){var t=gs(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Tk(e){return Zm(sf(e)).left+Pk(e).scrollLeft}function t1e(e,t){var n=gs(e),r=sf(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=F$();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+Tk(e),y:l}}function n1e(e){var t,n=sf(e),r=Pk(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=$h(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=$h(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Tk(e),l=-r.scrollTop;return nc(i||n).direction==="rtl"&&(s+=$h(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function Lk(e){var t=nc(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function W$(e){return["html","body","#document"].indexOf(lu(e))>=0?e.ownerDocument.body:as(e)&&Lk(e)?e:W$(ox(e))}function Qv(e,t){var n;t===void 0&&(t=[]);var r=W$(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=gs(r),a=i?[o].concat(o.visualViewport||[],Lk(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Qv(ox(a)))}function Z7(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function r1e(e,t){var n=Zm(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function HO(e,t,n){return t===j$?Z7(t1e(e,n)):Yh(t)?r1e(t,n):Z7(n1e(sf(e)))}function i1e(e){var t=Qv(ox(e)),n=["absolute","fixed"].indexOf(nc(e).position)>=0,r=n&&as(e)?Ty(e):e;return Yh(r)?t.filter(function(i){return Yh(i)&&$$(i,r)&&lu(i)!=="body"}):[]}function o1e(e,t,n,r){var i=t==="clippingParents"?i1e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var d=HO(e,u,r);return l.top=$h(d.top,l.top),l.right=h5(d.right,l.right),l.bottom=h5(d.bottom,l.bottom),l.left=$h(d.left,l.left),l},HO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function U$(e){var t=e.reference,n=e.element,r=e.placement,i=r?Jl(r):null,o=r?Qm(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Qo:l={x:a,y:t.y-n.height};break;case cs:l={x:a,y:t.y+t.height};break;case ds:l={x:t.x+t.width,y:s};break;case Jo:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?Ek(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case Km:l[u]=l[u]-(t[d]/2-n[d]/2);break;case I2:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function R2(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?k0e:s,u=n.rootBoundary,d=u===void 0?j$:u,h=n.elementContext,m=h===void 0?K1:h,y=n.altBoundary,b=y===void 0?!1:y,x=n.padding,k=x===void 0?0:x,E=H$(typeof k!="number"?k:V$(k,Py)),_=m===K1?E0e:K1,P=e.rects.popper,A=e.elements[b?_:m],M=o1e(Yh(A)?A:A.contextElement||sf(e.elements.popper),l,d,a),R=Zm(e.elements.reference),D=U$({reference:R,element:P,strategy:"absolute",placement:i}),j=Z7(Object.assign({},P,D)),z=m===K1?j:R,H={top:M.top-z.top+E.top,bottom:z.bottom-M.bottom+E.bottom,left:M.left-z.left+E.left,right:z.right-M.right+E.right},K=e.modifiersData.offset;if(m===K1&&K){var te=K[i];Object.keys(H).forEach(function(G){var F=[ds,cs].indexOf(G)>=0?1:-1,W=[Qo,cs].indexOf(G)>=0?"y":"x";H[G]+=te[W]*F})}return H}function a1e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?B$:l,d=Qm(r),h=d?s?BO:BO.filter(function(b){return Qm(b)===d}):Py,m=h.filter(function(b){return u.indexOf(b)>=0});m.length===0&&(m=h);var y=m.reduce(function(b,x){return b[x]=R2(e,{placement:x,boundary:i,rootBoundary:o,padding:a})[Jl(x)],b},{});return Object.keys(y).sort(function(b,x){return y[b]-y[x]})}function s1e(e){if(Jl(e)===Ck)return[];var t=v4(e);return[zO(e),t,zO(t)]}function l1e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,y=n.flipVariations,b=y===void 0?!0:y,x=n.allowedAutoPlacements,k=t.options.placement,E=Jl(k),_=E===k,P=l||(_||!b?[v4(k)]:s1e(k)),A=[k].concat(P).reduce(function(ye,ze){return ye.concat(Jl(ze)===Ck?a1e(t,{placement:ze,boundary:d,rootBoundary:h,padding:u,flipVariations:b,allowedAutoPlacements:x}):ze)},[]),M=t.rects.reference,R=t.rects.popper,D=new Map,j=!0,z=A[0],H=0;H=0,W=F?"width":"height",X=R2(t,{placement:K,boundary:d,rootBoundary:h,altBoundary:m,padding:u}),Z=F?G?ds:Jo:G?cs:Qo;M[W]>R[W]&&(Z=v4(Z));var U=v4(Z),Q=[];if(o&&Q.push(X[te]<=0),s&&Q.push(X[Z]<=0,X[U]<=0),Q.every(function(ye){return ye})){z=K,j=!1;break}D.set(K,Q)}if(j)for(var re=b?3:1,fe=function(ze){var Me=A.find(function(rt){var We=D.get(rt);if(We)return We.slice(0,ze).every(function(Be){return Be})});if(Me)return z=Me,"break"},Ee=re;Ee>0;Ee--){var be=fe(Ee);if(be==="break")break}t.placement!==z&&(t.modifiersData[r]._skip=!0,t.placement=z,t.reset=!0)}}const u1e={name:"flip",enabled:!0,phase:"main",fn:l1e,requiresIfExists:["offset"],data:{_skip:!1}};function VO(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function WO(e){return[Qo,ds,cs,Jo].some(function(t){return e[t]>=0})}function c1e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=R2(t,{elementContext:"reference"}),s=R2(t,{altBoundary:!0}),l=VO(a,r),u=VO(s,i,o),d=WO(l),h=WO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const d1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:c1e};function f1e(e,t,n){var r=Jl(e),i=[Jo,Qo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Jo,ds].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function h1e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=B$.reduce(function(d,h){return d[h]=f1e(h,t.rects,o),d},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const p1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:h1e};function g1e(e){var t=e.state,n=e.name;t.modifiersData[n]=U$({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const m1e={name:"popperOffsets",enabled:!0,phase:"read",fn:g1e,data:{}};function v1e(e){return e==="x"?"y":"x"}function y1e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,m=n.tether,y=m===void 0?!0:m,b=n.tetherOffset,x=b===void 0?0:b,k=R2(t,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),E=Jl(t.placement),_=Qm(t.placement),P=!_,A=Ek(E),M=v1e(A),R=t.modifiersData.popperOffsets,D=t.rects.reference,j=t.rects.popper,z=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,H=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,te={x:0,y:0};if(R){if(o){var G,F=A==="y"?Qo:Jo,W=A==="y"?cs:ds,X=A==="y"?"height":"width",Z=R[A],U=Z+k[F],Q=Z-k[W],re=y?-j[X]/2:0,fe=_===Km?D[X]:j[X],Ee=_===Km?-j[X]:-D[X],be=t.elements.arrow,ye=y&&be?kk(be):{width:0,height:0},ze=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:z$(),Me=ze[F],rt=ze[W],We=Zv(0,D[X],ye[X]),Be=P?D[X]/2-re-We-Me-H.mainAxis:fe-We-Me-H.mainAxis,wt=P?-D[X]/2+re+We+rt+H.mainAxis:Ee+We+rt+H.mainAxis,Fe=t.elements.arrow&&Ty(t.elements.arrow),at=Fe?A==="y"?Fe.clientTop||0:Fe.clientLeft||0:0,bt=(G=K==null?void 0:K[A])!=null?G:0,Le=Z+Be-bt-at,ut=Z+wt-bt,Mt=Zv(y?h5(U,Le):U,Z,y?$h(Q,ut):Q);R[A]=Mt,te[A]=Mt-Z}if(s){var ct,_t=A==="x"?Qo:Jo,un=A==="x"?cs:ds,ae=R[M],De=M==="y"?"height":"width",Ke=ae+k[_t],Xe=ae-k[un],xe=[Qo,Jo].indexOf(E)!==-1,Ne=(ct=K==null?void 0:K[M])!=null?ct:0,Ct=xe?Ke:ae-D[De]-j[De]-Ne+H.altAxis,Dt=xe?ae+D[De]+j[De]-Ne-H.altAxis:Xe,Te=y&&xe?H0e(Ct,ae,Dt):Zv(y?Ct:Ke,ae,y?Dt:Xe);R[M]=Te,te[M]=Te-ae}t.modifiersData[r]=te}}const b1e={name:"preventOverflow",enabled:!0,phase:"main",fn:y1e,requiresIfExists:["offset"]};function S1e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function x1e(e){return e===gs(e)||!as(e)?Pk(e):S1e(e)}function w1e(e){var t=e.getBoundingClientRect(),n=Xm(t.width)/e.offsetWidth||1,r=Xm(t.height)/e.offsetHeight||1;return n!==1||r!==1}function C1e(e,t,n){n===void 0&&(n=!1);var r=as(t),i=as(t)&&w1e(t),o=sf(t),a=Zm(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((lu(t)!=="body"||Lk(o))&&(s=x1e(t)),as(t)?(l=Zm(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Tk(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function _1e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function k1e(e){var t=_1e(e);return N0e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function E1e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function P1e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var UO={placement:"bottom",modifiers:[],strategy:"absolute"};function GO(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),oi={arrowShadowColor:Tg("--popper-arrow-shadow-color"),arrowSize:Tg("--popper-arrow-size","8px"),arrowSizeHalf:Tg("--popper-arrow-size-half"),arrowBg:Tg("--popper-arrow-bg"),transformOrigin:Tg("--popper-transform-origin"),arrowOffset:Tg("--popper-arrow-offset")};function O1e(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var M1e={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},I1e=e=>M1e[e],qO={scroll:!0,resize:!0};function R1e(e){let t;return typeof e=="object"?t={enabled:!0,options:{...qO,...e}}:t={enabled:e,options:qO},t}var D1e={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},N1e={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{YO(e)},effect:({state:e})=>()=>{YO(e)}},YO=e=>{e.elements.popper.style.setProperty(oi.transformOrigin.var,I1e(e.placement))},j1e={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{B1e(e)}},B1e=e=>{var t;if(!e.placement)return;const n=F1e(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:oi.arrowSize.varRef,height:oi.arrowSize.varRef,zIndex:-1});const r={[oi.arrowSizeHalf.var]:`calc(${oi.arrowSize.varRef} / 2)`,[oi.arrowOffset.var]:`calc(${oi.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},F1e=e=>{if(e.startsWith("top"))return{property:"bottom",value:oi.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:oi.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:oi.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:oi.arrowOffset.varRef}},$1e={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{KO(e)},effect:({state:e})=>()=>{KO(e)}},KO=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");t&&Object.assign(t.style,{transform:"rotate(45deg)",background:oi.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:O1e(e.placement)})},z1e={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},H1e={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function V1e(e,t="ltr"){var n;const r=((n=z1e[e])==null?void 0:n[t])||e;return t==="ltr"?r:H1e[e]??r}function G$(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:s,gutter:l=8,flip:u=!0,boundary:d="clippingParents",preventOverflow:h=!0,matchWidth:m,direction:y="ltr"}=e,b=w.useRef(null),x=w.useRef(null),k=w.useRef(null),E=V1e(r,y),_=w.useRef(()=>{}),P=w.useCallback(()=>{var H;!t||!b.current||!x.current||((H=_.current)==null||H.call(_),k.current=A1e(b.current,x.current,{placement:E,modifiers:[$1e,j1e,N1e,{...D1e,enabled:!!m},{name:"eventListeners",...R1e(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:d}},...n??[]],strategy:i}),k.current.forceUpdate(),_.current=k.current.destroy)},[E,t,n,m,a,o,s,l,u,h,d,i]);w.useEffect(()=>()=>{var H;!b.current&&!x.current&&((H=k.current)==null||H.destroy(),k.current=null)},[]);const A=w.useCallback(H=>{b.current=H,P()},[P]),M=w.useCallback((H={},K=null)=>({...H,ref:Hn(A,K)}),[A]),R=w.useCallback(H=>{x.current=H,P()},[P]),D=w.useCallback((H={},K=null)=>({...H,ref:Hn(R,K),style:{...H.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,R,m]),j=w.useCallback((H={},K=null)=>{const{size:te,shadowColor:G,bg:F,style:W,...X}=H;return{...X,ref:K,"data-popper-arrow":"",style:W1e(H)}},[]),z=w.useCallback((H={},K=null)=>({...H,ref:K,"data-popper-arrow-inner":""}),[]);return{update(){var H;(H=k.current)==null||H.update()},forceUpdate(){var H;(H=k.current)==null||H.forceUpdate()},transformOrigin:oi.transformOrigin.varRef,referenceRef:A,popperRef:R,getPopperProps:D,getArrowProps:j,getArrowInnerProps:z,getReferenceProps:M}}function W1e(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function q$(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=Er(n),a=Er(t),[s,l]=w.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,d=r!==void 0,h=w.useId(),m=i??`disclosure-${h}`,y=w.useCallback(()=>{d||l(!1),a==null||a()},[d,a]),b=w.useCallback(()=>{d||l(!0),o==null||o()},[d,o]),x=w.useCallback(()=>{u?y():b()},[u,b,y]);function k(_={}){return{..._,"aria-expanded":u,"aria-controls":m,onClick(P){var A;(A=_.onClick)==null||A.call(_,P),x()}}}function E(_={}){return{..._,hidden:!u,id:m}}return{isOpen:u,onOpen:b,onClose:y,onToggle:x,isControlled:d,getButtonProps:k,getDisclosureProps:E}}function U1e(e){const{isOpen:t,ref:n}=e,[r,i]=w.useState(t),[o,a]=w.useState(!1);return w.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),jh(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=d0e(n.current),d=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(d)}}}function Y$(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var el={},G1e={get exports(){return el},set exports(e){el=e}},ja={},zh={},q1e={get exports(){return zh},set exports(e){zh=e}},K$={};/** * @license React * scheduler.production.min.js * @@ -352,7 +352,7 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(U,Q){var re=U.length;U.push(Q);e:for(;0>>1,Ee=U[fe];if(0>>1;fei(Fe,re))Mei(rt,Fe)?(U[fe]=rt,U[Me]=re,fe=Me):(U[fe]=Fe,U[ye]=re,fe=ye);else if(Mei(rt,re))U[fe]=rt,U[Me]=re,fe=Me;else break e}}return Q}function i(U,Q){var re=U.sortIndex-Q.sortIndex;return re!==0?re:U.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],d=1,h=null,m=3,v=!1,b=!1,S=!1,_=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(U){for(var Q=n(u);Q!==null;){if(Q.callback===null)r(u);else if(Q.startTime<=U)r(u),Q.sortIndex=Q.expirationTime,t(l,Q);else break;Q=n(u)}}function A(U){if(S=!1,T(U),!b)if(n(l)!==null)b=!0,X(M);else{var Q=n(u);Q!==null&&Z(A,Q.startTime-U)}}function M(U,Q){b=!1,S&&(S=!1,E(j),j=-1),v=!0;var re=m;try{for(T(Q),h=n(l);h!==null&&(!(h.expirationTime>Q)||U&&!K());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,m=h.priorityLevel;var Ee=fe(h.expirationTime<=Q);Q=e.unstable_now(),typeof Ee=="function"?h.callback=Ee:h===n(l)&&r(l),T(Q)}else r(l);h=n(l)}if(h!==null)var be=!0;else{var ye=n(u);ye!==null&&Z(A,ye.startTime-Q),be=!1}return be}finally{h=null,m=re,v=!1}}var R=!1,D=null,j=-1,z=5,H=-1;function K(){return!(e.unstable_now()-HU||125fe?(U.sortIndex=re,t(u,U),n(l)===null&&U===n(u)&&(S?(E(j),j=-1):S=!0,Z(A,re-fe))):(U.sortIndex=Ee,t(l,U),b||v||(b=!0,X(M))),U},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(U){var Q=m;return function(){var re=m;m=Q;try{return U.apply(this,arguments)}finally{m=re}}}})(YF);(function(e){e.exports=YF})(q1e);/** + */(function(e){function t(U,Q){var re=U.length;U.push(Q);e:for(;0>>1,Ee=U[fe];if(0>>1;fei(ze,re))Mei(rt,ze)?(U[fe]=rt,U[Me]=re,fe=Me):(U[fe]=ze,U[ye]=re,fe=ye);else if(Mei(rt,re))U[fe]=rt,U[Me]=re,fe=Me;else break e}}return Q}function i(U,Q){var re=U.sortIndex-Q.sortIndex;return re!==0?re:U.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],d=1,h=null,m=3,y=!1,b=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(U){for(var Q=n(u);Q!==null;){if(Q.callback===null)r(u);else if(Q.startTime<=U)r(u),Q.sortIndex=Q.expirationTime,t(l,Q);else break;Q=n(u)}}function A(U){if(x=!1,P(U),!b)if(n(l)!==null)b=!0,X(M);else{var Q=n(u);Q!==null&&Z(A,Q.startTime-U)}}function M(U,Q){b=!1,x&&(x=!1,E(j),j=-1),y=!0;var re=m;try{for(P(Q),h=n(l);h!==null&&(!(h.expirationTime>Q)||U&&!K());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,m=h.priorityLevel;var Ee=fe(h.expirationTime<=Q);Q=e.unstable_now(),typeof Ee=="function"?h.callback=Ee:h===n(l)&&r(l),P(Q)}else r(l);h=n(l)}if(h!==null)var be=!0;else{var ye=n(u);ye!==null&&Z(A,ye.startTime-Q),be=!1}return be}finally{h=null,m=re,y=!1}}var R=!1,D=null,j=-1,z=5,H=-1;function K(){return!(e.unstable_now()-HU||125fe?(U.sortIndex=re,t(u,U),n(l)===null&&U===n(u)&&(x?(E(j),j=-1):x=!0,Z(A,re-fe))):(U.sortIndex=Ee,t(l,U),b||y||(b=!0,X(M))),U},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(U){var Q=m;return function(){var re=m;m=Q;try{return U.apply(this,arguments)}finally{m=re}}}})(K$);(function(e){e.exports=K$})(q1e);/** * @license React * react-dom.production.min.js * @@ -360,14 +360,14 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var KF=w,Ia=Fh;function He(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Q7=Object.prototype.hasOwnProperty,Y1e=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,KO={},XO={};function K1e(e){return Q7.call(XO,e)?!0:Q7.call(KO,e)?!1:Y1e.test(e)?XO[e]=!0:(KO[e]=!0,!1)}function X1e(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Z1e(e,t,n,r){if(t===null||typeof t>"u"||X1e(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mo(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Yi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Yi[e]=new Mo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Yi[t]=new Mo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Yi[e]=new Mo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Yi[e]=new Mo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Yi[e]=new Mo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Yi[e]=new Mo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Yi[e]=new Mo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Yi[e]=new Mo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Yi[e]=new Mo(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ak=/[\-:]([a-z])/g;function Ok(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Yi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!1,!1)});Yi.xlinkHref=new Mo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Yi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!0,!0)});function Mk(e,t,n,r){var i=Yi.hasOwnProperty(t)?Yi[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Q7=Object.prototype.hasOwnProperty,Y1e=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,XO={},ZO={};function K1e(e){return Q7.call(ZO,e)?!0:Q7.call(XO,e)?!1:Y1e.test(e)?ZO[e]=!0:(XO[e]=!0,!1)}function X1e(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Z1e(e,t,n,r){if(t===null||typeof t>"u"||X1e(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mo(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Yi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Yi[e]=new Mo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Yi[t]=new Mo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Yi[e]=new Mo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Yi[e]=new Mo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Yi[e]=new Mo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Yi[e]=new Mo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Yi[e]=new Mo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Yi[e]=new Mo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Yi[e]=new Mo(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ak=/[\-:]([a-z])/g;function Ok(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Yi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!1,!1)});Yi.xlinkHref=new Mo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Yi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!0,!0)});function Mk(e,t,n,r){var i=Yi.hasOwnProperty(t)?Yi[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` -`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{O6=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?xv(e):""}function Q1e(e){switch(e.tag){case 5:return xv(e.type);case 16:return xv("Lazy");case 13:return xv("Suspense");case 19:return xv("SuspenseList");case 0:case 2:case 15:return e=M6(e.type,!1),e;case 11:return e=M6(e.type.render,!1),e;case 1:return e=M6(e.type,!0),e;default:return""}}function n9(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qg:return"Fragment";case Zg:return"Portal";case J7:return"Profiler";case Ik:return"StrictMode";case e9:return"Suspense";case t9:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case QF:return(e.displayName||"Context")+".Consumer";case ZF:return(e._context.displayName||"Context")+".Provider";case Rk:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dk:return t=e.displayName||null,t!==null?t:n9(e.type)||"Memo";case md:t=e._payload,e=e._init;try{return n9(e(t))}catch{}}return null}function J1e(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return n9(t);case 8:return t===Ik?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function qd(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ez(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function eve(e){var t=ez(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ab(e){e._valueTracker||(e._valueTracker=eve(e))}function tz(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ez(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function p5(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function r9(e,t){var n=t.checked;return Lr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function QO(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qd(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function nz(e,t){t=t.checked,t!=null&&Mk(e,"checked",t,!1)}function i9(e,t){nz(e,t);var n=qd(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?o9(e,t.type,n):t.hasOwnProperty("defaultValue")&&o9(e,t.type,qd(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function JO(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function o9(e,t,n){(t!=="number"||p5(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wv=Array.isArray;function Pm(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=sb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function N2(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jv={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tve=["Webkit","ms","Moz","O"];Object.keys(Jv).forEach(function(e){tve.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jv[t]=Jv[e]})});function az(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jv.hasOwnProperty(e)&&Jv[e]?(""+t).trim():t+"px"}function sz(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=az(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var nve=Lr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function l9(e,t){if(t){if(nve[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(He(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(He(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(He(61))}if(t.style!=null&&typeof t.style!="object")throw Error(He(62))}}function u9(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var c9=null;function Nk(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var d9=null,Tm=null,Lm=null;function nM(e){if(e=Oy(e)){if(typeof d9!="function")throw Error(He(280));var t=e.stateNode;t&&(t=cx(t),d9(e.stateNode,e.type,t))}}function lz(e){Tm?Lm?Lm.push(e):Lm=[e]:Tm=e}function uz(){if(Tm){var e=Tm,t=Lm;if(Lm=Tm=null,nM(e),t)for(e=0;e>>=0,e===0?32:31-(hve(e)/pve|0)|0}var lb=64,ub=4194304;function Cv(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function y5(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Cv(s):(o&=a,o!==0&&(r=Cv(o)))}else a=n&~i,a!==0?r=Cv(a):o!==0&&(r=Cv(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ly(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xs(t),e[t]=n}function yve(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=t2),dM=String.fromCharCode(32),fM=!1;function Lz(e,t){switch(e){case"keyup":return Gve.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Az(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jg=!1;function Yve(e,t){switch(e){case"compositionend":return Az(t);case"keypress":return t.which!==32?null:(fM=!0,dM);case"textInput":return e=t.data,e===dM&&fM?null:e;default:return null}}function Kve(e,t){if(Jg)return e==="compositionend"||!Wk&&Lz(e,t)?(e=Pz(),b4=zk=Ed=null,Jg=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=mM(n)}}function Rz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dz(){for(var e=window,t=p5();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=p5(e.document)}return t}function Uk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function i2e(e){var t=Dz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Rz(n.ownerDocument.documentElement,n)){if(r!==null&&Uk(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=vM(n,o);var a=vM(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,em=null,v9=null,r2=null,y9=!1;function yM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;y9||em==null||em!==p5(r)||(r=em,"selectionStart"in r&&Uk(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),r2&&H2(r2,r)||(r2=r,r=x5(v9,"onSelect"),0rm||(e.current=_9[rm],_9[rm]=null,rm--)}function rr(e,t){rm++,_9[rm]=e.current,e.current=t}var Yd={},lo=lf(Yd),ea=lf(!1),Yh=Yd;function Jm(e,t){var n=e.type.contextTypes;if(!n)return Yd;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ta(e){return e=e.childContextTypes,e!=null}function C5(){fr(ea),fr(lo)}function kM(e,t,n){if(lo.current!==Yd)throw Error(He(168));rr(lo,t),rr(ea,n)}function Wz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(He(108,J1e(e)||"Unknown",i));return Lr({},n,r)}function _5(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yd,Yh=lo.current,rr(lo,e),rr(ea,ea.current),!0}function EM(e,t,n){var r=e.stateNode;if(!r)throw Error(He(169));n?(e=Wz(e,t,Yh),r.__reactInternalMemoizedMergedChildContext=e,fr(ea),fr(lo),rr(lo,e)):fr(ea),rr(ea,n)}var Wu=null,dx=!1,G6=!1;function Uz(e){Wu===null?Wu=[e]:Wu.push(e)}function m2e(e){dx=!0,Uz(e)}function uf(){if(!G6&&Wu!==null){G6=!0;var e=0,t=Bn;try{var n=Wu;for(Bn=1;e>=a,i-=a,qu=1<<32-Xs(t)+i|n<j?(z=D,D=null):z=D.sibling;var H=m(E,D,T[j],A);if(H===null){D===null&&(D=z);break}e&&D&&H.alternate===null&&t(E,D),k=o(H,k,j),R===null?M=H:R.sibling=H,R=H,D=z}if(j===T.length)return n(E,D),yr&&hh(E,j),M;if(D===null){for(;jj?(z=D,D=null):z=D.sibling;var K=m(E,D,H.value,A);if(K===null){D===null&&(D=z);break}e&&D&&K.alternate===null&&t(E,D),k=o(K,k,j),R===null?M=K:R.sibling=K,R=K,D=z}if(H.done)return n(E,D),yr&&hh(E,j),M;if(D===null){for(;!H.done;j++,H=T.next())H=h(E,H.value,A),H!==null&&(k=o(H,k,j),R===null?M=H:R.sibling=H,R=H);return yr&&hh(E,j),M}for(D=r(E,D);!H.done;j++,H=T.next())H=v(D,E,j,H.value,A),H!==null&&(e&&H.alternate!==null&&D.delete(H.key===null?j:H.key),k=o(H,k,j),R===null?M=H:R.sibling=H,R=H);return e&&D.forEach(function(te){return t(E,te)}),yr&&hh(E,j),M}function _(E,k,T,A){if(typeof T=="object"&&T!==null&&T.type===Qg&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case ob:e:{for(var M=T.key,R=k;R!==null;){if(R.key===M){if(M=T.type,M===Qg){if(R.tag===7){n(E,R.sibling),k=i(R,T.props.children),k.return=E,E=k;break e}}else if(R.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===md&&IM(M)===R.type){n(E,R.sibling),k=i(R,T.props),k.ref=ev(E,R,T),k.return=E,E=k;break e}n(E,R);break}else t(E,R);R=R.sibling}T.type===Qg?(k=Hh(T.props.children,E.mode,A,T.key),k.return=E,E=k):(A=P4(T.type,T.key,T.props,null,E.mode,A),A.ref=ev(E,k,T),A.return=E,E=A)}return a(E);case Zg:e:{for(R=T.key;k!==null;){if(k.key===R)if(k.tag===4&&k.stateNode.containerInfo===T.containerInfo&&k.stateNode.implementation===T.implementation){n(E,k.sibling),k=i(k,T.children||[]),k.return=E,E=k;break e}else{n(E,k);break}else t(E,k);k=k.sibling}k=eC(T,E.mode,A),k.return=E,E=k}return a(E);case md:return R=T._init,_(E,k,R(T._payload),A)}if(wv(T))return b(E,k,T,A);if(K1(T))return S(E,k,T,A);mb(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,k!==null&&k.tag===6?(n(E,k.sibling),k=i(k,T),k.return=E,E=k):(n(E,k),k=J6(T,E.mode,A),k.return=E,E=k),a(E)):n(E,k)}return _}var t0=Jz(!0),eH=Jz(!1),My={},tu=lf(My),G2=lf(My),q2=lf(My);function Lh(e){if(e===My)throw Error(He(174));return e}function eE(e,t){switch(rr(q2,t),rr(G2,e),rr(tu,My),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:s9(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=s9(t,e)}fr(tu),rr(tu,t)}function n0(){fr(tu),fr(G2),fr(q2)}function tH(e){Lh(q2.current);var t=Lh(tu.current),n=s9(t,e.type);t!==n&&(rr(G2,e),rr(tu,n))}function tE(e){G2.current===e&&(fr(tu),fr(G2))}var kr=lf(0);function A5(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var q6=[];function nE(){for(var e=0;en?n:4,e(!0);var r=Y6.transition;Y6.transition={};try{e(!1),t()}finally{Bn=n,Y6.transition=r}}function vH(){return hs().memoizedState}function S2e(e,t,n){var r=jd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},yH(e))bH(t,n);else if(n=Kz(e,t,n,r),n!==null){var i=Lo();Zs(n,e,r,i),SH(n,t,r)}}function x2e(e,t,n){var r=jd(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(yH(e))bH(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,tl(s,a)){var l=t.interleaved;l===null?(i.next=i,Qk(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Kz(e,t,i,r),n!==null&&(i=Lo(),Zs(n,e,r,i),SH(n,t,r))}}function yH(e){var t=e.alternate;return e===Pr||t!==null&&t===Pr}function bH(e,t){i2=O5=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function SH(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bk(e,n)}}var M5={readContext:fs,useCallback:Qi,useContext:Qi,useEffect:Qi,useImperativeHandle:Qi,useInsertionEffect:Qi,useLayoutEffect:Qi,useMemo:Qi,useReducer:Qi,useRef:Qi,useState:Qi,useDebugValue:Qi,useDeferredValue:Qi,useTransition:Qi,useMutableSource:Qi,useSyncExternalStore:Qi,useId:Qi,unstable_isNewReconciler:!1},w2e={readContext:fs,useCallback:function(e,t){return jl().memoizedState=[e,t===void 0?null:t],e},useContext:fs,useEffect:DM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,C4(4194308,4,fH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return C4(4194308,4,e,t)},useInsertionEffect:function(e,t){return C4(4,2,e,t)},useMemo:function(e,t){var n=jl();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jl();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=S2e.bind(null,Pr,e),[r.memoizedState,e]},useRef:function(e){var t=jl();return e={current:e},t.memoizedState=e},useState:RM,useDebugValue:sE,useDeferredValue:function(e){return jl().memoizedState=e},useTransition:function(){var e=RM(!1),t=e[0];return e=b2e.bind(null,e[1]),jl().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pr,i=jl();if(yr){if(n===void 0)throw Error(He(407));n=n()}else{if(n=t(),Li===null)throw Error(He(349));Xh&30||iH(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,DM(aH.bind(null,r,o,e),[e]),r.flags|=2048,X2(9,oH.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=jl(),t=Li.identifierPrefix;if(yr){var n=Yu,r=qu;n=(r&~(1<<32-Xs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Y2++,0")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{O6=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?wv(e):""}function Q1e(e){switch(e.tag){case 5:return wv(e.type);case 16:return wv("Lazy");case 13:return wv("Suspense");case 19:return wv("SuspenseList");case 0:case 2:case 15:return e=M6(e.type,!1),e;case 11:return e=M6(e.type.render,!1),e;case 1:return e=M6(e.type,!0),e;default:return""}}function n9(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Jg:return"Fragment";case Qg:return"Portal";case J7:return"Profiler";case Ik:return"StrictMode";case e9:return"Suspense";case t9:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case J$:return(e.displayName||"Context")+".Consumer";case Q$:return(e._context.displayName||"Context")+".Provider";case Rk:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dk:return t=e.displayName||null,t!==null?t:n9(e.type)||"Memo";case md:t=e._payload,e=e._init;try{return n9(e(t))}catch{}}return null}function J1e(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return n9(t);case 8:return t===Ik?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Yd(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tz(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function eve(e){var t=tz(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ab(e){e._valueTracker||(e._valueTracker=eve(e))}function nz(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tz(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function p5(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function r9(e,t){var n=t.checked;return Lr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function JO(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Yd(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rz(e,t){t=t.checked,t!=null&&Mk(e,"checked",t,!1)}function i9(e,t){rz(e,t);var n=Yd(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?o9(e,t.type,n):t.hasOwnProperty("defaultValue")&&o9(e,t.type,Yd(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function eM(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function o9(e,t,n){(t!=="number"||p5(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cv=Array.isArray;function Tm(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=sb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function N2(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jv={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tve=["Webkit","ms","Moz","O"];Object.keys(Jv).forEach(function(e){tve.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jv[t]=Jv[e]})});function sz(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jv.hasOwnProperty(e)&&Jv[e]?(""+t).trim():t+"px"}function lz(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=sz(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var nve=Lr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function l9(e,t){if(t){if(nve[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ve(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ve(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ve(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ve(62))}}function u9(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var c9=null;function Nk(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var d9=null,Lm=null,Am=null;function rM(e){if(e=Oy(e)){if(typeof d9!="function")throw Error(Ve(280));var t=e.stateNode;t&&(t=cx(t),d9(e.stateNode,e.type,t))}}function uz(e){Lm?Am?Am.push(e):Am=[e]:Lm=e}function cz(){if(Lm){var e=Lm,t=Am;if(Am=Lm=null,rM(e),t)for(e=0;e>>=0,e===0?32:31-(hve(e)/pve|0)|0}var lb=64,ub=4194304;function _v(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function y5(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=_v(s):(o&=a,o!==0&&(r=_v(o)))}else a=n&~i,a!==0?r=_v(a):o!==0&&(r=_v(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ly(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xs(t),e[t]=n}function yve(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=t2),fM=String.fromCharCode(32),hM=!1;function Az(e,t){switch(e){case"keyup":return Gve.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Oz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var em=!1;function Yve(e,t){switch(e){case"compositionend":return Oz(t);case"keypress":return t.which!==32?null:(hM=!0,fM);case"textInput":return e=t.data,e===fM&&hM?null:e;default:return null}}function Kve(e,t){if(em)return e==="compositionend"||!Wk&&Az(e,t)?(e=Tz(),b4=zk=Ed=null,em=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=vM(n)}}function Dz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nz(){for(var e=window,t=p5();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=p5(e.document)}return t}function Uk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function i2e(e){var t=Nz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Dz(n.ownerDocument.documentElement,n)){if(r!==null&&Uk(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=yM(n,o);var a=yM(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,tm=null,v9=null,r2=null,y9=!1;function bM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;y9||tm==null||tm!==p5(r)||(r=tm,"selectionStart"in r&&Uk(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),r2&&H2(r2,r)||(r2=r,r=x5(v9,"onSelect"),0im||(e.current=_9[im],_9[im]=null,im--)}function rr(e,t){im++,_9[im]=e.current,e.current=t}var Kd={},lo=uf(Kd),ea=uf(!1),Kh=Kd;function e0(e,t){var n=e.type.contextTypes;if(!n)return Kd;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ta(e){return e=e.childContextTypes,e!=null}function C5(){hr(ea),hr(lo)}function EM(e,t,n){if(lo.current!==Kd)throw Error(Ve(168));rr(lo,t),rr(ea,n)}function Uz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Ve(108,J1e(e)||"Unknown",i));return Lr({},n,r)}function _5(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kd,Kh=lo.current,rr(lo,e),rr(ea,ea.current),!0}function PM(e,t,n){var r=e.stateNode;if(!r)throw Error(Ve(169));n?(e=Uz(e,t,Kh),r.__reactInternalMemoizedMergedChildContext=e,hr(ea),hr(lo),rr(lo,e)):hr(ea),rr(ea,n)}var Wu=null,dx=!1,G6=!1;function Gz(e){Wu===null?Wu=[e]:Wu.push(e)}function m2e(e){dx=!0,Gz(e)}function cf(){if(!G6&&Wu!==null){G6=!0;var e=0,t=Bn;try{var n=Wu;for(Bn=1;e>=a,i-=a,qu=1<<32-Xs(t)+i|n<j?(z=D,D=null):z=D.sibling;var H=m(E,D,P[j],A);if(H===null){D===null&&(D=z);break}e&&D&&H.alternate===null&&t(E,D),_=o(H,_,j),R===null?M=H:R.sibling=H,R=H,D=z}if(j===P.length)return n(E,D),br&&ph(E,j),M;if(D===null){for(;jj?(z=D,D=null):z=D.sibling;var K=m(E,D,H.value,A);if(K===null){D===null&&(D=z);break}e&&D&&K.alternate===null&&t(E,D),_=o(K,_,j),R===null?M=K:R.sibling=K,R=K,D=z}if(H.done)return n(E,D),br&&ph(E,j),M;if(D===null){for(;!H.done;j++,H=P.next())H=h(E,H.value,A),H!==null&&(_=o(H,_,j),R===null?M=H:R.sibling=H,R=H);return br&&ph(E,j),M}for(D=r(E,D);!H.done;j++,H=P.next())H=y(D,E,j,H.value,A),H!==null&&(e&&H.alternate!==null&&D.delete(H.key===null?j:H.key),_=o(H,_,j),R===null?M=H:R.sibling=H,R=H);return e&&D.forEach(function(te){return t(E,te)}),br&&ph(E,j),M}function k(E,_,P,A){if(typeof P=="object"&&P!==null&&P.type===Jg&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case ob:e:{for(var M=P.key,R=_;R!==null;){if(R.key===M){if(M=P.type,M===Jg){if(R.tag===7){n(E,R.sibling),_=i(R,P.props.children),_.return=E,E=_;break e}}else if(R.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===md&&RM(M)===R.type){n(E,R.sibling),_=i(R,P.props),_.ref=tv(E,R,P),_.return=E,E=_;break e}n(E,R);break}else t(E,R);R=R.sibling}P.type===Jg?(_=Vh(P.props.children,E.mode,A,P.key),_.return=E,E=_):(A=P4(P.type,P.key,P.props,null,E.mode,A),A.ref=tv(E,_,P),A.return=E,E=A)}return a(E);case Qg:e:{for(R=P.key;_!==null;){if(_.key===R)if(_.tag===4&&_.stateNode.containerInfo===P.containerInfo&&_.stateNode.implementation===P.implementation){n(E,_.sibling),_=i(_,P.children||[]),_.return=E,E=_;break e}else{n(E,_);break}else t(E,_);_=_.sibling}_=eC(P,E.mode,A),_.return=E,E=_}return a(E);case md:return R=P._init,k(E,_,R(P._payload),A)}if(Cv(P))return b(E,_,P,A);if(X1(P))return x(E,_,P,A);mb(E,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,_!==null&&_.tag===6?(n(E,_.sibling),_=i(_,P),_.return=E,E=_):(n(E,_),_=J6(P,E.mode,A),_.return=E,E=_),a(E)):n(E,_)}return k}var n0=eH(!0),tH=eH(!1),My={},tu=uf(My),G2=uf(My),q2=uf(My);function Ah(e){if(e===My)throw Error(Ve(174));return e}function eE(e,t){switch(rr(q2,t),rr(G2,e),rr(tu,My),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:s9(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=s9(t,e)}hr(tu),rr(tu,t)}function r0(){hr(tu),hr(G2),hr(q2)}function nH(e){Ah(q2.current);var t=Ah(tu.current),n=s9(t,e.type);t!==n&&(rr(G2,e),rr(tu,n))}function tE(e){G2.current===e&&(hr(tu),hr(G2))}var kr=uf(0);function A5(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var q6=[];function nE(){for(var e=0;en?n:4,e(!0);var r=Y6.transition;Y6.transition={};try{e(!1),t()}finally{Bn=n,Y6.transition=r}}function yH(){return hs().memoizedState}function S2e(e,t,n){var r=Bd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bH(e))SH(t,n);else if(n=Xz(e,t,n,r),n!==null){var i=Lo();Zs(n,e,r,i),xH(n,t,r)}}function x2e(e,t,n){var r=Bd(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bH(e))SH(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,tl(s,a)){var l=t.interleaved;l===null?(i.next=i,Qk(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Xz(e,t,i,r),n!==null&&(i=Lo(),Zs(n,e,r,i),xH(n,t,r))}}function bH(e){var t=e.alternate;return e===Pr||t!==null&&t===Pr}function SH(e,t){i2=O5=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xH(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bk(e,n)}}var M5={readContext:fs,useCallback:Qi,useContext:Qi,useEffect:Qi,useImperativeHandle:Qi,useInsertionEffect:Qi,useLayoutEffect:Qi,useMemo:Qi,useReducer:Qi,useRef:Qi,useState:Qi,useDebugValue:Qi,useDeferredValue:Qi,useTransition:Qi,useMutableSource:Qi,useSyncExternalStore:Qi,useId:Qi,unstable_isNewReconciler:!1},w2e={readContext:fs,useCallback:function(e,t){return jl().memoizedState=[e,t===void 0?null:t],e},useContext:fs,useEffect:NM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,C4(4194308,4,hH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return C4(4194308,4,e,t)},useInsertionEffect:function(e,t){return C4(4,2,e,t)},useMemo:function(e,t){var n=jl();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jl();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=S2e.bind(null,Pr,e),[r.memoizedState,e]},useRef:function(e){var t=jl();return e={current:e},t.memoizedState=e},useState:DM,useDebugValue:sE,useDeferredValue:function(e){return jl().memoizedState=e},useTransition:function(){var e=DM(!1),t=e[0];return e=b2e.bind(null,e[1]),jl().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pr,i=jl();if(br){if(n===void 0)throw Error(Ve(407));n=n()}else{if(n=t(),Li===null)throw Error(Ve(349));Zh&30||oH(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,NM(sH.bind(null,r,o,e),[e]),r.flags|=2048,X2(9,aH.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=jl(),t=Li.identifierPrefix;if(br){var n=Yu,r=qu;n=(r&~(1<<32-Xs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Y2++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Vl]=t,e[U2]=r,LH(e,t,!1,!1),t.stateNode=e;e:{switch(a=u9(n,r),n){case"dialog":ar("cancel",e),ar("close",e),i=r;break;case"iframe":case"object":case"embed":ar("load",e),i=r;break;case"video":case"audio":for(i=0;i<_v.length;i++)ar(_v[i],e);i=r;break;case"source":ar("error",e),i=r;break;case"img":case"image":case"link":ar("error",e),ar("load",e),i=r;break;case"details":ar("toggle",e),i=r;break;case"input":QO(e,r),i=r9(e,r),ar("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Lr({},r,{value:void 0}),ar("invalid",e);break;case"textarea":eM(e,r),i=a9(e,r),ar("invalid",e);break;default:i=r}l9(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?sz(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&oz(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&N2(e,l):typeof l=="number"&&N2(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(D2.hasOwnProperty(o)?l!=null&&o==="onScroll"&&ar("scroll",e):l!=null&&Mk(e,o,l,a))}switch(n){case"input":ab(e),JO(e,r,!1);break;case"textarea":ab(e),tM(e);break;case"option":r.value!=null&&e.setAttribute("value",""+qd(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Pm(e,!!r.multiple,o,!1):r.defaultValue!=null&&Pm(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=w5)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ji(t),null;case 6:if(e&&t.stateNode!=null)OH(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(He(166));if(n=Lh(q2.current),Lh(tu.current),gb(t)){if(r=t.stateNode,n=t.memoizedProps,r[Vl]=t,(o=r.nodeValue!==n)&&(e=Aa,e!==null))switch(e.tag){case 3:pb(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&pb(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Vl]=t,t.stateNode=r}return Ji(t),null;case 13:if(fr(kr),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(yr&&Pa!==null&&t.mode&1&&!(t.flags&128))Yz(),e0(),t.flags|=98560,o=!1;else if(o=gb(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(He(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(He(317));o[Vl]=t}else e0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ji(t),o=!1}else Hs!==null&&(V9(Hs),Hs=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||kr.current&1?mi===0&&(mi=3):pE())),t.updateQueue!==null&&(t.flags|=4),Ji(t),null);case 4:return n0(),D9(e,t),e===null&&V2(t.stateNode.containerInfo),Ji(t),null;case 10:return Zk(t.type._context),Ji(t),null;case 17:return ta(t.type)&&C5(),Ji(t),null;case 19:if(fr(kr),o=t.memoizedState,o===null)return Ji(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)tv(o,!1);else{if(mi!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=A5(e),a!==null){for(t.flags|=128,tv(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return rr(kr,kr.current&1|2),t.child}e=e.sibling}o.tail!==null&&Zr()>i0&&(t.flags|=128,r=!0,tv(o,!1),t.lanes=4194304)}else{if(!r)if(e=A5(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),tv(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!yr)return Ji(t),null}else 2*Zr()-o.renderingStartTime>i0&&n!==1073741824&&(t.flags|=128,r=!0,tv(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Zr(),t.sibling=null,n=kr.current,rr(kr,r?n&1|2:n&1),t):(Ji(t),null);case 22:case 23:return hE(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ka&1073741824&&(Ji(t),t.subtreeFlags&6&&(t.flags|=8192)):Ji(t),null;case 24:return null;case 25:return null}throw Error(He(156,t.tag))}function A2e(e,t){switch(qk(t),t.tag){case 1:return ta(t.type)&&C5(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return n0(),fr(ea),fr(lo),nE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tE(t),null;case 13:if(fr(kr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(He(340));e0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fr(kr),null;case 4:return n0(),null;case 10:return Zk(t.type._context),null;case 22:case 23:return hE(),null;case 24:return null;default:return null}}var yb=!1,io=!1,O2e=typeof WeakSet=="function"?WeakSet:Set,pt=null;function sm(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Fr(e,t,r)}else n.current=null}function N9(e,t,n){try{n()}catch(r){Fr(e,t,r)}}var WM=!1;function M2e(e,t){if(b9=b5,e=Dz(),Uk(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,d=0,h=e,m=null;t:for(;;){for(var v;h!==n||i!==0&&h.nodeType!==3||(s=a+i),h!==o||r!==0&&h.nodeType!==3||(l=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(v=h.firstChild)!==null;)m=h,h=v;for(;;){if(h===e)break t;if(m===n&&++u===i&&(s=a),m===o&&++d===r&&(l=a),(v=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=v}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(S9={focusedElem:e,selectionRange:n},b5=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){t=pt;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var S=b.memoizedProps,_=b.memoizedState,E=t.stateNode,k=E.getSnapshotBeforeUpdate(t.elementType===t.type?S:$s(t.type,S),_);E.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(He(163))}}catch(A){Fr(t,t.return,A)}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}return b=WM,WM=!1,b}function o2(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&N9(t,n,o)}i=i.next}while(i!==r)}}function px(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function j9(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function MH(e){var t=e.alternate;t!==null&&(e.alternate=null,MH(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vl],delete t[U2],delete t[C9],delete t[p2e],delete t[g2e])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function IH(e){return e.tag===5||e.tag===3||e.tag===4}function UM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||IH(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function B9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=w5));else if(r!==4&&(e=e.child,e!==null))for(B9(e,t,n),e=e.sibling;e!==null;)B9(e,t,n),e=e.sibling}function $9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for($9(e,t,n),e=e.sibling;e!==null;)$9(e,t,n),e=e.sibling}var Vi=null,Fs=!1;function ud(e,t,n){for(n=n.child;n!==null;)RH(e,t,n),n=n.sibling}function RH(e,t,n){if(eu&&typeof eu.onCommitFiberUnmount=="function")try{eu.onCommitFiberUnmount(ax,n)}catch{}switch(n.tag){case 5:io||sm(n,t);case 6:var r=Vi,i=Fs;Vi=null,ud(e,t,n),Vi=r,Fs=i,Vi!==null&&(Fs?(e=Vi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Vi.removeChild(n.stateNode));break;case 18:Vi!==null&&(Fs?(e=Vi,n=n.stateNode,e.nodeType===8?U6(e.parentNode,n):e.nodeType===1&&U6(e,n),F2(e)):U6(Vi,n.stateNode));break;case 4:r=Vi,i=Fs,Vi=n.stateNode.containerInfo,Fs=!0,ud(e,t,n),Vi=r,Fs=i;break;case 0:case 11:case 14:case 15:if(!io&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&N9(n,t,a),i=i.next}while(i!==r)}ud(e,t,n);break;case 1:if(!io&&(sm(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Fr(n,t,s)}ud(e,t,n);break;case 21:ud(e,t,n);break;case 22:n.mode&1?(io=(r=io)||n.memoizedState!==null,ud(e,t,n),io=r):ud(e,t,n);break;default:ud(e,t,n)}}function GM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new O2e),t.forEach(function(r){var i=z2e.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ds(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Zr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*R2e(r/1960))-r,10e?16:e,Pd===null)var r=!1;else{if(e=Pd,Pd=null,D5=0,pn&6)throw Error(He(331));var i=pn;for(pn|=4,pt=e.current;pt!==null;){var o=pt,a=o.child;if(pt.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lZr()-dE?zh(e,0):cE|=n),na(e,t)}function HH(e,t){t===0&&(e.mode&1?(t=ub,ub<<=1,!(ub&130023424)&&(ub=4194304)):t=1);var n=Lo();e=oc(e,t),e!==null&&(Ly(e,t,n),na(e,n))}function F2e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),HH(e,n)}function z2e(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(He(314))}r!==null&&r.delete(t),HH(e,n)}var VH;VH=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ea.current)Zo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Zo=!1,T2e(e,t,n);Zo=!!(e.flags&131072)}else Zo=!1,yr&&t.flags&1048576&&Gz(t,E5,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_4(e,t),e=t.pendingProps;var i=Jm(t,lo.current);Om(t,n),i=iE(null,t,r,e,i,n);var o=oE();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ta(r)?(o=!0,_5(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Jk(t),i.updater=fx,t.stateNode=i,i._reactInternals=t,L9(t,r,e,n),t=M9(null,t,r,!0,o,n)):(t.tag=0,yr&&o&&Gk(t),Co(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_4(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=V2e(r),e=$s(r,e),i){case 0:t=O9(null,t,r,e,n);break e;case 1:t=zM(null,t,r,e,n);break e;case 11:t=$M(null,t,r,e,n);break e;case 14:t=FM(null,t,r,$s(r.type,e),n);break e}throw Error(He(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),O9(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),zM(e,t,r,i,n);case 3:e:{if(EH(t),e===null)throw Error(He(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Xz(e,t),L5(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=r0(Error(He(423)),t),t=HM(e,t,r,n,i);break e}else if(r!==i){i=r0(Error(He(424)),t),t=HM(e,t,r,n,i);break e}else for(Pa=Rd(t.stateNode.containerInfo.firstChild),Aa=t,yr=!0,Hs=null,n=eH(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(e0(),r===i){t=ac(e,t,n);break e}Co(e,t,r,n)}t=t.child}return t;case 5:return tH(t),e===null&&E9(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,x9(r,i)?a=null:o!==null&&x9(r,o)&&(t.flags|=32),kH(e,t),Co(e,t,a,n),t.child;case 6:return e===null&&E9(t),null;case 13:return PH(e,t,n);case 4:return eE(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=t0(t,null,r,n):Co(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),$M(e,t,r,i,n);case 7:return Co(e,t,t.pendingProps,n),t.child;case 8:return Co(e,t,t.pendingProps.children,n),t.child;case 12:return Co(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,rr(P5,r._currentValue),r._currentValue=a,o!==null)if(tl(o.value,a)){if(o.children===i.children&&!ea.current){t=ac(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ku(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),P9(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(He(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),P9(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Co(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Om(t,n),i=fs(i),r=r(i),t.flags|=1,Co(e,t,r,n),t.child;case 14:return r=t.type,i=$s(r,t.pendingProps),i=$s(r.type,i),FM(e,t,r,i,n);case 15:return CH(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),_4(e,t),t.tag=1,ta(r)?(e=!0,_5(t)):e=!1,Om(t,n),Qz(t,r,i),L9(t,r,i,n),M9(null,t,r,!0,e,n);case 19:return TH(e,t,n);case 22:return _H(e,t,n)}throw Error(He(156,t.tag))};function WH(e,t){return mz(e,t)}function H2e(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function is(e,t,n,r){return new H2e(e,t,n,r)}function gE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function V2e(e){if(typeof e=="function")return gE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rk)return 11;if(e===Dk)return 14}return 2}function Bd(e,t){var n=e.alternate;return n===null?(n=is(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function P4(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")gE(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Qg:return Hh(n.children,i,o,t);case Ik:a=8,i|=8;break;case J7:return e=is(12,n,t,i|2),e.elementType=J7,e.lanes=o,e;case e9:return e=is(13,n,t,i),e.elementType=e9,e.lanes=o,e;case t9:return e=is(19,n,t,i),e.elementType=t9,e.lanes=o,e;case JF:return mx(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ZF:a=10;break e;case QF:a=9;break e;case Rk:a=11;break e;case Dk:a=14;break e;case md:a=16,r=null;break e}throw Error(He(130,e==null?e:typeof e,""))}return t=is(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Hh(e,t,n,r){return e=is(7,e,r,t),e.lanes=n,e}function mx(e,t,n,r){return e=is(22,e,r,t),e.elementType=JF,e.lanes=n,e.stateNode={isHidden:!1},e}function J6(e,t,n){return e=is(6,e,null,t),e.lanes=n,e}function eC(e,t,n){return t=is(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function W2e(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=R6(0),this.expirationTimes=R6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R6(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function mE(e,t,n,r,i,o,a,s,l){return e=new W2e(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=is(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jk(o),e}function U2e(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=ja})(G1e);const xb=v_(el);var[X2e,Z2e]=Pn({strict:!1,name:"PortalManagerContext"});function YH(e){const{children:t,zIndex:n}=e;return N.createElement(X2e,{value:{zIndex:n}},t)}YH.displayName="PortalManager";var[KH,Q2e]=Pn({strict:!1,name:"PortalContext"}),SE="chakra-portal",J2e=".chakra-portal",eye=e=>N.createElement("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0}},e.children),tye=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=w.useState(null),o=w.useRef(null),[,a]=w.useState({});w.useEffect(()=>a({}),[]);const s=Q2e(),l=Z2e();Gs(()=>{if(!r)return;const d=r.ownerDocument,h=t?s??d.body:d.body;if(!h)return;o.current=d.createElement("div"),o.current.className=SE,h.appendChild(o.current),a({});const m=o.current;return()=>{h.contains(m)&&h.removeChild(m)}},[r]);const u=l!=null&&l.zIndex?N.createElement(eye,{zIndex:l==null?void 0:l.zIndex},n):n;return o.current?el.createPortal(N.createElement(KH,{value:o.current},u),o.current):N.createElement("span",{ref:d=>{d&&i(d)}})},nye=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=w.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=SE),l},[i]),[,s]=w.useState({});return Gs(()=>s({}),[]),Gs(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?el.createPortal(N.createElement(KH,{value:r?a:null},t),a):null};function up(e){const{containerRef:t,...n}=e;return t?N.createElement(nye,{containerRef:t,...n}):N.createElement(tye,{...n})}up.defaultProps={appendToParentPortal:!0};up.className=SE;up.selector=J2e;up.displayName="Portal";var rye=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lg=new WeakMap,wb=new WeakMap,Cb={},tC=0,XH=function(e){return e&&(e.host||XH(e.parentNode))},iye=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=XH(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},oye=function(e,t,n,r){var i=iye(t,Array.isArray(e)?e:[e]);Cb[n]||(Cb[n]=new WeakMap);var o=Cb[n],a=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(s.has(m))d(m);else{var v=m.getAttribute(r),b=v!==null&&v!=="false",S=(Lg.get(m)||0)+1,_=(o.get(m)||0)+1;Lg.set(m,S),o.set(m,_),a.push(m),S===1&&b&&wb.set(m,!0),_===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}})};return d(t),s.clear(),tC++,function(){a.forEach(function(h){var m=Lg.get(h)-1,v=o.get(h)-1;Lg.set(h,m),o.set(h,v),m||(wb.has(h)||h.removeAttribute(r),wb.delete(h)),v||h.removeAttribute(n)}),tC--,tC||(Lg=new WeakMap,Lg=new WeakMap,wb=new WeakMap,Cb={})}},ZH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||rye(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),oye(r,i,n,"aria-hidden")):function(){return null}};function xE(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var jn={},aye={get exports(){return jn},set exports(e){jn=e}},sye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",lye=sye,uye=lye;function QH(){}function JH(){}JH.resetWarningCache=QH;var cye=function(){function e(r,i,o,a,s,l){if(l!==uye){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:JH,resetWarningCache:QH};return n.PropTypes=n,n};aye.exports=cye();var W9="data-focus-lock",eV="data-focus-lock-disabled",dye="data-no-focus-lock",fye="data-autofocus-inside",hye="data-no-autofocus";function pye(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gye(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function tV(e,t){return gye(t||null,function(n){return e.forEach(function(r){return pye(r,n)})})}var nC={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function nV(e){return e}function rV(e,t){t===void 0&&(t=nV);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function wE(e,t){return t===void 0&&(t=nV),rV(e,t)}function iV(e){e===void 0&&(e={});var t=rV(null);return t.options=Hl({async:!0,ssr:!1},e),t}var oV=function(e){var t=e.sideCar,n=q$(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Hl({},n))};oV.isSideCarExport=!0;function mye(e,t){return e.useMedium(t),oV}var aV=wE({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),sV=wE(),vye=wE(),yye=iV({async:!0}),bye=[],CE=w.forwardRef(function(t,n){var r,i=w.useState(),o=i[0],a=i[1],s=w.useRef(),l=w.useRef(!1),u=w.useRef(null),d=t.children,h=t.disabled,m=t.noFocusGuards,v=t.persistentFocus,b=t.crossFrame,S=t.autoFocus;t.allowTextSelection;var _=t.group,E=t.className,k=t.whiteList,T=t.hasPositiveIndices,A=t.shards,M=A===void 0?bye:A,R=t.as,D=R===void 0?"div":R,j=t.lockProps,z=j===void 0?{}:j,H=t.sideCar,K=t.returnFocus,te=t.focusOptions,G=t.onActivation,$=t.onDeactivation,W=w.useState({}),X=W[0],Z=w.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&G&&G(s.current),l.current=!0},[G]),U=w.useCallback(function(){l.current=!1,$&&$(s.current)},[$]);w.useEffect(function(){h||(u.current=null)},[]);var Q=w.useCallback(function(rt){var Ve=u.current;if(Ve&&Ve.focus){var je=typeof K=="function"?K(Ve):K;if(je){var wt=typeof je=="object"?je:void 0;u.current=null,rt?Promise.resolve().then(function(){return Ve.focus(wt)}):Ve.focus(wt)}}},[K]),re=w.useCallback(function(rt){l.current&&aV.useMedium(rt)},[]),fe=sV.useMedium,Ee=w.useCallback(function(rt){s.current!==rt&&(s.current=rt,a(rt))},[]),be=bn((r={},r[eV]=h&&"disabled",r[W9]=_,r),z),ye=m!==!0,Fe=ye&&m!=="tail",Me=tV([n,Ee]);return w.createElement(w.Fragment,null,ye&&[w.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:nC}),T?w.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:nC}):null],!h&&w.createElement(H,{id:X,sideCar:yye,observed:o,disabled:h,persistentFocus:v,crossFrame:b,autoFocus:S,whiteList:k,shards:M,onActivation:Z,onDeactivation:U,returnFocus:Q,focusOptions:te}),w.createElement(D,bn({ref:Me},be,{className:E,onBlur:fe,onFocus:re}),d),Fe&&w.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:nC}))});CE.propTypes={};CE.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const lV=CE;function U9(e,t){return U9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},U9(e,t)}function _E(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,U9(e,t)}function uV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sye(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){_E(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return a};var h=d.prototype;return h.componentDidMount=function(){o.push(this),s()},h.componentDidUpdate=function(){s()},h.componentWillUnmount=function(){var v=o.indexOf(this);o.splice(v,1),s()},h.render=function(){return N.createElement(i,this.props)},d}(w.PureComponent);return uV(l,"displayName","SideEffect("+n(i)+")"),l}}var pu=function(e){for(var t=Array(e.length),n=0;n=0}).sort(Tye)},Lye=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],EE=Lye.join(","),Aye="".concat(EE,", [data-focus-guard]"),yV=function(e,t){var n;return pu(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,i){return r.concat(i.matches(t?Aye:EE)?[i]:[],yV(i))},[])},PE=function(e,t){return e.reduce(function(n,r){return n.concat(yV(r,t),r.parentNode?pu(r.parentNode.querySelectorAll(EE)).filter(function(i){return i===r}):[])},[])},Oye=function(e){var t=e.querySelectorAll("[".concat(fye,"]"));return pu(t).map(function(n){return PE([n])}).reduce(function(n,r){return n.concat(r)},[])},TE=function(e,t){return pu(e).filter(function(n){return fV(t,n)}).filter(function(n){return kye(n)})},eI=function(e,t){return t===void 0&&(t=new Map),pu(e).filter(function(n){return hV(t,n)})},q9=function(e,t,n){return vV(TE(PE(e,n),t),!0,n)},tI=function(e,t){return vV(TE(PE(e),t),!1)},Mye=function(e,t){return TE(Oye(e),t)},Q2=function(e,t){return e.shadowRoot?Q2(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:pu(e.children).some(function(n){return Q2(n,t)})},Iye=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},bV=function(e){return e.parentNode?bV(e.parentNode):e},LE=function(e){var t=G9(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(W9);return n.push.apply(n,i?Iye(pu(bV(r).querySelectorAll("[".concat(W9,'="').concat(i,'"]:not([').concat(eV,'="disabled"])')))):[r]),n},[])},SV=function(e){return e.activeElement?e.activeElement.shadowRoot?SV(e.activeElement.shadowRoot):e.activeElement:void 0},AE=function(){return document.activeElement?document.activeElement.shadowRoot?SV(document.activeElement.shadowRoot):document.activeElement:void 0},Rye=function(e){return e===document.activeElement},Dye=function(e){return Boolean(pu(e.querySelectorAll("iframe")).some(function(t){return Rye(t)}))},xV=function(e){var t=document&&AE();return!t||t.dataset&&t.dataset.focusGuard?!1:LE(e).some(function(n){return Q2(n,t)||Dye(n)})},Nye=function(){var e=document&&AE();return e?pu(document.querySelectorAll("[".concat(dye,"]"))).some(function(t){return Q2(t,e)}):!1},jye=function(e,t){return t.filter(mV).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},OE=function(e,t){return mV(e)&&e.name?jye(e,t):e},Bye=function(e){var t=new Set;return e.forEach(function(n){return t.add(OE(n,e))}),e.filter(function(n){return t.has(n)})},nI=function(e){return e[0]&&e.length>1?OE(e[0],e):e[0]},rI=function(e,t){return e.length>1?e.indexOf(OE(e[t],e)):t},wV="NEW_FOCUS",$ye=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=kE(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,d=r?e.indexOf(r):-1,h=l-u,m=t.indexOf(o),v=t.indexOf(a),b=Bye(t),S=n!==void 0?b.indexOf(n):-1,_=S-(r?b.indexOf(r):l),E=rI(e,0),k=rI(e,i-1);if(l===-1||d===-1)return wV;if(!h&&d>=0)return d;if(l<=m&&s&&Math.abs(h)>1)return k;if(l>=v&&s&&Math.abs(h)>1)return E;if(h&&Math.abs(_)>1)return d;if(l<=m)return k;if(l>v)return E;if(h)return Math.abs(h)>1?d:(i+d+h)%i}},Fye=function(e){return function(t){var n,r=(n=pV(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},zye=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=eI(r.filter(Fye(n)));return i&&i.length?nI(i):nI(eI(t))},Y9=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Y9(e.parentNode.host||e.parentNode,t),t},rC=function(e,t){for(var n=Y9(e),r=Y9(t),i=0;i=0)return o}return!1},CV=function(e,t,n){var r=G9(e),i=G9(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=rC(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=rC(o,l);u&&(!a||Q2(u,a)?a=u:a=rC(u,a))})}),a},Hye=function(e,t){return e.reduce(function(n,r){return n.concat(Mye(r,t))},[])},Vye=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Pye)},Wye=function(e,t){var n=document&&AE(),r=LE(e).filter(B5),i=CV(n||e,e,r),o=new Map,a=tI(r,o),s=q9(r,o).filter(function(m){var v=m.node;return B5(v)});if(!(!s[0]&&(s=a,!s[0]))){var l=tI([i],o).map(function(m){var v=m.node;return v}),u=Vye(l,s),d=u.map(function(m){var v=m.node;return v}),h=$ye(d,l,n,t);return h===wV?{node:zye(a,d,Hye(r,o))}:h===void 0?h:u[h]}},Uye=function(e){var t=LE(e).filter(B5),n=CV(e,e,t),r=new Map,i=q9([n],r,!0),o=q9(t,r).filter(function(a){var s=a.node;return B5(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:kE(s)}})},Gye=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},iC=0,oC=!1,qye=function(e,t,n){n===void 0&&(n={});var r=Wye(e,t);if(!oC&&r){if(iC>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),oC=!0,setTimeout(function(){oC=!1},1);return}iC++,Gye(r.node,n.focusOptions),iC--}};const _V=qye;function kV(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var Yye=function(){return document&&document.activeElement===document.body},Kye=function(){return Yye()||Nye()},Im=null,um=null,Rm=null,J2=!1,Xye=function(){return!0},Zye=function(t){return(Im.whiteList||Xye)(t)},Qye=function(t,n){Rm={observerNode:t,portaledElement:n}},Jye=function(t){return Rm&&Rm.portaledElement===t};function iI(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var e3e=function(t){return t&&"current"in t?t.current:t},t3e=function(t){return t?Boolean(J2):J2==="meanwhile"},n3e=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},r3e=function(t,n){return n.some(function(r){return n3e(t,r,r)})},$5=function(){var t=!1;if(Im){var n=Im,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||Rm&&Rm.portaledElement,d=document&&document.activeElement;if(u){var h=[u].concat(a.map(e3e).filter(Boolean));if((!d||Zye(d))&&(i||t3e(s)||!Kye()||!um&&o)&&(u&&!(xV(h)||d&&r3e(d,h)||Jye(d))&&(document&&!um&&d&&!o?(d.blur&&d.blur(),document.body.focus()):(t=_V(h,um,{focusOptions:l}),Rm={})),J2=!1,um=document&&document.activeElement),document){var m=document&&document.activeElement,v=Uye(h),b=v.map(function(S){var _=S.node;return _}).indexOf(m);b>-1&&(v.filter(function(S){var _=S.guard,E=S.node;return _&&E.dataset.focusAutoGuard}).forEach(function(S){var _=S.node;return _.removeAttribute("tabIndex")}),iI(b,v.length,1,v),iI(b,-1,-1,v))}}}return t},EV=function(t){$5()&&t&&(t.stopPropagation(),t.preventDefault())},ME=function(){return kV($5)},i3e=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Qye(r,n)},o3e=function(){return null},PV=function(){J2="just",setTimeout(function(){J2="meanwhile"},0)},a3e=function(){document.addEventListener("focusin",EV),document.addEventListener("focusout",ME),window.addEventListener("blur",PV)},s3e=function(){document.removeEventListener("focusin",EV),document.removeEventListener("focusout",ME),window.removeEventListener("blur",PV)};function l3e(e){return e.filter(function(t){var n=t.disabled;return!n})}function u3e(e){var t=e.slice(-1)[0];t&&!Im&&a3e();var n=Im,r=n&&t&&t.id===n.id;Im=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(um=null,(!r||n.observed!==t.observed)&&t.onActivation(),$5(),kV($5)):(s3e(),um=null)}aV.assignSyncMedium(i3e);sV.assignMedium(ME);vye.assignMedium(function(e){return e({moveFocusInside:_V,focusInside:xV})});const c3e=Sye(l3e,u3e)(o3e);var TV=w.forwardRef(function(t,n){return w.createElement(lV,bn({sideCar:c3e,ref:n},t))}),LV=lV.propTypes||{};LV.sideCar;xE(LV,["sideCar"]);TV.propTypes={};const d3e=TV;var AV=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,d=w.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&DF(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),h=w.useCallback(()=>{var v;(v=n==null?void 0:n.current)==null||v.focus()},[n]),m=i&&!n;return N.createElement(d3e,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:d,onDeactivation:h,returnFocus:m},o)};AV.displayName="FocusLock";var T4="right-scroll-bar-position",L4="width-before-scroll-bar",f3e="with-scroll-bars-hidden",h3e="--removed-body-scroll-bar-size",OV=iV(),aC=function(){},xx=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:aC,onWheelCapture:aC,onTouchMoveCapture:aC}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,m=e.sideCar,v=e.noIsolation,b=e.inert,S=e.allowPinchZoom,_=e.as,E=_===void 0?"div":_,k=q$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),T=m,A=tV([n,t]),M=Hl(Hl({},k),i);return w.createElement(w.Fragment,null,d&&w.createElement(T,{sideCar:OV,removeScrollBar:u,shards:h,noIsolation:v,inert:b,setCallbacks:o,allowPinchZoom:!!S,lockRef:n}),a?w.cloneElement(w.Children.only(s),Hl(Hl({},M),{ref:A})):w.createElement(E,Hl({},M,{className:l,ref:A}),s))});xx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xx.classNames={fullWidth:L4,zeroRight:T4};var p3e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function g3e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=p3e();return t&&e.setAttribute("nonce",t),e}function m3e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function v3e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var y3e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=g3e())&&(m3e(t,n),v3e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b3e=function(){var e=y3e();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},MV=function(){var e=b3e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},S3e={left:0,top:0,right:0,gap:0},sC=function(e){return parseInt(e||"",10)||0},x3e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[sC(n),sC(r),sC(i)]},w3e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return S3e;var t=x3e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},C3e=MV(),_3e=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` +`+o.stack}return{value:e,source:t,stack:i,digest:null}}function Z6(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function A9(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var k2e=typeof WeakMap=="function"?WeakMap:Map;function wH(e,t,n){n=Ku(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){R5||(R5=!0,$9=r),A9(e,t)},n}function CH(e,t,n){n=Ku(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){A9(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){A9(e,t),typeof r!="function"&&(jd===null?jd=new Set([this]):jd.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function jM(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new k2e;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=F2e.bind(null,e,t,n),t.then(e,e))}function BM(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function FM(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ku(-1,1),t.tag=2,Nd(n,t,1))),n.lanes|=1),e)}var E2e=dc.ReactCurrentOwner,Zo=!1;function Co(e,t,n,r){t.child=e===null?tH(t,null,n,r):n0(t,e.child,n,r)}function $M(e,t,n,r,i){n=n.render;var o=t.ref;return Mm(t,i),r=iE(e,t,n,r,o,i),n=oE(),e!==null&&!Zo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ac(e,t,i)):(br&&n&&Gk(t),t.flags|=1,Co(e,t,r,i),t.child)}function zM(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!gE(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,_H(e,t,o,r,i)):(e=P4(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:H2,n(a,r)&&e.ref===t.ref)return ac(e,t,i)}return t.flags|=1,e=Fd(o,r),e.ref=t.ref,e.return=t,t.child=e}function _H(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(H2(o,r)&&e.ref===t.ref)if(Zo=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Zo=!0);else return t.lanes=e.lanes,ac(e,t,i)}return O9(e,t,n,r,i)}function kH(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},rr(um,ka),ka|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,rr(um,ka),ka|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,rr(um,ka),ka|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,rr(um,ka),ka|=r;return Co(e,t,i,n),t.child}function EH(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function O9(e,t,n,r,i){var o=ta(n)?Kh:lo.current;return o=e0(t,o),Mm(t,i),n=iE(e,t,n,r,o,i),r=oE(),e!==null&&!Zo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ac(e,t,i)):(br&&r&&Gk(t),t.flags|=1,Co(e,t,n,i),t.child)}function HM(e,t,n,r,i){if(ta(n)){var o=!0;_5(t)}else o=!1;if(Mm(t,i),t.stateNode===null)_4(e,t),Jz(t,n,r),L9(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=fs(u):(u=ta(n)?Kh:lo.current,u=e0(t,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";h||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&IM(t,a,r,u),vd=!1;var m=t.memoizedState;a.state=m,L5(t,r,a,i),l=t.memoizedState,s!==r||m!==l||ea.current||vd?(typeof d=="function"&&(T9(t,n,d,r),l=t.memoizedState),(s=vd||MM(t,n,s,r,m,l,u))?(h||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Zz(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Fs(t.type,s),a.props=u,h=t.pendingProps,m=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=fs(l):(l=ta(n)?Kh:lo.current,l=e0(t,l));var y=n.getDerivedStateFromProps;(d=typeof y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==h||m!==l)&&IM(t,a,r,l),vd=!1,m=t.memoizedState,a.state=m,L5(t,r,a,i);var b=t.memoizedState;s!==h||m!==b||ea.current||vd?(typeof y=="function"&&(T9(t,n,y,r),b=t.memoizedState),(u=vd||MM(t,n,u,r,m,b,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,b,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,b,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),a.props=r,a.state=b,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return M9(e,t,n,r,o,i)}function M9(e,t,n,r,i,o){EH(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&PM(t,n,!1),ac(e,t,o);r=t.stateNode,E2e.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=n0(t,e.child,null,o),t.child=n0(t,null,s,o)):Co(e,t,s,o),t.memoizedState=r.state,i&&PM(t,n,!0),t.child}function PH(e){var t=e.stateNode;t.pendingContext?EM(e,t.pendingContext,t.pendingContext!==t.context):t.context&&EM(e,t.context,!1),eE(e,t.containerInfo)}function VM(e,t,n,r,i){return t0(),Yk(i),t.flags|=256,Co(e,t,n,r),t.child}var I9={dehydrated:null,treeContext:null,retryLane:0};function R9(e){return{baseLanes:e,cachePool:null,transitions:null}}function TH(e,t,n){var r=t.pendingProps,i=kr.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),rr(kr,i&1),e===null)return E9(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=mx(a,r,0,null),e=Vh(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=R9(n),t.memoizedState=I9,e):lE(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return P2e(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Fd(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=Fd(s,o):(o=Vh(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?R9(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=I9,r}return o=e.child,e=o.sibling,r=Fd(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function lE(e,t){return t=mx({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vb(e,t,n,r){return r!==null&&Yk(r),n0(t,e.child,null,n),e=lE(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function P2e(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=Z6(Error(Ve(422))),vb(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=mx({mode:"visible",children:r.children},i,0,null),o=Vh(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&n0(t,e.child,null,a),t.child.memoizedState=R9(a),t.memoizedState=I9,o);if(!(t.mode&1))return vb(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(Ve(419)),r=Z6(o,r,void 0),vb(e,t,a,r)}if(s=(a&e.childLanes)!==0,Zo||s){if(r=Li,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,oc(e,i),Zs(r,e,i,-1))}return pE(),r=Z6(Error(Ve(421))),vb(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=$2e.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Pa=Dd(i.nextSibling),Aa=t,br=!0,Hs=null,e!==null&&(Qa[Ja++]=qu,Qa[Ja++]=Yu,Qa[Ja++]=Xh,qu=e.id,Yu=e.overflow,Xh=t),t=lE(t,r.children),t.flags|=4096,t)}function WM(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),P9(e.return,t,n)}function Q6(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function LH(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Co(e,t,r.children,n),r=kr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&WM(e,n,t);else if(e.tag===19)WM(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(rr(kr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&A5(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Q6(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&A5(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Q6(t,!0,n,null,o);break;case"together":Q6(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function _4(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qh|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Ve(153));if(t.child!==null){for(e=t.child,n=Fd(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fd(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function T2e(e,t,n){switch(t.tag){case 3:PH(t),t0();break;case 5:nH(t);break;case 1:ta(t.type)&&_5(t);break;case 4:eE(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;rr(P5,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(rr(kr,kr.current&1),t.flags|=128,null):n&t.child.childLanes?TH(e,t,n):(rr(kr,kr.current&1),e=ac(e,t,n),e!==null?e.sibling:null);rr(kr,kr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return LH(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),rr(kr,kr.current),r)break;return null;case 22:case 23:return t.lanes=0,kH(e,t,n)}return ac(e,t,n)}var AH,D9,OH,MH;AH=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};D9=function(){};OH=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ah(tu.current);var o=null;switch(n){case"input":i=r9(e,i),r=r9(e,r),o=[];break;case"select":i=Lr({},i,{value:void 0}),r=Lr({},r,{value:void 0}),o=[];break;case"textarea":i=a9(e,i),r=a9(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=w5)}l9(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(D2.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(D2.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ar("scroll",e),o||s===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};MH=function(e,t,n,r){n!==r&&(t.flags|=4)};function nv(e,t){if(!br)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ji(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function L2e(e,t,n){var r=t.pendingProps;switch(qk(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ji(t),null;case 1:return ta(t.type)&&C5(),Ji(t),null;case 3:return r=t.stateNode,r0(),hr(ea),hr(lo),nE(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(gb(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Hs!==null&&(V9(Hs),Hs=null))),D9(e,t),Ji(t),null;case 5:tE(t);var i=Ah(q2.current);if(n=t.type,e!==null&&t.stateNode!=null)OH(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Ve(166));return Ji(t),null}if(e=Ah(tu.current),gb(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Vl]=t,r[U2]=o,e=(t.mode&1)!==0,n){case"dialog":ar("cancel",r),ar("close",r);break;case"iframe":case"object":case"embed":ar("load",r);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Vl]=t,e[U2]=r,AH(e,t,!1,!1),t.stateNode=e;e:{switch(a=u9(n,r),n){case"dialog":ar("cancel",e),ar("close",e),i=r;break;case"iframe":case"object":case"embed":ar("load",e),i=r;break;case"video":case"audio":for(i=0;io0&&(t.flags|=128,r=!0,nv(o,!1),t.lanes=4194304)}else{if(!r)if(e=A5(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),nv(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!br)return Ji(t),null}else 2*Zr()-o.renderingStartTime>o0&&n!==1073741824&&(t.flags|=128,r=!0,nv(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Zr(),t.sibling=null,n=kr.current,rr(kr,r?n&1|2:n&1),t):(Ji(t),null);case 22:case 23:return hE(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ka&1073741824&&(Ji(t),t.subtreeFlags&6&&(t.flags|=8192)):Ji(t),null;case 24:return null;case 25:return null}throw Error(Ve(156,t.tag))}function A2e(e,t){switch(qk(t),t.tag){case 1:return ta(t.type)&&C5(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return r0(),hr(ea),hr(lo),nE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tE(t),null;case 13:if(hr(kr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ve(340));t0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return hr(kr),null;case 4:return r0(),null;case 10:return Zk(t.type._context),null;case 22:case 23:return hE(),null;case 24:return null;default:return null}}var yb=!1,io=!1,O2e=typeof WeakSet=="function"?WeakSet:Set,pt=null;function lm(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$r(e,t,r)}else n.current=null}function N9(e,t,n){try{n()}catch(r){$r(e,t,r)}}var UM=!1;function M2e(e,t){if(b9=b5,e=Nz(),Uk(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,d=0,h=e,m=null;t:for(;;){for(var y;h!==n||i!==0&&h.nodeType!==3||(s=a+i),h!==o||r!==0&&h.nodeType!==3||(l=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(y=h.firstChild)!==null;)m=h,h=y;for(;;){if(h===e)break t;if(m===n&&++u===i&&(s=a),m===o&&++d===r&&(l=a),(y=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=y}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(S9={focusedElem:e,selectionRange:n},b5=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){t=pt;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var x=b.memoizedProps,k=b.memoizedState,E=t.stateNode,_=E.getSnapshotBeforeUpdate(t.elementType===t.type?x:Fs(t.type,x),k);E.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var P=t.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ve(163))}}catch(A){$r(t,t.return,A)}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}return b=UM,UM=!1,b}function o2(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&N9(t,n,o)}i=i.next}while(i!==r)}}function px(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function j9(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function IH(e){var t=e.alternate;t!==null&&(e.alternate=null,IH(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vl],delete t[U2],delete t[C9],delete t[p2e],delete t[g2e])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function RH(e){return e.tag===5||e.tag===3||e.tag===4}function GM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||RH(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function B9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=w5));else if(r!==4&&(e=e.child,e!==null))for(B9(e,t,n),e=e.sibling;e!==null;)B9(e,t,n),e=e.sibling}function F9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(F9(e,t,n),e=e.sibling;e!==null;)F9(e,t,n),e=e.sibling}var Vi=null,$s=!1;function ud(e,t,n){for(n=n.child;n!==null;)DH(e,t,n),n=n.sibling}function DH(e,t,n){if(eu&&typeof eu.onCommitFiberUnmount=="function")try{eu.onCommitFiberUnmount(ax,n)}catch{}switch(n.tag){case 5:io||lm(n,t);case 6:var r=Vi,i=$s;Vi=null,ud(e,t,n),Vi=r,$s=i,Vi!==null&&($s?(e=Vi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Vi.removeChild(n.stateNode));break;case 18:Vi!==null&&($s?(e=Vi,n=n.stateNode,e.nodeType===8?U6(e.parentNode,n):e.nodeType===1&&U6(e,n),$2(e)):U6(Vi,n.stateNode));break;case 4:r=Vi,i=$s,Vi=n.stateNode.containerInfo,$s=!0,ud(e,t,n),Vi=r,$s=i;break;case 0:case 11:case 14:case 15:if(!io&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&N9(n,t,a),i=i.next}while(i!==r)}ud(e,t,n);break;case 1:if(!io&&(lm(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){$r(n,t,s)}ud(e,t,n);break;case 21:ud(e,t,n);break;case 22:n.mode&1?(io=(r=io)||n.memoizedState!==null,ud(e,t,n),io=r):ud(e,t,n);break;default:ud(e,t,n)}}function qM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new O2e),t.forEach(function(r){var i=z2e.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ds(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Zr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*R2e(r/1960))-r,10e?16:e,Pd===null)var r=!1;else{if(e=Pd,Pd=null,D5=0,pn&6)throw Error(Ve(331));var i=pn;for(pn|=4,pt=e.current;pt!==null;){var o=pt,a=o.child;if(pt.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lZr()-dE?Hh(e,0):cE|=n),na(e,t)}function VH(e,t){t===0&&(e.mode&1?(t=ub,ub<<=1,!(ub&130023424)&&(ub=4194304)):t=1);var n=Lo();e=oc(e,t),e!==null&&(Ly(e,t,n),na(e,n))}function $2e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),VH(e,n)}function z2e(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ve(314))}r!==null&&r.delete(t),VH(e,n)}var WH;WH=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ea.current)Zo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Zo=!1,T2e(e,t,n);Zo=!!(e.flags&131072)}else Zo=!1,br&&t.flags&1048576&&qz(t,E5,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_4(e,t),e=t.pendingProps;var i=e0(t,lo.current);Mm(t,n),i=iE(null,t,r,e,i,n);var o=oE();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ta(r)?(o=!0,_5(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Jk(t),i.updater=fx,t.stateNode=i,i._reactInternals=t,L9(t,r,e,n),t=M9(null,t,r,!0,o,n)):(t.tag=0,br&&o&&Gk(t),Co(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_4(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=V2e(r),e=Fs(r,e),i){case 0:t=O9(null,t,r,e,n);break e;case 1:t=HM(null,t,r,e,n);break e;case 11:t=$M(null,t,r,e,n);break e;case 14:t=zM(null,t,r,Fs(r.type,e),n);break e}throw Error(Ve(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fs(r,i),O9(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fs(r,i),HM(e,t,r,i,n);case 3:e:{if(PH(t),e===null)throw Error(Ve(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Zz(e,t),L5(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=i0(Error(Ve(423)),t),t=VM(e,t,r,n,i);break e}else if(r!==i){i=i0(Error(Ve(424)),t),t=VM(e,t,r,n,i);break e}else for(Pa=Dd(t.stateNode.containerInfo.firstChild),Aa=t,br=!0,Hs=null,n=tH(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(t0(),r===i){t=ac(e,t,n);break e}Co(e,t,r,n)}t=t.child}return t;case 5:return nH(t),e===null&&E9(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,x9(r,i)?a=null:o!==null&&x9(r,o)&&(t.flags|=32),EH(e,t),Co(e,t,a,n),t.child;case 6:return e===null&&E9(t),null;case 13:return TH(e,t,n);case 4:return eE(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=n0(t,null,r,n):Co(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fs(r,i),$M(e,t,r,i,n);case 7:return Co(e,t,t.pendingProps,n),t.child;case 8:return Co(e,t,t.pendingProps.children,n),t.child;case 12:return Co(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,rr(P5,r._currentValue),r._currentValue=a,o!==null)if(tl(o.value,a)){if(o.children===i.children&&!ea.current){t=ac(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ku(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),P9(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Ve(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),P9(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Co(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Mm(t,n),i=fs(i),r=r(i),t.flags|=1,Co(e,t,r,n),t.child;case 14:return r=t.type,i=Fs(r,t.pendingProps),i=Fs(r.type,i),zM(e,t,r,i,n);case 15:return _H(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fs(r,i),_4(e,t),t.tag=1,ta(r)?(e=!0,_5(t)):e=!1,Mm(t,n),Jz(t,r,i),L9(t,r,i,n),M9(null,t,r,!0,e,n);case 19:return LH(e,t,n);case 22:return kH(e,t,n)}throw Error(Ve(156,t.tag))};function UH(e,t){return vz(e,t)}function H2e(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function is(e,t,n,r){return new H2e(e,t,n,r)}function gE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function V2e(e){if(typeof e=="function")return gE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rk)return 11;if(e===Dk)return 14}return 2}function Fd(e,t){var n=e.alternate;return n===null?(n=is(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function P4(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")gE(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Jg:return Vh(n.children,i,o,t);case Ik:a=8,i|=8;break;case J7:return e=is(12,n,t,i|2),e.elementType=J7,e.lanes=o,e;case e9:return e=is(13,n,t,i),e.elementType=e9,e.lanes=o,e;case t9:return e=is(19,n,t,i),e.elementType=t9,e.lanes=o,e;case ez:return mx(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q$:a=10;break e;case J$:a=9;break e;case Rk:a=11;break e;case Dk:a=14;break e;case md:a=16,r=null;break e}throw Error(Ve(130,e==null?e:typeof e,""))}return t=is(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Vh(e,t,n,r){return e=is(7,e,r,t),e.lanes=n,e}function mx(e,t,n,r){return e=is(22,e,r,t),e.elementType=ez,e.lanes=n,e.stateNode={isHidden:!1},e}function J6(e,t,n){return e=is(6,e,null,t),e.lanes=n,e}function eC(e,t,n){return t=is(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function W2e(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=R6(0),this.expirationTimes=R6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R6(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function mE(e,t,n,r,i,o,a,s,l){return e=new W2e(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=is(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jk(o),e}function U2e(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=ja})(G1e);const xb=v_(el);var[X2e,Z2e]=Pn({strict:!1,name:"PortalManagerContext"});function KH(e){const{children:t,zIndex:n}=e;return N.createElement(X2e,{value:{zIndex:n}},t)}KH.displayName="PortalManager";var[XH,Q2e]=Pn({strict:!1,name:"PortalContext"}),SE="chakra-portal",J2e=".chakra-portal",eye=e=>N.createElement("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0}},e.children),tye=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=w.useState(null),o=w.useRef(null),[,a]=w.useState({});w.useEffect(()=>a({}),[]);const s=Q2e(),l=Z2e();Gs(()=>{if(!r)return;const d=r.ownerDocument,h=t?s??d.body:d.body;if(!h)return;o.current=d.createElement("div"),o.current.className=SE,h.appendChild(o.current),a({});const m=o.current;return()=>{h.contains(m)&&h.removeChild(m)}},[r]);const u=l!=null&&l.zIndex?N.createElement(eye,{zIndex:l==null?void 0:l.zIndex},n):n;return o.current?el.createPortal(N.createElement(XH,{value:o.current},u),o.current):N.createElement("span",{ref:d=>{d&&i(d)}})},nye=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=w.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=SE),l},[i]),[,s]=w.useState({});return Gs(()=>s({}),[]),Gs(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?el.createPortal(N.createElement(XH,{value:r?a:null},t),a):null};function cp(e){const{containerRef:t,...n}=e;return t?N.createElement(nye,{containerRef:t,...n}):N.createElement(tye,{...n})}cp.defaultProps={appendToParentPortal:!0};cp.className=SE;cp.selector=J2e;cp.displayName="Portal";var rye=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ag=new WeakMap,wb=new WeakMap,Cb={},tC=0,ZH=function(e){return e&&(e.host||ZH(e.parentNode))},iye=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ZH(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},oye=function(e,t,n,r){var i=iye(t,Array.isArray(e)?e:[e]);Cb[n]||(Cb[n]=new WeakMap);var o=Cb[n],a=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(s.has(m))d(m);else{var y=m.getAttribute(r),b=y!==null&&y!=="false",x=(Ag.get(m)||0)+1,k=(o.get(m)||0)+1;Ag.set(m,x),o.set(m,k),a.push(m),x===1&&b&&wb.set(m,!0),k===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}})};return d(t),s.clear(),tC++,function(){a.forEach(function(h){var m=Ag.get(h)-1,y=o.get(h)-1;Ag.set(h,m),o.set(h,y),m||(wb.has(h)||h.removeAttribute(r),wb.delete(h)),y||h.removeAttribute(n)}),tC--,tC||(Ag=new WeakMap,Ag=new WeakMap,wb=new WeakMap,Cb={})}},QH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||rye(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),oye(r,i,n,"aria-hidden")):function(){return null}};function xE(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var jn={},aye={get exports(){return jn},set exports(e){jn=e}},sye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",lye=sye,uye=lye;function JH(){}function eV(){}eV.resetWarningCache=JH;var cye=function(){function e(r,i,o,a,s,l){if(l!==uye){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:eV,resetWarningCache:JH};return n.PropTypes=n,n};aye.exports=cye();var W9="data-focus-lock",tV="data-focus-lock-disabled",dye="data-no-focus-lock",fye="data-autofocus-inside",hye="data-no-autofocus";function pye(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gye(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function nV(e,t){return gye(t||null,function(n){return e.forEach(function(r){return pye(r,n)})})}var nC={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function rV(e){return e}function iV(e,t){t===void 0&&(t=rV);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function wE(e,t){return t===void 0&&(t=rV),iV(e,t)}function oV(e){e===void 0&&(e={});var t=iV(null);return t.options=Hl({async:!0,ssr:!1},e),t}var aV=function(e){var t=e.sideCar,n=YF(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Hl({},n))};aV.isSideCarExport=!0;function mye(e,t){return e.useMedium(t),aV}var sV=wE({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),lV=wE(),vye=wE(),yye=oV({async:!0}),bye=[],CE=w.forwardRef(function(t,n){var r,i=w.useState(),o=i[0],a=i[1],s=w.useRef(),l=w.useRef(!1),u=w.useRef(null),d=t.children,h=t.disabled,m=t.noFocusGuards,y=t.persistentFocus,b=t.crossFrame,x=t.autoFocus;t.allowTextSelection;var k=t.group,E=t.className,_=t.whiteList,P=t.hasPositiveIndices,A=t.shards,M=A===void 0?bye:A,R=t.as,D=R===void 0?"div":R,j=t.lockProps,z=j===void 0?{}:j,H=t.sideCar,K=t.returnFocus,te=t.focusOptions,G=t.onActivation,F=t.onDeactivation,W=w.useState({}),X=W[0],Z=w.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&G&&G(s.current),l.current=!0},[G]),U=w.useCallback(function(){l.current=!1,F&&F(s.current)},[F]);w.useEffect(function(){h||(u.current=null)},[]);var Q=w.useCallback(function(rt){var We=u.current;if(We&&We.focus){var Be=typeof K=="function"?K(We):K;if(Be){var wt=typeof Be=="object"?Be:void 0;u.current=null,rt?Promise.resolve().then(function(){return We.focus(wt)}):We.focus(wt)}}},[K]),re=w.useCallback(function(rt){l.current&&sV.useMedium(rt)},[]),fe=lV.useMedium,Ee=w.useCallback(function(rt){s.current!==rt&&(s.current=rt,a(rt))},[]),be=bn((r={},r[tV]=h&&"disabled",r[W9]=k,r),z),ye=m!==!0,ze=ye&&m!=="tail",Me=nV([n,Ee]);return w.createElement(w.Fragment,null,ye&&[w.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:nC}),P?w.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:nC}):null],!h&&w.createElement(H,{id:X,sideCar:yye,observed:o,disabled:h,persistentFocus:y,crossFrame:b,autoFocus:x,whiteList:_,shards:M,onActivation:Z,onDeactivation:U,returnFocus:Q,focusOptions:te}),w.createElement(D,bn({ref:Me},be,{className:E,onBlur:fe,onFocus:re}),d),ze&&w.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:nC}))});CE.propTypes={};CE.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const uV=CE;function U9(e,t){return U9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},U9(e,t)}function _E(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,U9(e,t)}function cV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sye(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){_E(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return a};var h=d.prototype;return h.componentDidMount=function(){o.push(this),s()},h.componentDidUpdate=function(){s()},h.componentWillUnmount=function(){var y=o.indexOf(this);o.splice(y,1),s()},h.render=function(){return N.createElement(i,this.props)},d}(w.PureComponent);return cV(l,"displayName","SideEffect("+n(i)+")"),l}}var pu=function(e){for(var t=Array(e.length),n=0;n=0}).sort(Tye)},Lye=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],EE=Lye.join(","),Aye="".concat(EE,", [data-focus-guard]"),bV=function(e,t){var n;return pu(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,i){return r.concat(i.matches(t?Aye:EE)?[i]:[],bV(i))},[])},PE=function(e,t){return e.reduce(function(n,r){return n.concat(bV(r,t),r.parentNode?pu(r.parentNode.querySelectorAll(EE)).filter(function(i){return i===r}):[])},[])},Oye=function(e){var t=e.querySelectorAll("[".concat(fye,"]"));return pu(t).map(function(n){return PE([n])}).reduce(function(n,r){return n.concat(r)},[])},TE=function(e,t){return pu(e).filter(function(n){return hV(t,n)}).filter(function(n){return kye(n)})},tI=function(e,t){return t===void 0&&(t=new Map),pu(e).filter(function(n){return pV(t,n)})},q9=function(e,t,n){return yV(TE(PE(e,n),t),!0,n)},nI=function(e,t){return yV(TE(PE(e),t),!1)},Mye=function(e,t){return TE(Oye(e),t)},Q2=function(e,t){return e.shadowRoot?Q2(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:pu(e.children).some(function(n){return Q2(n,t)})},Iye=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},SV=function(e){return e.parentNode?SV(e.parentNode):e},LE=function(e){var t=G9(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(W9);return n.push.apply(n,i?Iye(pu(SV(r).querySelectorAll("[".concat(W9,'="').concat(i,'"]:not([').concat(tV,'="disabled"])')))):[r]),n},[])},xV=function(e){return e.activeElement?e.activeElement.shadowRoot?xV(e.activeElement.shadowRoot):e.activeElement:void 0},AE=function(){return document.activeElement?document.activeElement.shadowRoot?xV(document.activeElement.shadowRoot):document.activeElement:void 0},Rye=function(e){return e===document.activeElement},Dye=function(e){return Boolean(pu(e.querySelectorAll("iframe")).some(function(t){return Rye(t)}))},wV=function(e){var t=document&&AE();return!t||t.dataset&&t.dataset.focusGuard?!1:LE(e).some(function(n){return Q2(n,t)||Dye(n)})},Nye=function(){var e=document&&AE();return e?pu(document.querySelectorAll("[".concat(dye,"]"))).some(function(t){return Q2(t,e)}):!1},jye=function(e,t){return t.filter(vV).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},OE=function(e,t){return vV(e)&&e.name?jye(e,t):e},Bye=function(e){var t=new Set;return e.forEach(function(n){return t.add(OE(n,e))}),e.filter(function(n){return t.has(n)})},rI=function(e){return e[0]&&e.length>1?OE(e[0],e):e[0]},iI=function(e,t){return e.length>1?e.indexOf(OE(e[t],e)):t},CV="NEW_FOCUS",Fye=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=kE(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,d=r?e.indexOf(r):-1,h=l-u,m=t.indexOf(o),y=t.indexOf(a),b=Bye(t),x=n!==void 0?b.indexOf(n):-1,k=x-(r?b.indexOf(r):l),E=iI(e,0),_=iI(e,i-1);if(l===-1||d===-1)return CV;if(!h&&d>=0)return d;if(l<=m&&s&&Math.abs(h)>1)return _;if(l>=y&&s&&Math.abs(h)>1)return E;if(h&&Math.abs(k)>1)return d;if(l<=m)return _;if(l>y)return E;if(h)return Math.abs(h)>1?d:(i+d+h)%i}},$ye=function(e){return function(t){var n,r=(n=gV(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},zye=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=tI(r.filter($ye(n)));return i&&i.length?rI(i):rI(tI(t))},Y9=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Y9(e.parentNode.host||e.parentNode,t),t},rC=function(e,t){for(var n=Y9(e),r=Y9(t),i=0;i=0)return o}return!1},_V=function(e,t,n){var r=G9(e),i=G9(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=rC(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=rC(o,l);u&&(!a||Q2(u,a)?a=u:a=rC(u,a))})}),a},Hye=function(e,t){return e.reduce(function(n,r){return n.concat(Mye(r,t))},[])},Vye=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Pye)},Wye=function(e,t){var n=document&&AE(),r=LE(e).filter(B5),i=_V(n||e,e,r),o=new Map,a=nI(r,o),s=q9(r,o).filter(function(m){var y=m.node;return B5(y)});if(!(!s[0]&&(s=a,!s[0]))){var l=nI([i],o).map(function(m){var y=m.node;return y}),u=Vye(l,s),d=u.map(function(m){var y=m.node;return y}),h=Fye(d,l,n,t);return h===CV?{node:zye(a,d,Hye(r,o))}:h===void 0?h:u[h]}},Uye=function(e){var t=LE(e).filter(B5),n=_V(e,e,t),r=new Map,i=q9([n],r,!0),o=q9(t,r).filter(function(a){var s=a.node;return B5(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:kE(s)}})},Gye=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},iC=0,oC=!1,qye=function(e,t,n){n===void 0&&(n={});var r=Wye(e,t);if(!oC&&r){if(iC>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),oC=!0,setTimeout(function(){oC=!1},1);return}iC++,Gye(r.node,n.focusOptions),iC--}};const kV=qye;function EV(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var Yye=function(){return document&&document.activeElement===document.body},Kye=function(){return Yye()||Nye()},Rm=null,cm=null,Dm=null,J2=!1,Xye=function(){return!0},Zye=function(t){return(Rm.whiteList||Xye)(t)},Qye=function(t,n){Dm={observerNode:t,portaledElement:n}},Jye=function(t){return Dm&&Dm.portaledElement===t};function oI(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var e3e=function(t){return t&&"current"in t?t.current:t},t3e=function(t){return t?Boolean(J2):J2==="meanwhile"},n3e=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},r3e=function(t,n){return n.some(function(r){return n3e(t,r,r)})},F5=function(){var t=!1;if(Rm){var n=Rm,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||Dm&&Dm.portaledElement,d=document&&document.activeElement;if(u){var h=[u].concat(a.map(e3e).filter(Boolean));if((!d||Zye(d))&&(i||t3e(s)||!Kye()||!cm&&o)&&(u&&!(wV(h)||d&&r3e(d,h)||Jye(d))&&(document&&!cm&&d&&!o?(d.blur&&d.blur(),document.body.focus()):(t=kV(h,cm,{focusOptions:l}),Dm={})),J2=!1,cm=document&&document.activeElement),document){var m=document&&document.activeElement,y=Uye(h),b=y.map(function(x){var k=x.node;return k}).indexOf(m);b>-1&&(y.filter(function(x){var k=x.guard,E=x.node;return k&&E.dataset.focusAutoGuard}).forEach(function(x){var k=x.node;return k.removeAttribute("tabIndex")}),oI(b,y.length,1,y),oI(b,-1,-1,y))}}}return t},PV=function(t){F5()&&t&&(t.stopPropagation(),t.preventDefault())},ME=function(){return EV(F5)},i3e=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Qye(r,n)},o3e=function(){return null},TV=function(){J2="just",setTimeout(function(){J2="meanwhile"},0)},a3e=function(){document.addEventListener("focusin",PV),document.addEventListener("focusout",ME),window.addEventListener("blur",TV)},s3e=function(){document.removeEventListener("focusin",PV),document.removeEventListener("focusout",ME),window.removeEventListener("blur",TV)};function l3e(e){return e.filter(function(t){var n=t.disabled;return!n})}function u3e(e){var t=e.slice(-1)[0];t&&!Rm&&a3e();var n=Rm,r=n&&t&&t.id===n.id;Rm=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(cm=null,(!r||n.observed!==t.observed)&&t.onActivation(),F5(),EV(F5)):(s3e(),cm=null)}sV.assignSyncMedium(i3e);lV.assignMedium(ME);vye.assignMedium(function(e){return e({moveFocusInside:kV,focusInside:wV})});const c3e=Sye(l3e,u3e)(o3e);var LV=w.forwardRef(function(t,n){return w.createElement(uV,bn({sideCar:c3e,ref:n},t))}),AV=uV.propTypes||{};AV.sideCar;xE(AV,["sideCar"]);LV.propTypes={};const d3e=LV;var OV=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,d=w.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&N$(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),h=w.useCallback(()=>{var y;(y=n==null?void 0:n.current)==null||y.focus()},[n]),m=i&&!n;return N.createElement(d3e,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:d,onDeactivation:h,returnFocus:m},o)};OV.displayName="FocusLock";var T4="right-scroll-bar-position",L4="width-before-scroll-bar",f3e="with-scroll-bars-hidden",h3e="--removed-body-scroll-bar-size",MV=oV(),aC=function(){},xx=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:aC,onWheelCapture:aC,onTouchMoveCapture:aC}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,m=e.sideCar,y=e.noIsolation,b=e.inert,x=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,_=YF(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),P=m,A=nV([n,t]),M=Hl(Hl({},_),i);return w.createElement(w.Fragment,null,d&&w.createElement(P,{sideCar:MV,removeScrollBar:u,shards:h,noIsolation:y,inert:b,setCallbacks:o,allowPinchZoom:!!x,lockRef:n}),a?w.cloneElement(w.Children.only(s),Hl(Hl({},M),{ref:A})):w.createElement(E,Hl({},M,{className:l,ref:A}),s))});xx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xx.classNames={fullWidth:L4,zeroRight:T4};var p3e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function g3e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=p3e();return t&&e.setAttribute("nonce",t),e}function m3e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function v3e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var y3e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=g3e())&&(m3e(t,n),v3e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b3e=function(){var e=y3e();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},IV=function(){var e=b3e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},S3e={left:0,top:0,right:0,gap:0},sC=function(e){return parseInt(e||"",10)||0},x3e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[sC(n),sC(r),sC(i)]},w3e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return S3e;var t=x3e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},C3e=IV(),_3e=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(f3e,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; @@ -404,10 +404,10 @@ Error generating stack: `+o.message+` body { `).concat(h3e,": ").concat(s,`px; } -`)},k3e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=w.useMemo(function(){return w3e(i)},[i]);return w.createElement(C3e,{styles:_3e(o,!t,i,n?"":"!important")})},K9=!1;if(typeof window<"u")try{var _b=Object.defineProperty({},"passive",{get:function(){return K9=!0,!0}});window.addEventListener("test",_b,_b),window.removeEventListener("test",_b,_b)}catch{K9=!1}var Ag=K9?{passive:!1}:!1,E3e=function(e){return e.tagName==="TEXTAREA"},IV=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!E3e(e)&&n[t]==="visible")},P3e=function(e){return IV(e,"overflowY")},T3e=function(e){return IV(e,"overflowX")},oI=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=RV(e,n);if(r){var i=DV(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},L3e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},A3e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},RV=function(e,t){return e==="v"?P3e(t):T3e(t)},DV=function(e,t){return e==="v"?L3e(t):A3e(t)},O3e=function(e,t){return e==="h"&&t==="rtl"?-1:1},M3e=function(e,t,n,r,i){var o=O3e(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,d=a>0,h=0,m=0;do{var v=DV(e,s),b=v[0],S=v[1],_=v[2],E=S-_-o*b;(b||E)&&RV(e,s)&&(h+=E,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(i&&h===0||!i&&a>h)||!d&&(i&&m===0||!i&&-a>m))&&(u=!0),u},kb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},aI=function(e){return[e.deltaX,e.deltaY]},sI=function(e){return e&&"current"in e?e.current:e},I3e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},R3e=function(e){return` +`)},k3e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=w.useMemo(function(){return w3e(i)},[i]);return w.createElement(C3e,{styles:_3e(o,!t,i,n?"":"!important")})},K9=!1;if(typeof window<"u")try{var _b=Object.defineProperty({},"passive",{get:function(){return K9=!0,!0}});window.addEventListener("test",_b,_b),window.removeEventListener("test",_b,_b)}catch{K9=!1}var Og=K9?{passive:!1}:!1,E3e=function(e){return e.tagName==="TEXTAREA"},RV=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!E3e(e)&&n[t]==="visible")},P3e=function(e){return RV(e,"overflowY")},T3e=function(e){return RV(e,"overflowX")},aI=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=DV(e,n);if(r){var i=NV(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},L3e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},A3e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},DV=function(e,t){return e==="v"?P3e(t):T3e(t)},NV=function(e,t){return e==="v"?L3e(t):A3e(t)},O3e=function(e,t){return e==="h"&&t==="rtl"?-1:1},M3e=function(e,t,n,r,i){var o=O3e(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,d=a>0,h=0,m=0;do{var y=NV(e,s),b=y[0],x=y[1],k=y[2],E=x-k-o*b;(b||E)&&DV(e,s)&&(h+=E,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(i&&h===0||!i&&a>h)||!d&&(i&&m===0||!i&&-a>m))&&(u=!0),u},kb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sI=function(e){return[e.deltaX,e.deltaY]},lI=function(e){return e&&"current"in e?e.current:e},I3e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},R3e=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},D3e=0,Og=[];function N3e(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(D3e++)[0],o=w.useState(function(){return MV()})[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=z7([e.lockRef.current],(e.shards||[]).map(sI),!0).filter(Boolean);return S.forEach(function(_){return _.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(S,_){if("touches"in S&&S.touches.length===2)return!a.current.allowPinchZoom;var E=kb(S),k=n.current,T="deltaX"in S?S.deltaX:k[0]-E[0],A="deltaY"in S?S.deltaY:k[1]-E[1],M,R=S.target,D=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in S&&D==="h"&&R.type==="range")return!1;var j=oI(D,R);if(!j)return!0;if(j?M=D:(M=D==="v"?"h":"v",j=oI(D,R)),!j)return!1;if(!r.current&&"changedTouches"in S&&(T||A)&&(r.current=M),!M)return!0;var z=r.current||M;return M3e(z,_,S,z==="h"?T:A,!0)},[]),l=w.useCallback(function(S){var _=S;if(!(!Og.length||Og[Og.length-1]!==o)){var E="deltaY"in _?aI(_):kb(_),k=t.current.filter(function(M){return M.name===_.type&&M.target===_.target&&I3e(M.delta,E)})[0];if(k&&k.should){_.cancelable&&_.preventDefault();return}if(!k){var T=(a.current.shards||[]).map(sI).filter(Boolean).filter(function(M){return M.contains(_.target)}),A=T.length>0?s(_,T[0]):!a.current.noIsolation;A&&_.cancelable&&_.preventDefault()}}},[]),u=w.useCallback(function(S,_,E,k){var T={name:S,delta:_,target:E,should:k};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(A){return A!==T})},1)},[]),d=w.useCallback(function(S){n.current=kb(S),r.current=void 0},[]),h=w.useCallback(function(S){u(S.type,aI(S),S.target,s(S,e.lockRef.current))},[]),m=w.useCallback(function(S){u(S.type,kb(S),S.target,s(S,e.lockRef.current))},[]);w.useEffect(function(){return Og.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Ag),document.addEventListener("touchmove",l,Ag),document.addEventListener("touchstart",d,Ag),function(){Og=Og.filter(function(S){return S!==o}),document.removeEventListener("wheel",l,Ag),document.removeEventListener("touchmove",l,Ag),document.removeEventListener("touchstart",d,Ag)}},[]);var v=e.removeScrollBar,b=e.inert;return w.createElement(w.Fragment,null,b?w.createElement(o,{styles:R3e(i)}):null,v?w.createElement(k3e,{gapMode:"margin"}):null)}const j3e=mye(OV,N3e);var NV=w.forwardRef(function(e,t){return w.createElement(xx,Hl({},e,{ref:t,sideCar:j3e}))});NV.classNames=xx.classNames;const jV=NV;var cp=(...e)=>e.filter(Boolean).join(" ");function kv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var B3e=class{constructor(){sn(this,"modals");this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},X9=new B3e;function $3e(e,t){w.useEffect(()=>(t&&X9.add(e),()=>{X9.remove(e)}),[t,e])}function F3e(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=w.useRef(null),d=w.useRef(null),[h,m,v]=H3e(r,"chakra-modal","chakra-modal--header","chakra-modal--body");z3e(u,t&&a),$3e(u,t);const b=w.useRef(null),S=w.useCallback(j=>{b.current=j.target},[]),_=w.useCallback(j=>{j.key==="Escape"&&(j.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[E,k]=w.useState(!1),[T,A]=w.useState(!1),M=w.useCallback((j={},z=null)=>({role:"dialog",...j,ref:Hn(z,u),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":E?m:void 0,"aria-describedby":T?v:void 0,onClick:kv(j.onClick,H=>H.stopPropagation())}),[v,T,h,m,E]),R=w.useCallback(j=>{j.stopPropagation(),b.current===j.target&&X9.isTopModal(u)&&(i&&(n==null||n()),s==null||s())},[n,i,s]),D=w.useCallback((j={},z=null)=>({...j,ref:Hn(z,d),onClick:kv(j.onClick,R),onKeyDown:kv(j.onKeyDown,_),onMouseDown:kv(j.onMouseDown,S)}),[_,S,R]);return{isOpen:t,onClose:n,headerId:m,bodyId:v,setBodyMounted:A,setHeaderMounted:k,dialogRef:u,overlayRef:d,getDialogProps:M,getDialogContainerProps:D}}function z3e(e,t){const n=e.current;w.useEffect(()=>{if(!(!e.current||!t))return ZH(e.current)},[t,e,n])}function H3e(e,...t){const n=w.useId(),r=e||n;return w.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[V3e,dp]=Pn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[W3e,Kd]=Pn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Xd=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m,onCloseComplete:v}=e,b=Oi("Modal",e),_={...F3e(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m};return N.createElement(W3e,{value:_},N.createElement(V3e,{value:b},N.createElement(of,{onExitComplete:v},_.isOpen&&N.createElement(up,{...t},n))))};Xd.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};Xd.displayName="Modal";var o0=Ae((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=Kd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=cp("chakra-modal__body",n),s=dp();return N.createElement(Ce.div,{ref:t,className:a,id:i,...r,__css:s.body})});o0.displayName="ModalBody";var Iy=Ae((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=Kd(),a=cp("chakra-modal__close-btn",r),s=dp();return N.createElement(rx,{ref:t,__css:s.closeButton,className:a,onClick:kv(n,l=>{l.stopPropagation(),o()}),...i})});Iy.displayName="ModalCloseButton";function BV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:d}=Kd(),[h,m]=tk();return w.useEffect(()=>{!h&&m&&setTimeout(m)},[h,m]),N.createElement(AV,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:d},N.createElement(jV,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0},e.children))}var U3e={slideInBottom:{...V7,custom:{offsetY:16,reverse:!0}},slideInRight:{...V7,custom:{offsetX:16,reverse:!0}},scale:{...X$,custom:{initialScale:.95,reverse:!0}},none:{}},G3e=Ce(hu.section),q3e=e=>U3e[e||"none"],$V=w.forwardRef((e,t)=>{const{preset:n,motionProps:r=q3e(n),...i}=e;return N.createElement(G3e,{ref:t,...r,...i})});$V.displayName="ModalTransition";var Jh=Ae((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Kd(),u=s(a,t),d=l(i),h=cp("chakra-modal__content",n),m=dp(),v={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:S}=Kd();return N.createElement(BV,null,N.createElement(Ce.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:b},N.createElement($V,{preset:S,motionProps:o,className:h,...u,__css:v},r)))});Jh.displayName="ModalContent";var wx=Ae((e,t)=>{const{className:n,...r}=e,i=cp("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...dp().footer};return N.createElement(Ce.footer,{ref:t,...r,__css:a,className:i})});wx.displayName="ModalFooter";var _0=Ae((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=Kd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=cp("chakra-modal__header",n),l={flex:0,...dp().header};return N.createElement(Ce.header,{ref:t,className:a,id:i,...r,__css:l})});_0.displayName="ModalHeader";var Y3e=Ce(hu.div),Zd=Ae((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=cp("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...dp().overlay},{motionPreset:u}=Kd(),h=i||(u==="none"?{}:K$);return N.createElement(Y3e,{...h,__css:l,ref:t,className:a,...o})});Zd.displayName="ModalOverlay";function FV(e){const{leastDestructiveRef:t,...n}=e;return N.createElement(Xd,{...n,initialFocusRef:t})}var zV=Ae((e,t)=>N.createElement(Jh,{ref:t,role:"alertdialog",...e})),[mze,K3e]=Pn(),X3e=Ce(Z$),Z3e=Ae((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=Kd(),d=s(a,t),h=l(o),m=cp("chakra-modal__content",n),v=dp(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},S={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{placement:_}=K3e();return N.createElement(BV,null,N.createElement(Ce.div,{...h,className:"chakra-modal__content-container",__css:S},N.createElement(X3e,{motionProps:i,direction:_,in:u,className:m,...d,__css:b},r)))});Z3e.displayName="DrawerContent";function Q3e(e,t){const n=Er(e);w.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var HV=(...e)=>e.filter(Boolean).join(" "),lC=e=>e?!0:void 0;function Ml(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var J3e=e=>N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})),ebe=e=>N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"}));function lI(e,t,n,r){w.useEffect(()=>{if(!e.current||!r)return;const i=e.current.ownerDocument.defaultView??window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(s=>{for(const l of s)l.type==="attributes"&&l.attributeName&&o.includes(l.attributeName)&&n(l)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var tbe=50,uI=300;function nbe(e,t){const[n,r]=w.useState(!1),[i,o]=w.useState(null),[a,s]=w.useState(!0),l=w.useRef(null),u=()=>clearTimeout(l.current);Q3e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?tbe:null);const d=w.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},uI)},[e,a]),h=w.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},uI)},[t,a]),m=w.useCallback(()=>{s(!0),r(!1),u()},[]);return w.useEffect(()=>()=>u(),[]),{up:d,down:h,stop:m,isSpinning:n}}var rbe=/^[Ee0-9+\-.]$/;function ibe(e){return rbe.test(e)}function obe(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function abe(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:d,pattern:h="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:v,id:b,onChange:S,precision:_,name:E,"aria-describedby":k,"aria-label":T,"aria-labelledby":A,onFocus:M,onBlur:R,onInvalid:D,getAriaValueText:j,isValidCharacter:z,format:H,parse:K,...te}=e,G=Er(M),$=Er(R),W=Er(D),X=Er(z??ibe),Z=Er(j),U=Sme(e),{update:Q,increment:re,decrement:fe}=U,[Ee,be]=w.useState(!1),ye=!(s||l),Fe=w.useRef(null),Me=w.useRef(null),rt=w.useRef(null),Ve=w.useRef(null),je=w.useCallback(Te=>Te.split("").filter(X).join(""),[X]),wt=w.useCallback(Te=>(K==null?void 0:K(Te))??Te,[K]),Be=w.useCallback(Te=>((H==null?void 0:H(Te))??Te).toString(),[H]);Ud(()=>{(U.valueAsNumber>o||U.valueAsNumber{if(!Fe.current)return;if(Fe.current.value!=U.value){const At=wt(Fe.current.value);U.setValue(je(At))}},[wt,je]);const at=w.useCallback((Te=a)=>{ye&&re(Te)},[re,ye,a]),bt=w.useCallback((Te=a)=>{ye&&fe(Te)},[fe,ye,a]),Le=nbe(at,bt);lI(rt,"disabled",Le.stop,Le.isSpinning),lI(Ve,"disabled",Le.stop,Le.isSpinning);const ut=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;const ze=wt(Te.currentTarget.value);Q(je(ze)),Me.current={start:Te.currentTarget.selectionStart,end:Te.currentTarget.selectionEnd}},[Q,je,wt]),Mt=w.useCallback(Te=>{var At;G==null||G(Te),Me.current&&(Te.target.selectionStart=Me.current.start??((At=Te.currentTarget.value)==null?void 0:At.length),Te.currentTarget.selectionEnd=Me.current.end??Te.currentTarget.selectionStart)},[G]),ct=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;obe(Te,X)||Te.preventDefault();const At=_t(Te)*a,ze=Te.key,nn={ArrowUp:()=>at(At),ArrowDown:()=>bt(At),Home:()=>Q(i),End:()=>Q(o)}[ze];nn&&(Te.preventDefault(),nn(Te))},[X,a,at,bt,Q,i,o]),_t=Te=>{let At=1;return(Te.metaKey||Te.ctrlKey)&&(At=.1),Te.shiftKey&&(At=10),At},un=w.useMemo(()=>{const Te=Z==null?void 0:Z(U.value);if(Te!=null)return Te;const At=U.value.toString();return At||void 0},[U.value,Z]),ae=w.useCallback(()=>{let Te=U.value;if(U.value==="")return;/^[eE]/.test(U.value.toString())?U.setValue(""):(U.valueAsNumbero&&(Te=o),U.cast(Te))},[U,o,i]),De=w.useCallback(()=>{be(!1),n&&ae()},[n,be,ae]),Ke=w.useCallback(()=>{t&&requestAnimationFrame(()=>{var Te;(Te=Fe.current)==null||Te.focus()})},[t]),Xe=w.useCallback(Te=>{Te.preventDefault(),Le.up(),Ke()},[Ke,Le]),xe=w.useCallback(Te=>{Te.preventDefault(),Le.down(),Ke()},[Ke,Le]);Nh(()=>Fe.current,"wheel",Te=>{var At;const vt=(((At=Fe.current)==null?void 0:At.ownerDocument)??document).activeElement===Fe.current;if(!v||!vt)return;Te.preventDefault();const nn=_t(Te)*a,Rn=Math.sign(Te.deltaY);Rn===-1?at(nn):Rn===1&&bt(nn)},{passive:!1});const Ne=w.useCallback((Te={},At=null)=>{const ze=l||r&&U.isAtMax;return{...Te,ref:Hn(At,rt),role:"button",tabIndex:-1,onPointerDown:Ml(Te.onPointerDown,vt=>{vt.button!==0||ze||Xe(vt)}),onPointerLeave:Ml(Te.onPointerLeave,Le.stop),onPointerUp:Ml(Te.onPointerUp,Le.stop),disabled:ze,"aria-disabled":lC(ze)}},[U.isAtMax,r,Xe,Le.stop,l]),Ct=w.useCallback((Te={},At=null)=>{const ze=l||r&&U.isAtMin;return{...Te,ref:Hn(At,Ve),role:"button",tabIndex:-1,onPointerDown:Ml(Te.onPointerDown,vt=>{vt.button!==0||ze||xe(vt)}),onPointerLeave:Ml(Te.onPointerLeave,Le.stop),onPointerUp:Ml(Te.onPointerUp,Le.stop),disabled:ze,"aria-disabled":lC(ze)}},[U.isAtMin,r,xe,Le.stop,l]),Dt=w.useCallback((Te={},At=null)=>({name:E,inputMode:m,type:"text",pattern:h,"aria-labelledby":A,"aria-label":T,"aria-describedby":k,id:b,disabled:l,...Te,readOnly:Te.readOnly??s,"aria-readonly":Te.readOnly??s,"aria-required":Te.required??u,required:Te.required??u,ref:Hn(Fe,At),value:Be(U.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(U.valueAsNumber)?void 0:U.valueAsNumber,"aria-invalid":lC(d??U.isOutOfRange),"aria-valuetext":un,autoComplete:"off",autoCorrect:"off",onChange:Ml(Te.onChange,ut),onKeyDown:Ml(Te.onKeyDown,ct),onFocus:Ml(Te.onFocus,Mt,()=>be(!0)),onBlur:Ml(Te.onBlur,$,De)}),[E,m,h,A,T,Be,k,b,l,u,s,d,U.value,U.valueAsNumber,U.isOutOfRange,i,o,un,ut,ct,Mt,$,De]);return{value:Be(U.value),valueAsNumber:U.valueAsNumber,isFocused:Ee,isDisabled:l,isReadOnly:s,getIncrementButtonProps:Ne,getDecrementButtonProps:Ct,getInputProps:Dt,htmlProps:te}}var[sbe,Cx]=Pn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[lbe,IE]=Pn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),RE=Ae(function(t,n){const r=Oi("NumberInput",t),i=Sn(t),o=pk(i),{htmlProps:a,...s}=abe(o),l=w.useMemo(()=>s,[s]);return N.createElement(lbe,{value:l},N.createElement(sbe,{value:r},N.createElement(Ce.div,{...a,ref:n,className:HV("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});RE.displayName="NumberInput";var VV=Ae(function(t,n){const r=Cx();return N.createElement(Ce.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});VV.displayName="NumberInputStepper";var DE=Ae(function(t,n){const{getInputProps:r}=IE(),i=r(t,n),o=Cx();return N.createElement(Ce.input,{...i,className:HV("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});DE.displayName="NumberInputField";var WV=Ce("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),NE=Ae(function(t,n){const r=Cx(),{getDecrementButtonProps:i}=IE(),o=i(t,n);return N.createElement(WV,{...o,__css:r.stepper},t.children??N.createElement(J3e,null))});NE.displayName="NumberDecrementStepper";var jE=Ae(function(t,n){const{getIncrementButtonProps:r}=IE(),i=r(t,n),o=Cx();return N.createElement(WV,{...i,__css:o.stepper},t.children??N.createElement(ebe,null))});jE.displayName="NumberIncrementStepper";var Ry=(...e)=>e.filter(Boolean).join(" ");function ube(e,...t){return cbe(e)?e(...t):e}var cbe=e=>typeof e=="function";function Il(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function dbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[fbe,fp]=Pn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[hbe,Dy]=Pn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Mg={click:"click",hover:"hover"};function pbe(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=Mg.click,openDelay:d=200,closeDelay:h=200,isLazy:m,lazyBehavior:v="unmount",computePositionOnMount:b,...S}=e,{isOpen:_,onClose:E,onOpen:k,onToggle:T}=GF(e),A=w.useRef(null),M=w.useRef(null),R=w.useRef(null),D=w.useRef(!1),j=w.useRef(!1);_&&(j.current=!0);const[z,H]=w.useState(!1),[K,te]=w.useState(!1),G=w.useId(),$=i??G,[W,X,Z,U]=["popover-trigger","popover-content","popover-header","popover-body"].map(ut=>`${ut}-${$}`),{referenceRef:Q,getArrowProps:re,getPopperProps:fe,getArrowInnerProps:Ee,forceUpdate:be}=UF({...S,enabled:_||!!b}),ye=U1e({isOpen:_,ref:R});Lme({enabled:_,ref:M}),x0e(R,{focusRef:M,visible:_,shouldFocus:o&&u===Mg.click}),C0e(R,{focusRef:r,visible:_,shouldFocus:a&&u===Mg.click});const Fe=qF({wasSelected:j.current,enabled:m,mode:v,isSelected:ye.present}),Me=w.useCallback((ut={},Mt=null)=>{const ct={...ut,style:{...ut.style,transformOrigin:oi.transformOrigin.varRef,[oi.arrowSize.var]:s?`${s}px`:void 0,[oi.arrowShadowColor.var]:l},ref:Hn(R,Mt),children:Fe?ut.children:null,id:X,tabIndex:-1,role:"dialog",onKeyDown:Il(ut.onKeyDown,_t=>{n&&_t.key==="Escape"&&E()}),onBlur:Il(ut.onBlur,_t=>{const un=cI(_t),ae=uC(R.current,un),De=uC(M.current,un);_&&t&&(!ae&&!De)&&E()}),"aria-labelledby":z?Z:void 0,"aria-describedby":K?U:void 0};return u===Mg.hover&&(ct.role="tooltip",ct.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0}),ct.onMouseLeave=Il(ut.onMouseLeave,_t=>{_t.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>E(),h))})),ct},[Fe,X,z,Z,K,U,u,n,E,_,t,h,l,s]),rt=w.useCallback((ut={},Mt=null)=>fe({...ut,style:{visibility:_?"visible":"hidden",...ut.style}},Mt),[_,fe]),Ve=w.useCallback((ut,Mt=null)=>({...ut,ref:Hn(Mt,A,Q)}),[A,Q]),je=w.useRef(),wt=w.useRef(),Be=w.useCallback(ut=>{A.current==null&&Q(ut)},[Q]),at=w.useCallback((ut={},Mt=null)=>{const ct={...ut,ref:Hn(M,Mt,Be),id:W,"aria-haspopup":"dialog","aria-expanded":_,"aria-controls":X};return u===Mg.click&&(ct.onClick=Il(ut.onClick,T)),u===Mg.hover&&(ct.onFocus=Il(ut.onFocus,()=>{je.current===void 0&&k()}),ct.onBlur=Il(ut.onBlur,_t=>{const un=cI(_t),ae=!uC(R.current,un);_&&t&&ae&&E()}),ct.onKeyDown=Il(ut.onKeyDown,_t=>{_t.key==="Escape"&&E()}),ct.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0,je.current=window.setTimeout(()=>k(),d)}),ct.onMouseLeave=Il(ut.onMouseLeave,()=>{D.current=!1,je.current&&(clearTimeout(je.current),je.current=void 0),wt.current=window.setTimeout(()=>{D.current===!1&&E()},h)})),ct},[W,_,X,u,Be,T,k,t,E,d,h]);w.useEffect(()=>()=>{je.current&&clearTimeout(je.current),wt.current&&clearTimeout(wt.current)},[]);const bt=w.useCallback((ut={},Mt=null)=>({...ut,id:Z,ref:Hn(Mt,ct=>{H(!!ct)})}),[Z]),Le=w.useCallback((ut={},Mt=null)=>({...ut,id:U,ref:Hn(Mt,ct=>{te(!!ct)})}),[U]);return{forceUpdate:be,isOpen:_,onAnimationComplete:ye.onComplete,onClose:E,getAnchorProps:Ve,getArrowProps:re,getArrowInnerProps:Ee,getPopoverPositionerProps:rt,getPopoverProps:Me,getTriggerProps:at,getHeaderProps:bt,getBodyProps:Le}}function uC(e,t){return e===t||(e==null?void 0:e.contains(t))}function cI(e){const t=e.currentTarget.ownerDocument.activeElement;return e.relatedTarget??t}function BE(e){const t=Oi("Popover",e),{children:n,...r}=Sn(e),i=m0(),o=pbe({...r,direction:i.direction});return N.createElement(fbe,{value:o},N.createElement(hbe,{value:t},ube(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})))}BE.displayName="Popover";function $E(e){const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=fp(),a=Dy(),s=t??n??r;return N.createElement(Ce.div,{...i(),className:"chakra-popover__arrow-positioner"},N.createElement(Ce.div,{className:Ry("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}$E.displayName="PopoverArrow";var gbe=Ae(function(t,n){const{getBodyProps:r}=fp(),i=Dy();return N.createElement(Ce.div,{...r(t,n),className:Ry("chakra-popover__body",t.className),__css:i.body})});gbe.displayName="PopoverBody";var mbe=Ae(function(t,n){const{onClose:r}=fp(),i=Dy();return N.createElement(rx,{size:"sm",onClick:r,className:Ry("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});mbe.displayName="PopoverCloseButton";function vbe(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var ybe={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},bbe=Ce(hu.section),UV=Ae(function(t,n){const{variants:r=ybe,...i}=t,{isOpen:o}=fp();return N.createElement(bbe,{ref:n,variants:vbe(r),initial:!1,animate:o?"enter":"exit",...i})});UV.displayName="PopoverTransition";var FE=Ae(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=fp(),u=Dy(),d={position:"relative",display:"flex",flexDirection:"column",...u.content};return N.createElement(Ce.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},N.createElement(UV,{...i,...a(o,n),onAnimationComplete:dbe(l,o.onAnimationComplete),className:Ry("chakra-popover__content",t.className),__css:d}))});FE.displayName="PopoverContent";var Sbe=Ae(function(t,n){const{getHeaderProps:r}=fp(),i=Dy();return N.createElement(Ce.header,{...r(t,n),className:Ry("chakra-popover__header",t.className),__css:i.header})});Sbe.displayName="PopoverHeader";function zE(e){const t=w.Children.only(e.children),{getTriggerProps:n}=fp();return w.cloneElement(t,n(t.props,t.ref))}zE.displayName="PopoverTrigger";function xbe(e,t,n){return(e-t)*100/(n-t)}var wbe=rf({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),Cbe=rf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),_be=rf({"0%":{left:"-40%"},"100%":{left:"100%"}}),kbe=rf({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function GV(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=xbe(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var qV=e=>{const{size:t,isIndeterminate:n,...r}=e;return N.createElement(Ce.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${Cbe} 2s linear infinite`:void 0},...r})};qV.displayName="Shape";var Z9=e=>N.createElement(Ce.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});Z9.displayName="Circle";var Ebe=Ae((e,t)=>{const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:d="10px",color:h="#0078d4",trackColor:m="#edebe9",isIndeterminate:v,...b}=e,S=GV({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:v}),_=v?void 0:(S.percent??0)*2.64,E=_==null?void 0:`${_} ${264-_}`,k=v?{css:{animation:`${wbe} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:E,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},T={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return N.createElement(Ce.div,{ref:t,className:"chakra-progress",...S.bind,...b,__css:T},N.createElement(qV,{size:n,isIndeterminate:v},N.createElement(Z9,{stroke:m,strokeWidth:d,className:"chakra-progress__track"}),N.createElement(Z9,{stroke:h,strokeWidth:d,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:S.value===0&&!v?0:void 0,...k})),u)});Ebe.displayName="CircularProgress";var[Pbe,Tbe]=Pn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Lbe=Ae((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=GV({value:i,min:n,max:r,isIndeterminate:o,role:a}),d={height:"100%",...Tbe().filledTrack};return N.createElement(Ce.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:d})}),YV=Ae((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:d,"aria-label":h,"aria-labelledby":m,title:v,role:b,...S}=Sn(e),_=Oi("Progress",e),E=u??((n=_.track)==null?void 0:n.borderRadius),k={animation:`${kbe} 1s linear infinite`},M={...!d&&a&&s&&k,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${_be} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",..._.track};return N.createElement(Ce.div,{ref:t,borderRadius:E,__css:R,...S},N.createElement(Pbe,{value:_},N.createElement(Lbe,{"aria-label":h,"aria-labelledby":m,min:i,max:o,value:r,isIndeterminate:d,css:M,borderRadius:E,title:v,role:b}),l))});YV.displayName="Progress";var Abe=Ce("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});Abe.displayName="CircularProgressLabel";var Obe=(...e)=>e.filter(Boolean).join(" ");function dI(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var So=e=>e?"":void 0,cC=e=>e?!0:void 0;function Ns(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Mbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function Ibe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}function Rbe(e){return e&&dI(e)&&dI(e.target)}function Dbe(e={}){const{onChange:t,value:n,defaultValue:r,name:i,isDisabled:o,isFocusable:a,isNative:s,...l}=e,[u,d]=w.useState(r||""),h=typeof n<"u",m=h?n:u,v=w.useRef(null),b=w.useCallback(()=>{const M=v.current;if(!M)return;let R="input:not(:disabled):checked";const D=M.querySelector(R);if(D){D.focus();return}R="input:not(:disabled)";const j=M.querySelector(R);j==null||j.focus()},[]),_=`radio-${w.useId()}`,E=i||_,k=w.useCallback(M=>{const R=Rbe(M)?M.target.value:M;h||d(R),t==null||t(String(R))},[t,h]),T=w.useCallback((M={},R=null)=>({...M,ref:Hn(R,v),role:"radiogroup"}),[]),A=w.useCallback((M={},R=null)=>({...M,ref:R,name:E,[s?"checked":"isChecked"]:m!=null?M.value===m:void 0,onChange(j){k(j)},"data-radiogroup":!0}),[s,E,k,m]);return{getRootProps:T,getRadioProps:A,name:E,ref:v,focus:b,setValue:d,value:m,onChange:k,isDisabled:o,isFocusable:a,htmlProps:l}}var[Nbe,KV]=Pn({name:"RadioGroupContext",strict:!1}),XV=Ae((e,t)=>{const{colorScheme:n,size:r,variant:i,children:o,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:d,onChange:h,getRootProps:m,name:v,htmlProps:b}=Dbe(u),S=w.useMemo(()=>({name:v,size:r,onChange:h,colorScheme:n,value:d,variant:i,isDisabled:s,isFocusable:l}),[v,r,h,n,d,i,s,l]);return N.createElement(Nbe,{value:S},N.createElement(Ce.div,{...m(b,t),className:Obe("chakra-radio-group",a)},o))});XV.displayName="RadioGroup";var jbe={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function Bbe(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:i,isReadOnly:o,isRequired:a,onChange:s,isInvalid:l,name:u,value:d,id:h,"data-radiogroup":m,"aria-describedby":v,...b}=e,S=`radio-${w.useId()}`,_=ap(),k=!!KV()||!!m;let A=!!_&&!k?_.id:S;A=h??A;const M=i??(_==null?void 0:_.isDisabled),R=o??(_==null?void 0:_.isReadOnly),D=a??(_==null?void 0:_.isRequired),j=l??(_==null?void 0:_.isInvalid),[z,H]=w.useState(!1),[K,te]=w.useState(!1),[G,$]=w.useState(!1),[W,X]=w.useState(!1),[Z,U]=w.useState(Boolean(t)),Q=typeof n<"u",re=Q?n:Z;w.useEffect(()=>oF(H),[]);const fe=w.useCallback(Be=>{if(R||M){Be.preventDefault();return}Q||U(Be.target.checked),s==null||s(Be)},[Q,M,R,s]),Ee=w.useCallback(Be=>{Be.key===" "&&X(!0)},[X]),be=w.useCallback(Be=>{Be.key===" "&&X(!1)},[X]),ye=w.useCallback((Be={},at=null)=>({...Be,ref:at,"data-active":So(W),"data-hover":So(G),"data-disabled":So(M),"data-invalid":So(j),"data-checked":So(re),"data-focus":So(K),"data-focus-visible":So(K&&z),"data-readonly":So(R),"aria-hidden":!0,onMouseDown:Ns(Be.onMouseDown,()=>X(!0)),onMouseUp:Ns(Be.onMouseUp,()=>X(!1)),onMouseEnter:Ns(Be.onMouseEnter,()=>$(!0)),onMouseLeave:Ns(Be.onMouseLeave,()=>$(!1))}),[W,G,M,j,re,K,R,z]),{onFocus:Fe,onBlur:Me}=_??{},rt=w.useCallback((Be={},at=null)=>{const bt=M&&!r;return{...Be,id:A,ref:at,type:"radio",name:u,value:d,onChange:Ns(Be.onChange,fe),onBlur:Ns(Me,Be.onBlur,()=>te(!1)),onFocus:Ns(Fe,Be.onFocus,()=>te(!0)),onKeyDown:Ns(Be.onKeyDown,Ee),onKeyUp:Ns(Be.onKeyUp,be),checked:re,disabled:bt,readOnly:R,required:D,"aria-invalid":cC(j),"aria-disabled":cC(bt),"aria-required":cC(D),"data-readonly":So(R),"aria-describedby":v,style:jbe}},[M,r,A,u,d,fe,Me,Fe,Ee,be,re,R,D,j,v]);return{state:{isInvalid:j,isFocused:K,isChecked:re,isActive:W,isHovered:G,isDisabled:M,isReadOnly:R,isRequired:D},getCheckboxProps:ye,getInputProps:rt,getLabelProps:(Be={},at=null)=>({...Be,ref:at,onMouseDown:Ns(Be.onMouseDown,fI),onTouchStart:Ns(Be.onTouchStart,fI),"data-disabled":So(M),"data-checked":So(re),"data-invalid":So(j)}),getRootProps:(Be,at=null)=>({...Be,ref:at,"data-disabled":So(M),"data-checked":So(re),"data-invalid":So(j)}),htmlProps:b}}function fI(e){e.preventDefault(),e.stopPropagation()}var Ev=Ae((e,t)=>{const n=KV(),{onChange:r,value:i}=e,o=Oi("Radio",{...n,...e}),a=Sn(e),{spacing:s="0.5rem",children:l,isDisabled:u=n==null?void 0:n.isDisabled,isFocusable:d=n==null?void 0:n.isFocusable,inputProps:h,...m}=a;let v=e.isChecked;(n==null?void 0:n.value)!=null&&i!=null&&(v=n.value===i);let b=r;n!=null&&n.onChange&&i!=null&&(b=Mbe(n.onChange,r));const S=(e==null?void 0:e.name)??(n==null?void 0:n.name),{getInputProps:_,getCheckboxProps:E,getLabelProps:k,getRootProps:T,htmlProps:A}=Bbe({...m,isChecked:v,isFocusable:d,isDisabled:u,onChange:b,name:S}),[M,R]=Ibe(A,Tj),D=E(R),j=_(h,t),z=k(),H=Object.assign({},M,T()),K={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...o.container},te={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...o.control},G={userSelect:"none",marginStart:s,...o.label};return N.createElement(Ce.label,{className:"chakra-radio",...H,__css:K},N.createElement("input",{className:"chakra-radio__input",...j}),N.createElement(Ce.span,{className:"chakra-radio__control",...D,__css:te}),l&&N.createElement(Ce.span,{className:"chakra-radio__label",...z,__css:G},l))});Ev.displayName="Radio";var $be=(...e)=>e.filter(Boolean).join(" "),Fbe=e=>e?"":void 0;function zbe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var ZV=Ae(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return N.createElement(Ce.select,{...a,ref:n,className:$be("chakra-select",o)},i&&N.createElement("option",{value:""},i),r)});ZV.displayName="SelectField";var QV=Ae((e,t)=>{var n;const r=Oi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:d,minHeight:h,iconColor:m,iconSize:v,...b}=Sn(e),[S,_]=zbe(b,Tj),E=hk(_),k={width:"100%",height:"fit-content",position:"relative",color:s},T={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return N.createElement(Ce.div,{className:"chakra-select__wrapper",__css:k,...S,...i},N.createElement(ZV,{ref:t,height:u??l,minH:d??h,placeholder:o,...E,__css:T},e.children),N.createElement(JV,{"data-disabled":Fbe(E.disabled),...(m||s)&&{color:m||s},__css:r.icon,...v&&{fontSize:v}},a))});QV.displayName="Select";var Hbe=e=>N.createElement("svg",{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Vbe=Ce("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),JV=e=>{const{children:t=N.createElement(Hbe,null),...n}=e,r=w.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return N.createElement(Vbe,{...n,className:"chakra-select__icon-wrapper"},w.isValidElement(t)?r:null)};JV.displayName="SelectIcon";function Wbe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ube(e){const t=qbe(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function eW(e){return!!e.touches}function Gbe(e){return eW(e)&&e.touches.length>1}function qbe(e){return e.view??window}function Ybe(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Kbe(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function tW(e,t="page"){return eW(e)?Ybe(e,t):Kbe(e,t)}function Xbe(e){return t=>{const n=Ube(t);(!n||n&&t.button===0)&&e(t)}}function Zbe(e,t=!1){function n(i){e(i,{point:tW(i)})}return t?Xbe(n):n}function A4(e,t,n,r){return Wbe(e,t,Zbe(n,t==="pointerdown"),r)}function nW(e){const t=w.useRef(null);return t.current=e,t}var Qbe=class{constructor(e,t,n){sn(this,"history",[]);sn(this,"startEvent",null);sn(this,"lastEvent",null);sn(this,"lastEventInfo",null);sn(this,"handlers",{});sn(this,"removeListeners",()=>{});sn(this,"threshold",3);sn(this,"win");sn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=dC(this.lastEventInfo,this.history),t=this.startEvent!==null,n=n4e(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=NL();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});sn(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,fre.update(this.updatePoint,!0)});sn(this,"onPointerUp",(e,t)=>{const n=dC(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});if(this.win=e.view??window,Gbe(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:tW(e)},{timestamp:i}=NL();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,dC(r,this.history)),this.removeListeners=t4e(A4(this.win,"pointermove",this.onPointerMove),A4(this.win,"pointerup",this.onPointerUp),A4(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),hre.update(this.updatePoint)}};function hI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dC(e,t){return{point:e.point,delta:hI(e.point,t[t.length-1]),offset:hI(e.point,t[0]),velocity:e4e(t,.1)}}var Jbe=e=>e*1e3;function e4e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Jbe(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function t4e(...e){return t=>e.reduce((n,r)=>r(n),t)}function fC(e,t){return Math.abs(e-t)}function pI(e){return"x"in e&&"y"in e}function n4e(e,t){if(typeof e=="number"&&typeof t=="number")return fC(e,t);if(pI(e)&&pI(t)){const n=fC(e.x,t.x),r=fC(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function rW(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=w.useRef(null),d=nW({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(h,m){u.current=null,i==null||i(h,m)}});w.useEffect(()=>{var h;(h=u.current)==null||h.updateHandlers(d.current)}),w.useEffect(()=>{const h=e.current;if(!h||!l)return;function m(v){u.current=new Qbe(v,d.current,s)}return A4(h,"pointerdown",m)},[e,l,d,s]),w.useEffect(()=>()=>{var h;(h=u.current)==null||h.end(),u.current=null},[])}function r4e(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const[o]=i;let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;t({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var i4e=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:w.useEffect;function o4e(e,t){var n;if(!e||!e.parentElement)return;const r=((n=e.ownerDocument)==null?void 0:n.defaultView)??window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function iW({getNodes:e,observeMutation:t=!0}){const[n,r]=w.useState([]),[i,o]=w.useState(0);return i4e(()=>{const a=e(),s=a.map((l,u)=>r4e(l,d=>{r(h=>[...h.slice(0,u),d,...h.slice(u+1)])}));if(t){const l=a[0];s.push(o4e(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function a4e(e){return typeof e=="object"&&e!==null&&"current"in e}function s4e(e){const[t]=iW({observeMutation:!1,getNodes(){return[a4e(e)?e.current:e]}});return t}var l4e=Object.getOwnPropertyNames,u4e=(e,t)=>function(){return e&&(t=(0,e[l4e(e)[0]])(e=0)),t},cf=u4e({"../../../react-shim.js"(){}});cf();cf();cf();var es=e=>e?"":void 0,Dm=e=>e?!0:void 0,df=(...e)=>e.filter(Boolean).join(" ");cf();function Nm(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}cf();cf();function c4e(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Pv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var O4={width:0,height:0},Eb=e=>e||O4;function oW(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=S=>{const _=r[S]??O4;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Pv({orientation:t,vertical:{bottom:`calc(${n[S]}% - ${_.height/2}px)`},horizontal:{left:`calc(${n[S]}% - ${_.width/2}px)`}})}},a=t==="vertical"?r.reduce((S,_)=>Eb(S).height>Eb(_).height?S:_,O4):r.reduce((S,_)=>Eb(S).width>Eb(_).width?S:_,O4),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Pv({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Pv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,d=[0,i?100-n[0]:n[0]],h=u?d:n;let m=h[0];!u&&i&&(m=100-m);const v=Math.abs(h[h.length-1]-h[0]),b={...l,...Pv({orientation:t,vertical:i?{height:`${v}%`,top:`${m}%`}:{height:`${v}%`,bottom:`${m}%`},horizontal:i?{width:`${v}%`,right:`${m}%`}:{width:`${v}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function aW(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function d4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:S,"aria-valuetext":_,"aria-label":E,"aria-labelledby":k,name:T,focusThumbOnChange:A=!0,minStepsBetweenThumbs:M=0,...R}=e,D=Er(m),j=Er(v),z=Er(S),H=aW({isReversed:a,direction:s,orientation:l}),[K,te]=$S({value:i,defaultValue:o??[25,75],onChange:r});if(!Array.isArray(K))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof K}\``);const[G,$]=w.useState(!1),[W,X]=w.useState(!1),[Z,U]=w.useState(-1),Q=!(d||h),re=w.useRef(K),fe=K.map(Ze=>Em(Ze,t,n)),Ee=M*b,be=f4e(fe,t,n,Ee),ye=w.useRef({eventSource:null,value:[],valueBounds:[]});ye.current.value=fe,ye.current.valueBounds=be;const Fe=fe.map(Ze=>n-Ze+t),rt=(H?Fe:fe).map(Ze=>f5(Ze,t,n)),Ve=l==="vertical",je=w.useRef(null),wt=w.useRef(null),Be=iW({getNodes(){const Ze=wt.current,xt=Ze==null?void 0:Ze.querySelectorAll("[role=slider]");return xt?Array.from(xt):[]}}),at=w.useId(),Le=c4e(u??at),ut=w.useCallback(Ze=>{var xt;if(!je.current)return;ye.current.eventSource="pointer";const ht=je.current.getBoundingClientRect(),{clientX:Ht,clientY:rn}=((xt=Ze.touches)==null?void 0:xt[0])??Ze,pr=Ve?ht.bottom-rn:Ht-ht.left,Io=Ve?ht.height:ht.width;let Mi=pr/Io;return H&&(Mi=1-Mi),lF(Mi,t,n)},[Ve,H,n,t]),Mt=(n-t)/10,ct=b||(n-t)/100,_t=w.useMemo(()=>({setValueAtIndex(Ze,xt){if(!Q)return;const ht=ye.current.valueBounds[Ze];xt=parseFloat(Y7(xt,ht.min,ct)),xt=Em(xt,ht.min,ht.max);const Ht=[...ye.current.value];Ht[Ze]=xt,te(Ht)},setActiveIndex:U,stepUp(Ze,xt=ct){const ht=ye.current.value[Ze],Ht=H?ht-xt:ht+xt;_t.setValueAtIndex(Ze,Ht)},stepDown(Ze,xt=ct){const ht=ye.current.value[Ze],Ht=H?ht+xt:ht-xt;_t.setValueAtIndex(Ze,Ht)},reset(){te(re.current)}}),[ct,H,te,Q]),un=w.useCallback(Ze=>{const xt=Ze.key,Ht={ArrowRight:()=>_t.stepUp(Z),ArrowUp:()=>_t.stepUp(Z),ArrowLeft:()=>_t.stepDown(Z),ArrowDown:()=>_t.stepDown(Z),PageUp:()=>_t.stepUp(Z,Mt),PageDown:()=>_t.stepDown(Z,Mt),Home:()=>{const{min:rn}=be[Z];_t.setValueAtIndex(Z,rn)},End:()=>{const{max:rn}=be[Z];_t.setValueAtIndex(Z,rn)}}[xt];Ht&&(Ze.preventDefault(),Ze.stopPropagation(),Ht(Ze),ye.current.eventSource="keyboard")},[_t,Z,Mt,be]),{getThumbStyle:ae,rootStyle:De,trackStyle:Ke,innerTrackStyle:Xe}=w.useMemo(()=>oW({isReversed:H,orientation:l,thumbRects:Be,thumbPercents:rt}),[H,l,rt,Be]),xe=w.useCallback(Ze=>{var xt;const ht=Ze??Z;if(ht!==-1&&A){const Ht=Le.getThumb(ht),rn=(xt=wt.current)==null?void 0:xt.ownerDocument.getElementById(Ht);rn&&setTimeout(()=>rn.focus())}},[A,Z,Le]);Ud(()=>{ye.current.eventSource==="keyboard"&&(j==null||j(ye.current.value))},[fe,j]);const Ne=Ze=>{const xt=ut(Ze)||0,ht=ye.current.value.map(Mi=>Math.abs(Mi-xt)),Ht=Math.min(...ht);let rn=ht.indexOf(Ht);const pr=ht.filter(Mi=>Mi===Ht);pr.length>1&&xt>ye.current.value[rn]&&(rn=rn+pr.length-1),U(rn),_t.setValueAtIndex(rn,xt),xe(rn)},Ct=Ze=>{if(Z==-1)return;const xt=ut(Ze)||0;U(Z),_t.setValueAtIndex(Z,xt),xe(Z)};rW(wt,{onPanSessionStart(Ze){Q&&($(!0),Ne(Ze),D==null||D(ye.current.value))},onPanSessionEnd(){Q&&($(!1),j==null||j(ye.current.value))},onPan(Ze){Q&&Ct(Ze)}});const Dt=w.useCallback((Ze={},xt=null)=>({...Ze,...R,id:Le.root,ref:Hn(xt,wt),tabIndex:-1,"aria-disabled":Dm(d),"data-focused":es(W),style:{...Ze.style,...De}}),[R,d,W,De,Le]),Te=w.useCallback((Ze={},xt=null)=>({...Ze,ref:Hn(xt,je),id:Le.track,"data-disabled":es(d),style:{...Ze.style,...Ke}}),[d,Ke,Le]),At=w.useCallback((Ze={},xt=null)=>({...Ze,ref:xt,id:Le.innerTrack,style:{...Ze.style,...Xe}}),[Xe,Le]),ze=w.useCallback((Ze,xt=null)=>{const{index:ht,...Ht}=Ze,rn=fe[ht];if(rn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ht}\`. The \`value\` or \`defaultValue\` length is : ${fe.length}`);const pr=be[ht];return{...Ht,ref:xt,role:"slider",tabIndex:Q?0:void 0,id:Le.getThumb(ht),"data-active":es(G&&Z===ht),"aria-valuetext":(z==null?void 0:z(rn))??(_==null?void 0:_[ht]),"aria-valuemin":pr.min,"aria-valuemax":pr.max,"aria-valuenow":rn,"aria-orientation":l,"aria-disabled":Dm(d),"aria-readonly":Dm(h),"aria-label":E==null?void 0:E[ht],"aria-labelledby":E!=null&&E[ht]||k==null?void 0:k[ht],style:{...Ze.style,...ae(ht)},onKeyDown:Nm(Ze.onKeyDown,un),onFocus:Nm(Ze.onFocus,()=>{X(!0),U(ht)}),onBlur:Nm(Ze.onBlur,()=>{X(!1),U(-1)})}},[Le,fe,be,Q,G,Z,z,_,l,d,h,E,k,ae,un,X]),vt=w.useCallback((Ze={},xt=null)=>({...Ze,ref:xt,id:Le.output,htmlFor:fe.map((ht,Ht)=>Le.getThumb(Ht)).join(" "),"aria-live":"off"}),[Le,fe]),nn=w.useCallback((Ze,xt=null)=>{const{value:ht,...Ht}=Ze,rn=!(htn),pr=ht>=fe[0]&&ht<=fe[fe.length-1];let Io=f5(ht,t,n);Io=H?100-Io:Io;const Mi={position:"absolute",pointerEvents:"none",...Pv({orientation:l,vertical:{bottom:`${Io}%`},horizontal:{left:`${Io}%`}})};return{...Ht,ref:xt,id:Le.getMarker(Ze.value),role:"presentation","aria-hidden":!0,"data-disabled":es(d),"data-invalid":es(!rn),"data-highlighted":es(pr),style:{...Ze.style,...Mi}}},[d,H,n,t,l,fe,Le]),Rn=w.useCallback((Ze,xt=null)=>{const{index:ht,...Ht}=Ze;return{...Ht,ref:xt,id:Le.getInput(ht),type:"hidden",value:fe[ht],name:Array.isArray(T)?T[ht]:`${T}-${ht}`}},[T,fe,Le]);return{state:{value:fe,isFocused:W,isDragging:G,getThumbPercent:Ze=>rt[Ze],getThumbMinValue:Ze=>be[Ze].min,getThumbMaxValue:Ze=>be[Ze].max},actions:_t,getRootProps:Dt,getTrackProps:Te,getInnerTrackProps:At,getThumbProps:ze,getMarkerProps:nn,getInputProps:Rn,getOutputProps:vt}}function f4e(e,t,n,r){return e.map((i,o)=>{const a=o===0?t:e[o-1]+r,s=o===e.length-1?n:e[o+1]-r;return{min:a,max:s}})}var[h4e,_x]=Pn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[p4e,HE]=Pn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),sW=Ae(function(t,n){const r=Oi("Slider",t),i=Sn(t),{direction:o}=m0();i.direction=o;const{getRootProps:a,...s}=d4e(i),l=w.useMemo(()=>({...s,name:t.name}),[s,t.name]);return N.createElement(h4e,{value:l},N.createElement(p4e,{value:r},N.createElement(Ce.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});sW.defaultProps={orientation:"horizontal"};sW.displayName="RangeSlider";var g4e=Ae(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=_x(),a=HE(),s=r(t,n);return N.createElement(Ce.div,{...s,className:df("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&N.createElement("input",{...i({index:t.index})}))});g4e.displayName="RangeSliderThumb";var m4e=Ae(function(t,n){const{getTrackProps:r}=_x(),i=HE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:df("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});m4e.displayName="RangeSliderTrack";var v4e=Ae(function(t,n){const{getInnerTrackProps:r}=_x(),i=HE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});v4e.displayName="RangeSliderFilledTrack";var y4e=Ae(function(t,n){const{getMarkerProps:r}=_x(),i=r(t,n);return N.createElement(Ce.div,{...i,className:df("chakra-slider__marker",t.className)})});y4e.displayName="RangeSliderMark";cf();cf();function b4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:S,"aria-valuetext":_,"aria-label":E,"aria-labelledby":k,name:T,focusThumbOnChange:A=!0,...M}=e,R=Er(m),D=Er(v),j=Er(S),z=aW({isReversed:a,direction:s,orientation:l}),[H,K]=$S({value:i,defaultValue:o??x4e(t,n),onChange:r}),[te,G]=w.useState(!1),[$,W]=w.useState(!1),X=!(d||h),Z=(n-t)/10,U=b||(n-t)/100,Q=Em(H,t,n),re=n-Q+t,Ee=f5(z?re:Q,t,n),be=l==="vertical",ye=nW({min:t,max:n,step:b,isDisabled:d,value:Q,isInteractive:X,isReversed:z,isVertical:be,eventSource:null,focusThumbOnChange:A,orientation:l}),Fe=w.useRef(null),Me=w.useRef(null),rt=w.useRef(null),Ve=w.useId(),je=u??Ve,[wt,Be]=[`slider-thumb-${je}`,`slider-track-${je}`],at=w.useCallback(ze=>{var vt;if(!Fe.current)return;const nn=ye.current;nn.eventSource="pointer";const Rn=Fe.current.getBoundingClientRect(),{clientX:Ze,clientY:xt}=((vt=ze.touches)==null?void 0:vt[0])??ze,ht=be?Rn.bottom-xt:Ze-Rn.left,Ht=be?Rn.height:Rn.width;let rn=ht/Ht;z&&(rn=1-rn);let pr=lF(rn,nn.min,nn.max);return nn.step&&(pr=parseFloat(Y7(pr,nn.min,nn.step))),pr=Em(pr,nn.min,nn.max),pr},[be,z,ye]),bt=w.useCallback(ze=>{const vt=ye.current;vt.isInteractive&&(ze=parseFloat(Y7(ze,vt.min,U)),ze=Em(ze,vt.min,vt.max),K(ze))},[U,K,ye]),Le=w.useMemo(()=>({stepUp(ze=U){const vt=z?Q-ze:Q+ze;bt(vt)},stepDown(ze=U){const vt=z?Q+ze:Q-ze;bt(vt)},reset(){bt(o||0)},stepTo(ze){bt(ze)}}),[bt,z,Q,U,o]),ut=w.useCallback(ze=>{const vt=ye.current,Rn={ArrowRight:()=>Le.stepUp(),ArrowUp:()=>Le.stepUp(),ArrowLeft:()=>Le.stepDown(),ArrowDown:()=>Le.stepDown(),PageUp:()=>Le.stepUp(Z),PageDown:()=>Le.stepDown(Z),Home:()=>bt(vt.min),End:()=>bt(vt.max)}[ze.key];Rn&&(ze.preventDefault(),ze.stopPropagation(),Rn(ze),vt.eventSource="keyboard")},[Le,bt,Z,ye]),Mt=(j==null?void 0:j(Q))??_,ct=s4e(Me),{getThumbStyle:_t,rootStyle:un,trackStyle:ae,innerTrackStyle:De}=w.useMemo(()=>{const ze=ye.current,vt=ct??{width:0,height:0};return oW({isReversed:z,orientation:ze.orientation,thumbRects:[vt],thumbPercents:[Ee]})},[z,ct,Ee,ye]),Ke=w.useCallback(()=>{ye.current.focusThumbOnChange&&setTimeout(()=>{var vt;return(vt=Me.current)==null?void 0:vt.focus()})},[ye]);Ud(()=>{const ze=ye.current;Ke(),ze.eventSource==="keyboard"&&(D==null||D(ze.value))},[Q,D]);function Xe(ze){const vt=at(ze);vt!=null&&vt!==ye.current.value&&K(vt)}rW(rt,{onPanSessionStart(ze){const vt=ye.current;vt.isInteractive&&(G(!0),Ke(),Xe(ze),R==null||R(vt.value))},onPanSessionEnd(){const ze=ye.current;ze.isInteractive&&(G(!1),D==null||D(ze.value))},onPan(ze){ye.current.isInteractive&&Xe(ze)}});const xe=w.useCallback((ze={},vt=null)=>({...ze,...M,ref:Hn(vt,rt),tabIndex:-1,"aria-disabled":Dm(d),"data-focused":es($),style:{...ze.style,...un}}),[M,d,$,un]),Ne=w.useCallback((ze={},vt=null)=>({...ze,ref:Hn(vt,Fe),id:Be,"data-disabled":es(d),style:{...ze.style,...ae}}),[d,Be,ae]),Ct=w.useCallback((ze={},vt=null)=>({...ze,ref:vt,style:{...ze.style,...De}}),[De]),Dt=w.useCallback((ze={},vt=null)=>({...ze,ref:Hn(vt,Me),role:"slider",tabIndex:X?0:void 0,id:wt,"data-active":es(te),"aria-valuetext":Mt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":Q,"aria-orientation":l,"aria-disabled":Dm(d),"aria-readonly":Dm(h),"aria-label":E,"aria-labelledby":E?void 0:k,style:{...ze.style,..._t(0)},onKeyDown:Nm(ze.onKeyDown,ut),onFocus:Nm(ze.onFocus,()=>W(!0)),onBlur:Nm(ze.onBlur,()=>W(!1))}),[X,wt,te,Mt,t,n,Q,l,d,h,E,k,_t,ut]),Te=w.useCallback((ze,vt=null)=>{const nn=!(ze.valuen),Rn=Q>=ze.value,Ze=f5(ze.value,t,n),xt={position:"absolute",pointerEvents:"none",...S4e({orientation:l,vertical:{bottom:z?`${100-Ze}%`:`${Ze}%`},horizontal:{left:z?`${100-Ze}%`:`${Ze}%`}})};return{...ze,ref:vt,role:"presentation","aria-hidden":!0,"data-disabled":es(d),"data-invalid":es(!nn),"data-highlighted":es(Rn),style:{...ze.style,...xt}}},[d,z,n,t,l,Q]),At=w.useCallback((ze={},vt=null)=>({...ze,ref:vt,type:"hidden",value:Q,name:T}),[T,Q]);return{state:{value:Q,isFocused:$,isDragging:te},actions:Le,getRootProps:xe,getTrackProps:Ne,getInnerTrackProps:Ct,getThumbProps:Dt,getMarkerProps:Te,getInputProps:At}}function S4e(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function x4e(e,t){return t"}),[C4e,Ex]=Pn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),VE=Ae((e,t)=>{const n=Oi("Slider",e),r=Sn(e),{direction:i}=m0();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=b4e(r),l=a(),u=o({},t);return N.createElement(w4e,{value:s},N.createElement(C4e,{value:n},N.createElement(Ce.div,{...l,className:df("chakra-slider",e.className),__css:n.container},e.children,N.createElement("input",{...u}))))});VE.defaultProps={orientation:"horizontal"};VE.displayName="Slider";var lW=Ae((e,t)=>{const{getThumbProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:df("chakra-slider__thumb",e.className),__css:r.thumb})});lW.displayName="SliderThumb";var uW=Ae((e,t)=>{const{getTrackProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:df("chakra-slider__track",e.className),__css:r.track})});uW.displayName="SliderTrack";var cW=Ae((e,t)=>{const{getInnerTrackProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:df("chakra-slider__filled-track",e.className),__css:r.filledTrack})});cW.displayName="SliderFilledTrack";var Q9=Ae((e,t)=>{const{getMarkerProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:df("chakra-slider__marker",e.className),__css:r.mark})});Q9.displayName="SliderMark";var _4e=(...e)=>e.filter(Boolean).join(" "),gI=e=>e?"":void 0,WE=Ae(function(t,n){const r=Oi("Switch",t),{spacing:i="0.5rem",children:o,...a}=Sn(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:d,getLabelProps:h}=aF(a),m=w.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),v=w.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=w.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return N.createElement(Ce.label,{...d(),className:_4e("chakra-switch",t.className),__css:m},N.createElement("input",{className:"chakra-switch__input",...l({},n)}),N.createElement(Ce.span,{...u(),className:"chakra-switch__track",__css:v},N.createElement(Ce.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":gI(s.isChecked),"data-hover":gI(s.isHovered)})),o&&N.createElement(Ce.span,{className:"chakra-switch__label",...h(),__css:b},o))});WE.displayName="Switch";var k0=(...e)=>e.filter(Boolean).join(" ");function J9(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[k4e,dW,E4e,P4e]=bB();function T4e(e){const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[d,h]=w.useState(t??0),[m,v]=$S({defaultValue:t??0,value:r,onChange:n});w.useEffect(()=>{r!=null&&h(r)},[r]);const b=E4e(),S=w.useId();return{id:`tabs-${e.id??S}`,selectedIndex:m,focusedIndex:d,setSelectedIndex:v,setFocusedIndex:h,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:b,direction:l,htmlProps:u}}var[L4e,Ny]=Pn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function A4e(e){const{focusedIndex:t,orientation:n,direction:r}=Ny(),i=dW(),o=w.useCallback(a=>{const s=()=>{var k;const T=i.nextEnabled(t);T&&((k=T.node)==null||k.focus())},l=()=>{var k;const T=i.prevEnabled(t);T&&((k=T.node)==null||k.focus())},u=()=>{var k;const T=i.firstEnabled();T&&((k=T.node)==null||k.focus())},d=()=>{var k;const T=i.lastEnabled();T&&((k=T.node)==null||k.focus())},h=n==="horizontal",m=n==="vertical",v=a.key,b=r==="ltr"?"ArrowLeft":"ArrowRight",S=r==="ltr"?"ArrowRight":"ArrowLeft",E={[b]:()=>h&&l(),[S]:()=>h&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:u,End:d}[v];E&&(a.preventDefault(),E(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:J9(e.onKeyDown,o)}}function O4e(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=Ny(),{index:u,register:d}=P4e({disabled:t&&!n}),h=u===l,m=()=>{i(u)},v=()=>{s(u),!o&&!(t&&n)&&i(u)},b=c0e({...r,ref:Hn(d,e.ref),isDisabled:t,isFocusable:n,onClick:J9(e.onClick,m)}),S="button";return{...b,id:fW(a,u),role:"tab",tabIndex:h?0:-1,type:S,"aria-selected":h,"aria-controls":hW(a,u),onFocus:t?void 0:J9(e.onFocus,v)}}var[M4e,I4e]=Pn({});function R4e(e){const t=Ny(),{id:n,selectedIndex:r}=t,o=ex(e.children).map((a,s)=>w.createElement(M4e,{key:s,value:{isSelected:s===r,id:hW(n,s),tabId:fW(n,s),selectedIndex:r}},a));return{...e,children:o}}function D4e(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=Ny(),{isSelected:o,id:a,tabId:s}=I4e(),l=w.useRef(!1);o&&(l.current=!0);const u=qF({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function N4e(){const e=Ny(),t=dW(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=w.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=w.useState(!1);return Gs(()=>{if(n==null)return;const d=t.item(n);if(d==null)return;i&&s({left:d.node.offsetLeft,width:d.node.offsetWidth}),o&&s({top:d.node.offsetTop,height:d.node.offsetHeight});const h=requestAnimationFrame(()=>{u(!0)});return()=>{h&&cancelAnimationFrame(h)}},[n,i,o,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:l?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function fW(e,t){return`${e}--tab-${t}`}function hW(e,t){return`${e}--tabpanel-${t}`}var[j4e,jy]=Pn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),pW=Ae(function(t,n){const r=Oi("Tabs",t),{children:i,className:o,...a}=Sn(t),{htmlProps:s,descendants:l,...u}=T4e(a),d=w.useMemo(()=>u,[u]),{isFitted:h,...m}=s;return N.createElement(k4e,{value:l},N.createElement(L4e,{value:d},N.createElement(j4e,{value:r},N.createElement(Ce.div,{className:k0("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});pW.displayName="Tabs";var B4e=Ae(function(t,n){const r=N4e(),i={...t.style,...r},o=jy();return N.createElement(Ce.div,{ref:n,...t,className:k0("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});B4e.displayName="TabIndicator";var $4e=Ae(function(t,n){const r=A4e({...t,ref:n}),o={display:"flex",...jy().tablist};return N.createElement(Ce.div,{...r,className:k0("chakra-tabs__tablist",t.className),__css:o})});$4e.displayName="TabList";var gW=Ae(function(t,n){const r=D4e({...t,ref:n}),i=jy();return N.createElement(Ce.div,{outline:"0",...r,className:k0("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});gW.displayName="TabPanel";var mW=Ae(function(t,n){const r=R4e(t),i=jy();return N.createElement(Ce.div,{...r,width:"100%",ref:n,className:k0("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});mW.displayName="TabPanels";var vW=Ae(function(t,n){const r=jy(),i=O4e({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return N.createElement(Ce.button,{...i,className:k0("chakra-tabs__tab",t.className),__css:o})});vW.displayName="Tab";var F4e=(...e)=>e.filter(Boolean).join(" ");function z4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var H4e=["h","minH","height","minHeight"],UE=Ae((e,t)=>{const n=Oo("Textarea",e),{className:r,rows:i,...o}=Sn(e),a=hk(o),s=i?z4e(n,H4e):n;return N.createElement(Ce.textarea,{ref:t,rows:i,...a,className:F4e("chakra-textarea",r),__css:s})});UE.displayName="Textarea";function V4e(e,t){const n=Er(e);w.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function e8(e,...t){return W4e(e)?e(...t):e}var W4e=e=>typeof e=="function";function U4e(e,t){const n=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(i==null?void 0:i[t])??n}var G4e=(e,t)=>e.find(n=>n.id===t);function mI(e,t){const n=yW(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function yW(e,t){for(const[n,r]of Object.entries(e))if(G4e(r,t))return n}function q4e(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Y4e(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}var K4e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Wl=X4e(K4e);function X4e(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=Z4e(i,o),{position:s,id:l}=a;return r(u=>{const h=s.includes("top")?[a,...u[s]??[]]:[...u[s]??[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=mI(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:bW(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(d=>({...d,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=yW(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(mI(Wl.getState(),i).position)}}var vI=0;function Z4e(e,t={}){vI+=1;const n=t.id??vI,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Wl.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var Q4e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return N.createElement(J$,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},N.createElement(tF,null,l),N.createElement(Ce.div,{flex:"1",maxWidth:"100%"},i&&N.createElement(nF,{id:u==null?void 0:u.title},i),s&&N.createElement(eF,{id:u==null?void 0:u.description,display:"block"},s)),o&&N.createElement(rx,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function bW(e={}){const{render:t,toastComponent:n=Q4e}=e;return i=>typeof t=="function"?t({...i,...e}):N.createElement(n,{...i,...e})}function J4e(e,t){const n=i=>({...t,...i,position:U4e((i==null?void 0:i.position)??(t==null?void 0:t.position),e)}),r=i=>{const o=n(i),a=bW(o);return Wl.notify(a,o)};return r.update=(i,o)=>{Wl.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...e8(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...e8(o.error,s)}))},r.closeAll=Wl.closeAll,r.close=Wl.close,r.isActive=Wl.isActive,r}function By(e){const{theme:t}=mB();return w.useMemo(()=>J4e(t.direction,e),[e,t.direction])}var e5e={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},SW=w.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=e5e,toastSpacing:d="0.5rem"}=e,[h,m]=w.useState(s),v=Ufe();Ud(()=>{v||r==null||r()},[v]),Ud(()=>{m(s)},[s]);const b=()=>m(null),S=()=>m(s),_=()=>{v&&i()};w.useEffect(()=>{v&&o&&i()},[v,o,i]),V4e(_,h);const E=w.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:d,...l}),[l,d]),k=w.useMemo(()=>q4e(a),[a]);return N.createElement(hu.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:S,custom:{position:a},style:k},N.createElement(Ce.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:E},e8(n,{id:t,onClose:_})))});SW.displayName="ToastComponent";var t5e=e=>{const t=w.useSyncExternalStore(Wl.subscribe,Wl.getState,Wl.getState),{children:n,motionVariants:r,component:i=SW,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return N.createElement("ul",{role:"region","aria-live":"polite",key:l,id:`chakra-toast-manager-${l}`,style:Y4e(l)},N.createElement(of,{initial:!1},u.map(d=>N.createElement(i,{key:d.id,motionVariants:r,...d}))))});return N.createElement(N.Fragment,null,n,N.createElement(up,{...o},s))};function n5e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function r5e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var i5e={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};function rv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var F5=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},t8=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function o5e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:d,id:h,isOpen:m,defaultIsOpen:v,arrowSize:b=10,arrowShadowColor:S,arrowPadding:_,modifiers:E,isDisabled:k,gutter:T,offset:A,direction:M,...R}=e,{isOpen:D,onOpen:j,onClose:z}=GF({isOpen:m,defaultIsOpen:v,onOpen:l,onClose:u}),{referenceRef:H,getPopperProps:K,getArrowInnerProps:te,getArrowProps:G}=UF({enabled:D,placement:d,arrowPadding:_,modifiers:E,gutter:T,offset:A,direction:M}),$=w.useId(),X=`tooltip-${h??$}`,Z=w.useRef(null),U=w.useRef(),Q=w.useCallback(()=>{U.current&&(clearTimeout(U.current),U.current=void 0)},[]),re=w.useRef(),fe=w.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=void 0)},[]),Ee=w.useCallback(()=>{fe(),z()},[z,fe]),be=a5e(Z,Ee),ye=w.useCallback(()=>{if(!k&&!U.current){be();const at=t8(Z);U.current=at.setTimeout(j,t)}},[be,k,j,t]),Fe=w.useCallback(()=>{Q();const at=t8(Z);re.current=at.setTimeout(Ee,n)},[n,Ee,Q]),Me=w.useCallback(()=>{D&&r&&Fe()},[r,Fe,D]),rt=w.useCallback(()=>{D&&a&&Fe()},[a,Fe,D]),Ve=w.useCallback(at=>{D&&at.key==="Escape"&&Fe()},[D,Fe]);Nh(()=>F5(Z),"keydown",s?Ve:void 0),Nh(()=>F5(Z),"scroll",()=>{D&&o&&Ee()}),w.useEffect(()=>{k&&(Q(),D&&z())},[k,D,z,Q]),w.useEffect(()=>()=>{Q(),fe()},[Q,fe]),Nh(()=>Z.current,"pointerleave",Fe);const je=w.useCallback((at={},bt=null)=>({...at,ref:Hn(Z,bt,H),onPointerEnter:rv(at.onPointerEnter,ut=>{ut.pointerType!=="touch"&&ye()}),onClick:rv(at.onClick,Me),onPointerDown:rv(at.onPointerDown,rt),onFocus:rv(at.onFocus,ye),onBlur:rv(at.onBlur,Fe),"aria-describedby":D?X:void 0}),[ye,Fe,rt,D,X,Me,H]),wt=w.useCallback((at={},bt=null)=>K({...at,style:{...at.style,[oi.arrowSize.var]:b?`${b}px`:void 0,[oi.arrowShadowColor.var]:S}},bt),[K,b,S]),Be=w.useCallback((at={},bt=null)=>{const Le={...at.style,position:"relative",transformOrigin:oi.transformOrigin.varRef};return{ref:bt,...R,...at,id:X,role:"tooltip",style:Le}},[R,X]);return{isOpen:D,show:ye,hide:Fe,getTriggerProps:je,getTooltipProps:Be,getTooltipPositionerProps:wt,getArrowProps:G,getArrowInnerProps:te}}var hC="chakra-ui:close-tooltip";function a5e(e,t){return w.useEffect(()=>{const n=F5(e);return n.addEventListener(hC,t),()=>n.removeEventListener(hC,t)},[t,e]),()=>{const n=F5(e),r=t8(e);n.dispatchEvent(new r.CustomEvent(hC))}}var s5e=Ce(hu.div),uo=Ae((e,t)=>{const n=Oo("Tooltip",e),r=Sn(e),i=m0(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:d,portalProps:h,background:m,backgroundColor:v,bgColor:b,motionProps:S,..._}=r,E=m??v??d??b;if(E){n.bg=E;const z=hne(i,"colors",E);n[oi.arrowBg.var]=z}const k=o5e({..._,direction:i.direction}),T=typeof o=="string"||s;let A;if(T)A=N.createElement(Ce.span,{display:"inline-block",tabIndex:0,...k.getTriggerProps()},o);else{const z=w.Children.only(o);A=w.cloneElement(z,k.getTriggerProps(z.props,z.ref))}const M=!!l,R=k.getTooltipProps({},t),D=M?n5e(R,["role","id"]):R,j=r5e(R,["role","id"]);return a?N.createElement(N.Fragment,null,A,N.createElement(of,null,k.isOpen&&N.createElement(up,{...h},N.createElement(Ce.div,{...k.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},N.createElement(s5e,{variants:i5e,initial:"exit",animate:"enter",exit:"exit",...S,...D,__css:n},a,M&&N.createElement(Ce.span,{srOnly:!0,...j},l),u&&N.createElement(Ce.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},N.createElement(Ce.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))))))):N.createElement(N.Fragment,null,o)});uo.displayName="Tooltip";var l5e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=N.createElement(TF,{environment:a},t);return N.createElement(ice,{theme:o,cssVarsRoot:s},N.createElement(bj,{colorModeManager:n,options:o.config},i?N.createElement(wme,null):N.createElement(xme,null),N.createElement(ace,null),r?N.createElement(YH,{zIndex:r},l):l))};function u5e({children:e,theme:t=Kue,toastOptions:n,...r}){return N.createElement(l5e,{theme:t,...r},e,N.createElement(t5e,{...n}))}var n8={},yI=el;n8.createRoot=yI.createRoot,n8.hydrateRoot=yI.hydrateRoot;var r8={},c5e={get exports(){return r8},set exports(e){r8=e}},xW={};/** +`)},D3e=0,Mg=[];function N3e(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(D3e++)[0],o=w.useState(function(){return IV()})[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=z7([e.lockRef.current],(e.shards||[]).map(lI),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(x,k){if("touches"in x&&x.touches.length===2)return!a.current.allowPinchZoom;var E=kb(x),_=n.current,P="deltaX"in x?x.deltaX:_[0]-E[0],A="deltaY"in x?x.deltaY:_[1]-E[1],M,R=x.target,D=Math.abs(P)>Math.abs(A)?"h":"v";if("touches"in x&&D==="h"&&R.type==="range")return!1;var j=aI(D,R);if(!j)return!0;if(j?M=D:(M=D==="v"?"h":"v",j=aI(D,R)),!j)return!1;if(!r.current&&"changedTouches"in x&&(P||A)&&(r.current=M),!M)return!0;var z=r.current||M;return M3e(z,k,x,z==="h"?P:A,!0)},[]),l=w.useCallback(function(x){var k=x;if(!(!Mg.length||Mg[Mg.length-1]!==o)){var E="deltaY"in k?sI(k):kb(k),_=t.current.filter(function(M){return M.name===k.type&&M.target===k.target&&I3e(M.delta,E)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var P=(a.current.shards||[]).map(lI).filter(Boolean).filter(function(M){return M.contains(k.target)}),A=P.length>0?s(k,P[0]):!a.current.noIsolation;A&&k.cancelable&&k.preventDefault()}}},[]),u=w.useCallback(function(x,k,E,_){var P={name:x,delta:k,target:E,should:_};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(A){return A!==P})},1)},[]),d=w.useCallback(function(x){n.current=kb(x),r.current=void 0},[]),h=w.useCallback(function(x){u(x.type,sI(x),x.target,s(x,e.lockRef.current))},[]),m=w.useCallback(function(x){u(x.type,kb(x),x.target,s(x,e.lockRef.current))},[]);w.useEffect(function(){return Mg.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Og),document.addEventListener("touchmove",l,Og),document.addEventListener("touchstart",d,Og),function(){Mg=Mg.filter(function(x){return x!==o}),document.removeEventListener("wheel",l,Og),document.removeEventListener("touchmove",l,Og),document.removeEventListener("touchstart",d,Og)}},[]);var y=e.removeScrollBar,b=e.inert;return w.createElement(w.Fragment,null,b?w.createElement(o,{styles:R3e(i)}):null,y?w.createElement(k3e,{gapMode:"margin"}):null)}const j3e=mye(MV,N3e);var jV=w.forwardRef(function(e,t){return w.createElement(xx,Hl({},e,{ref:t,sideCar:j3e}))});jV.classNames=xx.classNames;const BV=jV;var dp=(...e)=>e.filter(Boolean).join(" ");function Ev(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var B3e=class{constructor(){sn(this,"modals");this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},X9=new B3e;function F3e(e,t){w.useEffect(()=>(t&&X9.add(e),()=>{X9.remove(e)}),[t,e])}function $3e(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=w.useRef(null),d=w.useRef(null),[h,m,y]=H3e(r,"chakra-modal","chakra-modal--header","chakra-modal--body");z3e(u,t&&a),F3e(u,t);const b=w.useRef(null),x=w.useCallback(j=>{b.current=j.target},[]),k=w.useCallback(j=>{j.key==="Escape"&&(j.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[E,_]=w.useState(!1),[P,A]=w.useState(!1),M=w.useCallback((j={},z=null)=>({role:"dialog",...j,ref:Hn(z,u),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":E?m:void 0,"aria-describedby":P?y:void 0,onClick:Ev(j.onClick,H=>H.stopPropagation())}),[y,P,h,m,E]),R=w.useCallback(j=>{j.stopPropagation(),b.current===j.target&&X9.isTopModal(u)&&(i&&(n==null||n()),s==null||s())},[n,i,s]),D=w.useCallback((j={},z=null)=>({...j,ref:Hn(z,d),onClick:Ev(j.onClick,R),onKeyDown:Ev(j.onKeyDown,k),onMouseDown:Ev(j.onMouseDown,x)}),[k,x,R]);return{isOpen:t,onClose:n,headerId:m,bodyId:y,setBodyMounted:A,setHeaderMounted:_,dialogRef:u,overlayRef:d,getDialogProps:M,getDialogContainerProps:D}}function z3e(e,t){const n=e.current;w.useEffect(()=>{if(!(!e.current||!t))return QH(e.current)},[t,e,n])}function H3e(e,...t){const n=w.useId(),r=e||n;return w.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[V3e,fp]=Pn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[W3e,Xd]=Pn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Zd=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m,onCloseComplete:y}=e,b=Oi("Modal",e),k={...$3e(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m};return N.createElement(W3e,{value:k},N.createElement(V3e,{value:b},N.createElement(af,{onExitComplete:y},k.isOpen&&N.createElement(cp,{...t},n))))};Zd.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};Zd.displayName="Modal";var a0=Ae((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=Xd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=dp("chakra-modal__body",n),s=fp();return N.createElement(Ce.div,{ref:t,className:a,id:i,...r,__css:s.body})});a0.displayName="ModalBody";var Iy=Ae((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=Xd(),a=dp("chakra-modal__close-btn",r),s=fp();return N.createElement(rx,{ref:t,__css:s.closeButton,className:a,onClick:Ev(n,l=>{l.stopPropagation(),o()}),...i})});Iy.displayName="ModalCloseButton";function FV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:d}=Xd(),[h,m]=tk();return w.useEffect(()=>{!h&&m&&setTimeout(m)},[h,m]),N.createElement(OV,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:d},N.createElement(BV,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0},e.children))}var U3e={slideInBottom:{...V7,custom:{offsetY:16,reverse:!0}},slideInRight:{...V7,custom:{offsetX:16,reverse:!0}},scale:{...ZF,custom:{initialScale:.95,reverse:!0}},none:{}},G3e=Ce(hu.section),q3e=e=>U3e[e||"none"],$V=w.forwardRef((e,t)=>{const{preset:n,motionProps:r=q3e(n),...i}=e;return N.createElement(G3e,{ref:t,...r,...i})});$V.displayName="ModalTransition";var ep=Ae((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Xd(),u=s(a,t),d=l(i),h=dp("chakra-modal__content",n),m=fp(),y={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:x}=Xd();return N.createElement(FV,null,N.createElement(Ce.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:b},N.createElement($V,{preset:x,motionProps:o,className:h,...u,__css:y},r)))});ep.displayName="ModalContent";var wx=Ae((e,t)=>{const{className:n,...r}=e,i=dp("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...fp().footer};return N.createElement(Ce.footer,{ref:t,...r,__css:a,className:i})});wx.displayName="ModalFooter";var k0=Ae((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=Xd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=dp("chakra-modal__header",n),l={flex:0,...fp().header};return N.createElement(Ce.header,{ref:t,className:a,id:i,...r,__css:l})});k0.displayName="ModalHeader";var Y3e=Ce(hu.div),Qd=Ae((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=dp("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...fp().overlay},{motionPreset:u}=Xd(),h=i||(u==="none"?{}:XF);return N.createElement(Y3e,{...h,__css:l,ref:t,className:a,...o})});Qd.displayName="ModalOverlay";function zV(e){const{leastDestructiveRef:t,...n}=e;return N.createElement(Zd,{...n,initialFocusRef:t})}var HV=Ae((e,t)=>N.createElement(ep,{ref:t,role:"alertdialog",...e})),[mze,K3e]=Pn(),X3e=Ce(QF),Z3e=Ae((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=Xd(),d=s(a,t),h=l(o),m=dp("chakra-modal__content",n),y=fp(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...y.dialog},x={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...y.dialogContainer},{placement:k}=K3e();return N.createElement(FV,null,N.createElement(Ce.div,{...h,className:"chakra-modal__content-container",__css:x},N.createElement(X3e,{motionProps:i,direction:k,in:u,className:m,...d,__css:b},r)))});Z3e.displayName="DrawerContent";function Q3e(e,t){const n=Er(e);w.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var VV=(...e)=>e.filter(Boolean).join(" "),lC=e=>e?!0:void 0;function Ml(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var J3e=e=>N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})),ebe=e=>N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"}));function uI(e,t,n,r){w.useEffect(()=>{if(!e.current||!r)return;const i=e.current.ownerDocument.defaultView??window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(s=>{for(const l of s)l.type==="attributes"&&l.attributeName&&o.includes(l.attributeName)&&n(l)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var tbe=50,cI=300;function nbe(e,t){const[n,r]=w.useState(!1),[i,o]=w.useState(null),[a,s]=w.useState(!0),l=w.useRef(null),u=()=>clearTimeout(l.current);Q3e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?tbe:null);const d=w.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},cI)},[e,a]),h=w.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},cI)},[t,a]),m=w.useCallback(()=>{s(!0),r(!1),u()},[]);return w.useEffect(()=>()=>u(),[]),{up:d,down:h,stop:m,isSpinning:n}}var rbe=/^[Ee0-9+\-.]$/;function ibe(e){return rbe.test(e)}function obe(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function abe(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:d,pattern:h="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:y,id:b,onChange:x,precision:k,name:E,"aria-describedby":_,"aria-label":P,"aria-labelledby":A,onFocus:M,onBlur:R,onInvalid:D,getAriaValueText:j,isValidCharacter:z,format:H,parse:K,...te}=e,G=Er(M),F=Er(R),W=Er(D),X=Er(z??ibe),Z=Er(j),U=Sme(e),{update:Q,increment:re,decrement:fe}=U,[Ee,be]=w.useState(!1),ye=!(s||l),ze=w.useRef(null),Me=w.useRef(null),rt=w.useRef(null),We=w.useRef(null),Be=w.useCallback(Te=>Te.split("").filter(X).join(""),[X]),wt=w.useCallback(Te=>(K==null?void 0:K(Te))??Te,[K]),Fe=w.useCallback(Te=>((H==null?void 0:H(Te))??Te).toString(),[H]);Gd(()=>{(U.valueAsNumber>o||U.valueAsNumber{if(!ze.current)return;if(ze.current.value!=U.value){const At=wt(ze.current.value);U.setValue(Be(At))}},[wt,Be]);const at=w.useCallback((Te=a)=>{ye&&re(Te)},[re,ye,a]),bt=w.useCallback((Te=a)=>{ye&&fe(Te)},[fe,ye,a]),Le=nbe(at,bt);uI(rt,"disabled",Le.stop,Le.isSpinning),uI(We,"disabled",Le.stop,Le.isSpinning);const ut=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;const He=wt(Te.currentTarget.value);Q(Be(He)),Me.current={start:Te.currentTarget.selectionStart,end:Te.currentTarget.selectionEnd}},[Q,Be,wt]),Mt=w.useCallback(Te=>{var At;G==null||G(Te),Me.current&&(Te.target.selectionStart=Me.current.start??((At=Te.currentTarget.value)==null?void 0:At.length),Te.currentTarget.selectionEnd=Me.current.end??Te.currentTarget.selectionStart)},[G]),ct=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;obe(Te,X)||Te.preventDefault();const At=_t(Te)*a,He=Te.key,nn={ArrowUp:()=>at(At),ArrowDown:()=>bt(At),Home:()=>Q(i),End:()=>Q(o)}[He];nn&&(Te.preventDefault(),nn(Te))},[X,a,at,bt,Q,i,o]),_t=Te=>{let At=1;return(Te.metaKey||Te.ctrlKey)&&(At=.1),Te.shiftKey&&(At=10),At},un=w.useMemo(()=>{const Te=Z==null?void 0:Z(U.value);if(Te!=null)return Te;const At=U.value.toString();return At||void 0},[U.value,Z]),ae=w.useCallback(()=>{let Te=U.value;if(U.value==="")return;/^[eE]/.test(U.value.toString())?U.setValue(""):(U.valueAsNumbero&&(Te=o),U.cast(Te))},[U,o,i]),De=w.useCallback(()=>{be(!1),n&&ae()},[n,be,ae]),Ke=w.useCallback(()=>{t&&requestAnimationFrame(()=>{var Te;(Te=ze.current)==null||Te.focus()})},[t]),Xe=w.useCallback(Te=>{Te.preventDefault(),Le.up(),Ke()},[Ke,Le]),xe=w.useCallback(Te=>{Te.preventDefault(),Le.down(),Ke()},[Ke,Le]);jh(()=>ze.current,"wheel",Te=>{var At;const vt=(((At=ze.current)==null?void 0:At.ownerDocument)??document).activeElement===ze.current;if(!y||!vt)return;Te.preventDefault();const nn=_t(Te)*a,Rn=Math.sign(Te.deltaY);Rn===-1?at(nn):Rn===1&&bt(nn)},{passive:!1});const Ne=w.useCallback((Te={},At=null)=>{const He=l||r&&U.isAtMax;return{...Te,ref:Hn(At,rt),role:"button",tabIndex:-1,onPointerDown:Ml(Te.onPointerDown,vt=>{vt.button!==0||He||Xe(vt)}),onPointerLeave:Ml(Te.onPointerLeave,Le.stop),onPointerUp:Ml(Te.onPointerUp,Le.stop),disabled:He,"aria-disabled":lC(He)}},[U.isAtMax,r,Xe,Le.stop,l]),Ct=w.useCallback((Te={},At=null)=>{const He=l||r&&U.isAtMin;return{...Te,ref:Hn(At,We),role:"button",tabIndex:-1,onPointerDown:Ml(Te.onPointerDown,vt=>{vt.button!==0||He||xe(vt)}),onPointerLeave:Ml(Te.onPointerLeave,Le.stop),onPointerUp:Ml(Te.onPointerUp,Le.stop),disabled:He,"aria-disabled":lC(He)}},[U.isAtMin,r,xe,Le.stop,l]),Dt=w.useCallback((Te={},At=null)=>({name:E,inputMode:m,type:"text",pattern:h,"aria-labelledby":A,"aria-label":P,"aria-describedby":_,id:b,disabled:l,...Te,readOnly:Te.readOnly??s,"aria-readonly":Te.readOnly??s,"aria-required":Te.required??u,required:Te.required??u,ref:Hn(ze,At),value:Fe(U.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(U.valueAsNumber)?void 0:U.valueAsNumber,"aria-invalid":lC(d??U.isOutOfRange),"aria-valuetext":un,autoComplete:"off",autoCorrect:"off",onChange:Ml(Te.onChange,ut),onKeyDown:Ml(Te.onKeyDown,ct),onFocus:Ml(Te.onFocus,Mt,()=>be(!0)),onBlur:Ml(Te.onBlur,F,De)}),[E,m,h,A,P,Fe,_,b,l,u,s,d,U.value,U.valueAsNumber,U.isOutOfRange,i,o,un,ut,ct,Mt,F,De]);return{value:Fe(U.value),valueAsNumber:U.valueAsNumber,isFocused:Ee,isDisabled:l,isReadOnly:s,getIncrementButtonProps:Ne,getDecrementButtonProps:Ct,getInputProps:Dt,htmlProps:te}}var[sbe,Cx]=Pn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[lbe,IE]=Pn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),RE=Ae(function(t,n){const r=Oi("NumberInput",t),i=Sn(t),o=pk(i),{htmlProps:a,...s}=abe(o),l=w.useMemo(()=>s,[s]);return N.createElement(lbe,{value:l},N.createElement(sbe,{value:r},N.createElement(Ce.div,{...a,ref:n,className:VV("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});RE.displayName="NumberInput";var WV=Ae(function(t,n){const r=Cx();return N.createElement(Ce.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});WV.displayName="NumberInputStepper";var DE=Ae(function(t,n){const{getInputProps:r}=IE(),i=r(t,n),o=Cx();return N.createElement(Ce.input,{...i,className:VV("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});DE.displayName="NumberInputField";var UV=Ce("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),NE=Ae(function(t,n){const r=Cx(),{getDecrementButtonProps:i}=IE(),o=i(t,n);return N.createElement(UV,{...o,__css:r.stepper},t.children??N.createElement(J3e,null))});NE.displayName="NumberDecrementStepper";var jE=Ae(function(t,n){const{getIncrementButtonProps:r}=IE(),i=r(t,n),o=Cx();return N.createElement(UV,{...i,__css:o.stepper},t.children??N.createElement(ebe,null))});jE.displayName="NumberIncrementStepper";var Ry=(...e)=>e.filter(Boolean).join(" ");function ube(e,...t){return cbe(e)?e(...t):e}var cbe=e=>typeof e=="function";function Il(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function dbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[fbe,hp]=Pn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[hbe,Dy]=Pn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Ig={click:"click",hover:"hover"};function pbe(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=Ig.click,openDelay:d=200,closeDelay:h=200,isLazy:m,lazyBehavior:y="unmount",computePositionOnMount:b,...x}=e,{isOpen:k,onClose:E,onOpen:_,onToggle:P}=q$(e),A=w.useRef(null),M=w.useRef(null),R=w.useRef(null),D=w.useRef(!1),j=w.useRef(!1);k&&(j.current=!0);const[z,H]=w.useState(!1),[K,te]=w.useState(!1),G=w.useId(),F=i??G,[W,X,Z,U]=["popover-trigger","popover-content","popover-header","popover-body"].map(ut=>`${ut}-${F}`),{referenceRef:Q,getArrowProps:re,getPopperProps:fe,getArrowInnerProps:Ee,forceUpdate:be}=G$({...x,enabled:k||!!b}),ye=U1e({isOpen:k,ref:R});Lme({enabled:k,ref:M}),x0e(R,{focusRef:M,visible:k,shouldFocus:o&&u===Ig.click}),C0e(R,{focusRef:r,visible:k,shouldFocus:a&&u===Ig.click});const ze=Y$({wasSelected:j.current,enabled:m,mode:y,isSelected:ye.present}),Me=w.useCallback((ut={},Mt=null)=>{const ct={...ut,style:{...ut.style,transformOrigin:oi.transformOrigin.varRef,[oi.arrowSize.var]:s?`${s}px`:void 0,[oi.arrowShadowColor.var]:l},ref:Hn(R,Mt),children:ze?ut.children:null,id:X,tabIndex:-1,role:"dialog",onKeyDown:Il(ut.onKeyDown,_t=>{n&&_t.key==="Escape"&&E()}),onBlur:Il(ut.onBlur,_t=>{const un=dI(_t),ae=uC(R.current,un),De=uC(M.current,un);k&&t&&(!ae&&!De)&&E()}),"aria-labelledby":z?Z:void 0,"aria-describedby":K?U:void 0};return u===Ig.hover&&(ct.role="tooltip",ct.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0}),ct.onMouseLeave=Il(ut.onMouseLeave,_t=>{_t.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>E(),h))})),ct},[ze,X,z,Z,K,U,u,n,E,k,t,h,l,s]),rt=w.useCallback((ut={},Mt=null)=>fe({...ut,style:{visibility:k?"visible":"hidden",...ut.style}},Mt),[k,fe]),We=w.useCallback((ut,Mt=null)=>({...ut,ref:Hn(Mt,A,Q)}),[A,Q]),Be=w.useRef(),wt=w.useRef(),Fe=w.useCallback(ut=>{A.current==null&&Q(ut)},[Q]),at=w.useCallback((ut={},Mt=null)=>{const ct={...ut,ref:Hn(M,Mt,Fe),id:W,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":X};return u===Ig.click&&(ct.onClick=Il(ut.onClick,P)),u===Ig.hover&&(ct.onFocus=Il(ut.onFocus,()=>{Be.current===void 0&&_()}),ct.onBlur=Il(ut.onBlur,_t=>{const un=dI(_t),ae=!uC(R.current,un);k&&t&&ae&&E()}),ct.onKeyDown=Il(ut.onKeyDown,_t=>{_t.key==="Escape"&&E()}),ct.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0,Be.current=window.setTimeout(()=>_(),d)}),ct.onMouseLeave=Il(ut.onMouseLeave,()=>{D.current=!1,Be.current&&(clearTimeout(Be.current),Be.current=void 0),wt.current=window.setTimeout(()=>{D.current===!1&&E()},h)})),ct},[W,k,X,u,Fe,P,_,t,E,d,h]);w.useEffect(()=>()=>{Be.current&&clearTimeout(Be.current),wt.current&&clearTimeout(wt.current)},[]);const bt=w.useCallback((ut={},Mt=null)=>({...ut,id:Z,ref:Hn(Mt,ct=>{H(!!ct)})}),[Z]),Le=w.useCallback((ut={},Mt=null)=>({...ut,id:U,ref:Hn(Mt,ct=>{te(!!ct)})}),[U]);return{forceUpdate:be,isOpen:k,onAnimationComplete:ye.onComplete,onClose:E,getAnchorProps:We,getArrowProps:re,getArrowInnerProps:Ee,getPopoverPositionerProps:rt,getPopoverProps:Me,getTriggerProps:at,getHeaderProps:bt,getBodyProps:Le}}function uC(e,t){return e===t||(e==null?void 0:e.contains(t))}function dI(e){const t=e.currentTarget.ownerDocument.activeElement;return e.relatedTarget??t}function BE(e){const t=Oi("Popover",e),{children:n,...r}=Sn(e),i=v0(),o=pbe({...r,direction:i.direction});return N.createElement(fbe,{value:o},N.createElement(hbe,{value:t},ube(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})))}BE.displayName="Popover";function FE(e){const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=hp(),a=Dy(),s=t??n??r;return N.createElement(Ce.div,{...i(),className:"chakra-popover__arrow-positioner"},N.createElement(Ce.div,{className:Ry("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}FE.displayName="PopoverArrow";var gbe=Ae(function(t,n){const{getBodyProps:r}=hp(),i=Dy();return N.createElement(Ce.div,{...r(t,n),className:Ry("chakra-popover__body",t.className),__css:i.body})});gbe.displayName="PopoverBody";var mbe=Ae(function(t,n){const{onClose:r}=hp(),i=Dy();return N.createElement(rx,{size:"sm",onClick:r,className:Ry("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});mbe.displayName="PopoverCloseButton";function vbe(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var ybe={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},bbe=Ce(hu.section),GV=Ae(function(t,n){const{variants:r=ybe,...i}=t,{isOpen:o}=hp();return N.createElement(bbe,{ref:n,variants:vbe(r),initial:!1,animate:o?"enter":"exit",...i})});GV.displayName="PopoverTransition";var $E=Ae(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=hp(),u=Dy(),d={position:"relative",display:"flex",flexDirection:"column",...u.content};return N.createElement(Ce.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},N.createElement(GV,{...i,...a(o,n),onAnimationComplete:dbe(l,o.onAnimationComplete),className:Ry("chakra-popover__content",t.className),__css:d}))});$E.displayName="PopoverContent";var Sbe=Ae(function(t,n){const{getHeaderProps:r}=hp(),i=Dy();return N.createElement(Ce.header,{...r(t,n),className:Ry("chakra-popover__header",t.className),__css:i.header})});Sbe.displayName="PopoverHeader";function zE(e){const t=w.Children.only(e.children),{getTriggerProps:n}=hp();return w.cloneElement(t,n(t.props,t.ref))}zE.displayName="PopoverTrigger";function xbe(e,t,n){return(e-t)*100/(n-t)}var wbe=of({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),Cbe=of({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),_be=of({"0%":{left:"-40%"},"100%":{left:"100%"}}),kbe=of({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function qV(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=xbe(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var YV=e=>{const{size:t,isIndeterminate:n,...r}=e;return N.createElement(Ce.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${Cbe} 2s linear infinite`:void 0},...r})};YV.displayName="Shape";var Z9=e=>N.createElement(Ce.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});Z9.displayName="Circle";var Ebe=Ae((e,t)=>{const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:d="10px",color:h="#0078d4",trackColor:m="#edebe9",isIndeterminate:y,...b}=e,x=qV({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:y}),k=y?void 0:(x.percent??0)*2.64,E=k==null?void 0:`${k} ${264-k}`,_=y?{css:{animation:`${wbe} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:E,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},P={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return N.createElement(Ce.div,{ref:t,className:"chakra-progress",...x.bind,...b,__css:P},N.createElement(YV,{size:n,isIndeterminate:y},N.createElement(Z9,{stroke:m,strokeWidth:d,className:"chakra-progress__track"}),N.createElement(Z9,{stroke:h,strokeWidth:d,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:x.value===0&&!y?0:void 0,..._})),u)});Ebe.displayName="CircularProgress";var[Pbe,Tbe]=Pn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Lbe=Ae((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=qV({value:i,min:n,max:r,isIndeterminate:o,role:a}),d={height:"100%",...Tbe().filledTrack};return N.createElement(Ce.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:d})}),KV=Ae((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:d,"aria-label":h,"aria-labelledby":m,title:y,role:b,...x}=Sn(e),k=Oi("Progress",e),E=u??((n=k.track)==null?void 0:n.borderRadius),_={animation:`${kbe} 1s linear infinite`},M={...!d&&a&&s&&_,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${_be} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",...k.track};return N.createElement(Ce.div,{ref:t,borderRadius:E,__css:R,...x},N.createElement(Pbe,{value:k},N.createElement(Lbe,{"aria-label":h,"aria-labelledby":m,min:i,max:o,value:r,isIndeterminate:d,css:M,borderRadius:E,title:y,role:b}),l))});KV.displayName="Progress";var Abe=Ce("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});Abe.displayName="CircularProgressLabel";var Obe=(...e)=>e.filter(Boolean).join(" ");function fI(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var So=e=>e?"":void 0,cC=e=>e?!0:void 0;function Ns(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Mbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function Ibe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}function Rbe(e){return e&&fI(e)&&fI(e.target)}function Dbe(e={}){const{onChange:t,value:n,defaultValue:r,name:i,isDisabled:o,isFocusable:a,isNative:s,...l}=e,[u,d]=w.useState(r||""),h=typeof n<"u",m=h?n:u,y=w.useRef(null),b=w.useCallback(()=>{const M=y.current;if(!M)return;let R="input:not(:disabled):checked";const D=M.querySelector(R);if(D){D.focus();return}R="input:not(:disabled)";const j=M.querySelector(R);j==null||j.focus()},[]),k=`radio-${w.useId()}`,E=i||k,_=w.useCallback(M=>{const R=Rbe(M)?M.target.value:M;h||d(R),t==null||t(String(R))},[t,h]),P=w.useCallback((M={},R=null)=>({...M,ref:Hn(R,y),role:"radiogroup"}),[]),A=w.useCallback((M={},R=null)=>({...M,ref:R,name:E,[s?"checked":"isChecked"]:m!=null?M.value===m:void 0,onChange(j){_(j)},"data-radiogroup":!0}),[s,E,_,m]);return{getRootProps:P,getRadioProps:A,name:E,ref:y,focus:b,setValue:d,value:m,onChange:_,isDisabled:o,isFocusable:a,htmlProps:l}}var[Nbe,XV]=Pn({name:"RadioGroupContext",strict:!1}),HE=Ae((e,t)=>{const{colorScheme:n,size:r,variant:i,children:o,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:d,onChange:h,getRootProps:m,name:y,htmlProps:b}=Dbe(u),x=w.useMemo(()=>({name:y,size:r,onChange:h,colorScheme:n,value:d,variant:i,isDisabled:s,isFocusable:l}),[y,r,h,n,d,i,s,l]);return N.createElement(Nbe,{value:x},N.createElement(Ce.div,{...m(b,t),className:Obe("chakra-radio-group",a)},o))});HE.displayName="RadioGroup";var jbe={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function Bbe(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:i,isReadOnly:o,isRequired:a,onChange:s,isInvalid:l,name:u,value:d,id:h,"data-radiogroup":m,"aria-describedby":y,...b}=e,x=`radio-${w.useId()}`,k=sp(),_=!!XV()||!!m;let A=!!k&&!_?k.id:x;A=h??A;const M=i??(k==null?void 0:k.isDisabled),R=o??(k==null?void 0:k.isReadOnly),D=a??(k==null?void 0:k.isRequired),j=l??(k==null?void 0:k.isInvalid),[z,H]=w.useState(!1),[K,te]=w.useState(!1),[G,F]=w.useState(!1),[W,X]=w.useState(!1),[Z,U]=w.useState(Boolean(t)),Q=typeof n<"u",re=Q?n:Z;w.useEffect(()=>a$(H),[]);const fe=w.useCallback(Fe=>{if(R||M){Fe.preventDefault();return}Q||U(Fe.target.checked),s==null||s(Fe)},[Q,M,R,s]),Ee=w.useCallback(Fe=>{Fe.key===" "&&X(!0)},[X]),be=w.useCallback(Fe=>{Fe.key===" "&&X(!1)},[X]),ye=w.useCallback((Fe={},at=null)=>({...Fe,ref:at,"data-active":So(W),"data-hover":So(G),"data-disabled":So(M),"data-invalid":So(j),"data-checked":So(re),"data-focus":So(K),"data-focus-visible":So(K&&z),"data-readonly":So(R),"aria-hidden":!0,onMouseDown:Ns(Fe.onMouseDown,()=>X(!0)),onMouseUp:Ns(Fe.onMouseUp,()=>X(!1)),onMouseEnter:Ns(Fe.onMouseEnter,()=>F(!0)),onMouseLeave:Ns(Fe.onMouseLeave,()=>F(!1))}),[W,G,M,j,re,K,R,z]),{onFocus:ze,onBlur:Me}=k??{},rt=w.useCallback((Fe={},at=null)=>{const bt=M&&!r;return{...Fe,id:A,ref:at,type:"radio",name:u,value:d,onChange:Ns(Fe.onChange,fe),onBlur:Ns(Me,Fe.onBlur,()=>te(!1)),onFocus:Ns(ze,Fe.onFocus,()=>te(!0)),onKeyDown:Ns(Fe.onKeyDown,Ee),onKeyUp:Ns(Fe.onKeyUp,be),checked:re,disabled:bt,readOnly:R,required:D,"aria-invalid":cC(j),"aria-disabled":cC(bt),"aria-required":cC(D),"data-readonly":So(R),"aria-describedby":y,style:jbe}},[M,r,A,u,d,fe,Me,ze,Ee,be,re,R,D,j,y]);return{state:{isInvalid:j,isFocused:K,isChecked:re,isActive:W,isHovered:G,isDisabled:M,isReadOnly:R,isRequired:D},getCheckboxProps:ye,getInputProps:rt,getLabelProps:(Fe={},at=null)=>({...Fe,ref:at,onMouseDown:Ns(Fe.onMouseDown,hI),onTouchStart:Ns(Fe.onTouchStart,hI),"data-disabled":So(M),"data-checked":So(re),"data-invalid":So(j)}),getRootProps:(Fe,at=null)=>({...Fe,ref:at,"data-disabled":So(M),"data-checked":So(re),"data-invalid":So(j)}),htmlProps:b}}function hI(e){e.preventDefault(),e.stopPropagation()}var Td=Ae((e,t)=>{const n=XV(),{onChange:r,value:i}=e,o=Oi("Radio",{...n,...e}),a=Sn(e),{spacing:s="0.5rem",children:l,isDisabled:u=n==null?void 0:n.isDisabled,isFocusable:d=n==null?void 0:n.isFocusable,inputProps:h,...m}=a;let y=e.isChecked;(n==null?void 0:n.value)!=null&&i!=null&&(y=n.value===i);let b=r;n!=null&&n.onChange&&i!=null&&(b=Mbe(n.onChange,r));const x=(e==null?void 0:e.name)??(n==null?void 0:n.name),{getInputProps:k,getCheckboxProps:E,getLabelProps:_,getRootProps:P,htmlProps:A}=Bbe({...m,isChecked:y,isFocusable:d,isDisabled:u,onChange:b,name:x}),[M,R]=Ibe(A,Lj),D=E(R),j=k(h,t),z=_(),H=Object.assign({},M,P()),K={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...o.container},te={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...o.control},G={userSelect:"none",marginStart:s,...o.label};return N.createElement(Ce.label,{className:"chakra-radio",...H,__css:K},N.createElement("input",{className:"chakra-radio__input",...j}),N.createElement(Ce.span,{className:"chakra-radio__control",...D,__css:te}),l&&N.createElement(Ce.span,{className:"chakra-radio__label",...z,__css:G},l))});Td.displayName="Radio";var Fbe=(...e)=>e.filter(Boolean).join(" "),$be=e=>e?"":void 0;function zbe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var ZV=Ae(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return N.createElement(Ce.select,{...a,ref:n,className:Fbe("chakra-select",o)},i&&N.createElement("option",{value:""},i),r)});ZV.displayName="SelectField";var QV=Ae((e,t)=>{var n;const r=Oi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:d,minHeight:h,iconColor:m,iconSize:y,...b}=Sn(e),[x,k]=zbe(b,Lj),E=hk(k),_={width:"100%",height:"fit-content",position:"relative",color:s},P={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return N.createElement(Ce.div,{className:"chakra-select__wrapper",__css:_,...x,...i},N.createElement(ZV,{ref:t,height:u??l,minH:d??h,placeholder:o,...E,__css:P},e.children),N.createElement(JV,{"data-disabled":$be(E.disabled),...(m||s)&&{color:m||s},__css:r.icon,...y&&{fontSize:y}},a))});QV.displayName="Select";var Hbe=e=>N.createElement("svg",{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Vbe=Ce("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),JV=e=>{const{children:t=N.createElement(Hbe,null),...n}=e,r=w.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return N.createElement(Vbe,{...n,className:"chakra-select__icon-wrapper"},w.isValidElement(t)?r:null)};JV.displayName="SelectIcon";function Wbe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ube(e){const t=qbe(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function eW(e){return!!e.touches}function Gbe(e){return eW(e)&&e.touches.length>1}function qbe(e){return e.view??window}function Ybe(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Kbe(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function tW(e,t="page"){return eW(e)?Ybe(e,t):Kbe(e,t)}function Xbe(e){return t=>{const n=Ube(t);(!n||n&&t.button===0)&&e(t)}}function Zbe(e,t=!1){function n(i){e(i,{point:tW(i)})}return t?Xbe(n):n}function A4(e,t,n,r){return Wbe(e,t,Zbe(n,t==="pointerdown"),r)}function nW(e){const t=w.useRef(null);return t.current=e,t}var Qbe=class{constructor(e,t,n){sn(this,"history",[]);sn(this,"startEvent",null);sn(this,"lastEvent",null);sn(this,"lastEventInfo",null);sn(this,"handlers",{});sn(this,"removeListeners",()=>{});sn(this,"threshold",3);sn(this,"win");sn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=dC(this.lastEventInfo,this.history),t=this.startEvent!==null,n=n4e(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=jL();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});sn(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,fre.update(this.updatePoint,!0)});sn(this,"onPointerUp",(e,t)=>{const n=dC(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});if(this.win=e.view??window,Gbe(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:tW(e)},{timestamp:i}=jL();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,dC(r,this.history)),this.removeListeners=t4e(A4(this.win,"pointermove",this.onPointerMove),A4(this.win,"pointerup",this.onPointerUp),A4(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),hre.update(this.updatePoint)}};function pI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dC(e,t){return{point:e.point,delta:pI(e.point,t[t.length-1]),offset:pI(e.point,t[0]),velocity:e4e(t,.1)}}var Jbe=e=>e*1e3;function e4e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Jbe(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function t4e(...e){return t=>e.reduce((n,r)=>r(n),t)}function fC(e,t){return Math.abs(e-t)}function gI(e){return"x"in e&&"y"in e}function n4e(e,t){if(typeof e=="number"&&typeof t=="number")return fC(e,t);if(gI(e)&&gI(t)){const n=fC(e.x,t.x),r=fC(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function rW(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=w.useRef(null),d=nW({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(h,m){u.current=null,i==null||i(h,m)}});w.useEffect(()=>{var h;(h=u.current)==null||h.updateHandlers(d.current)}),w.useEffect(()=>{const h=e.current;if(!h||!l)return;function m(y){u.current=new Qbe(y,d.current,s)}return A4(h,"pointerdown",m)},[e,l,d,s]),w.useEffect(()=>()=>{var h;(h=u.current)==null||h.end(),u.current=null},[])}function r4e(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const[o]=i;let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;t({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var i4e=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:w.useEffect;function o4e(e,t){var n;if(!e||!e.parentElement)return;const r=((n=e.ownerDocument)==null?void 0:n.defaultView)??window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function iW({getNodes:e,observeMutation:t=!0}){const[n,r]=w.useState([]),[i,o]=w.useState(0);return i4e(()=>{const a=e(),s=a.map((l,u)=>r4e(l,d=>{r(h=>[...h.slice(0,u),d,...h.slice(u+1)])}));if(t){const l=a[0];s.push(o4e(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function a4e(e){return typeof e=="object"&&e!==null&&"current"in e}function s4e(e){const[t]=iW({observeMutation:!1,getNodes(){return[a4e(e)?e.current:e]}});return t}var l4e=Object.getOwnPropertyNames,u4e=(e,t)=>function(){return e&&(t=(0,e[l4e(e)[0]])(e=0)),t},df=u4e({"../../../react-shim.js"(){}});df();df();df();var es=e=>e?"":void 0,Nm=e=>e?!0:void 0,ff=(...e)=>e.filter(Boolean).join(" ");df();function jm(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}df();df();function c4e(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Pv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var O4={width:0,height:0},Eb=e=>e||O4;function oW(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=x=>{const k=r[x]??O4;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Pv({orientation:t,vertical:{bottom:`calc(${n[x]}% - ${k.height/2}px)`},horizontal:{left:`calc(${n[x]}% - ${k.width/2}px)`}})}},a=t==="vertical"?r.reduce((x,k)=>Eb(x).height>Eb(k).height?x:k,O4):r.reduce((x,k)=>Eb(x).width>Eb(k).width?x:k,O4),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Pv({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Pv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,d=[0,i?100-n[0]:n[0]],h=u?d:n;let m=h[0];!u&&i&&(m=100-m);const y=Math.abs(h[h.length-1]-h[0]),b={...l,...Pv({orientation:t,vertical:i?{height:`${y}%`,top:`${m}%`}:{height:`${y}%`,bottom:`${m}%`},horizontal:i?{width:`${y}%`,right:`${m}%`}:{width:`${y}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function aW(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function d4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:y,step:b=1,getAriaValueText:x,"aria-valuetext":k,"aria-label":E,"aria-labelledby":_,name:P,focusThumbOnChange:A=!0,minStepsBetweenThumbs:M=0,...R}=e,D=Er(m),j=Er(y),z=Er(x),H=aW({isReversed:a,direction:s,orientation:l}),[K,te]=FS({value:i,defaultValue:o??[25,75],onChange:r});if(!Array.isArray(K))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof K}\``);const[G,F]=w.useState(!1),[W,X]=w.useState(!1),[Z,U]=w.useState(-1),Q=!(d||h),re=w.useRef(K),fe=K.map(Ze=>Pm(Ze,t,n)),Ee=M*b,be=f4e(fe,t,n,Ee),ye=w.useRef({eventSource:null,value:[],valueBounds:[]});ye.current.value=fe,ye.current.valueBounds=be;const ze=fe.map(Ze=>n-Ze+t),rt=(H?ze:fe).map(Ze=>f5(Ze,t,n)),We=l==="vertical",Be=w.useRef(null),wt=w.useRef(null),Fe=iW({getNodes(){const Ze=wt.current,xt=Ze==null?void 0:Ze.querySelectorAll("[role=slider]");return xt?Array.from(xt):[]}}),at=w.useId(),Le=c4e(u??at),ut=w.useCallback(Ze=>{var xt;if(!Be.current)return;ye.current.eventSource="pointer";const ht=Be.current.getBoundingClientRect(),{clientX:Ht,clientY:rn}=((xt=Ze.touches)==null?void 0:xt[0])??Ze,gr=We?ht.bottom-rn:Ht-ht.left,Io=We?ht.height:ht.width;let Mi=gr/Io;return H&&(Mi=1-Mi),u$(Mi,t,n)},[We,H,n,t]),Mt=(n-t)/10,ct=b||(n-t)/100,_t=w.useMemo(()=>({setValueAtIndex(Ze,xt){if(!Q)return;const ht=ye.current.valueBounds[Ze];xt=parseFloat(Y7(xt,ht.min,ct)),xt=Pm(xt,ht.min,ht.max);const Ht=[...ye.current.value];Ht[Ze]=xt,te(Ht)},setActiveIndex:U,stepUp(Ze,xt=ct){const ht=ye.current.value[Ze],Ht=H?ht-xt:ht+xt;_t.setValueAtIndex(Ze,Ht)},stepDown(Ze,xt=ct){const ht=ye.current.value[Ze],Ht=H?ht+xt:ht-xt;_t.setValueAtIndex(Ze,Ht)},reset(){te(re.current)}}),[ct,H,te,Q]),un=w.useCallback(Ze=>{const xt=Ze.key,Ht={ArrowRight:()=>_t.stepUp(Z),ArrowUp:()=>_t.stepUp(Z),ArrowLeft:()=>_t.stepDown(Z),ArrowDown:()=>_t.stepDown(Z),PageUp:()=>_t.stepUp(Z,Mt),PageDown:()=>_t.stepDown(Z,Mt),Home:()=>{const{min:rn}=be[Z];_t.setValueAtIndex(Z,rn)},End:()=>{const{max:rn}=be[Z];_t.setValueAtIndex(Z,rn)}}[xt];Ht&&(Ze.preventDefault(),Ze.stopPropagation(),Ht(Ze),ye.current.eventSource="keyboard")},[_t,Z,Mt,be]),{getThumbStyle:ae,rootStyle:De,trackStyle:Ke,innerTrackStyle:Xe}=w.useMemo(()=>oW({isReversed:H,orientation:l,thumbRects:Fe,thumbPercents:rt}),[H,l,rt,Fe]),xe=w.useCallback(Ze=>{var xt;const ht=Ze??Z;if(ht!==-1&&A){const Ht=Le.getThumb(ht),rn=(xt=wt.current)==null?void 0:xt.ownerDocument.getElementById(Ht);rn&&setTimeout(()=>rn.focus())}},[A,Z,Le]);Gd(()=>{ye.current.eventSource==="keyboard"&&(j==null||j(ye.current.value))},[fe,j]);const Ne=Ze=>{const xt=ut(Ze)||0,ht=ye.current.value.map(Mi=>Math.abs(Mi-xt)),Ht=Math.min(...ht);let rn=ht.indexOf(Ht);const gr=ht.filter(Mi=>Mi===Ht);gr.length>1&&xt>ye.current.value[rn]&&(rn=rn+gr.length-1),U(rn),_t.setValueAtIndex(rn,xt),xe(rn)},Ct=Ze=>{if(Z==-1)return;const xt=ut(Ze)||0;U(Z),_t.setValueAtIndex(Z,xt),xe(Z)};rW(wt,{onPanSessionStart(Ze){Q&&(F(!0),Ne(Ze),D==null||D(ye.current.value))},onPanSessionEnd(){Q&&(F(!1),j==null||j(ye.current.value))},onPan(Ze){Q&&Ct(Ze)}});const Dt=w.useCallback((Ze={},xt=null)=>({...Ze,...R,id:Le.root,ref:Hn(xt,wt),tabIndex:-1,"aria-disabled":Nm(d),"data-focused":es(W),style:{...Ze.style,...De}}),[R,d,W,De,Le]),Te=w.useCallback((Ze={},xt=null)=>({...Ze,ref:Hn(xt,Be),id:Le.track,"data-disabled":es(d),style:{...Ze.style,...Ke}}),[d,Ke,Le]),At=w.useCallback((Ze={},xt=null)=>({...Ze,ref:xt,id:Le.innerTrack,style:{...Ze.style,...Xe}}),[Xe,Le]),He=w.useCallback((Ze,xt=null)=>{const{index:ht,...Ht}=Ze,rn=fe[ht];if(rn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ht}\`. The \`value\` or \`defaultValue\` length is : ${fe.length}`);const gr=be[ht];return{...Ht,ref:xt,role:"slider",tabIndex:Q?0:void 0,id:Le.getThumb(ht),"data-active":es(G&&Z===ht),"aria-valuetext":(z==null?void 0:z(rn))??(k==null?void 0:k[ht]),"aria-valuemin":gr.min,"aria-valuemax":gr.max,"aria-valuenow":rn,"aria-orientation":l,"aria-disabled":Nm(d),"aria-readonly":Nm(h),"aria-label":E==null?void 0:E[ht],"aria-labelledby":E!=null&&E[ht]||_==null?void 0:_[ht],style:{...Ze.style,...ae(ht)},onKeyDown:jm(Ze.onKeyDown,un),onFocus:jm(Ze.onFocus,()=>{X(!0),U(ht)}),onBlur:jm(Ze.onBlur,()=>{X(!1),U(-1)})}},[Le,fe,be,Q,G,Z,z,k,l,d,h,E,_,ae,un,X]),vt=w.useCallback((Ze={},xt=null)=>({...Ze,ref:xt,id:Le.output,htmlFor:fe.map((ht,Ht)=>Le.getThumb(Ht)).join(" "),"aria-live":"off"}),[Le,fe]),nn=w.useCallback((Ze,xt=null)=>{const{value:ht,...Ht}=Ze,rn=!(htn),gr=ht>=fe[0]&&ht<=fe[fe.length-1];let Io=f5(ht,t,n);Io=H?100-Io:Io;const Mi={position:"absolute",pointerEvents:"none",...Pv({orientation:l,vertical:{bottom:`${Io}%`},horizontal:{left:`${Io}%`}})};return{...Ht,ref:xt,id:Le.getMarker(Ze.value),role:"presentation","aria-hidden":!0,"data-disabled":es(d),"data-invalid":es(!rn),"data-highlighted":es(gr),style:{...Ze.style,...Mi}}},[d,H,n,t,l,fe,Le]),Rn=w.useCallback((Ze,xt=null)=>{const{index:ht,...Ht}=Ze;return{...Ht,ref:xt,id:Le.getInput(ht),type:"hidden",value:fe[ht],name:Array.isArray(P)?P[ht]:`${P}-${ht}`}},[P,fe,Le]);return{state:{value:fe,isFocused:W,isDragging:G,getThumbPercent:Ze=>rt[Ze],getThumbMinValue:Ze=>be[Ze].min,getThumbMaxValue:Ze=>be[Ze].max},actions:_t,getRootProps:Dt,getTrackProps:Te,getInnerTrackProps:At,getThumbProps:He,getMarkerProps:nn,getInputProps:Rn,getOutputProps:vt}}function f4e(e,t,n,r){return e.map((i,o)=>{const a=o===0?t:e[o-1]+r,s=o===e.length-1?n:e[o+1]-r;return{min:a,max:s}})}var[h4e,_x]=Pn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[p4e,VE]=Pn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),sW=Ae(function(t,n){const r=Oi("Slider",t),i=Sn(t),{direction:o}=v0();i.direction=o;const{getRootProps:a,...s}=d4e(i),l=w.useMemo(()=>({...s,name:t.name}),[s,t.name]);return N.createElement(h4e,{value:l},N.createElement(p4e,{value:r},N.createElement(Ce.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});sW.defaultProps={orientation:"horizontal"};sW.displayName="RangeSlider";var g4e=Ae(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=_x(),a=VE(),s=r(t,n);return N.createElement(Ce.div,{...s,className:ff("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&N.createElement("input",{...i({index:t.index})}))});g4e.displayName="RangeSliderThumb";var m4e=Ae(function(t,n){const{getTrackProps:r}=_x(),i=VE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:ff("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});m4e.displayName="RangeSliderTrack";var v4e=Ae(function(t,n){const{getInnerTrackProps:r}=_x(),i=VE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});v4e.displayName="RangeSliderFilledTrack";var y4e=Ae(function(t,n){const{getMarkerProps:r}=_x(),i=r(t,n);return N.createElement(Ce.div,{...i,className:ff("chakra-slider__marker",t.className)})});y4e.displayName="RangeSliderMark";df();df();function b4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:y,step:b=1,getAriaValueText:x,"aria-valuetext":k,"aria-label":E,"aria-labelledby":_,name:P,focusThumbOnChange:A=!0,...M}=e,R=Er(m),D=Er(y),j=Er(x),z=aW({isReversed:a,direction:s,orientation:l}),[H,K]=FS({value:i,defaultValue:o??x4e(t,n),onChange:r}),[te,G]=w.useState(!1),[F,W]=w.useState(!1),X=!(d||h),Z=(n-t)/10,U=b||(n-t)/100,Q=Pm(H,t,n),re=n-Q+t,Ee=f5(z?re:Q,t,n),be=l==="vertical",ye=nW({min:t,max:n,step:b,isDisabled:d,value:Q,isInteractive:X,isReversed:z,isVertical:be,eventSource:null,focusThumbOnChange:A,orientation:l}),ze=w.useRef(null),Me=w.useRef(null),rt=w.useRef(null),We=w.useId(),Be=u??We,[wt,Fe]=[`slider-thumb-${Be}`,`slider-track-${Be}`],at=w.useCallback(He=>{var vt;if(!ze.current)return;const nn=ye.current;nn.eventSource="pointer";const Rn=ze.current.getBoundingClientRect(),{clientX:Ze,clientY:xt}=((vt=He.touches)==null?void 0:vt[0])??He,ht=be?Rn.bottom-xt:Ze-Rn.left,Ht=be?Rn.height:Rn.width;let rn=ht/Ht;z&&(rn=1-rn);let gr=u$(rn,nn.min,nn.max);return nn.step&&(gr=parseFloat(Y7(gr,nn.min,nn.step))),gr=Pm(gr,nn.min,nn.max),gr},[be,z,ye]),bt=w.useCallback(He=>{const vt=ye.current;vt.isInteractive&&(He=parseFloat(Y7(He,vt.min,U)),He=Pm(He,vt.min,vt.max),K(He))},[U,K,ye]),Le=w.useMemo(()=>({stepUp(He=U){const vt=z?Q-He:Q+He;bt(vt)},stepDown(He=U){const vt=z?Q+He:Q-He;bt(vt)},reset(){bt(o||0)},stepTo(He){bt(He)}}),[bt,z,Q,U,o]),ut=w.useCallback(He=>{const vt=ye.current,Rn={ArrowRight:()=>Le.stepUp(),ArrowUp:()=>Le.stepUp(),ArrowLeft:()=>Le.stepDown(),ArrowDown:()=>Le.stepDown(),PageUp:()=>Le.stepUp(Z),PageDown:()=>Le.stepDown(Z),Home:()=>bt(vt.min),End:()=>bt(vt.max)}[He.key];Rn&&(He.preventDefault(),He.stopPropagation(),Rn(He),vt.eventSource="keyboard")},[Le,bt,Z,ye]),Mt=(j==null?void 0:j(Q))??k,ct=s4e(Me),{getThumbStyle:_t,rootStyle:un,trackStyle:ae,innerTrackStyle:De}=w.useMemo(()=>{const He=ye.current,vt=ct??{width:0,height:0};return oW({isReversed:z,orientation:He.orientation,thumbRects:[vt],thumbPercents:[Ee]})},[z,ct,Ee,ye]),Ke=w.useCallback(()=>{ye.current.focusThumbOnChange&&setTimeout(()=>{var vt;return(vt=Me.current)==null?void 0:vt.focus()})},[ye]);Gd(()=>{const He=ye.current;Ke(),He.eventSource==="keyboard"&&(D==null||D(He.value))},[Q,D]);function Xe(He){const vt=at(He);vt!=null&&vt!==ye.current.value&&K(vt)}rW(rt,{onPanSessionStart(He){const vt=ye.current;vt.isInteractive&&(G(!0),Ke(),Xe(He),R==null||R(vt.value))},onPanSessionEnd(){const He=ye.current;He.isInteractive&&(G(!1),D==null||D(He.value))},onPan(He){ye.current.isInteractive&&Xe(He)}});const xe=w.useCallback((He={},vt=null)=>({...He,...M,ref:Hn(vt,rt),tabIndex:-1,"aria-disabled":Nm(d),"data-focused":es(F),style:{...He.style,...un}}),[M,d,F,un]),Ne=w.useCallback((He={},vt=null)=>({...He,ref:Hn(vt,ze),id:Fe,"data-disabled":es(d),style:{...He.style,...ae}}),[d,Fe,ae]),Ct=w.useCallback((He={},vt=null)=>({...He,ref:vt,style:{...He.style,...De}}),[De]),Dt=w.useCallback((He={},vt=null)=>({...He,ref:Hn(vt,Me),role:"slider",tabIndex:X?0:void 0,id:wt,"data-active":es(te),"aria-valuetext":Mt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":Q,"aria-orientation":l,"aria-disabled":Nm(d),"aria-readonly":Nm(h),"aria-label":E,"aria-labelledby":E?void 0:_,style:{...He.style,..._t(0)},onKeyDown:jm(He.onKeyDown,ut),onFocus:jm(He.onFocus,()=>W(!0)),onBlur:jm(He.onBlur,()=>W(!1))}),[X,wt,te,Mt,t,n,Q,l,d,h,E,_,_t,ut]),Te=w.useCallback((He,vt=null)=>{const nn=!(He.valuen),Rn=Q>=He.value,Ze=f5(He.value,t,n),xt={position:"absolute",pointerEvents:"none",...S4e({orientation:l,vertical:{bottom:z?`${100-Ze}%`:`${Ze}%`},horizontal:{left:z?`${100-Ze}%`:`${Ze}%`}})};return{...He,ref:vt,role:"presentation","aria-hidden":!0,"data-disabled":es(d),"data-invalid":es(!nn),"data-highlighted":es(Rn),style:{...He.style,...xt}}},[d,z,n,t,l,Q]),At=w.useCallback((He={},vt=null)=>({...He,ref:vt,type:"hidden",value:Q,name:P}),[P,Q]);return{state:{value:Q,isFocused:F,isDragging:te},actions:Le,getRootProps:xe,getTrackProps:Ne,getInnerTrackProps:Ct,getThumbProps:Dt,getMarkerProps:Te,getInputProps:At}}function S4e(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function x4e(e,t){return t"}),[C4e,Ex]=Pn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),WE=Ae((e,t)=>{const n=Oi("Slider",e),r=Sn(e),{direction:i}=v0();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=b4e(r),l=a(),u=o({},t);return N.createElement(w4e,{value:s},N.createElement(C4e,{value:n},N.createElement(Ce.div,{...l,className:ff("chakra-slider",e.className),__css:n.container},e.children,N.createElement("input",{...u}))))});WE.defaultProps={orientation:"horizontal"};WE.displayName="Slider";var lW=Ae((e,t)=>{const{getThumbProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:ff("chakra-slider__thumb",e.className),__css:r.thumb})});lW.displayName="SliderThumb";var uW=Ae((e,t)=>{const{getTrackProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:ff("chakra-slider__track",e.className),__css:r.track})});uW.displayName="SliderTrack";var cW=Ae((e,t)=>{const{getInnerTrackProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:ff("chakra-slider__filled-track",e.className),__css:r.filledTrack})});cW.displayName="SliderFilledTrack";var Q9=Ae((e,t)=>{const{getMarkerProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:ff("chakra-slider__marker",e.className),__css:r.mark})});Q9.displayName="SliderMark";var _4e=(...e)=>e.filter(Boolean).join(" "),mI=e=>e?"":void 0,UE=Ae(function(t,n){const r=Oi("Switch",t),{spacing:i="0.5rem",children:o,...a}=Sn(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:d,getLabelProps:h}=s$(a),m=w.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),y=w.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=w.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return N.createElement(Ce.label,{...d(),className:_4e("chakra-switch",t.className),__css:m},N.createElement("input",{className:"chakra-switch__input",...l({},n)}),N.createElement(Ce.span,{...u(),className:"chakra-switch__track",__css:y},N.createElement(Ce.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":mI(s.isChecked),"data-hover":mI(s.isHovered)})),o&&N.createElement(Ce.span,{className:"chakra-switch__label",...h(),__css:b},o))});UE.displayName="Switch";var E0=(...e)=>e.filter(Boolean).join(" ");function J9(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[k4e,dW,E4e,P4e]=SB();function T4e(e){const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[d,h]=w.useState(t??0),[m,y]=FS({defaultValue:t??0,value:r,onChange:n});w.useEffect(()=>{r!=null&&h(r)},[r]);const b=E4e(),x=w.useId();return{id:`tabs-${e.id??x}`,selectedIndex:m,focusedIndex:d,setSelectedIndex:y,setFocusedIndex:h,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:b,direction:l,htmlProps:u}}var[L4e,Ny]=Pn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function A4e(e){const{focusedIndex:t,orientation:n,direction:r}=Ny(),i=dW(),o=w.useCallback(a=>{const s=()=>{var _;const P=i.nextEnabled(t);P&&((_=P.node)==null||_.focus())},l=()=>{var _;const P=i.prevEnabled(t);P&&((_=P.node)==null||_.focus())},u=()=>{var _;const P=i.firstEnabled();P&&((_=P.node)==null||_.focus())},d=()=>{var _;const P=i.lastEnabled();P&&((_=P.node)==null||_.focus())},h=n==="horizontal",m=n==="vertical",y=a.key,b=r==="ltr"?"ArrowLeft":"ArrowRight",x=r==="ltr"?"ArrowRight":"ArrowLeft",E={[b]:()=>h&&l(),[x]:()=>h&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:u,End:d}[y];E&&(a.preventDefault(),E(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:J9(e.onKeyDown,o)}}function O4e(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=Ny(),{index:u,register:d}=P4e({disabled:t&&!n}),h=u===l,m=()=>{i(u)},y=()=>{s(u),!o&&!(t&&n)&&i(u)},b=c0e({...r,ref:Hn(d,e.ref),isDisabled:t,isFocusable:n,onClick:J9(e.onClick,m)}),x="button";return{...b,id:fW(a,u),role:"tab",tabIndex:h?0:-1,type:x,"aria-selected":h,"aria-controls":hW(a,u),onFocus:t?void 0:J9(e.onFocus,y)}}var[M4e,I4e]=Pn({});function R4e(e){const t=Ny(),{id:n,selectedIndex:r}=t,o=ex(e.children).map((a,s)=>w.createElement(M4e,{key:s,value:{isSelected:s===r,id:hW(n,s),tabId:fW(n,s),selectedIndex:r}},a));return{...e,children:o}}function D4e(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=Ny(),{isSelected:o,id:a,tabId:s}=I4e(),l=w.useRef(!1);o&&(l.current=!0);const u=Y$({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function N4e(){const e=Ny(),t=dW(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=w.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=w.useState(!1);return Gs(()=>{if(n==null)return;const d=t.item(n);if(d==null)return;i&&s({left:d.node.offsetLeft,width:d.node.offsetWidth}),o&&s({top:d.node.offsetTop,height:d.node.offsetHeight});const h=requestAnimationFrame(()=>{u(!0)});return()=>{h&&cancelAnimationFrame(h)}},[n,i,o,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:l?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function fW(e,t){return`${e}--tab-${t}`}function hW(e,t){return`${e}--tabpanel-${t}`}var[j4e,jy]=Pn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),pW=Ae(function(t,n){const r=Oi("Tabs",t),{children:i,className:o,...a}=Sn(t),{htmlProps:s,descendants:l,...u}=T4e(a),d=w.useMemo(()=>u,[u]),{isFitted:h,...m}=s;return N.createElement(k4e,{value:l},N.createElement(L4e,{value:d},N.createElement(j4e,{value:r},N.createElement(Ce.div,{className:E0("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});pW.displayName="Tabs";var B4e=Ae(function(t,n){const r=N4e(),i={...t.style,...r},o=jy();return N.createElement(Ce.div,{ref:n,...t,className:E0("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});B4e.displayName="TabIndicator";var F4e=Ae(function(t,n){const r=A4e({...t,ref:n}),o={display:"flex",...jy().tablist};return N.createElement(Ce.div,{...r,className:E0("chakra-tabs__tablist",t.className),__css:o})});F4e.displayName="TabList";var gW=Ae(function(t,n){const r=D4e({...t,ref:n}),i=jy();return N.createElement(Ce.div,{outline:"0",...r,className:E0("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});gW.displayName="TabPanel";var mW=Ae(function(t,n){const r=R4e(t),i=jy();return N.createElement(Ce.div,{...r,width:"100%",ref:n,className:E0("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});mW.displayName="TabPanels";var vW=Ae(function(t,n){const r=jy(),i=O4e({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return N.createElement(Ce.button,{...i,className:E0("chakra-tabs__tab",t.className),__css:o})});vW.displayName="Tab";var $4e=(...e)=>e.filter(Boolean).join(" ");function z4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var H4e=["h","minH","height","minHeight"],GE=Ae((e,t)=>{const n=Oo("Textarea",e),{className:r,rows:i,...o}=Sn(e),a=hk(o),s=i?z4e(n,H4e):n;return N.createElement(Ce.textarea,{ref:t,rows:i,...a,className:$4e("chakra-textarea",r),__css:s})});GE.displayName="Textarea";function V4e(e,t){const n=Er(e);w.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function e8(e,...t){return W4e(e)?e(...t):e}var W4e=e=>typeof e=="function";function U4e(e,t){const n=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(i==null?void 0:i[t])??n}var G4e=(e,t)=>e.find(n=>n.id===t);function vI(e,t){const n=yW(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function yW(e,t){for(const[n,r]of Object.entries(e))if(G4e(r,t))return n}function q4e(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Y4e(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}var K4e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Wl=X4e(K4e);function X4e(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=Z4e(i,o),{position:s,id:l}=a;return r(u=>{const h=s.includes("top")?[a,...u[s]??[]]:[...u[s]??[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=vI(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:bW(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(d=>({...d,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=yW(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(vI(Wl.getState(),i).position)}}var yI=0;function Z4e(e,t={}){yI+=1;const n=t.id??yI,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Wl.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var Q4e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return N.createElement(e$,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},N.createElement(n$,null,l),N.createElement(Ce.div,{flex:"1",maxWidth:"100%"},i&&N.createElement(r$,{id:u==null?void 0:u.title},i),s&&N.createElement(t$,{id:u==null?void 0:u.description,display:"block"},s)),o&&N.createElement(rx,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function bW(e={}){const{render:t,toastComponent:n=Q4e}=e;return i=>typeof t=="function"?t({...i,...e}):N.createElement(n,{...i,...e})}function J4e(e,t){const n=i=>({...t,...i,position:U4e((i==null?void 0:i.position)??(t==null?void 0:t.position),e)}),r=i=>{const o=n(i),a=bW(o);return Wl.notify(a,o)};return r.update=(i,o)=>{Wl.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...e8(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...e8(o.error,s)}))},r.closeAll=Wl.closeAll,r.close=Wl.close,r.isActive=Wl.isActive,r}function By(e){const{theme:t}=vB();return w.useMemo(()=>J4e(t.direction,e),[e,t.direction])}var e5e={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},SW=w.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=e5e,toastSpacing:d="0.5rem"}=e,[h,m]=w.useState(s),y=Ufe();Gd(()=>{y||r==null||r()},[y]),Gd(()=>{m(s)},[s]);const b=()=>m(null),x=()=>m(s),k=()=>{y&&i()};w.useEffect(()=>{y&&o&&i()},[y,o,i]),V4e(k,h);const E=w.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:d,...l}),[l,d]),_=w.useMemo(()=>q4e(a),[a]);return N.createElement(hu.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:x,custom:{position:a},style:_},N.createElement(Ce.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:E},e8(n,{id:t,onClose:k})))});SW.displayName="ToastComponent";var t5e=e=>{const t=w.useSyncExternalStore(Wl.subscribe,Wl.getState,Wl.getState),{children:n,motionVariants:r,component:i=SW,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return N.createElement("ul",{role:"region","aria-live":"polite",key:l,id:`chakra-toast-manager-${l}`,style:Y4e(l)},N.createElement(af,{initial:!1},u.map(d=>N.createElement(i,{key:d.id,motionVariants:r,...d}))))});return N.createElement(N.Fragment,null,n,N.createElement(cp,{...o},s))};function n5e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function r5e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var i5e={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};function iv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var $5=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},t8=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function o5e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:d,id:h,isOpen:m,defaultIsOpen:y,arrowSize:b=10,arrowShadowColor:x,arrowPadding:k,modifiers:E,isDisabled:_,gutter:P,offset:A,direction:M,...R}=e,{isOpen:D,onOpen:j,onClose:z}=q$({isOpen:m,defaultIsOpen:y,onOpen:l,onClose:u}),{referenceRef:H,getPopperProps:K,getArrowInnerProps:te,getArrowProps:G}=G$({enabled:D,placement:d,arrowPadding:k,modifiers:E,gutter:P,offset:A,direction:M}),F=w.useId(),X=`tooltip-${h??F}`,Z=w.useRef(null),U=w.useRef(),Q=w.useCallback(()=>{U.current&&(clearTimeout(U.current),U.current=void 0)},[]),re=w.useRef(),fe=w.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=void 0)},[]),Ee=w.useCallback(()=>{fe(),z()},[z,fe]),be=a5e(Z,Ee),ye=w.useCallback(()=>{if(!_&&!U.current){be();const at=t8(Z);U.current=at.setTimeout(j,t)}},[be,_,j,t]),ze=w.useCallback(()=>{Q();const at=t8(Z);re.current=at.setTimeout(Ee,n)},[n,Ee,Q]),Me=w.useCallback(()=>{D&&r&&ze()},[r,ze,D]),rt=w.useCallback(()=>{D&&a&&ze()},[a,ze,D]),We=w.useCallback(at=>{D&&at.key==="Escape"&&ze()},[D,ze]);jh(()=>$5(Z),"keydown",s?We:void 0),jh(()=>$5(Z),"scroll",()=>{D&&o&&Ee()}),w.useEffect(()=>{_&&(Q(),D&&z())},[_,D,z,Q]),w.useEffect(()=>()=>{Q(),fe()},[Q,fe]),jh(()=>Z.current,"pointerleave",ze);const Be=w.useCallback((at={},bt=null)=>({...at,ref:Hn(Z,bt,H),onPointerEnter:iv(at.onPointerEnter,ut=>{ut.pointerType!=="touch"&&ye()}),onClick:iv(at.onClick,Me),onPointerDown:iv(at.onPointerDown,rt),onFocus:iv(at.onFocus,ye),onBlur:iv(at.onBlur,ze),"aria-describedby":D?X:void 0}),[ye,ze,rt,D,X,Me,H]),wt=w.useCallback((at={},bt=null)=>K({...at,style:{...at.style,[oi.arrowSize.var]:b?`${b}px`:void 0,[oi.arrowShadowColor.var]:x}},bt),[K,b,x]),Fe=w.useCallback((at={},bt=null)=>{const Le={...at.style,position:"relative",transformOrigin:oi.transformOrigin.varRef};return{ref:bt,...R,...at,id:X,role:"tooltip",style:Le}},[R,X]);return{isOpen:D,show:ye,hide:ze,getTriggerProps:Be,getTooltipProps:Fe,getTooltipPositionerProps:wt,getArrowProps:G,getArrowInnerProps:te}}var hC="chakra-ui:close-tooltip";function a5e(e,t){return w.useEffect(()=>{const n=$5(e);return n.addEventListener(hC,t),()=>n.removeEventListener(hC,t)},[t,e]),()=>{const n=$5(e),r=t8(e);n.dispatchEvent(new r.CustomEvent(hC))}}var s5e=Ce(hu.div),uo=Ae((e,t)=>{const n=Oo("Tooltip",e),r=Sn(e),i=v0(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:d,portalProps:h,background:m,backgroundColor:y,bgColor:b,motionProps:x,...k}=r,E=m??y??d??b;if(E){n.bg=E;const z=hne(i,"colors",E);n[oi.arrowBg.var]=z}const _=o5e({...k,direction:i.direction}),P=typeof o=="string"||s;let A;if(P)A=N.createElement(Ce.span,{display:"inline-block",tabIndex:0,..._.getTriggerProps()},o);else{const z=w.Children.only(o);A=w.cloneElement(z,_.getTriggerProps(z.props,z.ref))}const M=!!l,R=_.getTooltipProps({},t),D=M?n5e(R,["role","id"]):R,j=r5e(R,["role","id"]);return a?N.createElement(N.Fragment,null,A,N.createElement(af,null,_.isOpen&&N.createElement(cp,{...h},N.createElement(Ce.div,{..._.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},N.createElement(s5e,{variants:i5e,initial:"exit",animate:"enter",exit:"exit",...x,...D,__css:n},a,M&&N.createElement(Ce.span,{srOnly:!0,...j},l),u&&N.createElement(Ce.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},N.createElement(Ce.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))))))):N.createElement(N.Fragment,null,o)});uo.displayName="Tooltip";var l5e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=N.createElement(L$,{environment:a},t);return N.createElement(ice,{theme:o,cssVarsRoot:s},N.createElement(Sj,{colorModeManager:n,options:o.config},i?N.createElement(wme,null):N.createElement(xme,null),N.createElement(ace,null),r?N.createElement(KH,{zIndex:r},l):l))};function u5e({children:e,theme:t=Kue,toastOptions:n,...r}){return N.createElement(l5e,{theme:t,...r},e,N.createElement(t5e,{...n}))}var n8={},bI=el;n8.createRoot=bI.createRoot,n8.hydrateRoot=bI.hydrateRoot;var r8={},c5e={get exports(){return r8},set exports(e){r8=e}},xW={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -415,7 +415,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var a0=w;function d5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var f5e=typeof Object.is=="function"?Object.is:d5e,h5e=a0.useState,p5e=a0.useEffect,g5e=a0.useLayoutEffect,m5e=a0.useDebugValue;function v5e(e,t){var n=t(),r=h5e({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return g5e(function(){i.value=n,i.getSnapshot=t,pC(i)&&o({inst:i})},[e,n,t]),p5e(function(){return pC(i)&&o({inst:i}),e(function(){pC(i)&&o({inst:i})})},[e]),m5e(n),n}function pC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!f5e(e,n)}catch{return!0}}function y5e(e,t){return t()}var b5e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y5e:v5e;xW.useSyncExternalStore=a0.useSyncExternalStore!==void 0?a0.useSyncExternalStore:b5e;(function(e){e.exports=xW})(c5e);var i8={},S5e={get exports(){return i8},set exports(e){i8=e}},wW={};/** + */var s0=w;function d5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var f5e=typeof Object.is=="function"?Object.is:d5e,h5e=s0.useState,p5e=s0.useEffect,g5e=s0.useLayoutEffect,m5e=s0.useDebugValue;function v5e(e,t){var n=t(),r=h5e({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return g5e(function(){i.value=n,i.getSnapshot=t,pC(i)&&o({inst:i})},[e,n,t]),p5e(function(){return pC(i)&&o({inst:i}),e(function(){pC(i)&&o({inst:i})})},[e]),m5e(n),n}function pC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!f5e(e,n)}catch{return!0}}function y5e(e,t){return t()}var b5e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y5e:v5e;xW.useSyncExternalStore=s0.useSyncExternalStore!==void 0?s0.useSyncExternalStore:b5e;(function(e){e.exports=xW})(c5e);var i8={},S5e={get exports(){return i8},set exports(e){i8=e}},wW={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -423,7 +423,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Px=w,x5e=r8;function w5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var C5e=typeof Object.is=="function"?Object.is:w5e,_5e=x5e.useSyncExternalStore,k5e=Px.useRef,E5e=Px.useEffect,P5e=Px.useMemo,T5e=Px.useDebugValue;wW.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=k5e(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=P5e(function(){function l(v){if(!u){if(u=!0,d=v,v=r(v),i!==void 0&&a.hasValue){var b=a.value;if(i(b,v))return h=b}return h=v}if(b=h,C5e(d,v))return b;var S=r(v);return i!==void 0&&i(b,S)?b:(d=v,h=S)}var u=!1,d,h,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=_5e(e,o[0],o[1]);return E5e(function(){a.hasValue=!0,a.value=s},[s]),T5e(s),s};(function(e){e.exports=wW})(S5e);function L5e(e){e()}let CW=L5e;const A5e=e=>CW=e,O5e=()=>CW,Qd=w.createContext(null);function _W(){return w.useContext(Qd)}const M5e=()=>{throw new Error("uSES not initialized!")};let kW=M5e;const I5e=e=>{kW=e},R5e=(e,t)=>e===t;function D5e(e=Qd){const t=e===Qd?_W:()=>w.useContext(e);return function(r,i=R5e){const{store:o,subscription:a,getServerState:s}=t(),l=kW(a.addNestedSub,o.getState,s||o.getState,r,i);return w.useDebugValue(l),l}}const N5e=D5e();var bI={},j5e={get exports(){return bI},set exports(e){bI=e}},Fn={};/** + */var Px=w,x5e=r8;function w5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var C5e=typeof Object.is=="function"?Object.is:w5e,_5e=x5e.useSyncExternalStore,k5e=Px.useRef,E5e=Px.useEffect,P5e=Px.useMemo,T5e=Px.useDebugValue;wW.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=k5e(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=P5e(function(){function l(y){if(!u){if(u=!0,d=y,y=r(y),i!==void 0&&a.hasValue){var b=a.value;if(i(b,y))return h=b}return h=y}if(b=h,C5e(d,y))return b;var x=r(y);return i!==void 0&&i(b,x)?b:(d=y,h=x)}var u=!1,d,h,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=_5e(e,o[0],o[1]);return E5e(function(){a.hasValue=!0,a.value=s},[s]),T5e(s),s};(function(e){e.exports=wW})(S5e);function L5e(e){e()}let CW=L5e;const A5e=e=>CW=e,O5e=()=>CW,Jd=w.createContext(null);function _W(){return w.useContext(Jd)}const M5e=()=>{throw new Error("uSES not initialized!")};let kW=M5e;const I5e=e=>{kW=e},R5e=(e,t)=>e===t;function D5e(e=Jd){const t=e===Jd?_W:()=>w.useContext(e);return function(r,i=R5e){const{store:o,subscription:a,getServerState:s}=t(),l=kW(a.addNestedSub,o.getState,s||o.getState,r,i);return w.useDebugValue(l),l}}const N5e=D5e();var SI={},j5e={get exports(){return SI},set exports(e){SI=e}},$n={};/** * @license React * react-is.production.min.js * @@ -431,9 +431,9 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var GE=Symbol.for("react.element"),qE=Symbol.for("react.portal"),Tx=Symbol.for("react.fragment"),Lx=Symbol.for("react.strict_mode"),Ax=Symbol.for("react.profiler"),Ox=Symbol.for("react.provider"),Mx=Symbol.for("react.context"),B5e=Symbol.for("react.server_context"),Ix=Symbol.for("react.forward_ref"),Rx=Symbol.for("react.suspense"),Dx=Symbol.for("react.suspense_list"),Nx=Symbol.for("react.memo"),jx=Symbol.for("react.lazy"),$5e=Symbol.for("react.offscreen"),EW;EW=Symbol.for("react.module.reference");function ms(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case GE:switch(e=e.type,e){case Tx:case Ax:case Lx:case Rx:case Dx:return e;default:switch(e=e&&e.$$typeof,e){case B5e:case Mx:case Ix:case jx:case Nx:case Ox:return e;default:return t}}case qE:return t}}}Fn.ContextConsumer=Mx;Fn.ContextProvider=Ox;Fn.Element=GE;Fn.ForwardRef=Ix;Fn.Fragment=Tx;Fn.Lazy=jx;Fn.Memo=Nx;Fn.Portal=qE;Fn.Profiler=Ax;Fn.StrictMode=Lx;Fn.Suspense=Rx;Fn.SuspenseList=Dx;Fn.isAsyncMode=function(){return!1};Fn.isConcurrentMode=function(){return!1};Fn.isContextConsumer=function(e){return ms(e)===Mx};Fn.isContextProvider=function(e){return ms(e)===Ox};Fn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===GE};Fn.isForwardRef=function(e){return ms(e)===Ix};Fn.isFragment=function(e){return ms(e)===Tx};Fn.isLazy=function(e){return ms(e)===jx};Fn.isMemo=function(e){return ms(e)===Nx};Fn.isPortal=function(e){return ms(e)===qE};Fn.isProfiler=function(e){return ms(e)===Ax};Fn.isStrictMode=function(e){return ms(e)===Lx};Fn.isSuspense=function(e){return ms(e)===Rx};Fn.isSuspenseList=function(e){return ms(e)===Dx};Fn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Tx||e===Ax||e===Lx||e===Rx||e===Dx||e===$5e||typeof e=="object"&&e!==null&&(e.$$typeof===jx||e.$$typeof===Nx||e.$$typeof===Ox||e.$$typeof===Mx||e.$$typeof===Ix||e.$$typeof===EW||e.getModuleId!==void 0)};Fn.typeOf=ms;(function(e){e.exports=Fn})(j5e);function F5e(){const e=O5e();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const SI={notify(){},get:()=>[]};function z5e(e,t){let n,r=SI;function i(h){return l(),r.subscribe(h)}function o(){r.notify()}function a(){d.onStateChange&&d.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=F5e())}function u(){n&&(n(),n=void 0,r.clear(),r=SI)}const d={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return d}const H5e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",V5e=H5e?w.useLayoutEffect:w.useEffect;function W5e({store:e,context:t,children:n,serverState:r}){const i=w.useMemo(()=>{const s=z5e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=w.useMemo(()=>e.getState(),[e]);V5e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]);const a=t||Qd;return N.createElement(a.Provider,{value:i},n)}function PW(e=Qd){const t=e===Qd?_W:()=>w.useContext(e);return function(){const{store:r}=t();return r}}const U5e=PW();function G5e(e=Qd){const t=e===Qd?U5e:PW(e);return function(){return t().dispatch}}const q5e=G5e();I5e(i8.useSyncExternalStoreWithSelector);A5e(el.unstable_batchedUpdates);function M4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?M4=function(n){return typeof n}:M4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},M4(e)}function Y5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:YE(e)?2:KE(e)?3:0}function jm(e,t){return E0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Q5e(e,t){return E0(e)===2?e.get(t):e[t]}function LW(e,t,n){var r=E0(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function AW(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function YE(e){return iSe&&e instanceof Map}function KE(e){return oSe&&e instanceof Set}function gh(e){return e.o||e.t}function XE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=MW(e);delete t[vr];for(var n=Bm(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=J5e),Object.freeze(e),t&&ep(e,function(n,r){return ZE(r,!0)},!0)),e}function J5e(){Ws(2)}function QE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function nu(e){var t=c8[e];return t||Ws(18,e),t}function eSe(e,t){c8[e]||(c8[e]=t)}function s8(){return ey}function gC(e,t){t&&(nu("Patches"),e.u=[],e.s=[],e.v=t)}function z5(e){l8(e),e.p.forEach(tSe),e.p=null}function l8(e){e===ey&&(ey=e.l)}function wI(e){return ey={p:[],l:ey,h:e,m:!0,_:0}}function tSe(e){var t=e[vr];t.i===0||t.i===1?t.j():t.O=!0}function mC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||nu("ES5").S(t,e,r),r?(n[vr].P&&(z5(t),Ws(4)),sc(e)&&(e=H5(t,e),t.l||V5(t,e)),t.u&&nu("Patches").M(n[vr].t,e,t.u,t.s)):e=H5(t,n,[]),z5(t),t.u&&t.v(t.u,t.s),e!==OW?e:void 0}function H5(e,t,n){if(QE(t))return t;var r=t[vr];if(!r)return ep(t,function(o,a){return CI(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return V5(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=XE(r.k):r.o;ep(r.i===3?new Set(i):i,function(o,a){return CI(e,r,i,o,a,n)}),V5(e,i,!1),n&&e.u&&nu("Patches").R(r,n,e.u,e.s)}return r.o}function CI(e,t,n,r,i,o){if(Jd(i)){var a=H5(e,i,o&&t&&t.i!==3&&!jm(t.D,r)?o.concat(r):void 0);if(LW(n,r,a),!Jd(a))return;e.m=!1}if(sc(i)&&!QE(i)){if(!e.h.F&&e._<1)return;H5(e,i),t&&t.A.l||V5(e,i)}}function V5(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&ZE(t,n)}function vC(e,t){var n=e[vr];return(n?gh(n):e)[t]}function _I(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function wd(e){e.P||(e.P=!0,e.l&&wd(e.l))}function yC(e){e.o||(e.o=XE(e.t))}function u8(e,t,n){var r=YE(t)?nu("MapSet").N(t,n):KE(t)?nu("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:s8(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=ty;a&&(l=[s],u=Tv);var d=Proxy.revocable(l,u),h=d.revoke,m=d.proxy;return s.k=m,s.j=h,m}(t,n):nu("ES5").J(t,n);return(n?n.A:s8()).p.push(r),r}function nSe(e){return Jd(e)||Ws(22,e),function t(n){if(!sc(n))return n;var r,i=n[vr],o=E0(n);if(i){if(!i.P&&(i.i<4||!nu("ES5").K(i)))return i.t;i.I=!0,r=kI(n,o),i.I=!1}else r=kI(n,o);return ep(r,function(a,s){i&&Q5e(i.t,a)===s||LW(r,a,t(s))}),o===3?new Set(r):r}(e)}function kI(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return XE(e)}function rSe(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[vr];return ty.get(l,o)},set:function(l){var u=this[vr];ty.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][vr];if(!s.P)switch(s.i){case 5:r(s)&&wd(s);break;case 4:n(s)&&wd(s)}}}function n(o){for(var a=o.t,s=o.k,l=Bm(s),u=l.length-1;u>=0;u--){var d=l[u];if(d!==vr){var h=a[d];if(h===void 0&&!jm(a,d))return!0;var m=s[d],v=m&&m[vr];if(v?v.t!==h:!AW(m,h))return!0}}var b=!!a[vr];return l.length!==Bm(a).length+(b?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?E-1:0),T=1;T1?d-1:0),m=1;m=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=nu("Patches").$;return Jd(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Ra=new sSe,IW=Ra.produce;Ra.produceWithPatches.bind(Ra);Ra.setAutoFreeze.bind(Ra);Ra.setUseProxies.bind(Ra);Ra.applyPatches.bind(Ra);Ra.createDraft.bind(Ra);Ra.finishDraft.bind(Ra);function LI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function AI(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ro(1));return n(eP)(e,t)}if(typeof e!="function")throw new Error(ro(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function d(){if(l)throw new Error(ro(3));return o}function h(S){if(typeof S!="function")throw new Error(ro(4));if(l)throw new Error(ro(5));var _=!0;return u(),s.push(S),function(){if(_){if(l)throw new Error(ro(6));_=!1,u();var k=s.indexOf(S);s.splice(k,1),a=null}}}function m(S){if(!lSe(S))throw new Error(ro(7));if(typeof S.type>"u")throw new Error(ro(8));if(l)throw new Error(ro(9));try{l=!0,o=i(o,S)}finally{l=!1}for(var _=a=s,E=0;E<_.length;E++){var k=_[E];k()}return S}function v(S){if(typeof S!="function")throw new Error(ro(10));i=S,m({type:W5.REPLACE})}function b(){var S,_=h;return S={subscribe:function(k){if(typeof k!="object"||k===null)throw new Error(ro(11));function T(){k.next&&k.next(d())}T();var A=_(T);return{unsubscribe:A}}},S[OI]=function(){return this},S}return m({type:W5.INIT}),r={dispatch:m,subscribe:h,getState:d,replaceReducer:v},r[OI]=b,r}function uSe(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:W5.INIT});if(typeof r>"u")throw new Error(ro(12));if(typeof n(void 0,{type:W5.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ro(13))})}function RW(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(ro(14));h[v]=_,d=d||_!==S}return d=d||o.length!==Object.keys(l).length,d?h:l}}function U5(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return G5}function i(s,l){r(s)===G5&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var hSe=function(t,n){return t===n};function pSe(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(R).forEach(function(D){T(D)&&d[D]!==R[D]&&m.indexOf(D)===-1&&m.push(D)}),Object.keys(d).forEach(function(D){R[D]===void 0&&T(D)&&m.indexOf(D)===-1&&d[D]!==void 0&&m.push(D)}),v===null&&(v=setInterval(E,i)),d=R},o)}function E(){if(m.length===0){v&&clearInterval(v),v=null;return}var R=m.shift(),D=r.reduce(function(j,z){return z.in(j,R,d)},d[R]);if(D!==void 0)try{h[R]=l(D)}catch(j){console.error("redux-persist/createPersistoid: error serializing state",j)}else delete h[R];m.length===0&&k()}function k(){Object.keys(h).forEach(function(R){d[R]===void 0&&delete h[R]}),b=s.setItem(a,l(h)).catch(A)}function T(R){return!(n&&n.indexOf(R)===-1&&R!=="_persist"||t&&t.indexOf(R)!==-1)}function A(R){u&&u(R)}var M=function(){for(;m.length!==0;)E();return b||Promise.resolve()};return{update:_,flush:M}}function YSe(e){return JSON.stringify(e)}function KSe(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:nP).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=XSe,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,d){return d.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function XSe(e){return JSON.parse(e)}function ZSe(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:nP).concat(e.key);return t.removeItem(n,QSe)}function QSe(e){}function BI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zu(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function txe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var nxe=5e3;function rxe(e,t){var n=e.version!==void 0?e.version:VSe;e.debug;var r=e.stateReconciler===void 0?GSe:e.stateReconciler,i=e.getStoredState||KSe,o=e.timeout!==void 0?e.timeout:nxe,a=null,s=!1,l=!0,u=function(h){return h._persist.rehydrated&&a&&!l&&a.update(h),h};return function(d,h){var m=d||{},v=m._persist,b=exe(m,["_persist"]),S=b;if(h.type===FW){var _=!1,E=function(j,z){_||(h.rehydrate(e.key,j,z),_=!0)};if(o&&setTimeout(function(){!_&&E(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=qSe(e)),v)return zu({},t(S,h),{_persist:v});if(typeof h.rehydrate!="function"||typeof h.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return h.register(e.key),i(e).then(function(D){var j=e.migrate||function(z,H){return Promise.resolve(z)};j(D,n).then(function(z){E(z)},function(z){E(void 0,z)})},function(D){E(void 0,D)}),zu({},t(S,h),{_persist:{version:n,rehydrated:!1}})}else{if(h.type===zW)return s=!0,h.result(ZSe(e)),zu({},t(S,h),{_persist:v});if(h.type===BW)return h.result(a&&a.flush()),zu({},t(S,h),{_persist:v});if(h.type===$W)l=!0;else if(h.type===rP){if(s)return zu({},S,{_persist:zu({},v,{rehydrated:!0})});if(h.key===e.key){var k=t(S,h),T=h.payload,A=r!==!1&&T!==void 0?r(T,d,k,e):k,M=zu({},A,{_persist:zu({},v,{rehydrated:!0})});return u(M)}}}if(!v)return t(d,h);var R=t(S,h);return R===S?d:u(zu({},R,{_persist:v}))}}function $I(e){return axe(e)||oxe(e)||ixe()}function ixe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function oxe(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function axe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:VW,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case HW:return f8({},t,{registry:[].concat($I(t.registry),[n.key])});case rP:var r=t.registry.indexOf(n.key),i=$I(t.registry);return i.splice(r,1),f8({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function uxe(e,t,n){var r=n||!1,i=eP(lxe,VW,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:HW,key:u})},a=function(u,d,h){var m={type:rP,payload:d,err:h,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=f8({},i,{purge:function(){var u=[];return e.dispatch({type:zW,result:function(h){u.push(h)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:BW,result:function(h){u.push(h)}}),Promise.all(u)},pause:function(){e.dispatch({type:$W})},persist:function(){e.dispatch({type:FW,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var iP={},oP={};oP.__esModule=!0;oP.default=fxe;function N4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?N4=function(n){return typeof n}:N4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},N4(e)}function wC(){}var cxe={getItem:wC,setItem:wC,removeItem:wC};function dxe(e){if((typeof self>"u"?"undefined":N4(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function fxe(e){var t="".concat(e,"Storage");return dxe(t)?self[t]:cxe}iP.__esModule=!0;iP.default=gxe;var hxe=pxe(oP);function pxe(e){return e&&e.__esModule?e:{default:e}}function gxe(e){var t=(0,hxe.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var WW=void 0,mxe=vxe(iP);function vxe(e){return e&&e.__esModule?e:{default:e}}var yxe=(0,mxe.default)("local");WW=yxe;var UW={},GW={},tp={};Object.defineProperty(tp,"__esModule",{value:!0});tp.PLACEHOLDER_UNDEFINED=tp.PACKAGE_NAME=void 0;tp.PACKAGE_NAME="redux-deep-persist";tp.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var aP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(aP);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=tp,n=aP,r=function(G){return typeof G=="object"&&G!==null};e.isObjectLike=r;const i=function(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(G){return(0,e.isLength)(G&&G.length)&&Object.prototype.toString.call(G)==="[object Array]"};const o=function(G){return!!G&&typeof G=="object"&&!(0,e.isArray)(G)};e.isPlainObject=o;const a=function(G){return String(~~G)===G&&Number(G)>=0};e.isIntegerString=a;const s=function(G){return Object.prototype.toString.call(G)==="[object String]"};e.isString=s;const l=function(G){return Object.prototype.toString.call(G)==="[object Date]"};e.isDate=l;const u=function(G){return Object.keys(G).length===0};e.isEmpty=u;const d=Object.prototype.hasOwnProperty,h=function(G,$,W){W||(W=new Set([G])),$||($="");for(const X in G){const Z=$?`${$}.${X}`:X,U=G[X];if((0,e.isObjectLike)(U))return W.has(U)?`${$}.${X}:`:(W.add(U),(0,e.getCircularPath)(U,Z,W))}return null};e.getCircularPath=h;const m=function(G){if(!(0,e.isObjectLike)(G))return G;if((0,e.isDate)(G))return new Date(+G);const $=(0,e.isArray)(G)?[]:{};for(const W in G){const X=G[W];$[W]=(0,e._cloneDeep)(X)}return $};e._cloneDeep=m;const v=function(G){const $=(0,e.getCircularPath)(G);if($)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${$}' of object you're trying to persist: ${G}`);return(0,e._cloneDeep)(G)};e.cloneDeep=v;const b=function(G,$){if(G===$)return{};if(!(0,e.isObjectLike)(G)||!(0,e.isObjectLike)($))return $;const W=(0,e.cloneDeep)(G),X=(0,e.cloneDeep)($),Z=Object.keys(W).reduce((Q,re)=>(d.call(X,re)||(Q[re]=void 0),Q),{});if((0,e.isDate)(W)||(0,e.isDate)(X))return W.valueOf()===X.valueOf()?{}:X;const U=Object.keys(X).reduce((Q,re)=>{if(!d.call(W,re))return Q[re]=X[re],Q;const fe=(0,e.difference)(W[re],X[re]);return(0,e.isObjectLike)(fe)&&(0,e.isEmpty)(fe)&&!(0,e.isDate)(fe)?(0,e.isArray)(W)&&!(0,e.isArray)(X)||!(0,e.isArray)(W)&&(0,e.isArray)(X)?X:Q:(Q[re]=fe,Q)},Z);return delete U._persist,U};e.difference=b;const S=function(G,$){return $.reduce((W,X)=>{if(W){const Z=parseInt(X,10),U=(0,e.isIntegerString)(X)&&Z<0?W.length+Z:X;return(0,e.isString)(W)?W.charAt(U):W[U]}},G)};e.path=S;const _=function(G,$){return[...G].reverse().reduce((Z,U,Q)=>{const re=(0,e.isIntegerString)(U)?[]:{};return re[U]=Q===0?$:Z,re},{})};e.assocPath=_;const E=function(G,$){const W=(0,e.cloneDeep)(G);return $.reduce((X,Z,U)=>(U===$.length-1&&X&&(0,e.isObjectLike)(X)&&delete X[Z],X&&X[Z]),W),W};e.dissocPath=E;const k=function(G,$,...W){if(!W||!W.length)return $;const X=W.shift(),{preservePlaceholder:Z,preserveUndefined:U}=G;if((0,e.isObjectLike)($)&&(0,e.isObjectLike)(X))for(const Q in X)if((0,e.isObjectLike)(X[Q])&&(0,e.isObjectLike)($[Q]))$[Q]||($[Q]={}),k(G,$[Q],X[Q]);else if((0,e.isArray)($)){let re=X[Q];const fe=Z?t.PLACEHOLDER_UNDEFINED:void 0;U||(re=typeof re<"u"?re:$[parseInt(Q,10)]),re=re!==t.PLACEHOLDER_UNDEFINED?re:fe,$[parseInt(Q,10)]=re}else{const re=X[Q]!==t.PLACEHOLDER_UNDEFINED?X[Q]:void 0;$[Q]=re}return k(G,$,...W)},T=function(G,$,W){return k({preservePlaceholder:W==null?void 0:W.preservePlaceholder,preserveUndefined:W==null?void 0:W.preserveUndefined},(0,e.cloneDeep)(G),(0,e.cloneDeep)($))};e.mergeDeep=T;const A=function(G,$=[],W,X,Z){if(!(0,e.isObjectLike)(G))return G;for(const U in G){const Q=G[U],re=(0,e.isArray)(G),fe=X?X+"."+U:U;Q===null&&(W===n.ConfigType.WHITELIST&&$.indexOf(fe)===-1||W===n.ConfigType.BLACKLIST&&$.indexOf(fe)!==-1)&&re&&(G[parseInt(U,10)]=void 0),Q===void 0&&Z&&W===n.ConfigType.BLACKLIST&&$.indexOf(fe)===-1&&re&&(G[parseInt(U,10)]=t.PLACEHOLDER_UNDEFINED),A(Q,$,W,fe,Z)}},M=function(G,$,W,X){const Z=(0,e.cloneDeep)(G);return A(Z,$,W,"",X),Z};e.preserveUndefined=M;const R=function(G,$,W){return W.indexOf(G)===$};e.unique=R;const D=function(G){return G.reduce(($,W)=>{const X=G.filter(Ee=>Ee===W),Z=G.filter(Ee=>(W+".").indexOf(Ee+".")===0),{duplicates:U,subsets:Q}=$,re=X.length>1&&U.indexOf(W)===-1,fe=Z.length>1;return{duplicates:[...U,...re?X:[]],subsets:[...Q,...fe?Z:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=D;const j=function(G,$,W){const X=W===n.ConfigType.WHITELIST?"whitelist":"blacklist",Z=`${t.PACKAGE_NAME}: incorrect ${X} configuration.`,U=`Check your create${W===n.ConfigType.WHITELIST?"White":"Black"}list arguments. + */var qE=Symbol.for("react.element"),YE=Symbol.for("react.portal"),Tx=Symbol.for("react.fragment"),Lx=Symbol.for("react.strict_mode"),Ax=Symbol.for("react.profiler"),Ox=Symbol.for("react.provider"),Mx=Symbol.for("react.context"),B5e=Symbol.for("react.server_context"),Ix=Symbol.for("react.forward_ref"),Rx=Symbol.for("react.suspense"),Dx=Symbol.for("react.suspense_list"),Nx=Symbol.for("react.memo"),jx=Symbol.for("react.lazy"),F5e=Symbol.for("react.offscreen"),EW;EW=Symbol.for("react.module.reference");function ms(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case qE:switch(e=e.type,e){case Tx:case Ax:case Lx:case Rx:case Dx:return e;default:switch(e=e&&e.$$typeof,e){case B5e:case Mx:case Ix:case jx:case Nx:case Ox:return e;default:return t}}case YE:return t}}}$n.ContextConsumer=Mx;$n.ContextProvider=Ox;$n.Element=qE;$n.ForwardRef=Ix;$n.Fragment=Tx;$n.Lazy=jx;$n.Memo=Nx;$n.Portal=YE;$n.Profiler=Ax;$n.StrictMode=Lx;$n.Suspense=Rx;$n.SuspenseList=Dx;$n.isAsyncMode=function(){return!1};$n.isConcurrentMode=function(){return!1};$n.isContextConsumer=function(e){return ms(e)===Mx};$n.isContextProvider=function(e){return ms(e)===Ox};$n.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===qE};$n.isForwardRef=function(e){return ms(e)===Ix};$n.isFragment=function(e){return ms(e)===Tx};$n.isLazy=function(e){return ms(e)===jx};$n.isMemo=function(e){return ms(e)===Nx};$n.isPortal=function(e){return ms(e)===YE};$n.isProfiler=function(e){return ms(e)===Ax};$n.isStrictMode=function(e){return ms(e)===Lx};$n.isSuspense=function(e){return ms(e)===Rx};$n.isSuspenseList=function(e){return ms(e)===Dx};$n.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Tx||e===Ax||e===Lx||e===Rx||e===Dx||e===F5e||typeof e=="object"&&e!==null&&(e.$$typeof===jx||e.$$typeof===Nx||e.$$typeof===Ox||e.$$typeof===Mx||e.$$typeof===Ix||e.$$typeof===EW||e.getModuleId!==void 0)};$n.typeOf=ms;(function(e){e.exports=$n})(j5e);function $5e(){const e=O5e();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const xI={notify(){},get:()=>[]};function z5e(e,t){let n,r=xI;function i(h){return l(),r.subscribe(h)}function o(){r.notify()}function a(){d.onStateChange&&d.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=$5e())}function u(){n&&(n(),n=void 0,r.clear(),r=xI)}const d={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return d}const H5e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",V5e=H5e?w.useLayoutEffect:w.useEffect;function W5e({store:e,context:t,children:n,serverState:r}){const i=w.useMemo(()=>{const s=z5e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=w.useMemo(()=>e.getState(),[e]);V5e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]);const a=t||Jd;return N.createElement(a.Provider,{value:i},n)}function PW(e=Jd){const t=e===Jd?_W:()=>w.useContext(e);return function(){const{store:r}=t();return r}}const U5e=PW();function G5e(e=Jd){const t=e===Jd?U5e:PW(e);return function(){return t().dispatch}}const q5e=G5e();I5e(i8.useSyncExternalStoreWithSelector);A5e(el.unstable_batchedUpdates);function M4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?M4=function(n){return typeof n}:M4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},M4(e)}function Y5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:KE(e)?2:XE(e)?3:0}function Bm(e,t){return P0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Q5e(e,t){return P0(e)===2?e.get(t):e[t]}function LW(e,t,n){var r=P0(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function AW(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function KE(e){return iSe&&e instanceof Map}function XE(e){return oSe&&e instanceof Set}function mh(e){return e.o||e.t}function ZE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=MW(e);delete t[yr];for(var n=Fm(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=J5e),Object.freeze(e),t&&tp(e,function(n,r){return QE(r,!0)},!0)),e}function J5e(){Ws(2)}function JE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function nu(e){var t=c8[e];return t||Ws(18,e),t}function eSe(e,t){c8[e]||(c8[e]=t)}function s8(){return ey}function gC(e,t){t&&(nu("Patches"),e.u=[],e.s=[],e.v=t)}function z5(e){l8(e),e.p.forEach(tSe),e.p=null}function l8(e){e===ey&&(ey=e.l)}function CI(e){return ey={p:[],l:ey,h:e,m:!0,_:0}}function tSe(e){var t=e[yr];t.i===0||t.i===1?t.j():t.O=!0}function mC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||nu("ES5").S(t,e,r),r?(n[yr].P&&(z5(t),Ws(4)),sc(e)&&(e=H5(t,e),t.l||V5(t,e)),t.u&&nu("Patches").M(n[yr].t,e,t.u,t.s)):e=H5(t,n,[]),z5(t),t.u&&t.v(t.u,t.s),e!==OW?e:void 0}function H5(e,t,n){if(JE(t))return t;var r=t[yr];if(!r)return tp(t,function(o,a){return _I(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return V5(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=ZE(r.k):r.o;tp(r.i===3?new Set(i):i,function(o,a){return _I(e,r,i,o,a,n)}),V5(e,i,!1),n&&e.u&&nu("Patches").R(r,n,e.u,e.s)}return r.o}function _I(e,t,n,r,i,o){if(ef(i)){var a=H5(e,i,o&&t&&t.i!==3&&!Bm(t.D,r)?o.concat(r):void 0);if(LW(n,r,a),!ef(a))return;e.m=!1}if(sc(i)&&!JE(i)){if(!e.h.F&&e._<1)return;H5(e,i),t&&t.A.l||V5(e,i)}}function V5(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&QE(t,n)}function vC(e,t){var n=e[yr];return(n?mh(n):e)[t]}function kI(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function wd(e){e.P||(e.P=!0,e.l&&wd(e.l))}function yC(e){e.o||(e.o=ZE(e.t))}function u8(e,t,n){var r=KE(t)?nu("MapSet").N(t,n):XE(t)?nu("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:s8(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=ty;a&&(l=[s],u=Tv);var d=Proxy.revocable(l,u),h=d.revoke,m=d.proxy;return s.k=m,s.j=h,m}(t,n):nu("ES5").J(t,n);return(n?n.A:s8()).p.push(r),r}function nSe(e){return ef(e)||Ws(22,e),function t(n){if(!sc(n))return n;var r,i=n[yr],o=P0(n);if(i){if(!i.P&&(i.i<4||!nu("ES5").K(i)))return i.t;i.I=!0,r=EI(n,o),i.I=!1}else r=EI(n,o);return tp(r,function(a,s){i&&Q5e(i.t,a)===s||LW(r,a,t(s))}),o===3?new Set(r):r}(e)}function EI(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return ZE(e)}function rSe(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[yr];return ty.get(l,o)},set:function(l){var u=this[yr];ty.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][yr];if(!s.P)switch(s.i){case 5:r(s)&&wd(s);break;case 4:n(s)&&wd(s)}}}function n(o){for(var a=o.t,s=o.k,l=Fm(s),u=l.length-1;u>=0;u--){var d=l[u];if(d!==yr){var h=a[d];if(h===void 0&&!Bm(a,d))return!0;var m=s[d],y=m&&m[yr];if(y?y.t!==h:!AW(m,h))return!0}}var b=!!a[yr];return l.length!==Fm(a).length+(b?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?E-1:0),P=1;P1?d-1:0),m=1;m=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=nu("Patches").$;return ef(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Ra=new sSe,IW=Ra.produce;Ra.produceWithPatches.bind(Ra);Ra.setAutoFreeze.bind(Ra);Ra.setUseProxies.bind(Ra);Ra.applyPatches.bind(Ra);Ra.createDraft.bind(Ra);Ra.finishDraft.bind(Ra);function AI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OI(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ro(1));return n(tP)(e,t)}if(typeof e!="function")throw new Error(ro(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function d(){if(l)throw new Error(ro(3));return o}function h(x){if(typeof x!="function")throw new Error(ro(4));if(l)throw new Error(ro(5));var k=!0;return u(),s.push(x),function(){if(k){if(l)throw new Error(ro(6));k=!1,u();var _=s.indexOf(x);s.splice(_,1),a=null}}}function m(x){if(!lSe(x))throw new Error(ro(7));if(typeof x.type>"u")throw new Error(ro(8));if(l)throw new Error(ro(9));try{l=!0,o=i(o,x)}finally{l=!1}for(var k=a=s,E=0;E"u")throw new Error(ro(12));if(typeof n(void 0,{type:W5.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ro(13))})}function RW(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(ro(14));h[y]=k,d=d||k!==x}return d=d||o.length!==Object.keys(l).length,d?h:l}}function U5(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return G5}function i(s,l){r(s)===G5&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var hSe=function(t,n){return t===n};function pSe(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(R).forEach(function(D){P(D)&&d[D]!==R[D]&&m.indexOf(D)===-1&&m.push(D)}),Object.keys(d).forEach(function(D){R[D]===void 0&&P(D)&&m.indexOf(D)===-1&&d[D]!==void 0&&m.push(D)}),y===null&&(y=setInterval(E,i)),d=R},o)}function E(){if(m.length===0){y&&clearInterval(y),y=null;return}var R=m.shift(),D=r.reduce(function(j,z){return z.in(j,R,d)},d[R]);if(D!==void 0)try{h[R]=l(D)}catch(j){console.error("redux-persist/createPersistoid: error serializing state",j)}else delete h[R];m.length===0&&_()}function _(){Object.keys(h).forEach(function(R){d[R]===void 0&&delete h[R]}),b=s.setItem(a,l(h)).catch(A)}function P(R){return!(n&&n.indexOf(R)===-1&&R!=="_persist"||t&&t.indexOf(R)!==-1)}function A(R){u&&u(R)}var M=function(){for(;m.length!==0;)E();return b||Promise.resolve()};return{update:k,flush:M}}function YSe(e){return JSON.stringify(e)}function KSe(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:rP).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=XSe,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,d){return d.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function XSe(e){return JSON.parse(e)}function ZSe(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:rP).concat(e.key);return t.removeItem(n,QSe)}function QSe(e){}function FI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zu(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function txe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var nxe=5e3;function rxe(e,t){var n=e.version!==void 0?e.version:VSe;e.debug;var r=e.stateReconciler===void 0?GSe:e.stateReconciler,i=e.getStoredState||KSe,o=e.timeout!==void 0?e.timeout:nxe,a=null,s=!1,l=!0,u=function(h){return h._persist.rehydrated&&a&&!l&&a.update(h),h};return function(d,h){var m=d||{},y=m._persist,b=exe(m,["_persist"]),x=b;if(h.type===$W){var k=!1,E=function(j,z){k||(h.rehydrate(e.key,j,z),k=!0)};if(o&&setTimeout(function(){!k&&E(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=qSe(e)),y)return zu({},t(x,h),{_persist:y});if(typeof h.rehydrate!="function"||typeof h.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return h.register(e.key),i(e).then(function(D){var j=e.migrate||function(z,H){return Promise.resolve(z)};j(D,n).then(function(z){E(z)},function(z){E(void 0,z)})},function(D){E(void 0,D)}),zu({},t(x,h),{_persist:{version:n,rehydrated:!1}})}else{if(h.type===zW)return s=!0,h.result(ZSe(e)),zu({},t(x,h),{_persist:y});if(h.type===BW)return h.result(a&&a.flush()),zu({},t(x,h),{_persist:y});if(h.type===FW)l=!0;else if(h.type===iP){if(s)return zu({},x,{_persist:zu({},y,{rehydrated:!0})});if(h.key===e.key){var _=t(x,h),P=h.payload,A=r!==!1&&P!==void 0?r(P,d,_,e):_,M=zu({},A,{_persist:zu({},y,{rehydrated:!0})});return u(M)}}}if(!y)return t(d,h);var R=t(x,h);return R===x?d:u(zu({},R,{_persist:y}))}}function $I(e){return axe(e)||oxe(e)||ixe()}function ixe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function oxe(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function axe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:VW,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case HW:return f8({},t,{registry:[].concat($I(t.registry),[n.key])});case iP:var r=t.registry.indexOf(n.key),i=$I(t.registry);return i.splice(r,1),f8({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function uxe(e,t,n){var r=n||!1,i=tP(lxe,VW,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:HW,key:u})},a=function(u,d,h){var m={type:iP,payload:d,err:h,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=f8({},i,{purge:function(){var u=[];return e.dispatch({type:zW,result:function(h){u.push(h)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:BW,result:function(h){u.push(h)}}),Promise.all(u)},pause:function(){e.dispatch({type:FW})},persist:function(){e.dispatch({type:$W,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var oP={},aP={};aP.__esModule=!0;aP.default=fxe;function N4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?N4=function(n){return typeof n}:N4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},N4(e)}function wC(){}var cxe={getItem:wC,setItem:wC,removeItem:wC};function dxe(e){if((typeof self>"u"?"undefined":N4(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function fxe(e){var t="".concat(e,"Storage");return dxe(t)?self[t]:cxe}oP.__esModule=!0;oP.default=gxe;var hxe=pxe(aP);function pxe(e){return e&&e.__esModule?e:{default:e}}function gxe(e){var t=(0,hxe.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var WW=void 0,mxe=vxe(oP);function vxe(e){return e&&e.__esModule?e:{default:e}}var yxe=(0,mxe.default)("local");WW=yxe;var UW={},GW={},np={};Object.defineProperty(np,"__esModule",{value:!0});np.PLACEHOLDER_UNDEFINED=np.PACKAGE_NAME=void 0;np.PACKAGE_NAME="redux-deep-persist";np.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var sP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(sP);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=np,n=sP,r=function(G){return typeof G=="object"&&G!==null};e.isObjectLike=r;const i=function(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(G){return(0,e.isLength)(G&&G.length)&&Object.prototype.toString.call(G)==="[object Array]"};const o=function(G){return!!G&&typeof G=="object"&&!(0,e.isArray)(G)};e.isPlainObject=o;const a=function(G){return String(~~G)===G&&Number(G)>=0};e.isIntegerString=a;const s=function(G){return Object.prototype.toString.call(G)==="[object String]"};e.isString=s;const l=function(G){return Object.prototype.toString.call(G)==="[object Date]"};e.isDate=l;const u=function(G){return Object.keys(G).length===0};e.isEmpty=u;const d=Object.prototype.hasOwnProperty,h=function(G,F,W){W||(W=new Set([G])),F||(F="");for(const X in G){const Z=F?`${F}.${X}`:X,U=G[X];if((0,e.isObjectLike)(U))return W.has(U)?`${F}.${X}:`:(W.add(U),(0,e.getCircularPath)(U,Z,W))}return null};e.getCircularPath=h;const m=function(G){if(!(0,e.isObjectLike)(G))return G;if((0,e.isDate)(G))return new Date(+G);const F=(0,e.isArray)(G)?[]:{};for(const W in G){const X=G[W];F[W]=(0,e._cloneDeep)(X)}return F};e._cloneDeep=m;const y=function(G){const F=(0,e.getCircularPath)(G);if(F)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${F}' of object you're trying to persist: ${G}`);return(0,e._cloneDeep)(G)};e.cloneDeep=y;const b=function(G,F){if(G===F)return{};if(!(0,e.isObjectLike)(G)||!(0,e.isObjectLike)(F))return F;const W=(0,e.cloneDeep)(G),X=(0,e.cloneDeep)(F),Z=Object.keys(W).reduce((Q,re)=>(d.call(X,re)||(Q[re]=void 0),Q),{});if((0,e.isDate)(W)||(0,e.isDate)(X))return W.valueOf()===X.valueOf()?{}:X;const U=Object.keys(X).reduce((Q,re)=>{if(!d.call(W,re))return Q[re]=X[re],Q;const fe=(0,e.difference)(W[re],X[re]);return(0,e.isObjectLike)(fe)&&(0,e.isEmpty)(fe)&&!(0,e.isDate)(fe)?(0,e.isArray)(W)&&!(0,e.isArray)(X)||!(0,e.isArray)(W)&&(0,e.isArray)(X)?X:Q:(Q[re]=fe,Q)},Z);return delete U._persist,U};e.difference=b;const x=function(G,F){return F.reduce((W,X)=>{if(W){const Z=parseInt(X,10),U=(0,e.isIntegerString)(X)&&Z<0?W.length+Z:X;return(0,e.isString)(W)?W.charAt(U):W[U]}},G)};e.path=x;const k=function(G,F){return[...G].reverse().reduce((Z,U,Q)=>{const re=(0,e.isIntegerString)(U)?[]:{};return re[U]=Q===0?F:Z,re},{})};e.assocPath=k;const E=function(G,F){const W=(0,e.cloneDeep)(G);return F.reduce((X,Z,U)=>(U===F.length-1&&X&&(0,e.isObjectLike)(X)&&delete X[Z],X&&X[Z]),W),W};e.dissocPath=E;const _=function(G,F,...W){if(!W||!W.length)return F;const X=W.shift(),{preservePlaceholder:Z,preserveUndefined:U}=G;if((0,e.isObjectLike)(F)&&(0,e.isObjectLike)(X))for(const Q in X)if((0,e.isObjectLike)(X[Q])&&(0,e.isObjectLike)(F[Q]))F[Q]||(F[Q]={}),_(G,F[Q],X[Q]);else if((0,e.isArray)(F)){let re=X[Q];const fe=Z?t.PLACEHOLDER_UNDEFINED:void 0;U||(re=typeof re<"u"?re:F[parseInt(Q,10)]),re=re!==t.PLACEHOLDER_UNDEFINED?re:fe,F[parseInt(Q,10)]=re}else{const re=X[Q]!==t.PLACEHOLDER_UNDEFINED?X[Q]:void 0;F[Q]=re}return _(G,F,...W)},P=function(G,F,W){return _({preservePlaceholder:W==null?void 0:W.preservePlaceholder,preserveUndefined:W==null?void 0:W.preserveUndefined},(0,e.cloneDeep)(G),(0,e.cloneDeep)(F))};e.mergeDeep=P;const A=function(G,F=[],W,X,Z){if(!(0,e.isObjectLike)(G))return G;for(const U in G){const Q=G[U],re=(0,e.isArray)(G),fe=X?X+"."+U:U;Q===null&&(W===n.ConfigType.WHITELIST&&F.indexOf(fe)===-1||W===n.ConfigType.BLACKLIST&&F.indexOf(fe)!==-1)&&re&&(G[parseInt(U,10)]=void 0),Q===void 0&&Z&&W===n.ConfigType.BLACKLIST&&F.indexOf(fe)===-1&&re&&(G[parseInt(U,10)]=t.PLACEHOLDER_UNDEFINED),A(Q,F,W,fe,Z)}},M=function(G,F,W,X){const Z=(0,e.cloneDeep)(G);return A(Z,F,W,"",X),Z};e.preserveUndefined=M;const R=function(G,F,W){return W.indexOf(G)===F};e.unique=R;const D=function(G){return G.reduce((F,W)=>{const X=G.filter(Ee=>Ee===W),Z=G.filter(Ee=>(W+".").indexOf(Ee+".")===0),{duplicates:U,subsets:Q}=F,re=X.length>1&&U.indexOf(W)===-1,fe=Z.length>1;return{duplicates:[...U,...re?X:[]],subsets:[...Q,...fe?Z:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=D;const j=function(G,F,W){const X=W===n.ConfigType.WHITELIST?"whitelist":"blacklist",Z=`${t.PACKAGE_NAME}: incorrect ${X} configuration.`,U=`Check your create${W===n.ConfigType.WHITELIST?"White":"Black"}list arguments. -`;if(!(0,e.isString)($)||$.length<1)throw new Error(`${Z} Name (key) of reducer is required. ${U}`);if(!G||!G.length)return;const{duplicates:Q,subsets:re}=(0,e.findDuplicatesAndSubsets)(G);if(Q.length>1)throw new Error(`${Z} Duplicated paths. +`;if(!(0,e.isString)(F)||F.length<1)throw new Error(`${Z} Name (key) of reducer is required. ${U}`);if(!G||!G.length)return;const{duplicates:Q,subsets:re}=(0,e.findDuplicatesAndSubsets)(G);if(Q.length>1)throw new Error(`${Z} Duplicated paths. ${JSON.stringify(Q)} @@ -441,24 +441,24 @@ Error generating stack: `+o.message+` ${JSON.stringify(re)} - ${U}`)};e.singleTransformValidator=j;const z=function(G){if(!(0,e.isArray)(G))return;const $=(G==null?void 0:G.map(W=>W.deepPersistKey).filter(W=>W))||[];if($.length){const W=$.filter((X,Z)=>$.indexOf(X)!==Z);if(W.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. + ${U}`)};e.singleTransformValidator=j;const z=function(G){if(!(0,e.isArray)(G))return;const F=(G==null?void 0:G.map(W=>W.deepPersistKey).filter(W=>W))||[];if(F.length){const W=F.filter((X,Z)=>F.indexOf(X)!==Z);if(W.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. - Duplicates: ${JSON.stringify(W)}`)}};e.transformsValidator=z;const H=function({whitelist:G,blacklist:$}){if(G&&G.length&&$&&$.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(G){const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)(G);(0,e.throwError)({duplicates:W,subsets:X},"whitelist")}if($){const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)($);(0,e.throwError)({duplicates:W,subsets:X},"blacklist")}};e.configValidator=H;const K=function({duplicates:G,subsets:$},W){if(G.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${W}. + Duplicates: ${JSON.stringify(W)}`)}};e.transformsValidator=z;const H=function({whitelist:G,blacklist:F}){if(G&&G.length&&F&&F.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(G){const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)(G);(0,e.throwError)({duplicates:W,subsets:X},"whitelist")}if(F){const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)(F);(0,e.throwError)({duplicates:W,subsets:X},"blacklist")}};e.configValidator=H;const K=function({duplicates:G,subsets:F},W){if(G.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${W}. - ${JSON.stringify(G)}`);if($.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${W}. You must decide if you want to persist an entire path or its specific subset. + ${JSON.stringify(G)}`);if(F.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${W}. You must decide if you want to persist an entire path or its specific subset. - ${JSON.stringify($)}`)};e.throwError=K;const te=function(G){return(0,e.isArray)(G)?G.filter(e.unique).reduce(($,W)=>{const X=W.split("."),Z=X[0],U=X.slice(1).join(".")||void 0,Q=$.filter(fe=>Object.keys(fe)[0]===Z)[0],re=Q?Object.values(Q)[0]:void 0;return Q||$.push({[Z]:U?[U]:void 0}),Q&&!re&&U&&(Q[Z]=[U]),Q&&re&&U&&re.push(U),$},[]):[]};e.getRootKeysGroup=te})(GW);(function(e){var t=_o&&_o.__rest||function(h,m){var v={};for(var b in h)Object.prototype.hasOwnProperty.call(h,b)&&m.indexOf(b)<0&&(v[b]=h[b]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var S=0,b=Object.getOwnPropertySymbols(h);S!_(k)&&h?h(E,k,T):E,out:(E,k,T)=>!_(k)&&m?m(E,k,T):E,deepPersistKey:b&&b[0]}},a=(h,m,v,{debug:b,whitelist:S,blacklist:_,transforms:E})=>{if(S||_)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(E);const k=(0,n.cloneDeep)(v);let T=h;if(T&&(0,n.isObjectLike)(T)){const A=(0,n.difference)(m,v);(0,n.isEmpty)(A)||(T=(0,n.mergeDeep)(h,A,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(A)}`)),Object.keys(T).forEach(M=>{if(M!=="_persist"){if((0,n.isObjectLike)(k[M])){k[M]=(0,n.mergeDeep)(k[M],T[M]);return}k[M]=T[M]}})}return b&&T&&(0,n.isObjectLike)(T)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(T)}`),k};e.autoMergeDeep=a;const s=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.WHITELIST),o(v=>{if(!m||!m.length)return v;let b=null,S;return m.forEach(_=>{const E=_.split(".");S=(0,n.path)(v,E),typeof S>"u"&&(0,n.isIntegerString)(E[E.length-1])&&(S=r.PLACEHOLDER_UNDEFINED);const k=(0,n.assocPath)(E,S),T=(0,n.isArray)(k)?[]:{};b=(0,n.mergeDeep)(b||T,k,{preservePlaceholder:!0})}),b||v},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.WHITELIST),{whitelist:[h]}));e.createWhitelist=s;const l=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.BLACKLIST),o(v=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST,!0);return m.map(_=>_.split(".")).reduce((_,E)=>(0,n.dissocPath)(_,E),b)},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST),{whitelist:[h]}));e.createBlacklist=l;const u=function(h,m){return m.map(v=>{const b=Object.keys(v)[0],S=v[b];return h===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,S):(0,e.createBlacklist)(b,S)})};e.getTransforms=u;const d=h=>{var{key:m,whitelist:v,blacklist:b,storage:S,transforms:_,rootReducer:E}=h,k=t(h,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:v,blacklist:b});const T=(0,n.getRootKeysGroup)(v),A=(0,n.getRootKeysGroup)(b),M=Object.keys(E(void 0,{type:""})),R=T.map(te=>Object.keys(te)[0]),D=A.map(te=>Object.keys(te)[0]),j=M.filter(te=>R.indexOf(te)===-1&&D.indexOf(te)===-1),z=(0,e.getTransforms)(i.ConfigType.WHITELIST,T),H=(0,e.getTransforms)(i.ConfigType.BLACKLIST,A),K=(0,n.isArray)(v)?j.map(te=>(0,e.createBlacklist)(te)):[];return Object.assign(Object.assign({},k),{key:m,storage:S,transforms:[...z,...H,...K,..._||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=d})(UW);const Td=(e,t)=>Math.floor(e/t)*t,Yl=(e,t)=>Math.round(e/t)*t;var ke={},bxe={get exports(){return ke},set exports(e){ke=e}};/** + ${JSON.stringify(F)}`)};e.throwError=K;const te=function(G){return(0,e.isArray)(G)?G.filter(e.unique).reduce((F,W)=>{const X=W.split("."),Z=X[0],U=X.slice(1).join(".")||void 0,Q=F.filter(fe=>Object.keys(fe)[0]===Z)[0],re=Q?Object.values(Q)[0]:void 0;return Q||F.push({[Z]:U?[U]:void 0}),Q&&!re&&U&&(Q[Z]=[U]),Q&&re&&U&&re.push(U),F},[]):[]};e.getRootKeysGroup=te})(GW);(function(e){var t=_o&&_o.__rest||function(h,m){var y={};for(var b in h)Object.prototype.hasOwnProperty.call(h,b)&&m.indexOf(b)<0&&(y[b]=h[b]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,b=Object.getOwnPropertySymbols(h);x!k(_)&&h?h(E,_,P):E,out:(E,_,P)=>!k(_)&&m?m(E,_,P):E,deepPersistKey:b&&b[0]}},a=(h,m,y,{debug:b,whitelist:x,blacklist:k,transforms:E})=>{if(x||k)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(E);const _=(0,n.cloneDeep)(y);let P=h;if(P&&(0,n.isObjectLike)(P)){const A=(0,n.difference)(m,y);(0,n.isEmpty)(A)||(P=(0,n.mergeDeep)(h,A,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(A)}`)),Object.keys(P).forEach(M=>{if(M!=="_persist"){if((0,n.isObjectLike)(_[M])){_[M]=(0,n.mergeDeep)(_[M],P[M]);return}_[M]=P[M]}})}return b&&P&&(0,n.isObjectLike)(P)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(P)}`),_};e.autoMergeDeep=a;const s=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.WHITELIST),o(y=>{if(!m||!m.length)return y;let b=null,x;return m.forEach(k=>{const E=k.split(".");x=(0,n.path)(y,E),typeof x>"u"&&(0,n.isIntegerString)(E[E.length-1])&&(x=r.PLACEHOLDER_UNDEFINED);const _=(0,n.assocPath)(E,x),P=(0,n.isArray)(_)?[]:{};b=(0,n.mergeDeep)(b||P,_,{preservePlaceholder:!0})}),b||y},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.WHITELIST),{whitelist:[h]}));e.createWhitelist=s;const l=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.BLACKLIST),o(y=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST,!0);return m.map(k=>k.split(".")).reduce((k,E)=>(0,n.dissocPath)(k,E),b)},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST),{whitelist:[h]}));e.createBlacklist=l;const u=function(h,m){return m.map(y=>{const b=Object.keys(y)[0],x=y[b];return h===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,x):(0,e.createBlacklist)(b,x)})};e.getTransforms=u;const d=h=>{var{key:m,whitelist:y,blacklist:b,storage:x,transforms:k,rootReducer:E}=h,_=t(h,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:y,blacklist:b});const P=(0,n.getRootKeysGroup)(y),A=(0,n.getRootKeysGroup)(b),M=Object.keys(E(void 0,{type:""})),R=P.map(te=>Object.keys(te)[0]),D=A.map(te=>Object.keys(te)[0]),j=M.filter(te=>R.indexOf(te)===-1&&D.indexOf(te)===-1),z=(0,e.getTransforms)(i.ConfigType.WHITELIST,P),H=(0,e.getTransforms)(i.ConfigType.BLACKLIST,A),K=(0,n.isArray)(y)?j.map(te=>(0,e.createBlacklist)(te)):[];return Object.assign(Object.assign({},_),{key:m,storage:x,transforms:[...z,...H,...K,...k||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=d})(UW);const Ld=(e,t)=>Math.floor(e/t)*t,Yl=(e,t)=>Math.round(e/t)*t;var ke={},bxe={get exports(){return ke},set exports(e){ke=e}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,m=2,v=4,b=1,S=2,_=1,E=2,k=4,T=8,A=16,M=32,R=64,D=128,j=256,z=512,H=30,K="...",te=800,G=16,$=1,W=2,X=3,Z=1/0,U=9007199254740991,Q=17976931348623157e292,re=0/0,fe=4294967295,Ee=fe-1,be=fe>>>1,ye=[["ary",D],["bind",_],["bindKey",E],["curry",T],["curryRight",A],["flip",z],["partial",M],["partialRight",R],["rearg",j]],Fe="[object Arguments]",Me="[object Array]",rt="[object AsyncFunction]",Ve="[object Boolean]",je="[object Date]",wt="[object DOMException]",Be="[object Error]",at="[object Function]",bt="[object GeneratorFunction]",Le="[object Map]",ut="[object Number]",Mt="[object Null]",ct="[object Object]",_t="[object Promise]",un="[object Proxy]",ae="[object RegExp]",De="[object Set]",Ke="[object String]",Xe="[object Symbol]",xe="[object Undefined]",Ne="[object WeakMap]",Ct="[object WeakSet]",Dt="[object ArrayBuffer]",Te="[object DataView]",At="[object Float32Array]",ze="[object Float64Array]",vt="[object Int8Array]",nn="[object Int16Array]",Rn="[object Int32Array]",Ze="[object Uint8Array]",xt="[object Uint8ClampedArray]",ht="[object Uint16Array]",Ht="[object Uint32Array]",rn=/\b__p \+= '';/g,pr=/\b(__p \+=) '' \+/g,Io=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Mi=/&(?:amp|lt|gt|quot|#39);/g,ol=/[&<>"']/g,D0=RegExp(Mi.source),$a=RegExp(ol.source),Tp=/<%-([\s\S]+?)%>/g,N0=/<%([\s\S]+?)%>/g,Sc=/<%=([\s\S]+?)%>/g,Lp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ap=/^\w*$/,oa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bf=/[\\^$.*+?()[\]{}|]/g,j0=RegExp(bf.source),xc=/^\s+/,Sf=/\s/,B0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,al=/\{\n\/\* \[wrapped with (.+)\] \*/,wc=/,? & /,$0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,F0=/[()=,{}\[\]\/\s]/,z0=/\\(\\)?/g,H0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vs=/\w*$/,V0=/^[-+]0x[0-9a-f]+$/i,W0=/^0b[01]+$/i,U0=/^\[object .+?Constructor\]$/,G0=/^0o[0-7]+$/i,q0=/^(?:0|[1-9]\d*)$/,Y0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sl=/($^)/,K0=/['\n\r\u2028\u2029\\]/g,ys="\\ud800-\\udfff",bu="\\u0300-\\u036f",Su="\\ufe20-\\ufe2f",ll="\\u20d0-\\u20ff",xu=bu+Su+ll,Op="\\u2700-\\u27bf",Cc="a-z\\xdf-\\xf6\\xf8-\\xff",ul="\\xac\\xb1\\xd7\\xf7",aa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dn="\\u2000-\\u206f",Tn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",sa="A-Z\\xc0-\\xd6\\xd8-\\xde",Hr="\\ufe0e\\ufe0f",li=ul+aa+Dn+Tn,la="['’]",cl="["+ys+"]",ui="["+li+"]",bs="["+xu+"]",xf="\\d+",wu="["+Op+"]",Ss="["+Cc+"]",wf="[^"+ys+li+xf+Op+Cc+sa+"]",Ii="\\ud83c[\\udffb-\\udfff]",Mp="(?:"+bs+"|"+Ii+")",Ip="[^"+ys+"]",Cf="(?:\\ud83c[\\udde6-\\uddff]){2}",dl="[\\ud800-\\udbff][\\udc00-\\udfff]",Ro="["+sa+"]",fl="\\u200d",Cu="(?:"+Ss+"|"+wf+")",X0="(?:"+Ro+"|"+wf+")",_c="(?:"+la+"(?:d|ll|m|re|s|t|ve))?",kc="(?:"+la+"(?:D|LL|M|RE|S|T|VE))?",_f=Mp+"?",Ec="["+Hr+"]?",Fa="(?:"+fl+"(?:"+[Ip,Cf,dl].join("|")+")"+Ec+_f+")*",kf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_u="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yt=Ec+_f+Fa,Rp="(?:"+[wu,Cf,dl].join("|")+")"+Yt,Pc="(?:"+[Ip+bs+"?",bs,Cf,dl,cl].join("|")+")",Tc=RegExp(la,"g"),Dp=RegExp(bs,"g"),ua=RegExp(Ii+"(?="+Ii+")|"+Pc+Yt,"g"),Kn=RegExp([Ro+"?"+Ss+"+"+_c+"(?="+[ui,Ro,"$"].join("|")+")",X0+"+"+kc+"(?="+[ui,Ro+Cu,"$"].join("|")+")",Ro+"?"+Cu+"+"+_c,Ro+"+"+kc,_u,kf,xf,Rp].join("|"),"g"),Ef=RegExp("["+fl+ys+xu+Hr+"]"),Np=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],jp=-1,gn={};gn[At]=gn[ze]=gn[vt]=gn[nn]=gn[Rn]=gn[Ze]=gn[xt]=gn[ht]=gn[Ht]=!0,gn[Fe]=gn[Me]=gn[Dt]=gn[Ve]=gn[Te]=gn[je]=gn[Be]=gn[at]=gn[Le]=gn[ut]=gn[ct]=gn[ae]=gn[De]=gn[Ke]=gn[Ne]=!1;var Kt={};Kt[Fe]=Kt[Me]=Kt[Dt]=Kt[Te]=Kt[Ve]=Kt[je]=Kt[At]=Kt[ze]=Kt[vt]=Kt[nn]=Kt[Rn]=Kt[Le]=Kt[ut]=Kt[ct]=Kt[ae]=Kt[De]=Kt[Ke]=Kt[Xe]=Kt[Ze]=Kt[xt]=Kt[ht]=Kt[Ht]=!0,Kt[Be]=Kt[at]=Kt[Ne]=!1;var Bp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Z0={"&":"&","<":"<",">":">",'"':""","'":"'"},Y={"&":"&","<":"<",">":">",""":'"',"'":"'"},ie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ge=parseFloat,st=parseInt,Wt=typeof _o=="object"&&_o&&_o.Object===Object&&_o,xn=typeof self=="object"&&self&&self.Object===Object&&self,kt=Wt||xn||Function("return this")(),Nt=t&&!t.nodeType&&t,Xt=Nt&&!0&&e&&!e.nodeType&&e,Jr=Xt&&Xt.exports===Nt,Rr=Jr&&Wt.process,wn=function(){try{var oe=Xt&&Xt.require&&Xt.require("util").types;return oe||Rr&&Rr.binding&&Rr.binding("util")}catch{}}(),ci=wn&&wn.isArrayBuffer,Do=wn&&wn.isDate,co=wn&&wn.isMap,za=wn&&wn.isRegExp,hl=wn&&wn.isSet,Q0=wn&&wn.isTypedArray;function Ri(oe,we,ve){switch(ve.length){case 0:return oe.call(we);case 1:return oe.call(we,ve[0]);case 2:return oe.call(we,ve[0],ve[1]);case 3:return oe.call(we,ve[0],ve[1],ve[2])}return oe.apply(we,ve)}function J0(oe,we,ve,it){for(var It=-1,on=oe==null?0:oe.length;++It-1}function $p(oe,we,ve){for(var it=-1,It=oe==null?0:oe.length;++it-1;);return ve}function xs(oe,we){for(var ve=oe.length;ve--&&Oc(we,oe[ve],0)>-1;);return ve}function t1(oe,we){for(var ve=oe.length,it=0;ve--;)oe[ve]===we&&++it;return it}var r3=Of(Bp),ws=Of(Z0);function gl(oe){return"\\"+ie[oe]}function zp(oe,we){return oe==null?n:oe[we]}function Eu(oe){return Ef.test(oe)}function Hp(oe){return Np.test(oe)}function i3(oe){for(var we,ve=[];!(we=oe.next()).done;)ve.push(we.value);return ve}function Vp(oe){var we=-1,ve=Array(oe.size);return oe.forEach(function(it,It){ve[++we]=[It,it]}),ve}function Wp(oe,we){return function(ve){return oe(we(ve))}}function fa(oe,we){for(var ve=-1,it=oe.length,It=0,on=[];++ve-1}function C3(c,g){var C=this.__data__,O=Wr(C,c);return O<0?(++this.size,C.push([c,g])):C[O][1]=g,this}ha.prototype.clear=x3,ha.prototype.delete=w3,ha.prototype.get=m1,ha.prototype.has=v1,ha.prototype.set=C3;function pa(c){var g=-1,C=c==null?0:c.length;for(this.clear();++g=g?c:g)),c}function wi(c,g,C,O,B,V){var J,ne=g&h,ce=g&m,_e=g&v;if(C&&(J=B?C(c,O,B,V):C(c)),J!==n)return J;if(!Cr(c))return c;var Pe=Ft(c);if(Pe){if(J=ZK(c),!ne)return Fi(c,J)}else{var Re=ki(c),nt=Re==at||Re==bt;if(od(c))return El(c,ne);if(Re==ct||Re==Fe||nt&&!B){if(J=ce||nt?{}:kT(c),!ne)return ce?D1(c,Kc(J,c)):Ho(c,dt(J,c))}else{if(!Kt[Re])return B?c:{};J=QK(c,Re,ne)}}V||(V=new Nr);var St=V.get(c);if(St)return St;V.set(c,J),eL(c)?c.forEach(function(Tt){J.add(wi(Tt,g,C,Tt,c,V))}):QT(c)&&c.forEach(function(Tt,Qt){J.set(Qt,wi(Tt,g,C,Qt,c,V))});var Pt=_e?ce?me:ba:ce?Wo:Ei,qt=Pe?n:Pt(c);return Xn(qt||c,function(Tt,Qt){qt&&(Qt=Tt,Tt=c[Qt]),yl(J,Qt,wi(Tt,g,C,Qt,c,V))}),J}function Qp(c){var g=Ei(c);return function(C){return Jp(C,c,g)}}function Jp(c,g,C){var O=C.length;if(c==null)return!O;for(c=mn(c);O--;){var B=C[O],V=g[B],J=c[B];if(J===n&&!(B in c)||!V(J))return!1}return!0}function x1(c,g,C){if(typeof c!="function")throw new Di(a);return F1(function(){c.apply(n,C)},g)}function Xc(c,g,C,O){var B=-1,V=Ki,J=!0,ne=c.length,ce=[],_e=g.length;if(!ne)return ce;C&&(g=Un(g,Vr(C))),O?(V=$p,J=!1):g.length>=i&&(V=Ic,J=!1,g=new Ua(g));e:for(;++BB?0:B+C),O=O===n||O>B?B:Vt(O),O<0&&(O+=B),O=C>O?0:nL(O);C0&&C(ne)?g>1?Ur(ne,g-1,C,O,B):Ha(B,ne):O||(B[B.length]=ne)}return B}var tg=Pl(),$o=Pl(!0);function ya(c,g){return c&&tg(c,g,Ei)}function Fo(c,g){return c&&$o(c,g,Ei)}function ng(c,g){return jo(g,function(C){return Du(c[C])})}function bl(c,g){g=kl(g,c);for(var C=0,O=g.length;c!=null&&Cg}function ig(c,g){return c!=null&&cn.call(c,g)}function og(c,g){return c!=null&&g in mn(c)}function ag(c,g,C){return c>=fi(g,C)&&c=120&&Pe.length>=120)?new Ua(J&&Pe):n}Pe=c[0];var Re=-1,nt=ne[0];e:for(;++Re-1;)ne!==c&&$f.call(ne,ce,1),$f.call(c,ce,1);return c}function Yf(c,g){for(var C=c?g.length:0,O=C-1;C--;){var B=g[C];if(C==O||B!==V){var V=B;Ru(B)?$f.call(c,B,1):mg(c,B)}}return c}function Kf(c,g){return c+Tu(c1()*(g-c+1))}function Cl(c,g,C,O){for(var B=-1,V=Dr(Hf((g-c)/(C||1)),0),J=ve(V);V--;)J[O?V:++B]=c,c+=C;return J}function nd(c,g){var C="";if(!c||g<1||g>U)return C;do g%2&&(C+=c),g=Tu(g/2),g&&(c+=c);while(g);return C}function Ot(c,g){return Iw(TT(c,g,Uo),c+"")}function dg(c){return Yc(Cg(c))}function Xf(c,g){var C=Cg(c);return O3(C,Au(g,0,C.length))}function Mu(c,g,C,O){if(!Cr(c))return c;g=kl(g,c);for(var B=-1,V=g.length,J=V-1,ne=c;ne!=null&&++BB?0:B+g),C=C>B?B:C,C<0&&(C+=B),B=g>C?0:C-g>>>0,g>>>=0;for(var V=ve(B);++O>>1,J=c[V];J!==null&&!Sa(J)&&(C?J<=g:J=i){var _e=g?null:q(c);if(_e)return Df(_e);J=!1,B=Ic,ce=new Ua}else ce=g?[]:ne;e:for(;++O=O?c:qr(c,g,C)}var O1=u3||function(c){return kt.clearTimeout(c)};function El(c,g){if(g)return c.slice();var C=c.length,O=Bc?Bc(C):new c.constructor(C);return c.copy(O),O}function M1(c){var g=new c.constructor(c.byteLength);return new Ni(g).set(new Ni(c)),g}function Iu(c,g){var C=g?M1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.byteLength)}function P3(c){var g=new c.constructor(c.source,vs.exec(c));return g.lastIndex=c.lastIndex,g}function Zn(c){return Wf?mn(Wf.call(c)):{}}function T3(c,g){var C=g?M1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.length)}function I1(c,g){if(c!==g){var C=c!==n,O=c===null,B=c===c,V=Sa(c),J=g!==n,ne=g===null,ce=g===g,_e=Sa(g);if(!ne&&!_e&&!V&&c>g||V&&J&&ce&&!ne&&!_e||O&&J&&ce||!C&&ce||!B)return 1;if(!O&&!V&&!_e&&c=ne)return ce;var _e=C[O];return ce*(_e=="desc"?-1:1)}}return c.index-g.index}function L3(c,g,C,O){for(var B=-1,V=c.length,J=C.length,ne=-1,ce=g.length,_e=Dr(V-J,0),Pe=ve(ce+_e),Re=!O;++ne1?C[B-1]:n,J=B>2?C[2]:n;for(V=c.length>3&&typeof V=="function"?(B--,V):n,J&&vo(C[0],C[1],J)&&(V=B<3?n:V,B=1),g=mn(g);++O-1?B[V?g[J]:J]:n}}function j1(c){return mr(function(g){var C=g.length,O=C,B=ho.prototype.thru;for(c&&g.reverse();O--;){var V=g[O];if(typeof V!="function")throw new Di(a);if(B&&!J&&Se(V)=="wrapper")var J=new ho([],!0)}for(O=J?O:C;++O1&&an.reverse(),Pe&&cene))return!1;var _e=V.get(c),Pe=V.get(g);if(_e&&Pe)return _e==g&&Pe==c;var Re=-1,nt=!0,St=C&S?new Ua:n;for(V.set(c,g),V.set(g,c);++Re1?"& ":"")+g[O],g=g.join(C>2?", ":" "),c.replace(B0,`{ + */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,m=2,y=4,b=1,x=2,k=1,E=2,_=4,P=8,A=16,M=32,R=64,D=128,j=256,z=512,H=30,K="...",te=800,G=16,F=1,W=2,X=3,Z=1/0,U=9007199254740991,Q=17976931348623157e292,re=0/0,fe=4294967295,Ee=fe-1,be=fe>>>1,ye=[["ary",D],["bind",k],["bindKey",E],["curry",P],["curryRight",A],["flip",z],["partial",M],["partialRight",R],["rearg",j]],ze="[object Arguments]",Me="[object Array]",rt="[object AsyncFunction]",We="[object Boolean]",Be="[object Date]",wt="[object DOMException]",Fe="[object Error]",at="[object Function]",bt="[object GeneratorFunction]",Le="[object Map]",ut="[object Number]",Mt="[object Null]",ct="[object Object]",_t="[object Promise]",un="[object Proxy]",ae="[object RegExp]",De="[object Set]",Ke="[object String]",Xe="[object Symbol]",xe="[object Undefined]",Ne="[object WeakMap]",Ct="[object WeakSet]",Dt="[object ArrayBuffer]",Te="[object DataView]",At="[object Float32Array]",He="[object Float64Array]",vt="[object Int8Array]",nn="[object Int16Array]",Rn="[object Int32Array]",Ze="[object Uint8Array]",xt="[object Uint8ClampedArray]",ht="[object Uint16Array]",Ht="[object Uint32Array]",rn=/\b__p \+= '';/g,gr=/\b(__p \+=) '' \+/g,Io=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Mi=/&(?:amp|lt|gt|quot|#39);/g,ol=/[&<>"']/g,N0=RegExp(Mi.source),Fa=RegExp(ol.source),Lp=/<%-([\s\S]+?)%>/g,j0=/<%([\s\S]+?)%>/g,Sc=/<%=([\s\S]+?)%>/g,Ap=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Op=/^\w*$/,oa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sf=/[\\^$.*+?()[\]{}|]/g,B0=RegExp(Sf.source),xc=/^\s+/,xf=/\s/,F0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,al=/\{\n\/\* \[wrapped with (.+)\] \*/,wc=/,? & /,$0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,z0=/[()=,{}\[\]\/\s]/,H0=/\\(\\)?/g,V0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vs=/\w*$/,W0=/^[-+]0x[0-9a-f]+$/i,U0=/^0b[01]+$/i,G0=/^\[object .+?Constructor\]$/,q0=/^0o[0-7]+$/i,Y0=/^(?:0|[1-9]\d*)$/,K0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sl=/($^)/,X0=/['\n\r\u2028\u2029\\]/g,ys="\\ud800-\\udfff",bu="\\u0300-\\u036f",Su="\\ufe20-\\ufe2f",ll="\\u20d0-\\u20ff",xu=bu+Su+ll,Mp="\\u2700-\\u27bf",Cc="a-z\\xdf-\\xf6\\xf8-\\xff",ul="\\xac\\xb1\\xd7\\xf7",aa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dn="\\u2000-\\u206f",Tn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",sa="A-Z\\xc0-\\xd6\\xd8-\\xde",Hr="\\ufe0e\\ufe0f",li=ul+aa+Dn+Tn,la="['’]",cl="["+ys+"]",ui="["+li+"]",bs="["+xu+"]",wf="\\d+",wu="["+Mp+"]",Ss="["+Cc+"]",Cf="[^"+ys+li+wf+Mp+Cc+sa+"]",Ii="\\ud83c[\\udffb-\\udfff]",Ip="(?:"+bs+"|"+Ii+")",Rp="[^"+ys+"]",_f="(?:\\ud83c[\\udde6-\\uddff]){2}",dl="[\\ud800-\\udbff][\\udc00-\\udfff]",Ro="["+sa+"]",fl="\\u200d",Cu="(?:"+Ss+"|"+Cf+")",Z0="(?:"+Ro+"|"+Cf+")",_c="(?:"+la+"(?:d|ll|m|re|s|t|ve))?",kc="(?:"+la+"(?:D|LL|M|RE|S|T|VE))?",kf=Ip+"?",Ec="["+Hr+"]?",$a="(?:"+fl+"(?:"+[Rp,_f,dl].join("|")+")"+Ec+kf+")*",Ef="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_u="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Kt=Ec+kf+$a,Dp="(?:"+[wu,_f,dl].join("|")+")"+Kt,Pc="(?:"+[Rp+bs+"?",bs,_f,dl,cl].join("|")+")",Tc=RegExp(la,"g"),Np=RegExp(bs,"g"),ua=RegExp(Ii+"(?="+Ii+")|"+Pc+Kt,"g"),Kn=RegExp([Ro+"?"+Ss+"+"+_c+"(?="+[ui,Ro,"$"].join("|")+")",Z0+"+"+kc+"(?="+[ui,Ro+Cu,"$"].join("|")+")",Ro+"?"+Cu+"+"+_c,Ro+"+"+kc,_u,Ef,wf,Dp].join("|"),"g"),Pf=RegExp("["+fl+ys+xu+Hr+"]"),jp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Tf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Bp=-1,gn={};gn[At]=gn[He]=gn[vt]=gn[nn]=gn[Rn]=gn[Ze]=gn[xt]=gn[ht]=gn[Ht]=!0,gn[ze]=gn[Me]=gn[Dt]=gn[We]=gn[Te]=gn[Be]=gn[Fe]=gn[at]=gn[Le]=gn[ut]=gn[ct]=gn[ae]=gn[De]=gn[Ke]=gn[Ne]=!1;var Xt={};Xt[ze]=Xt[Me]=Xt[Dt]=Xt[Te]=Xt[We]=Xt[Be]=Xt[At]=Xt[He]=Xt[vt]=Xt[nn]=Xt[Rn]=Xt[Le]=Xt[ut]=Xt[ct]=Xt[ae]=Xt[De]=Xt[Ke]=Xt[Xe]=Xt[Ze]=Xt[xt]=Xt[ht]=Xt[Ht]=!0,Xt[Fe]=Xt[at]=Xt[Ne]=!1;var Fp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Q0={"&":"&","<":"<",">":">",'"':""","'":"'"},Y={"&":"&","<":"<",">":">",""":'"',"'":"'"},ie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ge=parseFloat,st=parseInt,Wt=typeof _o=="object"&&_o&&_o.Object===Object&&_o,xn=typeof self=="object"&&self&&self.Object===Object&&self,kt=Wt||xn||Function("return this")(),Nt=t&&!t.nodeType&&t,Zt=Nt&&!0&&e&&!e.nodeType&&e,Jr=Zt&&Zt.exports===Nt,Rr=Jr&&Wt.process,wn=function(){try{var oe=Zt&&Zt.require&&Zt.require("util").types;return oe||Rr&&Rr.binding&&Rr.binding("util")}catch{}}(),ci=wn&&wn.isArrayBuffer,Do=wn&&wn.isDate,co=wn&&wn.isMap,za=wn&&wn.isRegExp,hl=wn&&wn.isSet,J0=wn&&wn.isTypedArray;function Ri(oe,we,ve){switch(ve.length){case 0:return oe.call(we);case 1:return oe.call(we,ve[0]);case 2:return oe.call(we,ve[0],ve[1]);case 3:return oe.call(we,ve[0],ve[1],ve[2])}return oe.apply(we,ve)}function e1(oe,we,ve,it){for(var It=-1,on=oe==null?0:oe.length;++It-1}function $p(oe,we,ve){for(var it=-1,It=oe==null?0:oe.length;++it-1;);return ve}function xs(oe,we){for(var ve=oe.length;ve--&&Oc(we,oe[ve],0)>-1;);return ve}function n1(oe,we){for(var ve=oe.length,it=0;ve--;)oe[ve]===we&&++it;return it}var r3=Mf(Fp),ws=Mf(Q0);function gl(oe){return"\\"+ie[oe]}function Hp(oe,we){return oe==null?n:oe[we]}function Eu(oe){return Pf.test(oe)}function Vp(oe){return jp.test(oe)}function i3(oe){for(var we,ve=[];!(we=oe.next()).done;)ve.push(we.value);return ve}function Wp(oe){var we=-1,ve=Array(oe.size);return oe.forEach(function(it,It){ve[++we]=[It,it]}),ve}function Up(oe,we){return function(ve){return oe(we(ve))}}function fa(oe,we){for(var ve=-1,it=oe.length,It=0,on=[];++ve-1}function C3(c,g){var C=this.__data__,O=Wr(C,c);return O<0?(++this.size,C.push([c,g])):C[O][1]=g,this}ha.prototype.clear=x3,ha.prototype.delete=w3,ha.prototype.get=v1,ha.prototype.has=y1,ha.prototype.set=C3;function pa(c){var g=-1,C=c==null?0:c.length;for(this.clear();++g=g?c:g)),c}function wi(c,g,C,O,B,V){var J,ne=g&h,ce=g&m,_e=g&y;if(C&&(J=B?C(c,O,B,V):C(c)),J!==n)return J;if(!Cr(c))return c;var Pe=$t(c);if(Pe){if(J=ZK(c),!ne)return $i(c,J)}else{var Re=ki(c),nt=Re==at||Re==bt;if(od(c))return El(c,ne);if(Re==ct||Re==ze||nt&&!B){if(J=ce||nt?{}:ET(c),!ne)return ce?N1(c,Kc(J,c)):Ho(c,dt(J,c))}else{if(!Xt[Re])return B?c:{};J=QK(c,Re,ne)}}V||(V=new Nr);var St=V.get(c);if(St)return St;V.set(c,J),tL(c)?c.forEach(function(Tt){J.add(wi(Tt,g,C,Tt,c,V))}):JT(c)&&c.forEach(function(Tt,Jt){J.set(Jt,wi(Tt,g,C,Jt,c,V))});var Pt=_e?ce?me:ba:ce?Wo:Ei,qt=Pe?n:Pt(c);return Xn(qt||c,function(Tt,Jt){qt&&(Jt=Tt,Tt=c[Jt]),yl(J,Jt,wi(Tt,g,C,Jt,c,V))}),J}function Jp(c){var g=Ei(c);return function(C){return eg(C,c,g)}}function eg(c,g,C){var O=C.length;if(c==null)return!O;for(c=mn(c);O--;){var B=C[O],V=g[B],J=c[B];if(J===n&&!(B in c)||!V(J))return!1}return!0}function w1(c,g,C){if(typeof c!="function")throw new Di(a);return z1(function(){c.apply(n,C)},g)}function Xc(c,g,C,O){var B=-1,V=Ki,J=!0,ne=c.length,ce=[],_e=g.length;if(!ne)return ce;C&&(g=Un(g,Vr(C))),O?(V=$p,J=!1):g.length>=i&&(V=Ic,J=!1,g=new Ua(g));e:for(;++BB?0:B+C),O=O===n||O>B?B:Vt(O),O<0&&(O+=B),O=C>O?0:rL(O);C0&&C(ne)?g>1?Ur(ne,g-1,C,O,B):Ha(B,ne):O||(B[B.length]=ne)}return B}var ng=Pl(),Fo=Pl(!0);function ya(c,g){return c&&ng(c,g,Ei)}function $o(c,g){return c&&Fo(c,g,Ei)}function rg(c,g){return jo(g,function(C){return Du(c[C])})}function bl(c,g){g=kl(g,c);for(var C=0,O=g.length;c!=null&&Cg}function og(c,g){return c!=null&&cn.call(c,g)}function ag(c,g){return c!=null&&g in mn(c)}function sg(c,g,C){return c>=fi(g,C)&&c=120&&Pe.length>=120)?new Ua(J&&Pe):n}Pe=c[0];var Re=-1,nt=ne[0];e:for(;++Re-1;)ne!==c&&$f.call(ne,ce,1),$f.call(c,ce,1);return c}function Kf(c,g){for(var C=c?g.length:0,O=C-1;C--;){var B=g[C];if(C==O||B!==V){var V=B;Ru(B)?$f.call(c,B,1):vg(c,B)}}return c}function Xf(c,g){return c+Tu(d1()*(g-c+1))}function Cl(c,g,C,O){for(var B=-1,V=Dr(Vf((g-c)/(C||1)),0),J=ve(V);V--;)J[O?V:++B]=c,c+=C;return J}function nd(c,g){var C="";if(!c||g<1||g>U)return C;do g%2&&(C+=c),g=Tu(g/2),g&&(c+=c);while(g);return C}function Ot(c,g){return Iw(LT(c,g,Uo),c+"")}function fg(c){return Yc(_g(c))}function Zf(c,g){var C=_g(c);return O3(C,Au(g,0,C.length))}function Mu(c,g,C,O){if(!Cr(c))return c;g=kl(g,c);for(var B=-1,V=g.length,J=V-1,ne=c;ne!=null&&++BB?0:B+g),C=C>B?B:C,C<0&&(C+=B),B=g>C?0:C-g>>>0,g>>>=0;for(var V=ve(B);++O>>1,J=c[V];J!==null&&!Sa(J)&&(C?J<=g:J=i){var _e=g?null:q(c);if(_e)return Nf(_e);J=!1,B=Ic,ce=new Ua}else ce=g?[]:ne;e:for(;++O=O?c:qr(c,g,C)}var M1=u3||function(c){return kt.clearTimeout(c)};function El(c,g){if(g)return c.slice();var C=c.length,O=Bc?Bc(C):new c.constructor(C);return c.copy(O),O}function I1(c){var g=new c.constructor(c.byteLength);return new Ni(g).set(new Ni(c)),g}function Iu(c,g){var C=g?I1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.byteLength)}function P3(c){var g=new c.constructor(c.source,vs.exec(c));return g.lastIndex=c.lastIndex,g}function Zn(c){return Uf?mn(Uf.call(c)):{}}function T3(c,g){var C=g?I1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.length)}function R1(c,g){if(c!==g){var C=c!==n,O=c===null,B=c===c,V=Sa(c),J=g!==n,ne=g===null,ce=g===g,_e=Sa(g);if(!ne&&!_e&&!V&&c>g||V&&J&&ce&&!ne&&!_e||O&&J&&ce||!C&&ce||!B)return 1;if(!O&&!V&&!_e&&c=ne)return ce;var _e=C[O];return ce*(_e=="desc"?-1:1)}}return c.index-g.index}function L3(c,g,C,O){for(var B=-1,V=c.length,J=C.length,ne=-1,ce=g.length,_e=Dr(V-J,0),Pe=ve(ce+_e),Re=!O;++ne1?C[B-1]:n,J=B>2?C[2]:n;for(V=c.length>3&&typeof V=="function"?(B--,V):n,J&&vo(C[0],C[1],J)&&(V=B<3?n:V,B=1),g=mn(g);++O-1?B[V?g[J]:J]:n}}function B1(c){return vr(function(g){var C=g.length,O=C,B=ho.prototype.thru;for(c&&g.reverse();O--;){var V=g[O];if(typeof V!="function")throw new Di(a);if(B&&!J&&Se(V)=="wrapper")var J=new ho([],!0)}for(O=J?O:C;++O1&&an.reverse(),Pe&&cene))return!1;var _e=V.get(c),Pe=V.get(g);if(_e&&Pe)return _e==g&&Pe==c;var Re=-1,nt=!0,St=C&x?new Ua:n;for(V.set(c,g),V.set(g,c);++Re1?"& ":"")+g[O],g=g.join(C>2?", ":" "),c.replace(F0,`{ /* [wrapped with `+g+`] */ -`)}function eX(c){return Ft(c)||ih(c)||!!(l1&&c&&c[l1])}function Ru(c,g){var C=typeof c;return g=g??U,!!g&&(C=="number"||C!="symbol"&&q0.test(c))&&c>-1&&c%1==0&&c0){if(++g>=te)return arguments[0]}else g=0;return c.apply(n,arguments)}}function O3(c,g){var C=-1,O=c.length,B=O-1;for(g=g===n?O:g;++C1?c[g-1]:n;return C=typeof C=="function"?(c.pop(),C):n,FT(c,C)});function zT(c){var g=F(c);return g.__chain__=!0,g}function dZ(c,g){return g(c),c}function M3(c,g){return g(c)}var fZ=mr(function(c){var g=c.length,C=g?c[0]:0,O=this.__wrapped__,B=function(V){return Zp(V,c)};return g>1||this.__actions__.length||!(O instanceof Zt)||!Ru(C)?this.thru(B):(O=O.slice(C,+C+(g?1:0)),O.__actions__.push({func:M3,args:[B],thisArg:n}),new ho(O,this.__chain__).thru(function(V){return g&&!V.length&&V.push(n),V}))});function hZ(){return zT(this)}function pZ(){return new ho(this.value(),this.__chain__)}function gZ(){this.__values__===n&&(this.__values__=tL(this.value()));var c=this.__index__>=this.__values__.length,g=c?n:this.__values__[this.__index__++];return{done:c,value:g}}function mZ(){return this}function vZ(c){for(var g,C=this;C instanceof Uf;){var O=RT(C);O.__index__=0,O.__values__=n,g?B.__wrapped__=O:g=O;var B=O;C=C.__wrapped__}return B.__wrapped__=c,g}function yZ(){var c=this.__wrapped__;if(c instanceof Zt){var g=c;return this.__actions__.length&&(g=new Zt(this)),g=g.reverse(),g.__actions__.push({func:M3,args:[Rw],thisArg:n}),new ho(g,this.__chain__)}return this.thru(Rw)}function bZ(){return _l(this.__wrapped__,this.__actions__)}var SZ=yg(function(c,g,C){cn.call(c,C)?++c[C]:ga(c,C,1)});function xZ(c,g,C){var O=Ft(c)?Wn:w1;return C&&vo(c,g,C)&&(g=n),O(c,Ie(g,3))}function wZ(c,g){var C=Ft(c)?jo:va;return C(c,Ie(g,3))}var CZ=N1(DT),_Z=N1(NT);function kZ(c,g){return Ur(I3(c,g),1)}function EZ(c,g){return Ur(I3(c,g),Z)}function PZ(c,g,C){return C=C===n?1:Vt(C),Ur(I3(c,g),C)}function HT(c,g){var C=Ft(c)?Xn:ks;return C(c,Ie(g,3))}function VT(c,g){var C=Ft(c)?No:eg;return C(c,Ie(g,3))}var TZ=yg(function(c,g,C){cn.call(c,C)?c[C].push(g):ga(c,C,[g])});function LZ(c,g,C,O){c=Vo(c)?c:Cg(c),C=C&&!O?Vt(C):0;var B=c.length;return C<0&&(C=Dr(B+C,0)),B3(c)?C<=B&&c.indexOf(g,C)>-1:!!B&&Oc(c,g,C)>-1}var AZ=Ot(function(c,g,C){var O=-1,B=typeof g=="function",V=Vo(c)?ve(c.length):[];return ks(c,function(J){V[++O]=B?Ri(g,J,C):Es(J,g,C)}),V}),OZ=yg(function(c,g,C){ga(c,C,g)});function I3(c,g){var C=Ft(c)?Un:Br;return C(c,Ie(g,3))}function MZ(c,g,C,O){return c==null?[]:(Ft(g)||(g=g==null?[]:[g]),C=O?n:C,Ft(C)||(C=C==null?[]:[C]),Bi(c,g,C))}var IZ=yg(function(c,g,C){c[C?0:1].push(g)},function(){return[[],[]]});function RZ(c,g,C){var O=Ft(c)?Tf:Fp,B=arguments.length<3;return O(c,Ie(g,4),C,B,ks)}function DZ(c,g,C){var O=Ft(c)?Jy:Fp,B=arguments.length<3;return O(c,Ie(g,4),C,B,eg)}function NZ(c,g){var C=Ft(c)?jo:va;return C(c,N3(Ie(g,3)))}function jZ(c){var g=Ft(c)?Yc:dg;return g(c)}function BZ(c,g,C){(C?vo(c,g,C):g===n)?g=1:g=Vt(g);var O=Ft(c)?xi:Xf;return O(c,g)}function $Z(c){var g=Ft(c)?kw:_i;return g(c)}function FZ(c){if(c==null)return 0;if(Vo(c))return B3(c)?Va(c):c.length;var g=ki(c);return g==Le||g==De?c.size:Gr(c).length}function zZ(c,g,C){var O=Ft(c)?Lc:zo;return C&&vo(c,g,C)&&(g=n),O(c,Ie(g,3))}var HZ=Ot(function(c,g){if(c==null)return[];var C=g.length;return C>1&&vo(c,g[0],g[1])?g=[]:C>2&&vo(g[0],g[1],g[2])&&(g=[g[0]]),Bi(c,Ur(g,1),[])}),R3=c3||function(){return kt.Date.now()};function VZ(c,g){if(typeof g!="function")throw new Di(a);return c=Vt(c),function(){if(--c<1)return g.apply(this,arguments)}}function WT(c,g,C){return g=C?n:g,g=c&&g==null?c.length:g,pe(c,D,n,n,n,n,g)}function UT(c,g){var C;if(typeof g!="function")throw new Di(a);return c=Vt(c),function(){return--c>0&&(C=g.apply(this,arguments)),c<=1&&(g=n),C}}var Nw=Ot(function(c,g,C){var O=_;if(C.length){var B=fa(C,tt(Nw));O|=M}return pe(c,O,g,C,B)}),GT=Ot(function(c,g,C){var O=_|E;if(C.length){var B=fa(C,tt(GT));O|=M}return pe(g,O,c,C,B)});function qT(c,g,C){g=C?n:g;var O=pe(c,T,n,n,n,n,n,g);return O.placeholder=qT.placeholder,O}function YT(c,g,C){g=C?n:g;var O=pe(c,A,n,n,n,n,n,g);return O.placeholder=YT.placeholder,O}function KT(c,g,C){var O,B,V,J,ne,ce,_e=0,Pe=!1,Re=!1,nt=!0;if(typeof c!="function")throw new Di(a);g=Ya(g)||0,Cr(C)&&(Pe=!!C.leading,Re="maxWait"in C,V=Re?Dr(Ya(C.maxWait)||0,g):V,nt="trailing"in C?!!C.trailing:nt);function St(Kr){var Os=O,ju=B;return O=B=n,_e=Kr,J=c.apply(ju,Os),J}function Pt(Kr){return _e=Kr,ne=F1(Qt,g),Pe?St(Kr):J}function qt(Kr){var Os=Kr-ce,ju=Kr-_e,pL=g-Os;return Re?fi(pL,V-ju):pL}function Tt(Kr){var Os=Kr-ce,ju=Kr-_e;return ce===n||Os>=g||Os<0||Re&&ju>=V}function Qt(){var Kr=R3();if(Tt(Kr))return an(Kr);ne=F1(Qt,qt(Kr))}function an(Kr){return ne=n,nt&&O?St(Kr):(O=B=n,J)}function xa(){ne!==n&&O1(ne),_e=0,O=ce=B=ne=n}function yo(){return ne===n?J:an(R3())}function wa(){var Kr=R3(),Os=Tt(Kr);if(O=arguments,B=this,ce=Kr,Os){if(ne===n)return Pt(ce);if(Re)return O1(ne),ne=F1(Qt,g),St(ce)}return ne===n&&(ne=F1(Qt,g)),J}return wa.cancel=xa,wa.flush=yo,wa}var WZ=Ot(function(c,g){return x1(c,1,g)}),UZ=Ot(function(c,g,C){return x1(c,Ya(g)||0,C)});function GZ(c){return pe(c,z)}function D3(c,g){if(typeof c!="function"||g!=null&&typeof g!="function")throw new Di(a);var C=function(){var O=arguments,B=g?g.apply(this,O):O[0],V=C.cache;if(V.has(B))return V.get(B);var J=c.apply(this,O);return C.cache=V.set(B,J)||V,J};return C.cache=new(D3.Cache||pa),C}D3.Cache=pa;function N3(c){if(typeof c!="function")throw new Di(a);return function(){var g=arguments;switch(g.length){case 0:return!c.call(this);case 1:return!c.call(this,g[0]);case 2:return!c.call(this,g[0],g[1]);case 3:return!c.call(this,g[0],g[1],g[2])}return!c.apply(this,g)}}function qZ(c){return UT(2,c)}var YZ=Tw(function(c,g){g=g.length==1&&Ft(g[0])?Un(g[0],Vr(Ie())):Un(Ur(g,1),Vr(Ie()));var C=g.length;return Ot(function(O){for(var B=-1,V=fi(O.length,C);++B=g}),ih=lg(function(){return arguments}())?lg:function(c){return $r(c)&&cn.call(c,"callee")&&!s1.call(c,"callee")},Ft=ve.isArray,uQ=ci?Vr(ci):_1;function Vo(c){return c!=null&&j3(c.length)&&!Du(c)}function Yr(c){return $r(c)&&Vo(c)}function cQ(c){return c===!0||c===!1||$r(c)&&Ci(c)==Ve}var od=d3||Yw,dQ=Do?Vr(Do):k1;function fQ(c){return $r(c)&&c.nodeType===1&&!z1(c)}function hQ(c){if(c==null)return!0;if(Vo(c)&&(Ft(c)||typeof c=="string"||typeof c.splice=="function"||od(c)||wg(c)||ih(c)))return!c.length;var g=ki(c);if(g==Le||g==De)return!c.size;if($1(c))return!Gr(c).length;for(var C in c)if(cn.call(c,C))return!1;return!0}function pQ(c,g){return Qc(c,g)}function gQ(c,g,C){C=typeof C=="function"?C:n;var O=C?C(c,g):n;return O===n?Qc(c,g,n,C):!!O}function Bw(c){if(!$r(c))return!1;var g=Ci(c);return g==Be||g==wt||typeof c.message=="string"&&typeof c.name=="string"&&!z1(c)}function mQ(c){return typeof c=="number"&&qp(c)}function Du(c){if(!Cr(c))return!1;var g=Ci(c);return g==at||g==bt||g==rt||g==un}function ZT(c){return typeof c=="number"&&c==Vt(c)}function j3(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=U}function Cr(c){var g=typeof c;return c!=null&&(g=="object"||g=="function")}function $r(c){return c!=null&&typeof c=="object"}var QT=co?Vr(co):Pw;function vQ(c,g){return c===g||Jc(c,g,Rt(g))}function yQ(c,g,C){return C=typeof C=="function"?C:n,Jc(c,g,Rt(g),C)}function bQ(c){return JT(c)&&c!=+c}function SQ(c){if(rX(c))throw new It(o);return ug(c)}function xQ(c){return c===null}function wQ(c){return c==null}function JT(c){return typeof c=="number"||$r(c)&&Ci(c)==ut}function z1(c){if(!$r(c)||Ci(c)!=ct)return!1;var g=$c(c);if(g===null)return!0;var C=cn.call(g,"constructor")&&g.constructor;return typeof C=="function"&&C instanceof C&&Sr.call(C)==Si}var $w=za?Vr(za):xr;function CQ(c){return ZT(c)&&c>=-U&&c<=U}var eL=hl?Vr(hl):Ut;function B3(c){return typeof c=="string"||!Ft(c)&&$r(c)&&Ci(c)==Ke}function Sa(c){return typeof c=="symbol"||$r(c)&&Ci(c)==Xe}var wg=Q0?Vr(Q0):ei;function _Q(c){return c===n}function kQ(c){return $r(c)&&ki(c)==Ne}function EQ(c){return $r(c)&&Ci(c)==Ct}var PQ=P(Sl),TQ=P(function(c,g){return c<=g});function tL(c){if(!c)return[];if(Vo(c))return B3(c)?Xi(c):Fi(c);if(Fc&&c[Fc])return i3(c[Fc]());var g=ki(c),C=g==Le?Vp:g==De?Df:Cg;return C(c)}function Nu(c){if(!c)return c===0?c:0;if(c=Ya(c),c===Z||c===-Z){var g=c<0?-1:1;return g*Q}return c===c?c:0}function Vt(c){var g=Nu(c),C=g%1;return g===g?C?g-C:g:0}function nL(c){return c?Au(Vt(c),0,fe):0}function Ya(c){if(typeof c=="number")return c;if(Sa(c))return re;if(Cr(c)){var g=typeof c.valueOf=="function"?c.valueOf():c;c=Cr(g)?g+"":g}if(typeof c!="string")return c===0?c:+c;c=fo(c);var C=W0.test(c);return C||G0.test(c)?st(c.slice(2),C?2:8):V0.test(c)?re:+c}function rL(c){return Ga(c,Wo(c))}function LQ(c){return c?Au(Vt(c),-U,U):c===0?c:0}function An(c){return c==null?"":go(c)}var AQ=mo(function(c,g){if($1(g)||Vo(g)){Ga(g,Ei(g),c);return}for(var C in g)cn.call(g,C)&&yl(c,C,g[C])}),iL=mo(function(c,g){Ga(g,Wo(g),c)}),$3=mo(function(c,g,C,O){Ga(g,Wo(g),c,O)}),OQ=mo(function(c,g,C,O){Ga(g,Ei(g),c,O)}),MQ=mr(Zp);function IQ(c,g){var C=Lu(c);return g==null?C:dt(C,g)}var RQ=Ot(function(c,g){c=mn(c);var C=-1,O=g.length,B=O>2?g[2]:n;for(B&&vo(g[0],g[1],B)&&(O=1);++C1),V}),Ga(c,me(c),C),O&&(C=wi(C,h|m|v,jt));for(var B=g.length;B--;)mg(C,g[B]);return C});function QQ(c,g){return aL(c,N3(Ie(g)))}var JQ=mr(function(c,g){return c==null?{}:T1(c,g)});function aL(c,g){if(c==null)return{};var C=Un(me(c),function(O){return[O]});return g=Ie(g),cg(c,C,function(O,B){return g(O,B[0])})}function eJ(c,g,C){g=kl(g,c);var O=-1,B=g.length;for(B||(B=1,c=n);++Og){var O=c;c=g,g=O}if(C||c%1||g%1){var B=c1();return fi(c+B*(g-c+ge("1e-"+((B+"").length-1))),g)}return Kf(c,g)}var dJ=Tl(function(c,g,C){return g=g.toLowerCase(),c+(C?uL(g):g)});function uL(c){return Hw(An(c).toLowerCase())}function cL(c){return c=An(c),c&&c.replace(Y0,r3).replace(Dp,"")}function fJ(c,g,C){c=An(c),g=go(g);var O=c.length;C=C===n?O:Au(Vt(C),0,O);var B=C;return C-=g.length,C>=0&&c.slice(C,B)==g}function hJ(c){return c=An(c),c&&$a.test(c)?c.replace(ol,ws):c}function pJ(c){return c=An(c),c&&j0.test(c)?c.replace(bf,"\\$&"):c}var gJ=Tl(function(c,g,C){return c+(C?"-":"")+g.toLowerCase()}),mJ=Tl(function(c,g,C){return c+(C?" ":"")+g.toLowerCase()}),vJ=Sg("toLowerCase");function yJ(c,g,C){c=An(c),g=Vt(g);var O=g?Va(c):0;if(!g||O>=g)return c;var B=(g-O)/2;return f(Tu(B),C)+c+f(Hf(B),C)}function bJ(c,g,C){c=An(c),g=Vt(g);var O=g?Va(c):0;return g&&O>>0,C?(c=An(c),c&&(typeof g=="string"||g!=null&&!$w(g))&&(g=go(g),!g&&Eu(c))?Ts(Xi(c),0,C):c.split(g,C)):[]}var EJ=Tl(function(c,g,C){return c+(C?" ":"")+Hw(g)});function PJ(c,g,C){return c=An(c),C=C==null?0:Au(Vt(C),0,c.length),g=go(g),c.slice(C,C+g.length)==g}function TJ(c,g,C){var O=F.templateSettings;C&&vo(c,g,C)&&(g=n),c=An(c),g=$3({},g,O,We);var B=$3({},g.imports,O.imports,We),V=Ei(B),J=Rf(B,V),ne,ce,_e=0,Pe=g.interpolate||sl,Re="__p += '",nt=jf((g.escape||sl).source+"|"+Pe.source+"|"+(Pe===Sc?H0:sl).source+"|"+(g.evaluate||sl).source+"|$","g"),St="//# sourceURL="+(cn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jp+"]")+` -`;c.replace(nt,function(Tt,Qt,an,xa,yo,wa){return an||(an=xa),Re+=c.slice(_e,wa).replace(K0,gl),Qt&&(ne=!0,Re+=`' + -__e(`+Qt+`) + +`)}function eX(c){return $t(c)||oh(c)||!!(u1&&c&&c[u1])}function Ru(c,g){var C=typeof c;return g=g??U,!!g&&(C=="number"||C!="symbol"&&Y0.test(c))&&c>-1&&c%1==0&&c0){if(++g>=te)return arguments[0]}else g=0;return c.apply(n,arguments)}}function O3(c,g){var C=-1,O=c.length,B=O-1;for(g=g===n?O:g;++C1?c[g-1]:n;return C=typeof C=="function"?(c.pop(),C):n,zT(c,C)});function HT(c){var g=$(c);return g.__chain__=!0,g}function dZ(c,g){return g(c),c}function M3(c,g){return g(c)}var fZ=vr(function(c){var g=c.length,C=g?c[0]:0,O=this.__wrapped__,B=function(V){return Qp(V,c)};return g>1||this.__actions__.length||!(O instanceof Qt)||!Ru(C)?this.thru(B):(O=O.slice(C,+C+(g?1:0)),O.__actions__.push({func:M3,args:[B],thisArg:n}),new ho(O,this.__chain__).thru(function(V){return g&&!V.length&&V.push(n),V}))});function hZ(){return HT(this)}function pZ(){return new ho(this.value(),this.__chain__)}function gZ(){this.__values__===n&&(this.__values__=nL(this.value()));var c=this.__index__>=this.__values__.length,g=c?n:this.__values__[this.__index__++];return{done:c,value:g}}function mZ(){return this}function vZ(c){for(var g,C=this;C instanceof Gf;){var O=DT(C);O.__index__=0,O.__values__=n,g?B.__wrapped__=O:g=O;var B=O;C=C.__wrapped__}return B.__wrapped__=c,g}function yZ(){var c=this.__wrapped__;if(c instanceof Qt){var g=c;return this.__actions__.length&&(g=new Qt(this)),g=g.reverse(),g.__actions__.push({func:M3,args:[Rw],thisArg:n}),new ho(g,this.__chain__)}return this.thru(Rw)}function bZ(){return _l(this.__wrapped__,this.__actions__)}var SZ=bg(function(c,g,C){cn.call(c,C)?++c[C]:ga(c,C,1)});function xZ(c,g,C){var O=$t(c)?Wn:C1;return C&&vo(c,g,C)&&(g=n),O(c,Ie(g,3))}function wZ(c,g){var C=$t(c)?jo:va;return C(c,Ie(g,3))}var CZ=j1(NT),_Z=j1(jT);function kZ(c,g){return Ur(I3(c,g),1)}function EZ(c,g){return Ur(I3(c,g),Z)}function PZ(c,g,C){return C=C===n?1:Vt(C),Ur(I3(c,g),C)}function VT(c,g){var C=$t(c)?Xn:ks;return C(c,Ie(g,3))}function WT(c,g){var C=$t(c)?No:tg;return C(c,Ie(g,3))}var TZ=bg(function(c,g,C){cn.call(c,C)?c[C].push(g):ga(c,C,[g])});function LZ(c,g,C,O){c=Vo(c)?c:_g(c),C=C&&!O?Vt(C):0;var B=c.length;return C<0&&(C=Dr(B+C,0)),B3(c)?C<=B&&c.indexOf(g,C)>-1:!!B&&Oc(c,g,C)>-1}var AZ=Ot(function(c,g,C){var O=-1,B=typeof g=="function",V=Vo(c)?ve(c.length):[];return ks(c,function(J){V[++O]=B?Ri(g,J,C):Es(J,g,C)}),V}),OZ=bg(function(c,g,C){ga(c,C,g)});function I3(c,g){var C=$t(c)?Un:Br;return C(c,Ie(g,3))}function MZ(c,g,C,O){return c==null?[]:($t(g)||(g=g==null?[]:[g]),C=O?n:C,$t(C)||(C=C==null?[]:[C]),Bi(c,g,C))}var IZ=bg(function(c,g,C){c[C?0:1].push(g)},function(){return[[],[]]});function RZ(c,g,C){var O=$t(c)?Lf:zp,B=arguments.length<3;return O(c,Ie(g,4),C,B,ks)}function DZ(c,g,C){var O=$t(c)?Jy:zp,B=arguments.length<3;return O(c,Ie(g,4),C,B,tg)}function NZ(c,g){var C=$t(c)?jo:va;return C(c,N3(Ie(g,3)))}function jZ(c){var g=$t(c)?Yc:fg;return g(c)}function BZ(c,g,C){(C?vo(c,g,C):g===n)?g=1:g=Vt(g);var O=$t(c)?xi:Zf;return O(c,g)}function FZ(c){var g=$t(c)?kw:_i;return g(c)}function $Z(c){if(c==null)return 0;if(Vo(c))return B3(c)?Va(c):c.length;var g=ki(c);return g==Le||g==De?c.size:Gr(c).length}function zZ(c,g,C){var O=$t(c)?Lc:zo;return C&&vo(c,g,C)&&(g=n),O(c,Ie(g,3))}var HZ=Ot(function(c,g){if(c==null)return[];var C=g.length;return C>1&&vo(c,g[0],g[1])?g=[]:C>2&&vo(g[0],g[1],g[2])&&(g=[g[0]]),Bi(c,Ur(g,1),[])}),R3=c3||function(){return kt.Date.now()};function VZ(c,g){if(typeof g!="function")throw new Di(a);return c=Vt(c),function(){if(--c<1)return g.apply(this,arguments)}}function UT(c,g,C){return g=C?n:g,g=c&&g==null?c.length:g,pe(c,D,n,n,n,n,g)}function GT(c,g){var C;if(typeof g!="function")throw new Di(a);return c=Vt(c),function(){return--c>0&&(C=g.apply(this,arguments)),c<=1&&(g=n),C}}var Nw=Ot(function(c,g,C){var O=k;if(C.length){var B=fa(C,tt(Nw));O|=M}return pe(c,O,g,C,B)}),qT=Ot(function(c,g,C){var O=k|E;if(C.length){var B=fa(C,tt(qT));O|=M}return pe(g,O,c,C,B)});function YT(c,g,C){g=C?n:g;var O=pe(c,P,n,n,n,n,n,g);return O.placeholder=YT.placeholder,O}function KT(c,g,C){g=C?n:g;var O=pe(c,A,n,n,n,n,n,g);return O.placeholder=KT.placeholder,O}function XT(c,g,C){var O,B,V,J,ne,ce,_e=0,Pe=!1,Re=!1,nt=!0;if(typeof c!="function")throw new Di(a);g=Ya(g)||0,Cr(C)&&(Pe=!!C.leading,Re="maxWait"in C,V=Re?Dr(Ya(C.maxWait)||0,g):V,nt="trailing"in C?!!C.trailing:nt);function St(Kr){var Os=O,ju=B;return O=B=n,_e=Kr,J=c.apply(ju,Os),J}function Pt(Kr){return _e=Kr,ne=z1(Jt,g),Pe?St(Kr):J}function qt(Kr){var Os=Kr-ce,ju=Kr-_e,gL=g-Os;return Re?fi(gL,V-ju):gL}function Tt(Kr){var Os=Kr-ce,ju=Kr-_e;return ce===n||Os>=g||Os<0||Re&&ju>=V}function Jt(){var Kr=R3();if(Tt(Kr))return an(Kr);ne=z1(Jt,qt(Kr))}function an(Kr){return ne=n,nt&&O?St(Kr):(O=B=n,J)}function xa(){ne!==n&&M1(ne),_e=0,O=ce=B=ne=n}function yo(){return ne===n?J:an(R3())}function wa(){var Kr=R3(),Os=Tt(Kr);if(O=arguments,B=this,ce=Kr,Os){if(ne===n)return Pt(ce);if(Re)return M1(ne),ne=z1(Jt,g),St(ce)}return ne===n&&(ne=z1(Jt,g)),J}return wa.cancel=xa,wa.flush=yo,wa}var WZ=Ot(function(c,g){return w1(c,1,g)}),UZ=Ot(function(c,g,C){return w1(c,Ya(g)||0,C)});function GZ(c){return pe(c,z)}function D3(c,g){if(typeof c!="function"||g!=null&&typeof g!="function")throw new Di(a);var C=function(){var O=arguments,B=g?g.apply(this,O):O[0],V=C.cache;if(V.has(B))return V.get(B);var J=c.apply(this,O);return C.cache=V.set(B,J)||V,J};return C.cache=new(D3.Cache||pa),C}D3.Cache=pa;function N3(c){if(typeof c!="function")throw new Di(a);return function(){var g=arguments;switch(g.length){case 0:return!c.call(this);case 1:return!c.call(this,g[0]);case 2:return!c.call(this,g[0],g[1]);case 3:return!c.call(this,g[0],g[1],g[2])}return!c.apply(this,g)}}function qZ(c){return GT(2,c)}var YZ=Tw(function(c,g){g=g.length==1&&$t(g[0])?Un(g[0],Vr(Ie())):Un(Ur(g,1),Vr(Ie()));var C=g.length;return Ot(function(O){for(var B=-1,V=fi(O.length,C);++B=g}),oh=ug(function(){return arguments}())?ug:function(c){return Fr(c)&&cn.call(c,"callee")&&!l1.call(c,"callee")},$t=ve.isArray,uQ=ci?Vr(ci):k1;function Vo(c){return c!=null&&j3(c.length)&&!Du(c)}function Yr(c){return Fr(c)&&Vo(c)}function cQ(c){return c===!0||c===!1||Fr(c)&&Ci(c)==We}var od=d3||Yw,dQ=Do?Vr(Do):E1;function fQ(c){return Fr(c)&&c.nodeType===1&&!H1(c)}function hQ(c){if(c==null)return!0;if(Vo(c)&&($t(c)||typeof c=="string"||typeof c.splice=="function"||od(c)||Cg(c)||oh(c)))return!c.length;var g=ki(c);if(g==Le||g==De)return!c.size;if($1(c))return!Gr(c).length;for(var C in c)if(cn.call(c,C))return!1;return!0}function pQ(c,g){return Qc(c,g)}function gQ(c,g,C){C=typeof C=="function"?C:n;var O=C?C(c,g):n;return O===n?Qc(c,g,n,C):!!O}function Bw(c){if(!Fr(c))return!1;var g=Ci(c);return g==Fe||g==wt||typeof c.message=="string"&&typeof c.name=="string"&&!H1(c)}function mQ(c){return typeof c=="number"&&Yp(c)}function Du(c){if(!Cr(c))return!1;var g=Ci(c);return g==at||g==bt||g==rt||g==un}function QT(c){return typeof c=="number"&&c==Vt(c)}function j3(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=U}function Cr(c){var g=typeof c;return c!=null&&(g=="object"||g=="function")}function Fr(c){return c!=null&&typeof c=="object"}var JT=co?Vr(co):Pw;function vQ(c,g){return c===g||Jc(c,g,Rt(g))}function yQ(c,g,C){return C=typeof C=="function"?C:n,Jc(c,g,Rt(g),C)}function bQ(c){return eL(c)&&c!=+c}function SQ(c){if(rX(c))throw new It(o);return cg(c)}function xQ(c){return c===null}function wQ(c){return c==null}function eL(c){return typeof c=="number"||Fr(c)&&Ci(c)==ut}function H1(c){if(!Fr(c)||Ci(c)!=ct)return!1;var g=Fc(c);if(g===null)return!0;var C=cn.call(g,"constructor")&&g.constructor;return typeof C=="function"&&C instanceof C&&Sr.call(C)==Si}var Fw=za?Vr(za):xr;function CQ(c){return QT(c)&&c>=-U&&c<=U}var tL=hl?Vr(hl):Ut;function B3(c){return typeof c=="string"||!$t(c)&&Fr(c)&&Ci(c)==Ke}function Sa(c){return typeof c=="symbol"||Fr(c)&&Ci(c)==Xe}var Cg=J0?Vr(J0):ei;function _Q(c){return c===n}function kQ(c){return Fr(c)&&ki(c)==Ne}function EQ(c){return Fr(c)&&Ci(c)==Ct}var PQ=T(Sl),TQ=T(function(c,g){return c<=g});function nL(c){if(!c)return[];if(Vo(c))return B3(c)?Xi(c):$i(c);if($c&&c[$c])return i3(c[$c]());var g=ki(c),C=g==Le?Wp:g==De?Nf:_g;return C(c)}function Nu(c){if(!c)return c===0?c:0;if(c=Ya(c),c===Z||c===-Z){var g=c<0?-1:1;return g*Q}return c===c?c:0}function Vt(c){var g=Nu(c),C=g%1;return g===g?C?g-C:g:0}function rL(c){return c?Au(Vt(c),0,fe):0}function Ya(c){if(typeof c=="number")return c;if(Sa(c))return re;if(Cr(c)){var g=typeof c.valueOf=="function"?c.valueOf():c;c=Cr(g)?g+"":g}if(typeof c!="string")return c===0?c:+c;c=fo(c);var C=U0.test(c);return C||q0.test(c)?st(c.slice(2),C?2:8):W0.test(c)?re:+c}function iL(c){return Ga(c,Wo(c))}function LQ(c){return c?Au(Vt(c),-U,U):c===0?c:0}function An(c){return c==null?"":go(c)}var AQ=mo(function(c,g){if($1(g)||Vo(g)){Ga(g,Ei(g),c);return}for(var C in g)cn.call(g,C)&&yl(c,C,g[C])}),oL=mo(function(c,g){Ga(g,Wo(g),c)}),F3=mo(function(c,g,C,O){Ga(g,Wo(g),c,O)}),OQ=mo(function(c,g,C,O){Ga(g,Ei(g),c,O)}),MQ=vr(Qp);function IQ(c,g){var C=Lu(c);return g==null?C:dt(C,g)}var RQ=Ot(function(c,g){c=mn(c);var C=-1,O=g.length,B=O>2?g[2]:n;for(B&&vo(g[0],g[1],B)&&(O=1);++C1),V}),Ga(c,me(c),C),O&&(C=wi(C,h|m|y,jt));for(var B=g.length;B--;)vg(C,g[B]);return C});function QQ(c,g){return sL(c,N3(Ie(g)))}var JQ=vr(function(c,g){return c==null?{}:L1(c,g)});function sL(c,g){if(c==null)return{};var C=Un(me(c),function(O){return[O]});return g=Ie(g),dg(c,C,function(O,B){return g(O,B[0])})}function eJ(c,g,C){g=kl(g,c);var O=-1,B=g.length;for(B||(B=1,c=n);++Og){var O=c;c=g,g=O}if(C||c%1||g%1){var B=d1();return fi(c+B*(g-c+ge("1e-"+((B+"").length-1))),g)}return Xf(c,g)}var dJ=Tl(function(c,g,C){return g=g.toLowerCase(),c+(C?cL(g):g)});function cL(c){return Hw(An(c).toLowerCase())}function dL(c){return c=An(c),c&&c.replace(K0,r3).replace(Np,"")}function fJ(c,g,C){c=An(c),g=go(g);var O=c.length;C=C===n?O:Au(Vt(C),0,O);var B=C;return C-=g.length,C>=0&&c.slice(C,B)==g}function hJ(c){return c=An(c),c&&Fa.test(c)?c.replace(ol,ws):c}function pJ(c){return c=An(c),c&&B0.test(c)?c.replace(Sf,"\\$&"):c}var gJ=Tl(function(c,g,C){return c+(C?"-":"")+g.toLowerCase()}),mJ=Tl(function(c,g,C){return c+(C?" ":"")+g.toLowerCase()}),vJ=xg("toLowerCase");function yJ(c,g,C){c=An(c),g=Vt(g);var O=g?Va(c):0;if(!g||O>=g)return c;var B=(g-O)/2;return f(Tu(B),C)+c+f(Vf(B),C)}function bJ(c,g,C){c=An(c),g=Vt(g);var O=g?Va(c):0;return g&&O>>0,C?(c=An(c),c&&(typeof g=="string"||g!=null&&!Fw(g))&&(g=go(g),!g&&Eu(c))?Ts(Xi(c),0,C):c.split(g,C)):[]}var EJ=Tl(function(c,g,C){return c+(C?" ":"")+Hw(g)});function PJ(c,g,C){return c=An(c),C=C==null?0:Au(Vt(C),0,c.length),g=go(g),c.slice(C,C+g.length)==g}function TJ(c,g,C){var O=$.templateSettings;C&&vo(c,g,C)&&(g=n),c=An(c),g=F3({},g,O,Ue);var B=F3({},g.imports,O.imports,Ue),V=Ei(B),J=Df(B,V),ne,ce,_e=0,Pe=g.interpolate||sl,Re="__p += '",nt=Bf((g.escape||sl).source+"|"+Pe.source+"|"+(Pe===Sc?V0:sl).source+"|"+(g.evaluate||sl).source+"|$","g"),St="//# sourceURL="+(cn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Bp+"]")+` +`;c.replace(nt,function(Tt,Jt,an,xa,yo,wa){return an||(an=xa),Re+=c.slice(_e,wa).replace(X0,gl),Jt&&(ne=!0,Re+=`' + +__e(`+Jt+`) + '`),yo&&(ce=!0,Re+=`'; `+yo+`; __p += '`),an&&(Re+=`' + @@ -467,16 +467,16 @@ __p += '`),an&&(Re+=`' + `;var Pt=cn.call(g,"variable")&&g.variable;if(!Pt)Re=`with (obj) { `+Re+` } -`;else if(F0.test(Pt))throw new It(s);Re=(ce?Re.replace(rn,""):Re).replace(pr,"$1").replace(Io,"$1;"),Re="function("+(Pt||"obj")+`) { +`;else if(z0.test(Pt))throw new It(s);Re=(ce?Re.replace(rn,""):Re).replace(gr,"$1").replace(Io,"$1;"),Re="function("+(Pt||"obj")+`) { `+(Pt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(ne?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Re+`return __p -}`;var qt=fL(function(){return on(V,St+"return "+Re).apply(n,J)});if(qt.source=Re,Bw(qt))throw qt;return qt}function LJ(c){return An(c).toLowerCase()}function AJ(c){return An(c).toUpperCase()}function OJ(c,g,C){if(c=An(c),c&&(C||g===n))return fo(c);if(!c||!(g=go(g)))return c;var O=Xi(c),B=Xi(g),V=da(O,B),J=xs(O,B)+1;return Ts(O,V,J).join("")}function MJ(c,g,C){if(c=An(c),c&&(C||g===n))return c.slice(0,r1(c)+1);if(!c||!(g=go(g)))return c;var O=Xi(c),B=xs(O,Xi(g))+1;return Ts(O,0,B).join("")}function IJ(c,g,C){if(c=An(c),c&&(C||g===n))return c.replace(xc,"");if(!c||!(g=go(g)))return c;var O=Xi(c),B=da(O,Xi(g));return Ts(O,B).join("")}function RJ(c,g){var C=H,O=K;if(Cr(g)){var B="separator"in g?g.separator:B;C="length"in g?Vt(g.length):C,O="omission"in g?go(g.omission):O}c=An(c);var V=c.length;if(Eu(c)){var J=Xi(c);V=J.length}if(C>=V)return c;var ne=C-Va(O);if(ne<1)return O;var ce=J?Ts(J,0,ne).join(""):c.slice(0,ne);if(B===n)return ce+O;if(J&&(ne+=ce.length-ne),$w(B)){if(c.slice(ne).search(B)){var _e,Pe=ce;for(B.global||(B=jf(B.source,An(vs.exec(B))+"g")),B.lastIndex=0;_e=B.exec(Pe);)var Re=_e.index;ce=ce.slice(0,Re===n?ne:Re)}}else if(c.indexOf(go(B),ne)!=ne){var nt=ce.lastIndexOf(B);nt>-1&&(ce=ce.slice(0,nt))}return ce+O}function DJ(c){return c=An(c),c&&D0.test(c)?c.replace(Mi,s3):c}var NJ=Tl(function(c,g,C){return c+(C?" ":"")+g.toUpperCase()}),Hw=Sg("toUpperCase");function dL(c,g,C){return c=An(c),g=C?n:g,g===n?Hp(c)?Nf(c):e1(c):c.match(g)||[]}var fL=Ot(function(c,g){try{return Ri(c,n,g)}catch(C){return Bw(C)?C:new It(C)}}),jJ=mr(function(c,g){return Xn(g,function(C){C=Ll(C),ga(c,C,Nw(c[C],c))}),c});function BJ(c){var g=c==null?0:c.length,C=Ie();return c=g?Un(c,function(O){if(typeof O[1]!="function")throw new Di(a);return[C(O[0]),O[1]]}):[],Ot(function(O){for(var B=-1;++BU)return[];var C=fe,O=fi(c,fe);g=Ie(g),c-=fe;for(var B=If(O,g);++C0||g<0)?new Zt(C):(c<0?C=C.takeRight(-c):c&&(C=C.drop(c)),g!==n&&(g=Vt(g),C=g<0?C.dropRight(-g):C.take(g-c)),C)},Zt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Zt.prototype.toArray=function(){return this.take(fe)},ya(Zt.prototype,function(c,g){var C=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),B=F[O?"take"+(g=="last"?"Right":""):g],V=O||/^find/.test(g);B&&(F.prototype[g]=function(){var J=this.__wrapped__,ne=O?[1]:arguments,ce=J instanceof Zt,_e=ne[0],Pe=ce||Ft(J),Re=function(Qt){var an=B.apply(F,Ha([Qt],ne));return O&&nt?an[0]:an};Pe&&C&&typeof _e=="function"&&_e.length!=1&&(ce=Pe=!1);var nt=this.__chain__,St=!!this.__actions__.length,Pt=V&&!nt,qt=ce&&!St;if(!V&&Pe){J=qt?J:new Zt(this);var Tt=c.apply(J,ne);return Tt.__actions__.push({func:M3,args:[Re],thisArg:n}),new ho(Tt,nt)}return Pt&&qt?c.apply(this,ne):(Tt=this.thru(Re),Pt?O?Tt.value()[0]:Tt.value():Tt)})}),Xn(["pop","push","shift","sort","splice","unshift"],function(c){var g=Dc[c],C=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",O=/^(?:pop|shift)$/.test(c);F.prototype[c]=function(){var B=arguments;if(O&&!this.__chain__){var V=this.value();return g.apply(Ft(V)?V:[],B)}return this[C](function(J){return g.apply(Ft(J)?J:[],B)})}}),ya(Zt.prototype,function(c,g){var C=F[g];if(C){var O=C.name+"";cn.call(Cs,O)||(Cs[O]=[]),Cs[O].push({name:g,func:C})}}),Cs[th(n,E).name]=[{name:"wrapper",func:n}],Zt.prototype.clone=Zi,Zt.prototype.reverse=ji,Zt.prototype.value=m3,F.prototype.at=fZ,F.prototype.chain=hZ,F.prototype.commit=pZ,F.prototype.next=gZ,F.prototype.plant=vZ,F.prototype.reverse=yZ,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=bZ,F.prototype.first=F.prototype.head,Fc&&(F.prototype[Fc]=mZ),F},Wa=Bo();Xt?((Xt.exports=Wa)._=Wa,Nt._=Wa):kt._=Wa}).call(_o)})(bxe,ke);const Ig=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Rg=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},Sxe=.999,xxe=.1,wxe=20,iv=.95,zI=30,h8=10,HI=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),sh=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Yl(s/o,64)):o<1&&(r.height=s,r.width=Yl(s*o,64)),a=r.width*r.height;return r},Cxe=e=>({width:Yl(e.width,64),height:Yl(e.height,64)}),qW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],_xe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],sP=e=>e.kind==="line"&&e.layer==="mask",kxe=e=>e.kind==="line"&&e.layer==="base",Y5=e=>e.kind==="image"&&e.layer==="base",Exe=e=>e.kind==="fillRect"&&e.layer==="base",Pxe=e=>e.kind==="eraseRect"&&e.layer==="base",Txe=e=>e.kind==="line",Lv={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},Lxe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:Lv,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},YW=hp({name:"canvas",initialState:Lxe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!sP(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Td(ke.clamp(n.width,64,512),64),height:Td(ke.clamp(n.height,64,512),64)},o={x:Yl(n.width/2-i.width/2,64),y:Yl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=sh(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState={...Lv,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Rg(r.width,r.height,n.width,n.height,iv),s=Ig(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=Cxe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=sh(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=HI(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...Lv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(Txe);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(ke.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState=Lv,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(Y5),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const d=Rg(i.width,i.height,512,512,iv),h=Ig(i.width,i.height,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=sh(m);e.scaledBoundingBoxDimensions=v}return}const{width:o,height:a}=r,l=Rg(t,n,o,a,.95),u=Ig(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=HI(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(Y5)){const i=Rg(r.width,r.height,512,512,iv),o=Ig(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=sh(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const d=r?1:Rg(i,o,l,u,iv),h=Ig(i,o,a,s,l,u,d);e.stageScale=d,e.stageCoordinates=h}else{const d=Rg(i,o,512,512,iv),h=Ig(i,o,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=sh(m);e.scaledBoundingBoxDimensions=v}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...Lv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Td(ke.clamp(o,64,512),64),height:Td(ke.clamp(a,64,512),64)},l={x:Yl(o/2-s.width/2,64),y:Yl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=sh(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=sh(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:KW,addFillRect:XW,addImageToStagingArea:Axe,addLine:Oxe,addPointToCurrentLine:ZW,clearCanvasHistory:QW,clearMask:lP,commitColorPickerColor:Mxe,commitStagingAreaImage:Ixe,discardStagedImages:Rxe,fitBoundingBoxToStage:vze,mouseLeftCanvas:Dxe,nextStagingAreaImage:Nxe,prevStagingAreaImage:jxe,redo:Bxe,resetCanvas:uP,resetCanvasInteractionState:$xe,resetCanvasView:JW,resizeAndScaleCanvas:Bx,resizeCanvas:Fxe,setBoundingBoxCoordinates:CC,setBoundingBoxDimensions:Av,setBoundingBoxPreviewFill:yze,setBoundingBoxScaleMethod:zxe,setBrushColor:$m,setBrushSize:Fm,setCanvasContainerDimensions:Hxe,setColorPickerColor:Vxe,setCursorPosition:Wxe,setDoesCanvasNeedScaling:vi,setInitialCanvasImage:$x,setIsDrawing:eU,setIsMaskEnabled:$y,setIsMouseOverBoundingBox:Pb,setIsMoveBoundingBoxKeyHeld:bze,setIsMoveStageKeyHeld:Sze,setIsMovingBoundingBox:_C,setIsMovingStage:K5,setIsTransformingBoundingBox:kC,setLayer:X5,setMaskColor:tU,setMergedCanvas:Uxe,setShouldAutoSave:nU,setShouldCropToBoundingBoxOnSave:rU,setShouldDarkenOutsideBoundingBox:iU,setShouldLockBoundingBox:xze,setShouldPreserveMaskedArea:oU,setShouldShowBoundingBox:Gxe,setShouldShowBrush:wze,setShouldShowBrushPreview:Cze,setShouldShowCanvasDebugInfo:aU,setShouldShowCheckboardTransparency:_ze,setShouldShowGrid:sU,setShouldShowIntermediates:lU,setShouldShowStagingImage:qxe,setShouldShowStagingOutline:VI,setShouldSnapToGrid:Z5,setStageCoordinates:uU,setStageScale:Yxe,setTool:ru,toggleShouldLockBoundingBox:kze,toggleTool:Eze,undo:Kxe,setScaledBoundingBoxDimensions:Tb,setShouldRestrictStrokesToBox:cU}=YW.actions,Xxe=YW.reducer,Zxe={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},dU=hp({name:"gallery",initialState:Zxe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=ke.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:cm,clearIntermediateImage:EC,removeImage:fU,setCurrentImage:WI,addGalleryImages:Qxe,setIntermediateImage:Jxe,selectNextImage:cP,selectPrevImage:dP,setShouldPinGallery:ewe,setShouldShowGallery:Fd,setGalleryScrollPosition:twe,setGalleryImageMinimumWidth:ov,setGalleryImageObjectFit:nwe,setShouldHoldGalleryOpen:hU,setShouldAutoSwitchToNewImages:rwe,setCurrentCategory:Lb,setGalleryWidth:iwe,setShouldUseSingleGalleryColumn:owe}=dU.actions,awe=dU.reducer,swe={isLightboxOpen:!1},lwe=swe,pU=hp({name:"lightbox",initialState:lwe,reducers:{setIsLightboxOpen:(e,t)=>{e.isLightboxOpen=t.payload}}}),{setIsLightboxOpen:zm}=pU.actions,uwe=pU.reducer,l2=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" ");function fP(e){let t=l2(e),n=null;const r=new RegExp(/\[([^\][]*)]/,"gi"),i=[...t.matchAll(r)].map(o=>o[1]);return i.length&&(n=i.join(" "),i.forEach(o=>{t=t.replace(`[${o}]`,"").replaceAll("[]","").trim()})),[t,n]}const cwe=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return hP(r)?r:!1},hP=e=>Boolean(typeof e=="string"?cwe(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),Q5=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),dwe=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),gU={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512},fwe=gU,mU=hp({name:"generation",initialState:fwe,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=l2(n)},setNegativePrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.negativePrompt=n:e.negativePrompt=l2(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:d,hires_fix:h,width:m,height:v}=t.payload.image;o&&o.length>0?(e.seedWeights=Q5(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=l2(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,typeof u>"u"?e.perlin=0:e.perlin=u,typeof d=="boolean"&&(e.seamless=d),m&&(e.width=m),v&&(e.height=v)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:d,seamless:h,hires_fix:m,width:v,height:b,strength:S,fit:_,init_image_path:E,mask_image_path:k}=t.payload.image;if(n==="img2img"&&(E&&(e.initialImage=E),k&&(e.maskPath=k),S&&(e.img2imgStrength=S),typeof _=="boolean"&&(e.shouldFitToWidthHeight=_)),a&&a.length>0?(e.seedWeights=Q5(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i){const[T,A]=fP(i);T&&(e.prompt=T),A?e.negativePrompt=A:e.negativePrompt=""}r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),typeof u>"u"?e.threshold=0:e.threshold=u,typeof d>"u"?e.perlin=0:e.perlin=d,typeof h=="boolean"&&(e.seamless=h),v&&(e.width=v),b&&(e.height=b)},resetParametersState:e=>({...e,...gU}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload}}}),{clearInitialImage:vU,resetParametersState:Pze,resetSeed:Tze,setAllImageToImageParameters:hwe,setAllParameters:yU,setAllTextToImageParameters:Lze,setCfgScale:bU,setHeight:SU,setImg2imgStrength:p8,setInfillMethod:xU,setInitialImage:P0,setIterations:pwe,setMaskPath:wU,setParameter:Aze,setPerlin:CU,setPrompt:Fx,setNegativePrompt:ny,setSampler:_U,setSeamBlur:UI,setSeamless:kU,setSeamSize:GI,setSeamSteps:qI,setSeamStrength:YI,setSeed:Fy,setSeedWeights:EU,setShouldFitToWidthHeight:PU,setShouldGenerateVariations:gwe,setShouldRandomizeSeed:mwe,setSteps:TU,setThreshold:LU,setTileSize:KI,setVariationAmount:vwe,setWidth:AU}=mU.actions,ywe=mU.reducer,OU={codeformerFidelity:.75,facetoolStrength:.8,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingDenoising:.75,upscalingStrength:.75},bwe=OU,MU=hp({name:"postprocessing",initialState:bwe,reducers:{setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingDenoising:(e,t)=>{e.upscalingDenoising=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setHiresStrength:(e,t)=>{e.hiresStrength=t.payload},resetPostprocessingState:e=>({...e,...OU}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload}}}),{resetPostprocessingState:Oze,setCodeformerFidelity:IU,setFacetoolStrength:g8,setFacetoolType:j4,setHiresFix:pP,setHiresStrength:XI,setShouldLoopback:Swe,setShouldRunESRGAN:xwe,setShouldRunFacetool:wwe,setUpscalingLevel:RU,setUpscalingDenoising:m8,setUpscalingStrength:v8}=MU.actions,Cwe=MU.reducer;function Qs(e){return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qs(e)}function gu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _we(e,t){if(Qs(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qs(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DU(e){var t=_we(e,"string");return Qs(t)==="symbol"?t:String(t)}function ZI(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};gu(this,e),this.init(t,n)}return mu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||Awe,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function nR(e,t,n){var r=gP(e,t,Object),i=r.obj,o=r.k;i[o]=n}function Iwe(e,t,n,r){var i=gP(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function J5(e,t){var n=gP(e,t),r=n.obj,i=n.k;if(r)return r[i]}function rR(e,t,n){var r=J5(e,n);return r!==void 0?r:J5(t,n)}function NU(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):NU(e[r],t[r],n):e[r]=t[r]);return e}function Dg(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Rwe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Dwe(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return Rwe[t]}):e}var Hx=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Nwe=[" ",",","?","!",";"];function jwe(e,t,n){t=t||"",n=n||"";var r=Nwe.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function iR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ab(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jU(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?jU(l,u,n):void 0}i=i[r[o]]}return i}}var Fwe=function(e){zx(n,e);var t=Bwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return gu(this,n),i=t.call(this),Hx&&ef.call(zd(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return mu(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[i,o];a&&typeof a!="string"&&(d=d.concat(a)),a&&typeof a=="string"&&(d=d.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(d=i.split("."));var h=J5(this.data,d);return h||!u||typeof a!="string"?h:jU(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var d=[i,o];a&&(d=d.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(d=i.split("."),s=o,o=d[1]),this.addNamespaces(o),nR(this.data,d,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[i,o];i.indexOf(".")>-1&&(d=i.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);var h=J5(this.data,d)||{};s?NU(h,a,l):h=Ab(Ab({},h),a),nR(this.data,d,h),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Ab(Ab({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(ef),BU={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function oR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var aR={},sR=function(e){zx(n,e);var t=zwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gu(this,n),i=t.call(this),Hx&&ef.call(zd(i)),Mwe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,zd(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Kl.create("translator"),i}return mu(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!jwe(i,a,s);if(u&&!d){var h=i.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:i,namespaces:l};var m=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),i=m.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(Qs(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,d=this.extractFromKey(i[i.length-1],o),h=d.key,m=d.namespaces,v=m[m.length-1],b=o.lng||this.language,S=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(S){var _=o.nsSeparator||this.options.nsSeparator;return l?(E.res="".concat(v).concat(_).concat(h),E):"".concat(v).concat(_).concat(h)}return l?(E.res=h,E):h}var E=this.resolve(i,o),k=E&&E.res,T=E&&E.usedKey||h,A=E&&E.exactUsedKey||h,M=Object.prototype.toString.apply(k),R=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,z=typeof k!="string"&&typeof k!="boolean"&&typeof k!="number";if(j&&k&&z&&R.indexOf(M)<0&&!(typeof D=="string"&&M==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var H=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,k,xo(xo({},o),{},{ns:m})):"key '".concat(h," (").concat(this.language,")' returned an object instead of string.");return l?(E.res=H,E):H}if(u){var K=M==="[object Array]",te=K?[]:{},G=K?A:T;for(var $ in k)if(Object.prototype.hasOwnProperty.call(k,$)){var W="".concat(G).concat(u).concat($);te[$]=this.translate(W,xo(xo({},o),{joinArrays:!1,ns:m})),te[$]===W&&(te[$]=k[$])}k=te}}else if(j&&typeof D=="string"&&M==="[object Array]")k=k.join(D),k&&(k=this.extendTranslation(k,i,o,a));else{var X=!1,Z=!1,U=o.count!==void 0&&typeof o.count!="string",Q=n.hasDefaultValue(o),re=U?this.pluralResolver.getSuffix(b,o.count,o):"",fe=o["defaultValue".concat(re)]||o.defaultValue;!this.isValidLookup(k)&&Q&&(X=!0,k=fe),this.isValidLookup(k)||(Z=!0,k=h);var Ee=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,be=Ee&&Z?void 0:k,ye=Q&&fe!==k&&this.options.updateMissing;if(Z||X||ye){if(this.logger.log(ye?"updateKey":"missingKey",b,v,h,ye?fe:k),u){var Fe=this.resolve(h,xo(xo({},o),{},{keySeparator:!1}));Fe&&Fe.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Me=[],rt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&rt&&rt[0])for(var Ve=0;Ve1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,d,h;return typeof i=="string"&&(i=[i]),i.forEach(function(m){if(!o.isValidLookup(s)){var v=o.extractFromKey(m,a),b=v.key;l=b;var S=v.namespaces;o.options.fallbackNS&&(S=S.concat(o.options.fallbackNS));var _=a.count!==void 0&&typeof a.count!="string",E=_&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),k=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);S.forEach(function(A){o.isValidLookup(s)||(h=A,!aR["".concat(T[0],"-").concat(A)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(h)&&(aR["".concat(T[0],"-").concat(A)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(T.join(", "),`" won't get resolved as namespace "`).concat(h,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(function(M){if(!o.isValidLookup(s)){d=M;var R=[b];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(R,b,M,A,a);else{var D;_&&(D=o.pluralResolver.getSuffix(M,a.count,a));var j="".concat(o.options.pluralSeparator,"zero");if(_&&(R.push(b+D),E&&R.push(b+j)),k){var z="".concat(b).concat(o.options.contextSeparator).concat(a.context);R.push(z),_&&(R.push(z+D),E&&R.push(z+j))}}for(var H;H=R.pop();)o.isValidLookup(s)||(u=H,s=o.getResource(M,A,H,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:d,usedNS:h}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(ef);function PC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var lR=function(){function e(t){gu(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kl.create("languageUtils")}return mu(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=PC(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=PC(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=PC(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){u&&(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),Vwe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Wwe={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Uwe=["v1","v2","v3"],uR={zero:0,one:1,two:2,few:3,many:4,other:5};function Gwe(){var e={};return Vwe.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Wwe[t.fc]}})}),e}var qwe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gu(this,e),this.languageUtils=t,this.options=n,this.logger=Kl.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Gwe()}return mu(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return uR[a]-uR[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!Uwe.includes(this.options.compatibilityJSON)}}]),e}();function cR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function js(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};gu(this,e),this.logger=Kl.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return mu(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:Dwe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Dg(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Dg(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Dg(r.nestingPrefix):r.nestingPrefixEscaped||Dg("$t("),this.nestingSuffix=r.nestingSuffix?Dg(r.nestingSuffix):r.nestingSuffixEscaped||Dg(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(_){return _.replace(/\$/g,"$$$$")}var m=function(E){if(E.indexOf(a.formatSeparator)<0){var k=rR(r,d,E);return a.alwaysFormat?a.format(k,void 0,i,js(js(js({},o),r),{},{interpolationkey:E})):k}var T=E.split(a.formatSeparator),A=T.shift().trim(),M=T.join(a.formatSeparator).trim();return a.format(rR(r,d,A),M,i,js(js(js({},o),r),{},{interpolationkey:A}))};this.resetRegExp();var v=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,S=[{regex:this.regexpUnescape,safeValue:function(E){return h(E)}},{regex:this.regexp,safeValue:function(E){return a.escapeValue?h(a.escape(E)):h(E)}}];return S.forEach(function(_){for(u=0;s=_.regex.exec(n);){var E=s[1].trim();if(l=m(E),l===void 0)if(typeof v=="function"){var k=v(n,s,o);l=typeof k=="string"?k:""}else if(o&&o.hasOwnProperty(E))l="";else if(b){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(E," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=tR(l));var T=_.safeValue(l);if(n=n.replace(s[0],T),b?(_.regex.lastIndex+=l.length,_.regex.lastIndex-=s[0].length):_.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(v,b){var S=this.nestingOptionsSeparator;if(v.indexOf(S)<0)return v;var _=v.split(new RegExp("".concat(S,"[ ]*{"))),E="{".concat(_[1]);v=_[0],E=this.interpolate(E,l);var k=E.match(/'/g),T=E.match(/"/g);(k&&k.length%2===0&&!T||T.length%2!==0)&&(E=E.replace(/'/g,'"'));try{l=JSON.parse(E),b&&(l=js(js({},b),l))}catch(A){return this.logger.warn("failed parsing options string in nesting for key ".concat(v),A),"".concat(v).concat(S).concat(E)}return delete l.defaultValue,v}for(;a=this.nestingRegexp.exec(n);){var d=[];l=js({},o),l.applyPostProcessor=!1,delete l.defaultValue;var h=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var m=a[1].split(this.formatSeparator).map(function(v){return v.trim()});a[1]=m.shift(),d=m,h=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=tR(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),h&&(s=d.reduce(function(v,b){return i.format(v,b,o.lng,js(js({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function dR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cd(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(a){var s=a.split(":"),l=Lwe(s),u=l[0],d=l.slice(1),h=d.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=h),h==="false"&&(n[u.trim()]=!1),h==="true"&&(n[u.trim()]=!0),isNaN(h)||(n[u.trim()]=parseInt(h,10))}})}}return{formatName:t,formatOptions:n}}function Ng(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var Xwe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gu(this,e),this.logger=Kl.create("formatter"),this.options=t,this.formats={number:Ng(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:Ng(function(n,r){var i=new Intl.NumberFormat(n,cd(cd({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:Ng(function(n,r){var i=new Intl.DateTimeFormat(n,cd({},r));return function(o){return i.format(o)}}),relativetime:Ng(function(n,r){var i=new Intl.RelativeTimeFormat(n,cd({},r));return function(o){return i.format(o,r.range||"day")}}),list:Ng(function(n,r){var i=new Intl.ListFormat(n,cd({},r));return function(o){return i.format(o)}})},this.init(t)}return mu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Ng(r)}},{key:"format",value:function(n,r,i,o){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,d){var h=Kwe(d),m=h.formatName,v=h.formatOptions;if(a.formats[m]){var b=u;try{var S=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},_=S.locale||S.lng||o.locale||o.lng||i;b=a.formats[m](u,_,cd(cd(cd({},v),o),S))}catch(E){a.logger.warn(E)}return b}else a.logger.warn("there was no format function for ".concat(m));return u},n);return l}}]),e}();function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hR(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jwe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var e6e=function(e){zx(n,e);var t=Zwe(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return gu(this,n),a=t.call(this),Hx&&ef.call(zd(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Kl.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return mu(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},d={},h={},m={};return i.forEach(function(v){var b=!0;o.forEach(function(S){var _="".concat(v,"|").concat(S);!a.reload&&l.store.hasResourceBundle(v,S)?l.state[_]=2:l.state[_]<0||(l.state[_]===1?d[_]===void 0&&(d[_]=!0):(l.state[_]=1,b=!1,d[_]===void 0&&(d[_]=!0),u[_]===void 0&&(u[_]=!0),m[S]===void 0&&(m[S]=!0)))}),b||(h[v]=!0)}),(Object.keys(u).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(d),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var d={};this.queue.forEach(function(h){Iwe(h.loaded,[l],u),Jwe(h,i),o&&h.errors.push(o),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(function(m){d[m]||(d[m]={});var v=h.loaded[m];v.length&&v.forEach(function(b){d[m][b]===void 0&&(d[m][b]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(h){return!h.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!i.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:d});return}this.readingCalls++;var h=function(S,_){if(s.readingCalls--,s.waitingReads.length>0){var E=s.waitingReads.shift();s.read(E.lng,E.ns,E.fcName,E.tried,E.wait,E.callback)}if(S&&_&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(d){a.loadOne(d)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(d,h){d&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),d),!d&&h&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),h),o.loaded(i,d,h)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var h=hR(hR({},u),{},{isUpdate:l}),m=this.backend.create.bind(this.backend);if(m.length<6)try{var v;m.length===5?v=m(i,o,a,s,h):v=m(i,o,a,s),v&&typeof v.then=="function"?v.then(function(b){return d(null,b)}).catch(d):d(null,v)}catch(b){d(b)}else m(i,o,a,s,d,h)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(ef);function pR(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Qs(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Qs(t[2])==="object"||Qs(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function gR(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function mR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rl(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ob(){}function r6e(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var eS=function(e){zx(n,e);var t=t6e(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(gu(this,n),r=t.call(this),Hx&&ef.call(zd(r)),r.options=gR(i),r.services={},r.logger=Kl,r.modules={external:[]},r6e(zd(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),zy(r,zd(r));setTimeout(function(){r.init(i,o)},0)}return r}return mu(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=pR();this.options=Rl(Rl(Rl({},s),this.options),gR(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Rl(Rl({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(E){return E?typeof E=="function"?new E:E:null}if(!this.options.isClone){this.modules.logger?Kl.init(l(this.modules.logger),this.options):Kl.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Xwe);var d=new lR(this.options);this.store=new Fwe(this.options.resources,this.options);var h=this.services;h.logger=Kl,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new qwe(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=l(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Ywe(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new e6e(l(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(E){for(var k=arguments.length,T=new Array(k>1?k-1:0),A=1;A1?k-1:0),A=1;A0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var v=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];v.forEach(function(E){i[E]=function(){var k;return(k=i.store)[E].apply(k,arguments)}});var b=["addResource","addResources","addResourceBundle","removeResourceBundle"];b.forEach(function(E){i[E]=function(){var k;return(k=i.store)[E].apply(k,arguments),i}});var S=av(),_=function(){var k=function(A,M){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),S.resolve(M),a(A,M)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return k(null,i.t.bind(i));i.changeLanguage(i.options.lng,k)};return this.options.resources||!this.options.initImmediate?_():setTimeout(_,0),S}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ob,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],d=function(v){if(v){var b=o.services.languageUtils.toResolveHierarchy(v);b.forEach(function(S){u.indexOf(S)<0&&u.push(S)})}};if(l)d(l);else{var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.forEach(function(m){return d(m)})}this.options.preload&&this.options.preload.forEach(function(m){return d(m)}),this.services.backendConnector.load(u,this.options.ns,function(m){!m&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=av();return i||(i=this.languages),o||(o=this.options.ns),a||(a=Ob),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&BU.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=av();this.emit("languageChanging",i);var l=function(m){a.language=m,a.languages=a.services.languageUtils.toResolveHierarchy(m),a.resolvedLanguage=void 0,a.setResolvedLanguage(m)},u=function(m,v){v?(l(v),a.translator.changeLanguage(v),a.isLanguageChangingTo=void 0,a.emit("languageChanged",v),a.logger.log("languageChanged",v)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(m,function(){return a.t.apply(a,arguments)})},d=function(m){!i&&!m&&a.services.languageDetector&&(m=[]);var v=typeof m=="string"?m:a.services.languageUtils.getBestMatchFromCodes(m);v&&(a.language||l(v),a.translator.language||a.translator.changeLanguage(v),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(v)),a.loadResources(v,function(b){u(b,v)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(d,h){var m;if(Qs(h)!=="object"){for(var v=arguments.length,b=new Array(v>2?v-2:0),S=2;S1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var d=function(v,b){var S=o.services.backendConnector.state["".concat(v,"|").concat(b)];return S===-1||S===2};if(a.precheck){var h=a.precheck(this,d);if(h!==void 0)return h}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,i)&&(!l||d(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=av();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=av();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new lR(pR());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ob,s=Rl(Rl(Rl({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(d){l[d]=i[d]}),l.services=Rl({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new sR(l.services,l.options),l.translator.on("*",function(d){for(var h=arguments.length,m=new Array(h>1?h-1:0),v=1;v0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new eS(e,t)});var zt=eS.createInstance();zt.createInstance=eS.createInstance;zt.createInstance;zt.dir;zt.init;zt.loadResources;zt.reloadResources;zt.use;zt.changeLanguage;zt.getFixedT;zt.t;zt.exists;zt.setDefaultNamespace;zt.hasLoadedNamespace;zt.loadNamespaces;zt.loadLanguages;function i6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ry(e){return ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ry(e)}function o6e(e,t){if(ry(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ry(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a6e(e){var t=o6e(e,"string");return ry(t)==="symbol"?t:String(t)}function vR(e,t){for(var n=0;n0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!yR.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!yR.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},bR={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=d6e(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},sv=null,SR=function(){if(sv!==null)return sv;try{sv=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{sv=!1}return sv},p6e={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&SR()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&SR()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},lv=null,xR=function(){if(lv!==null)return lv;try{lv=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{lv=!1}return lv},g6e={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&xR()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&xR()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},m6e={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},v6e={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},y6e={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},b6e={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function S6e(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var FU=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i6e(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return s6e(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=c6e(r,this.options||{},S6e()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(f6e),this.addDetector(h6e),this.addDetector(p6e),this.addDetector(g6e),this.addDetector(m6e),this.addDetector(v6e),this.addDetector(y6e),this.addDetector(b6e)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();FU.type="languageDetector";function b8(e){return b8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b8(e)}var zU=[],x6e=zU.forEach,w6e=zU.slice;function S8(e){return x6e.call(w6e.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function HU(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":b8(XMLHttpRequest))==="object"}function C6e(e){return!!e&&typeof e.then=="function"}function _6e(e){return C6e(e)?e:Promise.resolve(e)}function k6e(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var iy={},E6e={get exports(){return iy},set exports(e){iy=e}},u2={},P6e={get exports(){return u2},set exports(e){u2=e}},wR;function T6e(){return wR||(wR=1,function(e,t){var n=typeof self<"u"?self:_o,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l($){return $&&DataView.prototype.isPrototypeOf($)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function($){return $&&u.indexOf(Object.prototype.toString.call($))>-1};function h($){if(typeof $!="string"&&($=String($)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test($))throw new TypeError("Invalid character in header field name");return $.toLowerCase()}function m($){return typeof $!="string"&&($=String($)),$}function v($){var W={next:function(){var X=$.shift();return{done:X===void 0,value:X}}};return s.iterable&&(W[Symbol.iterator]=function(){return W}),W}function b($){this.map={},$ instanceof b?$.forEach(function(W,X){this.append(X,W)},this):Array.isArray($)?$.forEach(function(W){this.append(W[0],W[1])},this):$&&Object.getOwnPropertyNames($).forEach(function(W){this.append(W,$[W])},this)}b.prototype.append=function($,W){$=h($),W=m(W);var X=this.map[$];this.map[$]=X?X+", "+W:W},b.prototype.delete=function($){delete this.map[h($)]},b.prototype.get=function($){return $=h($),this.has($)?this.map[$]:null},b.prototype.has=function($){return this.map.hasOwnProperty(h($))},b.prototype.set=function($,W){this.map[h($)]=m(W)},b.prototype.forEach=function($,W){for(var X in this.map)this.map.hasOwnProperty(X)&&$.call(W,this.map[X],X,this)},b.prototype.keys=function(){var $=[];return this.forEach(function(W,X){$.push(X)}),v($)},b.prototype.values=function(){var $=[];return this.forEach(function(W){$.push(W)}),v($)},b.prototype.entries=function(){var $=[];return this.forEach(function(W,X){$.push([X,W])}),v($)},s.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function S($){if($.bodyUsed)return Promise.reject(new TypeError("Already read"));$.bodyUsed=!0}function _($){return new Promise(function(W,X){$.onload=function(){W($.result)},$.onerror=function(){X($.error)}})}function E($){var W=new FileReader,X=_(W);return W.readAsArrayBuffer($),X}function k($){var W=new FileReader,X=_(W);return W.readAsText($),X}function T($){for(var W=new Uint8Array($),X=new Array(W.length),Z=0;Z-1?W:$}function j($,W){W=W||{};var X=W.body;if($ instanceof j){if($.bodyUsed)throw new TypeError("Already read");this.url=$.url,this.credentials=$.credentials,W.headers||(this.headers=new b($.headers)),this.method=$.method,this.mode=$.mode,this.signal=$.signal,!X&&$._bodyInit!=null&&(X=$._bodyInit,$.bodyUsed=!0)}else this.url=String($);if(this.credentials=W.credentials||this.credentials||"same-origin",(W.headers||!this.headers)&&(this.headers=new b(W.headers)),this.method=D(W.method||this.method||"GET"),this.mode=W.mode||this.mode||null,this.signal=W.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function z($){var W=new FormData;return $.trim().split("&").forEach(function(X){if(X){var Z=X.split("="),U=Z.shift().replace(/\+/g," "),Q=Z.join("=").replace(/\+/g," ");W.append(decodeURIComponent(U),decodeURIComponent(Q))}}),W}function H($){var W=new b,X=$.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(Z){var U=Z.split(":"),Q=U.shift().trim();if(Q){var re=U.join(":").trim();W.append(Q,re)}}),W}M.call(j.prototype);function K($,W){W||(W={}),this.type="default",this.status=W.status===void 0?200:W.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in W?W.statusText:"OK",this.headers=new b(W.headers),this.url=W.url||"",this._initBody($)}M.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},K.error=function(){var $=new K(null,{status:0,statusText:""});return $.type="error",$};var te=[301,302,303,307,308];K.redirect=function($,W){if(te.indexOf(W)===-1)throw new RangeError("Invalid status code");return new K(null,{status:W,headers:{location:$}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(W,X){this.message=W,this.name=X;var Z=Error(W);this.stack=Z.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function G($,W){return new Promise(function(X,Z){var U=new j($,W);if(U.signal&&U.signal.aborted)return Z(new a.DOMException("Aborted","AbortError"));var Q=new XMLHttpRequest;function re(){Q.abort()}Q.onload=function(){var fe={status:Q.status,statusText:Q.statusText,headers:H(Q.getAllResponseHeaders()||"")};fe.url="responseURL"in Q?Q.responseURL:fe.headers.get("X-Request-URL");var Ee="response"in Q?Q.response:Q.responseText;X(new K(Ee,fe))},Q.onerror=function(){Z(new TypeError("Network request failed"))},Q.ontimeout=function(){Z(new TypeError("Network request failed"))},Q.onabort=function(){Z(new a.DOMException("Aborted","AbortError"))},Q.open(U.method,U.url,!0),U.credentials==="include"?Q.withCredentials=!0:U.credentials==="omit"&&(Q.withCredentials=!1),"responseType"in Q&&s.blob&&(Q.responseType="blob"),U.headers.forEach(function(fe,Ee){Q.setRequestHeader(Ee,fe)}),U.signal&&(U.signal.addEventListener("abort",re),Q.onreadystatechange=function(){Q.readyState===4&&U.signal.removeEventListener("abort",re)}),Q.send(typeof U._bodyInit>"u"?null:U._bodyInit)})}return G.polyfill=!0,o.fetch||(o.fetch=G,o.Headers=b,o.Request=j,o.Response=K),a.Headers=b,a.Request=j,a.Response=K,a.fetch=G,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(P6e,u2)),u2}(function(e,t){var n;if(typeof fetch=="function"&&(typeof _o<"u"&&_o.fetch?n=_o.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof k6e<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||T6e();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(E6e,iy);const VU=iy,CR=cj({__proto__:null,default:VU},[iy]);function tS(e){return tS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tS(e)}var Xu;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Xu=global.fetch:typeof window<"u"&&window.fetch?Xu=window.fetch:Xu=fetch);var oy;HU()&&(typeof global<"u"&&global.XMLHttpRequest?oy=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(oy=window.XMLHttpRequest));var nS;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?nS=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(nS=window.ActiveXObject));!Xu&&CR&&!oy&&!nS&&(Xu=VU||CR);typeof Xu!="function"&&(Xu=void 0);var x8=function(t,n){if(n&&tS(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},_R=function(t,n,r){Xu(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},kR=!1,L6e=function(t,n,r,i){t.queryStringParams&&(n=x8(n,t.queryStringParams));var o=S8({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=S8({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},kR?{}:a);try{_R(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),_R(n,s,i),kR=!0}catch(u){i(u)}}},A6e=function(t,n,r,i){r&&tS(r)==="object"&&(r=x8("",r).slice(1)),t.queryStringParams&&(n=x8(n,t.queryStringParams));try{var o;oy?o=new oy:o=new nS("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},O6e=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Xu&&n.indexOf("file:")!==0)return L6e(t,n,r,i);if(HU()||typeof ActiveXObject=="function")return A6e(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function ay(e){return ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ay(e)}function M6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ER(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};M6e(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return I6e(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=S8(i,this.options||{},N6e()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=_6e(l),l.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(d,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,d;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch{d="failed parsing "+n+" to json"}if(d)return r(d,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,d=[],h=[];n.forEach(function(m){var v=s.options.addPath;typeof s.options.addPath=="function"&&(v=s.options.addPath(m,r));var b=s.services.interpolator.interpolate(v,{lng:m,ns:r});s.options.request(s.options,b,l,function(S,_){u+=1,d.push(S),h.push(_),u===n.length&&a&&a(d,h)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(h){var m=o.toResolveHierarchy(h);m.forEach(function(v){l.indexOf(v)<0&&l.push(v)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),l.forEach(function(d){n.allOptions.ns.forEach(function(h){i.read(d,h,"read",null,null,function(m,v){m&&a.warn("loading namespace ".concat(h," for language ").concat(d," failed"),m),!m&&v&&a.log("loaded namespace ".concat(h," for language ").concat(d),v),i.loaded("".concat(d,"|").concat(h),m,v)})})})}}}]),e}();UU.type="backend";function sy(e){return sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sy(e)}function j6e(e,t){if(sy(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sy(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GU(e){var t=j6e(e,"string");return sy(t)==="symbol"?t:String(t)}function qU(e,t,n){return t=GU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B6e(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var d=t.services.backendConnector.state["".concat(l,"|").concat(u)];return d===-1||d===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function F6e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return w8("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):$6e(e,t,n)}var z6e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,H6e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},V6e=function(t){return H6e[t]},W6e=function(t){return t.replace(z6e,V6e)};function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function AR(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};C8=AR(AR({},C8),e)}function G6e(){return C8}var YU;function q6e(e){YU=e}function Y6e(){return YU}function K6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=w.useContext(Q6e)||{},i=r.i18n,o=r.defaultNS,a=n||i||Y6e();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new J6e),!a){w8("You will need to pass in an i18next instance by using initReactI18next");var s=function(z){return Array.isArray(z)?z[z.length-1]:z},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&w8("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=TC(TC(TC({},G6e()),a.options.react),t),d=u.useSuspense,h=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var v=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(j){return F6e(j,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],h)}var S=w.useState(b),_=iCe(S,2),E=_[0],k=_[1],T=m.join(),A=oCe(T),M=w.useRef(!0);w.useEffect(function(){var j=u.bindI18n,z=u.bindI18nStore;M.current=!0,!v&&!d&&TR(a,m,function(){M.current&&k(b)}),v&&A&&A!==T&&M.current&&k(b);function H(){M.current&&k(b)}return j&&a&&a.on(j,H),z&&a&&a.store.on(z,H),function(){M.current=!1,j&&a&&j.split(" ").forEach(function(K){return a.off(K,H)}),z&&a&&z.split(" ").forEach(function(K){return a.store.off(K,H)})}},[a,T]);var R=w.useRef(!0);w.useEffect(function(){M.current&&!R.current&&k(b),R.current=!1},[a,h]);var D=[E,a,v];if(D.t=E,D.i18n=a,D.ready=v,v||!v&&!d)return D;throw new Promise(function(j){TR(a,m,function(){j()})})}zt.use(UU).use(FU).use(Z6e).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","parameters","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const aCe={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:zt.isInitialized?zt.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},KU=hp({name:"system",initialState:aCe,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?zt.t("common:statusConnected"):zt.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=zt.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:sCe,setIsProcessing:ns,addLogEntry:to,setShouldShowLogViewer:LC,setIsConnected:RR,setSocketId:Mze,setShouldConfirmOnDelete:XU,setOpenAccordions:lCe,setSystemStatus:uCe,setCurrentStatus:B4,setSystemConfig:cCe,setShouldDisplayGuides:dCe,processingCanceled:fCe,errorOccurred:DR,errorSeen:ZU,setModelList:Mb,setIsCancelable:dm,modelChangeRequested:hCe,setSaveIntermediatesInterval:pCe,setEnableImageDebugging:gCe,generationRequested:mCe,addToast:Ah,clearToastQueue:vCe,setProcessingIndeterminateTask:yCe,setSearchFolder:QU,setFoundModels:JU,setOpenModel:NR}=KU.actions,bCe=KU.reducer,mP=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],SCe={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,addNewModelUIOption:null},xCe=SCe,eG=hp({name:"ui",initialState:xCe,reducers:{setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=mP.indexOf(t.payload)},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setParametersPanelScrollPosition:(e,t)=>{e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:(e,t)=>{e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:(e,t)=>{e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setAddNewModelUIOption:(e,t)=>{e.addNewModelUIOption=t.payload}}}),{setActiveTab:Yo,setCurrentTheme:wCe,setParametersPanelScrollPosition:CCe,setShouldHoldParametersPanelOpen:_Ce,setShouldPinParametersPanel:kCe,setShouldShowParametersPanel:Zu,setShouldShowDualDisplay:ECe,setShouldShowImageDetails:tG,setShouldUseCanvasBetaLayout:PCe,setShouldShowExistingModelsInSearch:TCe,setAddNewModelUIOption:Vh}=eG.actions,LCe=eG.reducer,cu=Object.create(null);cu.open="0";cu.close="1";cu.ping="2";cu.pong="3";cu.message="4";cu.upgrade="5";cu.noop="6";const $4=Object.create(null);Object.keys(cu).forEach(e=>{$4[cu[e]]=e});const ACe={type:"error",data:"parser error"},OCe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",MCe=typeof ArrayBuffer=="function",ICe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,nG=({type:e,data:t},n,r)=>OCe&&t instanceof Blob?n?r(t):jR(t,r):MCe&&(t instanceof ArrayBuffer||ICe(t))?n?r(t):jR(new Blob([t]),r):r(cu[e]+(t||"")),jR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},BR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ov=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(a&15)<<4|s>>2,d[i++]=(s&3)<<6|l&63;return u},DCe=typeof ArrayBuffer=="function",rG=(e,t)=>{if(typeof e!="string")return{type:"message",data:iG(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:NCe(e.substring(1),t)}:$4[n]?e.length>1?{type:$4[n],data:e.substring(1)}:{type:$4[n]}:ACe},NCe=(e,t)=>{if(DCe){const n=RCe(e);return iG(n,t)}else return{base64:!0,data:e}},iG=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},oG=String.fromCharCode(30),jCe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{nG(o,!1,s=>{r[a]=s,++i===n&&t(r.join(oG))})})},BCe=(e,t)=>{const n=e.split(oG),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function sG(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const FCe=setTimeout,zCe=clearTimeout;function Vx(e,t){t.useNativeTimers?(e.setTimeoutFn=FCe.bind(Ld),e.clearTimeoutFn=zCe.bind(Ld)):(e.setTimeoutFn=setTimeout.bind(Ld),e.clearTimeoutFn=clearTimeout.bind(Ld))}const HCe=1.33;function VCe(e){return typeof e=="string"?WCe(e):Math.ceil((e.byteLength||e.size)*HCe)}function WCe(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class UCe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class lG extends si{constructor(t){super(),this.writable=!1,Vx(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new UCe(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=rG(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const uG="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),_8=64,GCe={};let $R=0,Ib=0,FR;function zR(e){let t="";do t=uG[e%_8]+t,e=Math.floor(e/_8);while(e>0);return t}function cG(){const e=zR(+new Date);return e!==FR?($R=0,FR=e):e+"."+zR($R++)}for(;Ib<_8;Ib++)GCe[uG[Ib]]=Ib;function dG(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function qCe(e){let t={},n=e.split("&");for(let r=0,i=n.length;r{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};BCe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,jCe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=cG()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=dG(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new iu(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class iu extends si{constructor(t,n){super(),Vx(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=sG(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new hG(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=iu.requestsCount++,iu.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=KCe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete iu.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}iu.requestsCount=0;iu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",HR);else if(typeof addEventListener=="function"){const e="onpagehide"in Ld?"pagehide":"unload";addEventListener(e,HR,!1)}}function HR(){for(let e in iu.requests)iu.requests.hasOwnProperty(e)&&iu.requests[e].abort()}const pG=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Rb=Ld.WebSocket||Ld.MozWebSocket,VR=!0,QCe="arraybuffer",WR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class JCe extends lG{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=WR?{}:sG(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=VR&&!WR?n?new Rb(t,n):new Rb(t):new Rb(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||QCe,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{VR&&this.ws.send(o)}catch{}i&&pG(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=cG()),this.supportsBinary||(t.b64=1);const i=dG(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Rb}}const e7e={websocket:JCe,polling:ZCe},t7e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n7e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function k8(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=t7e.exec(e||""),o={},a=14;for(;a--;)o[n7e[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=r7e(o,o.path),o.queryKey=i7e(o,o.query),o}function r7e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function i7e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let gG=class Hg extends si{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=k8(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=k8(n.host).host),Vx(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=qCe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=aG,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new e7e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Hg.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Hg.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Hg.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=h=>{const m=new Error("probe error: "+h);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(h){n&&h.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Hg.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Hg.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,mG=Object.prototype.toString,l7e=typeof Blob=="function"||typeof Blob<"u"&&mG.call(Blob)==="[object BlobConstructor]",u7e=typeof File=="function"||typeof File<"u"&&mG.call(File)==="[object FileConstructor]";function vP(e){return a7e&&(e instanceof ArrayBuffer||s7e(e))||l7e&&e instanceof Blob||u7e&&e instanceof File}function F4(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case dn.ACK:case dn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class p7e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=d7e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const g7e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:yP,Encoder:h7e,get PacketType(){return dn},protocol:f7e},Symbol.toStringTag,{value:"Module"}));function zs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const m7e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class vG extends si{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[zs(t,"open",this.onopen.bind(this)),zs(t,"packet",this.onpacket.bind(this)),zs(t,"error",this.onerror.bind(this)),zs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(m7e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:dn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:dn.CONNECT,data:t})}):this.packet({type:dn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case dn.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case dn.EVENT:case dn.BINARY_EVENT:this.onevent(t);break;case dn.ACK:case dn.BINARY_ACK:this.onack(t);break;case dn.DISCONNECT:this.ondisconnect();break;case dn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:dn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:dn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}T0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};T0.prototype.reset=function(){this.attempts=0};T0.prototype.setMin=function(e){this.ms=e};T0.prototype.setMax=function(e){this.max=e};T0.prototype.setJitter=function(e){this.jitter=e};class T8 extends si{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Vx(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new T0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||g7e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new gG(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=zs(n,"open",function(){r.onopen(),t&&t()}),o=zs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(zs(t,"ping",this.onping.bind(this)),zs(t,"data",this.ondata.bind(this)),zs(t,"error",this.onerror.bind(this)),zs(t,"close",this.onclose.bind(this)),zs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){pG(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new vG(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const uv={};function z4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=o7e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=uv[i]&&o in uv[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new T8(r,t):(uv[i]||(uv[i]=new T8(r,t)),l=uv[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(z4,{Manager:T8,Socket:vG,io:z4,connect:z4});const v7e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],y7e=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],b7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],S7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],x7e=[{key:"2x",value:2},{key:"4x",value:4}],bP=0,SP=4294967295,w7e=["gfpgan","codeformer"],C7e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var _7e=Math.PI/180;function k7e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Hm=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},gt={_global:Hm,version:"8.3.14",isBrowser:k7e(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return gt.angleDeg?e*_7e:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return gt.DD.isDragging},isDragReady(){return!!gt.DD.node},releaseCanvasOnDestroy:!0,document:Hm.document,_injectGlobal(e){Hm.Konva=e}},Or=e=>{gt[e.prototype.getClassName()]=e};gt._injectGlobal(gt);class Ea{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new Ea(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var d=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/d):-Math.acos(r/d)),l.scaleX=s/d,l.scaleY=d,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=de._getRotation(l.rotation),l}}var E7e="[object Array]",P7e="[object Number]",T7e="[object String]",L7e="[object Boolean]",A7e=Math.PI/180,O7e=180/Math.PI,AC="#",M7e="",I7e="0",R7e="Konva warning: ",UR="Konva error: ",D7e="rgb(",OC={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},N7e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Db=[];const j7e=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},de={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===E7e},_isNumber(e){return Object.prototype.toString.call(e)===P7e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===T7e},_isBoolean(e){return Object.prototype.toString.call(e)===L7e},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){Db.push(e),Db.length===1&&j7e(function(){const t=Db;Db=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=de.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(AC,M7e);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=I7e+e;return AC+e},getRGB(e){var t;return e in OC?(t=OC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===AC?this._hexToRgb(e.substring(1)):e.substr(0,4)===D7e?(t=N7e.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",de._namedColorToRBA(e)||de._hex3ColorToRGBA(e)||de._hex6ColorToRGBA(e)||de._rgbColorToRGBA(e)||de._rgbaColorToRGBA(e)||de._hslColorToRGBA(e)},_namedColorToRBA(e){var t=OC[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,d=[0,0,0];for(let h=0;h<3;h++)s=r+1/3*-(h-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,d[h]=l*255;return{r:Math.round(d[0]),g:Math.round(d[1]),b:Math.round(d[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+d*(n-e),s=t+d*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=de.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=de._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],d=l[1],h=l[2];ht.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function hf(e){return de._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||de._isBoolean(e)?e:Object.prototype.toString.call(e)}function yG(e){return e>255?255:e<0?0:Math.round(e)}function Ye(){if(gt.isUnminified)return function(e,t){return de._isNumber(e)||de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function bG(e){if(gt.isUnminified)return function(t,n){let r=de._isNumber(t),i=de._isArray(t)&&t.length==e;return!r&&!i&&de.warn(hf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function xP(){if(gt.isUnminified)return function(e,t){var n=de._isNumber(e),r=e==="auto";return n||r||de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function L0(){if(gt.isUnminified)return function(e,t){return de._isString(e)||de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function SG(){if(gt.isUnminified)return function(e,t){const n=de._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function B7e(){if(gt.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(de._isArray(e)?e.forEach(function(r){de._isNumber(r)||de.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function il(){if(gt.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||de.warn(hf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function $7e(e){if(gt.isUnminified)return function(t,n){return t==null||de.isObject(t)||de.warn(hf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var cv="get",dv="set";const ee={addGetterSetter(e,t,n,r,i){ee.addGetter(e,t,n),ee.addSetter(e,t,r,i),ee.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=cv+de._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=dv+de._capitalize(t);e.prototype[i]||ee.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=dv+de._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=de._capitalize,s=cv+a(t),l=dv+a(t),u,d;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(S),void 0)}),this._fireChangeEvent(t,v,m),i&&i.call(this),this},ee.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=de._capitalize(t),r=dv+n,i=cv+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){de.error("Adding deprecated "+t);var i=cv+de._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){de.error(o);var a=this.attrs[t];return a===void 0?n:a},ee.addSetter(e,t,r,function(){de.error(o)}),ee.addOverloadedGetterSetter(e,t)},backCompat(e,t){de.each(t,function(n,r){var i=e.prototype[r],o=cv+de._capitalize(n),a=dv+de._capitalize(n);function s(){i.apply(this,arguments),de.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function F7e(e){var t=[],n=e.length,r=de,i,o;for(i=0;itypeof d=="number"?Math.floor(d):d)),o+=z7e+u.join(GR)+H7e)):(o+=s.property,t||(o+=q7e+s.val)),o+=U7e;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=K7e&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var d=arguments,h=this._context;d.length===3?h.drawImage(t,n,r):d.length===5?h.drawImage(t,n,r,i,o):d.length===9&&h.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){return this._context.isPointInPath(t,n)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=qR.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=F7e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return vn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];vn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=de._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];vn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(vn.justDragged=!0,gt._mouseListenClick=!1,gt._touchListenClick=!1,gt._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof gt.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){vn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&vn._dragElements.delete(n)})}};gt.isBrowser&&(window.addEventListener("mouseup",vn._endDragBefore,!0),window.addEventListener("touchend",vn._endDragBefore,!0),window.addEventListener("mousemove",vn._drag),window.addEventListener("touchmove",vn._drag),window.addEventListener("mouseup",vn._endDragAfter,!1),window.addEventListener("touchend",vn._endDragAfter,!1));var H4="absoluteOpacity",jb="allEventListeners",Hu="absoluteTransform",YR="absoluteScale",lh="canvas",J7e="Change",e9e="children",t9e="konva",L8="listening",KR="mouseenter",XR="mouseleave",ZR="set",QR="Shape",V4=" ",JR="stage",pd="transform",n9e="Stage",A8="visible",r9e=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(V4);let i9e=1,Qe=class O8{constructor(t){this._id=i9e++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===pd||t===Hu)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===pd||t===Hu,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(V4);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(lh)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Hu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(lh)){const{scene:t,filter:n,hit:r}=this._cache.get(lh);de.releaseCanvas(t,n,r),this._cache.delete(lh)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,h=n.hitCanvasPixelRatio||1;if(!i||!o){de.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new Vm({pixelRatio:a,width:i,height:o}),v=new Vm({pixelRatio:a,width:0,height:0}),b=new wP({pixelRatio:h,width:i,height:o}),S=m.getContext(),_=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(lh),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,v.getContext()._context.imageSmoothingEnabled=!1),S.save(),_.save(),S.translate(-s,-l),_.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(H4),this._clearSelfAndDescendantCache(YR),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,S.restore(),_.restore(),d&&(S.save(),S.beginPath(),S.rect(0,0,i,o),S.closePath(),S.setAttr("strokeStyle","red"),S.setAttr("lineWidth",5),S.stroke(),S.restore()),this._cache.set(lh,{scene:m,filter:v,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(lh)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=l.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==e9e&&(r=ZR+de._capitalize(n),de._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(L8,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(A8,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;vn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!gt.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==n9e&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(pd),this._clearSelfAndDescendantCache(Hu)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new Ea,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(pd);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(pd),this._clearSelfAndDescendantCache(Hu),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return de.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return de.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&de.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(H4,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=de.isObject(i)&&!de._isPlainObject(i)&&!de._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),de._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,de._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():gt.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(r&&!this.isDragging()){var i=!1;vn._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=vn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&vn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return de.haveIntersection(r,this.getClientRect())}static create(t,n){return de._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=O8.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),gt[r]||(de.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=gt[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(arguments.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Qe.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Qe.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const d=r===this;if(u){o.save();var h=this.getAbsoluteTransform(r),m=h.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var v=this.clipX(),b=this.clipY();o.rect(v,b,a,s)}o.clip(),m=h.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var S=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";S&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(_){_[t](n,r)}),S&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(S){if(S.visible()){var _=S.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});_.width===0&&_.height===0||(o===void 0?(o=_.x,a=_.y,s=_.x+_.width,l=_.y+_.height):(o=Math.min(o,_.x),a=Math.min(a,_.y),s=Math.max(s,_.x+_.width),l=Math.max(l,_.y+_.height)))}});for(var h=this.find("Shape"),m=!1,v=0;ve.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",jg=e=>{const t=Dv(e);if(t==="pointer")return gt.pointerEventsEnabled&&IC.pointer;if(t==="touch")return IC.touch;if(t==="mouse")return IC.mouse};function tD(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&de.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const d9e="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",W4=[];let Gx=class extends Oa{constructor(t){super(tD(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),W4.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{tD(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||de.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===a9e){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t=this.children,n=t.length,r;for(r=0;r-1&&W4.splice(n,1),de.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(de.warn(d9e),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t=t||{},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var n=new Vm({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+eD,this.content.style.height=n+eD),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;ru9e&&de.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),gt.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return wG(t,this)}setPointerCapture(t){CG(t,this)}releaseCapture(t){c2(t)}getLayers(){return this.children}_bindContentEvents(){gt.isBrowser&&c9e.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=jg(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=jg(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=jg(t.type),r=Dv(t.type);if(n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!vn.isDragging||gt.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=jg(t.type),r=Dv(t.type);if(n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(vn.justDragged=!1,gt["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;gt.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=jg(t.type),r=Dv(t.type);if(!n)return;vn.isDragging&&vn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!vn.isDragging||gt.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=MC(l.id)||this.getIntersection(l),d=l.id,h={evt:t,pointerId:d};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},h),u),s._fireAndBubble(n.pointerleave,Object.assign({},h),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},h),s),u._fireAndBubble(n.pointerenter,Object.assign({},h),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},h))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=jg(t.type),r=Dv(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=MC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const d=l.id,h={evt:t,pointerId:d};let m=!1;gt["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):vn.justDragged||(gt["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){gt["_"+r+"InDblClickWindow"]=!1},gt.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},h)),gt["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},h)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},h)))):(this[r+"ClickEndShape"]=null,gt["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:d}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:d}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),gt["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(M8,{evt:t}):this._fire(M8,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(I8,{evt:t}):this._fire(I8,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=MC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(fm,CP(t)),c2(t.pointerId)}_lostpointercapture(t){c2(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}])}_setPointerPosition(t){de.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Vm({width:this.width(),height:this.height()}),this.bufferHitCanvas=new wP({pixelRatio:1,width:this.width(),height:this.height()}),!!gt.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return de.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};Gx.prototype.nodeType=o9e;Or(Gx);ee.addGetterSetter(Gx,"container");var RG="hasShadow",DG="shadowRGBA",NG="patternImage",jG="linearGradient",BG="radialGradient";let Hb;function RC(){return Hb||(Hb=de.createCanvasElement().getContext("2d"),Hb)}const d2={};function f9e(e){e.fill()}function h9e(e){e.stroke()}function p9e(e){e.fill()}function g9e(e){e.stroke()}function m9e(){this._clearCache(RG)}function v9e(){this._clearCache(DG)}function y9e(){this._clearCache(NG)}function b9e(){this._clearCache(jG)}function S9e(){this._clearCache(BG)}class $e extends Qe{constructor(t){super(t);let n;for(;n=de.getRandomColor(),!(n&&!(n in d2)););this.colorKey=n,d2[n]=this}getContext(){return de.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return de.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(RG,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(NG,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=RC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Ea;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(gt.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(jG,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=RC(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return Qe.prototype.destroy.call(this),delete d2[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){de.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),d=u?this.shadowOffsetX():0,h=u?this.shadowOffsetY():0,m=s+Math.abs(d),v=l+Math.abs(h),b=u&&this.shadowBlur()||0,S=m+b*2,_=v+b*2,E={width:S,height:_,x:-(a/2+b)+Math.min(d,0)+i.x,y:-(a/2+b)+Math.min(h,0)+i.y};return n?E:this._transformedRect(E,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,d,h,m=i.isCache,v=n===this;if(!this.isVisible()&&!v)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),d=u.bufferCanvas,h=d.getContext(),h.clear(),h.save(),h._applyLineJoin(this);var S=this.getAbsoluteTransform(n).getMatrix();h.transform(S[0],S[1],S[2],S[3],S[4],S[5]),s.call(this,h,this),h.restore();var _=d.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(d._canvas,0,0,d.width/_,d.height/_)}else{if(o._applyLineJoin(this),!v){var S=this.getAbsoluteTransform(n).getMatrix();o.transform(S[0],S[1],S[2],S[3],S[4],S[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||de.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){a.save();var d=this.getAbsoluteTransform(n).getMatrix();return a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,d,h,m,v;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,d=u.length,h=de._hexToRgb(this.colorKey),m=0;mt?(u[m]=h.r,u[m+1]=h.g,u[m+2]=h.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){de.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return wG(t,this)}setPointerCapture(t){CG(t,this)}releaseCapture(t){c2(t)}}$e.prototype._fillFunc=f9e;$e.prototype._strokeFunc=h9e;$e.prototype._fillFuncHit=p9e;$e.prototype._strokeFuncHit=g9e;$e.prototype._centroid=!1;$e.prototype.nodeType="Shape";Or($e);$e.prototype.eventListeners={};$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m9e);$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",y9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",b9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",S9e);ee.addGetterSetter($e,"stroke",void 0,SG());ee.addGetterSetter($e,"strokeWidth",2,Ye());ee.addGetterSetter($e,"fillAfterStrokeEnabled",!1);ee.addGetterSetter($e,"hitStrokeWidth","auto",xP());ee.addGetterSetter($e,"strokeHitEnabled",!0,il());ee.addGetterSetter($e,"perfectDrawEnabled",!0,il());ee.addGetterSetter($e,"shadowForStrokeEnabled",!0,il());ee.addGetterSetter($e,"lineJoin");ee.addGetterSetter($e,"lineCap");ee.addGetterSetter($e,"sceneFunc");ee.addGetterSetter($e,"hitFunc");ee.addGetterSetter($e,"dash");ee.addGetterSetter($e,"dashOffset",0,Ye());ee.addGetterSetter($e,"shadowColor",void 0,L0());ee.addGetterSetter($e,"shadowBlur",0,Ye());ee.addGetterSetter($e,"shadowOpacity",1,Ye());ee.addComponentsGetterSetter($e,"shadowOffset",["x","y"]);ee.addGetterSetter($e,"shadowOffsetX",0,Ye());ee.addGetterSetter($e,"shadowOffsetY",0,Ye());ee.addGetterSetter($e,"fillPatternImage");ee.addGetterSetter($e,"fill",void 0,SG());ee.addGetterSetter($e,"fillPatternX",0,Ye());ee.addGetterSetter($e,"fillPatternY",0,Ye());ee.addGetterSetter($e,"fillLinearGradientColorStops");ee.addGetterSetter($e,"strokeLinearGradientColorStops");ee.addGetterSetter($e,"fillRadialGradientStartRadius",0);ee.addGetterSetter($e,"fillRadialGradientEndRadius",0);ee.addGetterSetter($e,"fillRadialGradientColorStops");ee.addGetterSetter($e,"fillPatternRepeat","repeat");ee.addGetterSetter($e,"fillEnabled",!0);ee.addGetterSetter($e,"strokeEnabled",!0);ee.addGetterSetter($e,"shadowEnabled",!0);ee.addGetterSetter($e,"dashEnabled",!0);ee.addGetterSetter($e,"strokeScaleEnabled",!0);ee.addGetterSetter($e,"fillPriority","color");ee.addComponentsGetterSetter($e,"fillPatternOffset",["x","y"]);ee.addGetterSetter($e,"fillPatternOffsetX",0,Ye());ee.addGetterSetter($e,"fillPatternOffsetY",0,Ye());ee.addComponentsGetterSetter($e,"fillPatternScale",["x","y"]);ee.addGetterSetter($e,"fillPatternScaleX",1,Ye());ee.addGetterSetter($e,"fillPatternScaleY",1,Ye());ee.addComponentsGetterSetter($e,"fillLinearGradientStartPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientStartPointX",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointX",0);ee.addGetterSetter($e,"fillLinearGradientStartPointY",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillLinearGradientEndPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientEndPointX",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointX",0);ee.addGetterSetter($e,"fillLinearGradientEndPointY",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientStartPointX",0);ee.addGetterSetter($e,"fillRadialGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientEndPointX",0);ee.addGetterSetter($e,"fillRadialGradientEndPointY",0);ee.addGetterSetter($e,"fillPatternRotation",0);ee.backCompat($e,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var x9e="#",w9e="beforeDraw",C9e="draw",$G=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],_9e=$G.length;let pp=class extends Oa{constructor(t){super(t),this.canvas=new Vm,this.hitCanvas=new wP({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i<_9e;i++){const o=$G[i],a=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),s=a.shape;if(s)return s;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,i=r[3];if(i===255){const o=de._rgbToHex(r[0],r[1],r[2]),a=d2[x9e+o];return a?{shape:a}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(w9e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Oa.prototype.drawScene.call(this,i,n),this._fire(C9e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Oa.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return de.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};pp.prototype.nodeType="Layer";Or(pp);ee.addGetterSetter(pp,"imageSmoothingEnabled",!0);ee.addGetterSetter(pp,"clearBeforeDraw",!0);ee.addGetterSetter(pp,"hitGraphEnabled",!0,il());class _P extends pp{constructor(t){super(t),this.listening(!1),de.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}_P.prototype.nodeType="FastLayer";Or(_P);let s0=class extends Oa{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&de.throw("You may only add groups and shapes to groups.")}};s0.prototype.nodeType="Group";Or(s0);var DC=function(){return Hm.performance&&Hm.performance.now?function(){return Hm.performance.now()}:function(){return new Date().getTime()}}();class rs{constructor(t,n){this.id=rs.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:DC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=nD,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=rD,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;this.state===nD?this.setTime(t):this.state===rD&&this.setTime(this.duration-t)}pause(){this.state=E9e,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Xr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||f2.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=P9e++;var u=r.getLayer()||(r instanceof gt.Stage?r.getLayers():null);u||de.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new rs(function(){n.tween.onEnterFrame()},u),this.tween=new T9e(l,function(d){n._tweenFunc(d)},a,0,1,o*1e3,s),this._addListeners(),Xr.attrs[i]||(Xr.attrs[i]={}),Xr.attrs[i][this._id]||(Xr.attrs[i][this._id]={}),Xr.tweens[i]||(Xr.tweens[i]={});for(l in t)k9e[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,d,h,m;if(s=Xr.tweens[i][t],s&&delete Xr.attrs[i][s][t],o=r.getAttr(t),de._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(h=o,o=de._prepareArrayForTween(o,n,r.closed())):(d=n,n=de._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t=this.node._id,n=this._id,r=Xr.tweens[t],i;this.pause();for(i in r)delete Xr.tweens[t][i];delete Xr.attrs[t][n]}}Xr.attrs={};Xr.tweens={};Qe.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Xr(e);n.play()};const f2={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),d=a*n,h=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:h,width:d-u,height:m-h}}}fc.prototype._centroid=!0;fc.prototype.className="Arc";fc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Or(fc);ee.addGetterSetter(fc,"innerRadius",0,Ye());ee.addGetterSetter(fc,"outerRadius",0,Ye());ee.addGetterSetter(fc,"angle",0,Ye());ee.addGetterSetter(fc,"clockwise",!1,il());function R8(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),d=a*l/(s+l),h=n-u*(i-e),m=r-u*(o-t),v=n+d*(i-e),b=r+d*(o-t);return[h,m,v,b]}function oD(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);ud?u:d,_=u>d?1:u/d,E=u>d?d/u:1;t.translate(s,l),t.rotate(v),t.scale(_,E),t.arc(0,0,S,h,h+m,1-b),t.scale(1/_,1/E),t.rotate(-v),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],h=u.points[5],m=u.points[4]+h,v=Math.PI/180;if(Math.abs(d-m)m;b-=v){const S=zn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(S.x,S.y)}else for(let b=d+v;bthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return zn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return zn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return zn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],d=a[3],h=a[4],m=a[5],v=a[6];return h+=m*t/o.pathLength,zn.getPointOnEllipticalArc(s,l,u,d,h,v)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var k=null,T=[],A=l,M=u,R,D,j,z,H,K,te,G,$,W;switch(v){case"l":l+=b.shift(),u+=b.shift(),k="L",T.push(l,u);break;case"L":l=b.shift(),u=b.shift(),T.push(l,u);break;case"m":var X=b.shift(),Z=b.shift();if(l+=X,u+=Z,k="M",a.length>2&&a[a.length-1].command==="z"){for(var U=a.length-2;U>=0;U--)if(a[U].command==="M"){l=a[U].points[0]+X,u=a[U].points[1]+Z;break}}T.push(l,u),v="l";break;case"M":l=b.shift(),u=b.shift(),k="M",T.push(l,u),v="L";break;case"h":l+=b.shift(),k="L",T.push(l,u);break;case"H":l=b.shift(),k="L",T.push(l,u);break;case"v":u+=b.shift(),k="L",T.push(l,u);break;case"V":u=b.shift(),k="L",T.push(l,u);break;case"C":T.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"c":T.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="C",T.push(l,u);break;case"S":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),T.push(D,j,b.shift(),b.shift()),l=b.shift(),u=b.shift(),k="C",T.push(l,u);break;case"s":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),T.push(D,j,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="C",T.push(l,u);break;case"Q":T.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"q":T.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="Q",T.push(l,u);break;case"T":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l=b.shift(),u=b.shift(),k="Q",T.push(D,j,l,u);break;case"t":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l+=b.shift(),u+=b.shift(),k="Q",T.push(D,j,l,u);break;case"A":z=b.shift(),H=b.shift(),K=b.shift(),te=b.shift(),G=b.shift(),$=l,W=u,l=b.shift(),u=b.shift(),k="A",T=this.convertEndpointToCenterParameterization($,W,l,u,te,G,z,H,K);break;case"a":z=b.shift(),H=b.shift(),K=b.shift(),te=b.shift(),G=b.shift(),$=l,W=u,l+=b.shift(),u+=b.shift(),k="A",T=this.convertEndpointToCenterParameterization($,W,l,u,te,G,z,H,K);break}a.push({command:k||v,points:T,start:{x:A,y:M},pathLength:this.calcLength(A,M,k||v,T)})}(v==="z"||v==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=zn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var d=i[4],h=i[5],m=i[4]+h,v=Math.PI/180;if(Math.abs(d-m)m;l-=v)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=d+v;l1&&(s*=Math.sqrt(v),l*=Math.sqrt(v));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(h*h))/(s*s*(m*m)+l*l*(h*h)));o===a&&(b*=-1),isNaN(b)&&(b=0);var S=b*s*m/l,_=b*-l*h/s,E=(t+r)/2+Math.cos(d)*S-Math.sin(d)*_,k=(n+i)/2+Math.sin(d)*S+Math.cos(d)*_,T=function(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])},A=function(H,K){return(H[0]*K[0]+H[1]*K[1])/(T(H)*T(K))},M=function(H,K){return(H[0]*K[1]=1&&(z=0),a===0&&z>0&&(z=z-2*Math.PI),a===1&&z<0&&(z=z+2*Math.PI),[E,k,s,l,R,z,d,a]}}zn.prototype.className="Path";zn.prototype._attrsAffectingSize=["data"];Or(zn);ee.addGetterSetter(zn,"data");class gp extends hc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],v=zn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=zn.getPointOnQuadraticBezier(Math.min(1,1-a/v),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var d=(Math.atan2(u,l)+n)%n,h=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}gp.prototype.className="Arrow";Or(gp);ee.addGetterSetter(gp,"pointerLength",10,Ye());ee.addGetterSetter(gp,"pointerWidth",10,Ye());ee.addGetterSetter(gp,"pointerAtBeginning",!1);ee.addGetterSetter(gp,"pointerAtEnding",!0);let A0=class extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};A0.prototype._centroid=!0;A0.prototype.className="Circle";A0.prototype._attrsAffectingSize=["radius"];Or(A0);ee.addGetterSetter(A0,"radius",0,Ye());class pf extends $e{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}pf.prototype.className="Ellipse";pf.prototype._centroid=!0;pf.prototype._attrsAffectingSize=["radiusX","radiusY"];Or(pf);ee.addComponentsGetterSetter(pf,"radius",["x","y"]);ee.addGetterSetter(pf,"radiusX",0,Ye());ee.addGetterSetter(pf,"radiusY",0,Ye());let pc=class FG extends $e{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.attrs.image;let o;if(i){const a=this.attrs.cropWidth,s=this.attrs.cropHeight;a&&s?o=[i,this.cropX(),this.cropY(),a,s,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&t.drawImage.apply(t,o)}_hitFunc(t){var n=this.width(),r=this.height();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=de.createImageElement();i.onload=function(){var o=new FG({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};pc.prototype.className="Image";Or(pc);ee.addGetterSetter(pc,"image");ee.addComponentsGetterSetter(pc,"crop",["x","y","width","height"]);ee.addGetterSetter(pc,"cropX",0,Ye());ee.addGetterSetter(pc,"cropY",0,Ye());ee.addGetterSetter(pc,"cropWidth",0,Ye());ee.addGetterSetter(pc,"cropHeight",0,Ye());var zG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],L9e="Change.konva",A9e="none",D8="up",N8="right",j8="down",B8="left",O9e=zG.length;class kP extends s0{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}vp.prototype.className="RegularPolygon";vp.prototype._centroid=!0;vp.prototype._attrsAffectingSize=["radius"];Or(vp);ee.addGetterSetter(vp,"radius",0,Ye());ee.addGetterSetter(vp,"sides",0,Ye());var aD=Math.PI*2;class yp extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,aD,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),aD,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}yp.prototype.className="Ring";yp.prototype._centroid=!0;yp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Or(yp);ee.addGetterSetter(yp,"innerRadius",0,Ye());ee.addGetterSetter(yp,"outerRadius",0,Ye());class vu extends $e{constructor(t){super(t),this._updated=!0,this.anim=new rs(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],d=o[i+3],h=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,d),t.closePath(),t.fillStrokeShape(this)),h)if(a){var m=a[n],v=r*2;t.drawImage(h,s,l,u,d,m[v+0],m[v+1],u,d)}else t.drawImage(h,s,l,u,d,0,0,u,d)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],d=r*2;t.rect(u[d+0],u[d+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Wb;function jC(){return Wb||(Wb=de.createCanvasElement().getContext(R9e),Wb)}function U9e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function G9e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function q9e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Ar extends $e{constructor(t){super(q9e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(E+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=de._isString(t)?t:t==null?"":t+"";return this._setAttr(D9e,n),this}getWidth(){var t=this.attrs.width===Bg||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Bg||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return de.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=jC(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+Vb+this.fontVariant()+Vb+(this.fontSize()+$9e)+W9e(this.fontFamily())}_addTextLine(t){this.align()===fv&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return jC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` -`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Bg&&o!==void 0,l=a!==Bg&&a!==void 0,u=this.padding(),d=o-u*2,h=a-u*2,m=0,v=this.wrap(),b=v!==uD,S=v!==H9e&&b,_=this.ellipsis();this.textArr=[],jC().font=this._getContextFont();for(var E=_?this._getTextWidth(NC):0,k=0,T=t.length;kd)for(;A.length>0;){for(var R=0,D=A.length,j="",z=0;R>>1,K=A.slice(0,H+1),te=this._getTextWidth(K)+E;te<=d?(R=H+1,j=K,z=te):D=H}if(j){if(S){var G,$=A[j.length],W=$===Vb||$===sD;W&&z<=d?G=j.length:G=Math.max(j.lastIndexOf(Vb),j.lastIndexOf(sD))+1,G>0&&(R=G,j=j.slice(0,R),z=this._getTextWidth(j))}j=j.trimRight(),this._addTextLine(j),r=Math.max(r,z),m+=i;var X=this._shouldHandleEllipsis(m);if(X){this._tryToAddEllipsisToLastLine();break}if(A=A.slice(R),A=A.trimLeft(),A.length>0&&(M=this._getTextWidth(A),M<=d)){this._addTextLine(A),m+=i,r=Math.max(r,M);break}}else break}else this._addTextLine(A),m+=i,r=Math.max(r,M),this._shouldHandleEllipsis(m)&&kh)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Bg&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==uD;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Bg&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+NC)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var d=HG(this.text()),h=this.text().split(" ").length-1,m,v,b,S=-1,_=0,E=function(){_=0;for(var te=t.dataArray,G=S+1;G0)return S=G,te[G];te[G].command==="M"&&(m={x:te[G].points[0],y:te[G].points[1]})}return{}},k=function(te){var G=t._getTextSize(te).width+r;te===" "&&i==="justify"&&(G+=(s-a)/h);var $=0,W=0;for(v=void 0;Math.abs(G-$)/G>.01&&W<20;){W++;for(var X=$;b===void 0;)b=E(),b&&X+b.pathLengthG?v=zn.getPointOnLine(G,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var U=b.points[4],Q=b.points[5],re=b.points[4]+Q;_===0?_=U+1e-8:G>$?_+=Math.PI/180*Q/Math.abs(Q):_-=Math.PI/360*Q/Math.abs(Q),(Q<0&&_=0&&_>re)&&(_=re,Z=!0),v=zn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],_,b.points[6]);break;case"C":_===0?G>b.pathLength?_=1e-8:_=G/b.pathLength:G>$?_+=(G-$)/b.pathLength/2:_=Math.max(_-($-G)/b.pathLength/2,0),_>1&&(_=1,Z=!0),v=zn.getPointOnCubicBezier(_,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":_===0?_=G/b.pathLength:G>$?_+=(G-$)/b.pathLength:_-=($-G)/b.pathLength,_>1&&(_=1,Z=!0),v=zn.getPointOnQuadraticBezier(_,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}v!==void 0&&($=zn.getLineLength(m.x,m.y,v.x,v.y)),Z&&(Z=!1,b=void 0)}},T="C",A=t._getTextSize(T).width+r,M=u/A-1,R=0;Re+`.${KG}`).join(" "),cD="nodesRect",X9e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Z9e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const Q9e="ontouchstart"in gt._global;function J9e(e,t){if(e==="rotater")return"crosshair";t+=de.degToRad(Z9e[e]||0);var n=(de.radToDeg(t)%360+360)%360;return de._inRange(n,315+22.5,360)||de._inRange(n,0,22.5)?"ns-resize":de._inRange(n,45-22.5,45+22.5)?"nesw-resize":de._inRange(n,90-22.5,90+22.5)?"ew-resize":de._inRange(n,135-22.5,135+22.5)?"nwse-resize":de._inRange(n,180-22.5,180+22.5)?"ns-resize":de._inRange(n,225-22.5,225+22.5)?"nesw-resize":de._inRange(n,270-22.5,270+22.5)?"ew-resize":de._inRange(n,315-22.5,315+22.5)?"nwse-resize":(de.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var rS=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],dD=1e8;function e8e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function XG(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function t8e(e,t){const n=e8e(e);return XG(e,t,n)}function n8e(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(X9e.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(cD),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(cD,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(gt.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return XG(d,-gt.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-dD,y:-dD,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const d=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var h=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],m=u.getAbsoluteTransform();h.forEach(function(v){var b=m.point(v);n.push(b)})});const r=new Ea;r.rotate(-gt.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var d=r.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:gt.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),rS.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new Hy({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Q9e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=gt.getAngle(this.rotation()),o=J9e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new $e({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*de._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const d=o.getAbsolutePosition();if(!(u.x===d.x&&u.y===d.y)){if(this._movingAnchorName==="rotater"){var h=this._getNodeRect();n=o.x()-h.width/2,r=-o.y()+h.height/2;let te=Math.atan2(-r,n)+Math.PI/2;h.height<0&&(te-=Math.PI);var m=gt.getAngle(this.rotation());const G=m+te,$=gt.getAngle(this.rotationSnapTolerance()),X=n8e(this.rotationSnaps(),G,$)-h.rotation,Z=t8e(h,X);this._fitNodesInto(Z,t);return}var v=this.keepRatio()||t.shiftKey,k=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(v){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var S=this.findOne(".top-left").x()>b.x?-1:1,_=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*S,r=i*this.sin*_,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(v){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-b.x,2)+Math.pow(b.y-o.y(),2));var S=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*S,r=i*this.sin*_,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var E=o.position();this.findOne(".top-left").y(E.y),this.findOne(".bottom-right").x(E.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(v){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var S=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(de._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(de._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new Ea;if(a.rotate(gt.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const h=a.point({x:-this.padding()*2,y:0});if(t.x+=h.x,t.y+=h.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const h=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const h=a.point({x:0,y:-this.padding()*2});if(t.x+=h.x,t.y+=h.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const h=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const h=this.boundBoxFunc()(r,t);h?t=h:de.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new Ea;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new Ea;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const d=u.multiply(l.invert());this._nodes.forEach(h=>{var m;const v=h.getParent().getAbsoluteTransform(),b=h.getTransform().copy();b.translate(h.offsetX(),h.offsetY());const S=new Ea;S.multiply(v.copy().invert()).multiply(d).multiply(v).multiply(b);const _=S.decompose();h.setAttrs(_),this._fire("transform",{evt:n,target:h}),h._fire("transform",{evt:n,target:h}),(m=h.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(de._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(de._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*de._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),s0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Qe.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function r8e(e){return e instanceof Array||de.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){rS.indexOf(t)===-1&&de.warn("Unknown anchor name: "+t+". Available names are: "+rS.join(", "))}),e||[]}In.prototype.className="Transformer";Or(In);ee.addGetterSetter(In,"enabledAnchors",rS,r8e);ee.addGetterSetter(In,"flipEnabled",!0,il());ee.addGetterSetter(In,"resizeEnabled",!0);ee.addGetterSetter(In,"anchorSize",10,Ye());ee.addGetterSetter(In,"rotateEnabled",!0);ee.addGetterSetter(In,"rotationSnaps",[]);ee.addGetterSetter(In,"rotateAnchorOffset",50,Ye());ee.addGetterSetter(In,"rotationSnapTolerance",5,Ye());ee.addGetterSetter(In,"borderEnabled",!0);ee.addGetterSetter(In,"anchorStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"anchorStrokeWidth",1,Ye());ee.addGetterSetter(In,"anchorFill","white");ee.addGetterSetter(In,"anchorCornerRadius",0,Ye());ee.addGetterSetter(In,"borderStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"borderStrokeWidth",1,Ye());ee.addGetterSetter(In,"borderDash");ee.addGetterSetter(In,"keepRatio",!0);ee.addGetterSetter(In,"centeredScaling",!1);ee.addGetterSetter(In,"ignoreStroke",!1);ee.addGetterSetter(In,"padding",0,Ye());ee.addGetterSetter(In,"node");ee.addGetterSetter(In,"nodes");ee.addGetterSetter(In,"boundBoxFunc");ee.addGetterSetter(In,"anchorDragBoundFunc");ee.addGetterSetter(In,"shouldOverdrawWholeArea",!1);ee.addGetterSetter(In,"useSingleNodeRotation",!0);ee.backCompat(In,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class gc extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,gt.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}gc.prototype.className="Wedge";gc.prototype._centroid=!0;gc.prototype._attrsAffectingSize=["radius"];Or(gc);ee.addGetterSetter(gc,"radius",0,Ye());ee.addGetterSetter(gc,"angle",0,Ye());ee.addGetterSetter(gc,"clockwise",!1);ee.backCompat(gc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function fD(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var i8e=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],o8e=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function a8e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,d,h,m,v,b,S,_,E,k,T,A,M,R,D,j,z,H,K,te,G=t+t+1,$=r-1,W=i-1,X=t+1,Z=X*(X+1)/2,U=new fD,Q=null,re=U,fe=null,Ee=null,be=i8e[t],ye=o8e[t];for(s=1;s>ye,K!==0?(K=255/K,n[d]=(m*be>>ye)*K,n[d+1]=(v*be>>ye)*K,n[d+2]=(b*be>>ye)*K):n[d]=n[d+1]=n[d+2]=0,m-=_,v-=E,b-=k,S-=T,_-=fe.r,E-=fe.g,k-=fe.b,T-=fe.a,l=h+((l=o+t+1)<$?l:$)<<2,A+=fe.r=n[l],M+=fe.g=n[l+1],R+=fe.b=n[l+2],D+=fe.a=n[l+3],m+=A,v+=M,b+=R,S+=D,fe=fe.next,_+=j=Ee.r,E+=z=Ee.g,k+=H=Ee.b,T+=K=Ee.a,A-=j,M-=z,R-=H,D-=K,Ee=Ee.next,d+=4;h+=r}for(o=0;o>ye,K>0?(K=255/K,n[l]=(m*be>>ye)*K,n[l+1]=(v*be>>ye)*K,n[l+2]=(b*be>>ye)*K):n[l]=n[l+1]=n[l+2]=0,m-=_,v-=E,b-=k,S-=T,_-=fe.r,E-=fe.g,k-=fe.b,T-=fe.a,l=o+((l=a+X)0&&a8e(t,n)};ee.addGetterSetter(Qe,"blurRadius",0,Ye(),ee.afterSetFilter);const l8e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};ee.addGetterSetter(Qe,"contrast",0,Ye(),ee.afterSetFilter);const c8e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,d=l*4,h=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:de.error("Unknown emboss direction: "+r)}do{var m=(h-1)*d,v=o;h+v<1&&(v=0),h+v>u&&(v=0);var b=(h-1+v)*l*4,S=l;do{var _=m+(S-1)*4,E=a;S+E<1&&(E=0),S+E>l&&(E=0);var k=b+(S-1+E)*4,T=s[_]-s[k],A=s[_+1]-s[k+1],M=s[_+2]-s[k+2],R=T,D=R>0?R:-R,j=A>0?A:-A,z=M>0?M:-M;if(j>D&&(R=A),z>D&&(R=M),R*=t,i){var H=s[_]+R,K=s[_+1]+R,te=s[_+2]+R;s[_]=H>255?255:H<0?0:H,s[_+1]=K>255?255:K<0?0:K,s[_+2]=te>255?255:te<0?0:te}else{var G=n-R;G<0?G=0:G>255&&(G=255),s[_]=s[_+1]=s[_+2]=G}}while(--S)}while(--h)};ee.addGetterSetter(Qe,"embossStrength",.5,Ye(),ee.afterSetFilter);ee.addGetterSetter(Qe,"embossWhiteLevel",.5,Ye(),ee.afterSetFilter);ee.addGetterSetter(Qe,"embossDirection","top-left",null,ee.afterSetFilter);ee.addGetterSetter(Qe,"embossBlend",!1,null,ee.afterSetFilter);function BC(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const d8e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],d=u,h,m,v=this.enhance();if(v!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),h=t[m+2],hd&&(d=h);i===r&&(i=255,r=0),s===a&&(s=255,a=0),d===u&&(d=255,u=0);var b,S,_,E,k,T,A,M,R;for(v>0?(S=i+v*(255-i),_=r-v*(r-0),k=s+v*(255-s),T=a-v*(a-0),M=d+v*(255-d),R=u-v*(u-0)):(b=(i+r)*.5,S=i+v*(i-b),_=r+v*(r-b),E=(s+a)*.5,k=s+v*(s-E),T=a+v*(a-E),A=(d+u)*.5,M=d+v*(d-A),R=u+v*(u-A)),m=0;mE?_:E;var k=a,T=o,A,M,R=360/T*Math.PI/180,D,j;for(M=0;MT?k:T;var A=a,M=o,R,D,j=n.polarRotation||0,z,H;for(d=0;dt&&(A=T,M=0,R=-1),i=0;i=0&&v=0&&b=0&&v=0&&b=255*4?255:0}return a}function _8e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&v=0&&b=n))for(o=S;o<_;o+=1)o>=r||(a=(n*o+i)*4,s+=A[a+0],l+=A[a+1],u+=A[a+2],d+=A[a+3],T+=1);for(s=s/T,l=l/T,u=u/T,d=d/T,i=v;i=n))for(o=S;o<_;o+=1)o>=r||(a=(n*o+i)*4,A[a+0]=s,A[a+1]=l,A[a+2]=u,A[a+3]=d)}};ee.addGetterSetter(Qe,"pixelSize",8,Ye(),ee.afterSetFilter);const T8e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"blue",0,yG,ee.afterSetFilter);const A8e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"blue",0,yG,ee.afterSetFilter);ee.addGetterSetter(Qe,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const O8e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),d>127&&(d=255-d),h>127&&(h=255-h),t[l]=u,t[l+1]=d,t[l+2]=h}while(--s)}while(--o)},I8e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new Vg.Stage({container:i,width:n,height:r}),a=new Vg.Layer,s=new Vg.Layer;a.add(new Vg.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new Vg.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l};let ZG=null,QG=null;const D8e=e=>{ZG=e},nl=()=>ZG,N8e=e=>{QG=e},JG=()=>QG,j8e=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},eq=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),B8e=e=>{const t=nl(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:o,systemState:a}=e,{codeformerFidelity:s,facetoolStrength:l,facetoolType:u,hiresFix:d,hiresStrength:h,shouldRunESRGAN:m,shouldRunFacetool:v,upscalingLevel:b,upscalingStrength:S,upscalingDenoising:_}=i,{cfgScale:E,height:k,img2imgStrength:T,infillMethod:A,initialImage:M,iterations:R,perlin:D,prompt:j,negativePrompt:z,sampler:H,seamBlur:K,seamless:te,seamSize:G,seamSteps:$,seamStrength:W,seed:X,seedWeights:Z,shouldFitToWidthHeight:U,shouldGenerateVariations:Q,shouldRandomizeSeed:re,steps:fe,threshold:Ee,tileSize:be,variationAmount:ye,width:Fe}=r,{shouldDisplayInProgressType:Me,saveIntermediatesInterval:rt,enableImageDebugging:Ve}=a,je={prompt:j,iterations:R,steps:fe,cfg_scale:E,threshold:Ee,perlin:D,height:k,width:Fe,sampler_name:H,seed:X,progress_images:Me==="full-res",progress_latents:Me==="latents",save_intermediates:rt,generation_mode:n,init_mask:""};let wt=!1,Be=!1;if(z!==""&&(je.prompt=`${j} [${z}]`),je.seed=re?eq(bP,SP):X,["txt2img","img2img"].includes(n)&&(je.seamless=te,je.hires_fix=d,d&&(je.strength=h),m&&(wt={level:b,denoise_str:_,strength:S}),v&&(Be={type:u,strength:l},u==="codeformer"&&(Be.codeformer_fidelity=s))),n==="img2img"&&M&&(je.init_img=typeof M=="string"?M:M.url,je.strength=T,je.fit=U),n==="unifiedCanvas"&&t){const{layerState:{objects:at},boundingBoxCoordinates:bt,boundingBoxDimensions:Le,stageScale:ut,isMaskEnabled:Mt,shouldPreserveMaskedArea:ct,boundingBoxScaleMethod:_t,scaledBoundingBoxDimensions:un}=o,ae={...bt,...Le},De=R8e(Mt?at.filter(sP):[],ae);je.init_mask=De,je.fit=!1,je.strength=T,je.invert_mask=ct,je.bounding_box=ae;const Ke=t.scale();t.scale({x:1/ut,y:1/ut});const Xe=t.getAbsolutePosition(),xe=t.toDataURL({x:ae.x+Xe.x,y:ae.y+Xe.y,width:ae.width,height:ae.height});Ve&&j8e([{base64:De,caption:"mask sent as init_mask"},{base64:xe,caption:"image sent as init_img"}]),t.scale(Ke),je.init_img=xe,je.progress_images=!1,_t!=="none"&&(je.inpaint_width=un.width,je.inpaint_height=un.height),je.seam_size=G,je.seam_blur=K,je.seam_strength=W,je.seam_steps=$,je.tile_size=be,je.infill_method=A,je.force_outpaint=!1}return Q?(je.variation_amount=ye,Z&&(je.with_variations=dwe(Z))):je.variation_amount=0,Ve&&(je.enable_image_debugging=Ve),{generationParameters:je,esrganParameters:wt,facetoolParameters:Be}};var $8e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,F8e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,z8e=/[^-+\dA-Z]/g;function no(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(hD[t]||t||hD.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},d=function(){return e[o()+"Hours"]()},h=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},v=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},S=function(){return H8e(e)},_=function(){return V8e(e)},E={d:function(){return a()},dd:function(){return Ca(a())},ddd:function(){return Go.dayNames[s()]},DDD:function(){return pD({y:u(),m:l(),d:a(),_:o(),dayName:Go.dayNames[s()],short:!0})},dddd:function(){return Go.dayNames[s()+7]},DDDD:function(){return pD({y:u(),m:l(),d:a(),_:o(),dayName:Go.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Ca(l()+1)},mmm:function(){return Go.monthNames[l()]},mmmm:function(){return Go.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return Ca(u(),4)},h:function(){return d()%12||12},hh:function(){return Ca(d()%12||12)},H:function(){return d()},HH:function(){return Ca(d())},M:function(){return h()},MM:function(){return Ca(h())},s:function(){return m()},ss:function(){return Ca(m())},l:function(){return Ca(v(),3)},L:function(){return Ca(Math.floor(v()/10))},t:function(){return d()<12?Go.timeNames[0]:Go.timeNames[1]},tt:function(){return d()<12?Go.timeNames[2]:Go.timeNames[3]},T:function(){return d()<12?Go.timeNames[4]:Go.timeNames[5]},TT:function(){return d()<12?Go.timeNames[6]:Go.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":W8e(e)},o:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60),2)+":"+Ca(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return S()},WW:function(){return Ca(S())},N:function(){return _()}};return t.replace($8e,function(k){return k in E?E[k]():k.slice(1,k.length-1)})}var hD={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Go={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Ca=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},pD=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,d=new Date;d.setDate(d[o+"Date"]()-1);var h=new Date;h.setDate(h[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},v=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},S=function(){return d[o+"Date"]()},_=function(){return d[o+"Month"]()},E=function(){return d[o+"FullYear"]()},k=function(){return h[o+"Date"]()},T=function(){return h[o+"Month"]()},A=function(){return h[o+"FullYear"]()};return b()===n&&v()===r&&m()===i?l?"Tdy":"Today":E()===n&&_()===r&&S()===i?l?"Ysd":"Yesterday":A()===n&&T()===r&&k()===i?l?"Tmw":"Tomorrow":a},H8e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},V8e=function(t){var n=t.getDay();return n===0&&(n=7),n},W8e=function(t){return(String(t).match(F8e)||[""]).pop().replace(z8e,"").replace(/GMT\+0000/g,"UTC")};const U8e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(ns(!0));const o=r(),{generation:a,postprocessing:s,system:l,canvas:u}=o,d={generationMode:i,generationState:a,postprocessingState:s,canvasState:u,systemState:l};n(mCe());const{generationParameters:h,esrganParameters:m,facetoolParameters:v}=B8e(d);t.emit("generateImage",h,m,v),h.init_mask&&(h.init_mask=h.init_mask.substr(0,64).concat("...")),h.init_img&&(h.init_img=h.init_img.substr(0,64).concat("...")),n(to({timestamp:no(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...h,...m,...v})}`}))},emitRunESRGAN:i=>{n(ns(!0));const{postprocessing:{upscalingLevel:o,upscalingDenoising:a,upscalingStrength:s}}=r(),l={upscale:[o,a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(ns(!0));const{postprocessing:{facetoolType:o,facetoolStrength:a,codeformerFidelity:s}}=r(),l={facetool_strength:a};o==="codeformer"&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",i,{type:o,...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`Face restoration (${o}) requested: ${JSON.stringify({file:i.url,...l})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(fU(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitConvertToDiffusers:i=>{t.emit("convertToDiffusers",i)},emitRequestModelChange:i=>{n(hCe()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}};let Gb;const G8e=new Uint8Array(16);function q8e(){if(!Gb&&(Gb=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gb(G8e)}const Hi=[];for(let e=0;e<256;++e)Hi.push((e+256).toString(16).slice(1));function Y8e(e,t=0){return(Hi[e[t+0]]+Hi[e[t+1]]+Hi[e[t+2]]+Hi[e[t+3]]+"-"+Hi[e[t+4]]+Hi[e[t+5]]+"-"+Hi[e[t+6]]+Hi[e[t+7]]+"-"+Hi[e[t+8]]+Hi[e[t+9]]+"-"+Hi[e[t+10]]+Hi[e[t+11]]+Hi[e[t+12]]+Hi[e[t+13]]+Hi[e[t+14]]+Hi[e[t+15]]).toLowerCase()}const K8e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gD={randomUUID:K8e};function hm(e,t,n){if(gD.randomUUID&&!t&&!e)return gD.randomUUID();e=e||{};const r=e.random||(e.rng||q8e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Y8e(r)}const $8=Tr("socketio/generateImage"),X8e=Tr("socketio/runESRGAN"),Z8e=Tr("socketio/runFacetool"),Q8e=Tr("socketio/deleteImage"),F8=Tr("socketio/requestImages"),mD=Tr("socketio/requestNewImages"),J8e=Tr("socketio/cancelProcessing"),e_e=Tr("socketio/requestSystemConfig"),vD=Tr("socketio/searchForModels"),Vy=Tr("socketio/addNewModel"),t_e=Tr("socketio/deleteModel"),n_e=Tr("socketio/convertToDiffusers"),tq=Tr("socketio/requestModelChange"),r_e=Tr("socketio/saveStagingAreaImageToGallery"),i_e=Tr("socketio/requestEmptyTempFolder"),o_e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(RR(!0)),t(B4(zt.t("common:statusConnected"))),t(e_e());const r=n().gallery;r.categories.result.latest_mtime?t(mD("result")):t(F8("result")),r.categories.user.latest_mtime?t(mD("user")):t(F8("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(RR(!1)),t(B4(zt.t("common:statusDisconnected"))),t(to({timestamp:no(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:o}=i.ui,{shouldLoopback:a}=i.postprocessing,{boundingBox:s,generationMode:l,...u}=r,d={uuid:hm(),...u};if(["txt2img","img2img"].includes(l)&&t(cm({category:"result",image:{...d,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:h}=r;t(Axe({image:{...d,category:"temp"},boundingBox:h})),i.canvas.shouldAutoSave&&t(cm({image:{...d,category:"result"},category:"result"}))}if(a)switch(mP[o]){case"img2img":{t(P0(d));break}}t(EC()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(Jxe({uuid:hm(),...r,category:"result"})),r.isBase64||t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(cm({category:"result",image:{uuid:hm(),...r,category:"result"}})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(ns(!0)),t(uCe(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(to({timestamp:no(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(DR()),t(EC())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:hm(),...l}));t(Qxe({images:s,areMoreImagesAvailable:o,category:a})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(fCe());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(cm({category:"result",image:r})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(EC())),t(to({timestamp:no(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(fU(r));const{generation:{initialImage:o,maskPath:a}}=n();(o===i||(o==null?void 0:o.url)===i)&&t(vU()),a===i&&t(wU("")),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(cCe(r)),r.infill_methods.includes("patchmatch")||t(xU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(QU(i)),t(JU(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(Mb(o)),t(ns(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t(Ah({title:a?`${zt.t("modelmanager:modelUpdated")}: ${i}`:`${zt.t("modelmanager:modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(Mb(o)),t(ns(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`${zt.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t(Ah({title:`${zt.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(Mb(o)),t(B4(zt.t("common:statusModelChanged"))),t(ns(!1)),t(dm(!0)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(Mb(o)),t(ns(!1)),t(dm(!0)),t(DR()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Ah({title:zt.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},a_e=()=>{const{origin:e}=new URL(window.location.href),t=z4(e,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:d,onGenerationResult:h,onIntermediateResult:m,onProgressUpdate:v,onGalleryImages:b,onProcessingCanceled:S,onImageDeleted:_,onSystemConfig:E,onModelChanged:k,onFoundModels:T,onNewModelAdded:A,onModelDeleted:M,onModelChangeFailed:R,onTempFolderEmptied:D}=o_e(i),{emitGenerateImage:j,emitRunESRGAN:z,emitRunFacetool:H,emitDeleteImage:K,emitRequestImages:te,emitRequestNewImages:G,emitCancelProcessing:$,emitRequestSystemConfig:W,emitSearchForModels:X,emitAddNewModel:Z,emitDeleteModel:U,emitConvertToDiffusers:Q,emitRequestModelChange:re,emitSaveStagingAreaImageToGallery:fe,emitRequestEmptyTempFolder:Ee}=U8e(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",be=>u(be)),t.on("generationResult",be=>h(be)),t.on("postprocessingResult",be=>d(be)),t.on("intermediateResult",be=>m(be)),t.on("progressUpdate",be=>v(be)),t.on("galleryImages",be=>b(be)),t.on("processingCanceled",()=>{S()}),t.on("imageDeleted",be=>{_(be)}),t.on("systemConfig",be=>{E(be)}),t.on("foundModels",be=>{T(be)}),t.on("newModelAdded",be=>{A(be)}),t.on("modelDeleted",be=>{M(be)}),t.on("modelChanged",be=>{k(be)}),t.on("modelChangeFailed",be=>{R(be)}),t.on("tempFolderEmptied",()=>{D()}),n=!0),a.type){case"socketio/generateImage":{j(a.payload);break}case"socketio/runESRGAN":{z(a.payload);break}case"socketio/runFacetool":{H(a.payload);break}case"socketio/deleteImage":{K(a.payload);break}case"socketio/requestImages":{te(a.payload);break}case"socketio/requestNewImages":{G(a.payload);break}case"socketio/cancelProcessing":{$();break}case"socketio/requestSystemConfig":{W();break}case"socketio/searchForModels":{X(a.payload);break}case"socketio/addNewModel":{Z(a.payload);break}case"socketio/deleteModel":{U(a.payload);break}case"socketio/convertToDiffusers":{Q(a.payload);break}case"socketio/requestModelChange":{re(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{fe(a.payload);break}case"socketio/requestEmptyTempFolder":{Ee();break}}o(a)}},s_e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),l_e=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map(e=>`system.${e}`),u_e=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),nq=RW({generation:ywe,postprocessing:Cwe,gallery:awe,system:bCe,canvas:Xxe,ui:LCe,lightbox:uwe}),c_e=UW.getPersistConfig({key:"root",storage:WW,rootReducer:nq,blacklist:[...s_e,...l_e,...u_e],debounce:300}),d_e=rxe(c_e,nq),rq=ISe({reducer:d_e,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(a_e()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),iq=uxe(rq),EP=w.createContext(null),Oe=q5e,he=N5e;let yD;const PP=()=>({setOpenUploader:e=>{e&&(yD=e)},openUploader:yD}),Mr=lt(e=>e.ui,e=>mP[e.activeTab],{memoizeOptions:{equalityCheck:ke.isEqual}}),f_e=lt(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:ke.isEqual}}),bp=lt(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),bD=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Mr(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:a})).json(),u={uuid:hm(),category:"user",...l};t(cm({image:u,category:"user"})),o==="unifiedCanvas"?t($x(u)):o==="img2img"&&t(P0(u))};function h_e(){const{t:e}=Ue();return y.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[y.jsx("h1",{children:e("common:nodes")}),y.jsx("p",{children:e("common:nodesDesc")})]})}const p_e=()=>{const{t:e}=Ue();return y.jsxs("div",{className:"work-in-progress post-processing-work-in-progress",children:[y.jsx("h1",{children:e("common:postProcessing")}),y.jsx("p",{children:e("common:postProcessDesc1")}),y.jsx("p",{children:e("common:postProcessDesc2")}),y.jsx("p",{children:e("common:postProcessDesc3")})]})};function g_e(){const{t:e}=Ue();return y.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[y.jsx("h1",{children:e("common:training")}),y.jsxs("p",{children:[e("common:trainingDesc1"),y.jsx("br",{}),y.jsx("br",{}),e("common:trainingDesc2")]})]})}function m_e(e){const{i18n:t}=Ue(),n=localStorage.getItem("i18nextLng");N.useEffect(()=>{e()},[e]),N.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const v_e=yt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:y.jsx("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),y_e=yt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),b_e=yt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),S_e=yt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:y.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:y.jsx("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})}),x_e=yt({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),w_e=yt({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:y.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})}),Je=Ae((e,t)=>{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return y.jsx(uo,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:y.jsx(us,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})}),nr=Ae((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return y.jsx(uo,{label:r,...i,children:y.jsx(ls,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),Js=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return y.jsxs(BE,{...o,children:[y.jsx(zE,{children:t}),y.jsxs(FE,{className:`invokeai__popover-content ${r}`,children:[i&&y.jsx($E,{className:"invokeai__popover-arrow"}),n]})]})},qx=lt(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),SD=/^-?(0\.)?\.?$/,ia=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:d,min:h,max:m,isInteger:v=!0,formControlProps:b,formLabelProps:S,numberInputFieldProps:_,numberInputStepperProps:E,tooltipProps:k,...T}=e,[A,M]=w.useState(String(u));w.useEffect(()=>{!A.match(SD)&&u!==Number(A)&&M(String(u))},[u,A]);const R=j=>{M(j),j.match(SD)||d(v?Math.floor(Number(j)):Number(j))},D=j=>{const z=ke.clamp(v?Math.floor(Number(j.target.value)):Number(j.target.value),h,m);M(String(z)),d(z)};return y.jsx(uo,{...k,children:y.jsxs(fn,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&y.jsx(En,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...S,children:t}),y.jsxs(RE,{className:"invokeai__number-input-root",value:A,min:h,max:m,keepWithinRange:!0,clampValueOnBlur:!1,onChange:R,onBlur:D,width:a,...T,children:[y.jsx(DE,{className:"invokeai__number-input-field",textAlign:s,..._}),o&&y.jsxs("div",{className:"invokeai__number-input-stepper",children:[y.jsx(jE,{...E,className:"invokeai__number-input-stepper-button"}),y.jsx(NE,{...E,className:"invokeai__number-input-stepper-button"})]})]})]})})},rl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return y.jsxs(fn,{isDisabled:n,className:`invokeai__select ${l}`,onClick:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation(),d.nativeEvent.stopPropagation(),d.nativeEvent.cancelBubble=!0},children:[t&&y.jsx(En,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),y.jsx(uo,{label:i,...o,children:y.jsx(QV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(d=>typeof d=="string"||typeof d=="number"?y.jsx("option",{value:d,className:"invokeai__select-option",children:d},d):y.jsx("option",{value:d.value,className:"invokeai__select-option",children:d.key},d.value))})})]})},Wy=e=>e.postprocessing,or=e=>e.system,C_e=e=>e.system.toastQueue,oq=lt(or,e=>{const{model_list:t}=e,n=ke.reduce(t,(r,i,o)=>(i.status==="active"&&(r=o),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),__e=lt([Wy,or],({facetoolStrength:e,facetoolType:t,codeformerFidelity:n},{isGFPGANAvailable:r})=>({facetoolStrength:e,facetoolType:t,codeformerFidelity:n,isGFPGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),TP=()=>{const e=Oe(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r,isGFPGANAvailable:i}=he(__e),o=u=>e(g8(u)),a=u=>e(IU(u)),s=u=>e(j4(u.target.value)),{t:l}=Ue();return y.jsxs(Ge,{direction:"column",gap:2,children:[y.jsx(rl,{label:l("parameters:type"),validValues:w7e.concat(),value:n,onChange:s}),y.jsx(ia,{isDisabled:!i,label:l("parameters:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&y.jsx(ia,{isDisabled:!i,label:l("parameters:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};var aq={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},xD=N.createContext&&N.createContext(aq),Hd=globalThis&&globalThis.__assign||function(){return Hd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{Ee(i)},[i]);const be=w.useMemo(()=>W!=null&&W.max?W.max:a,[a,W==null?void 0:W.max]),ye=Ve=>{l(Ve)},Fe=Ve=>{Ve.target.value===""&&(Ve.target.value=String(o));const je=ke.clamp(S?Math.floor(Number(Ve.target.value)):Number(fe),o,be);l(je)},Me=Ve=>{Ee(Ve)},rt=()=>{M&&M()};return y.jsxs(fn,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":h,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...H,children:[y.jsx(En,{className:"invokeai__slider-component-label",...K,children:r}),y.jsxs(Ey,{w:"100%",gap:2,alignItems:"center",children:[y.jsxs(VE,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:ye,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...re,children:[h&&y.jsxs(y.Fragment,{children:[y.jsx(Q9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),y.jsx(Q9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:v,...te,children:a})]}),y.jsx(uW,{className:"invokeai__slider_track",...G,children:y.jsx(cW,{className:"invokeai__slider_track-filled"})}),y.jsx(uo,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${d}`,hidden:T,...U,children:y.jsx(lW,{className:"invokeai__slider-thumb",...$})})]}),b&&y.jsxs(RE,{min:o,max:be,step:s,value:fe,onChange:Me,onBlur:Fe,className:"invokeai__slider-number-field",isDisabled:j,...W,children:[y.jsx(DE,{className:"invokeai__slider-number-input",width:_,readOnly:E,minWidth:_,...X}),y.jsxs(VV,{...Z,children:[y.jsx(jE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"}),y.jsx(NE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"})]})]}),k&&y.jsx(Je,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:y.jsx(Yx,{}),onClick:rt,isDisabled:R,...Q})]})]})}const M_e=lt([Wy,or],({upscalingLevel:e,upscalingStrength:t,upscalingDenoising:n},{isESRGANAvailable:r})=>({upscalingLevel:e,upscalingDenoising:n,upscalingStrength:t,isESRGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),LP=()=>{const e=Oe(),{upscalingLevel:t,upscalingStrength:n,upscalingDenoising:r,isESRGANAvailable:i}=he(M_e),{t:o}=Ue(),a=l=>e(RU(Number(l.target.value))),s=l=>e(v8(l));return y.jsxs(Ge,{flexDir:"column",rowGap:"1rem",minWidth:"20rem",children:[y.jsx(rl,{isDisabled:!i,label:o("parameters:scale"),value:t,onChange:a,validValues:x7e}),y.jsx(so,{label:o("parameters:denoisingStrength"),value:r,min:0,max:1,step:.01,onChange:l=>{e(m8(l))},handleReset:()=>e(m8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i}),y.jsx(so,{label:`${o("parameters:upscale")} ${o("parameters:strength")}`,value:n,min:0,max:1,step:.05,onChange:s,handleReset:()=>e(v8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i})]})};var I_e=Object.create,uq=Object.defineProperty,R_e=Object.getOwnPropertyDescriptor,D_e=Object.getOwnPropertyNames,N_e=Object.getPrototypeOf,j_e=Object.prototype.hasOwnProperty,qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),B_e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of D_e(t))!j_e.call(e,i)&&i!==n&&uq(e,i,{get:()=>t[i],enumerable:!(r=R_e(t,i))||r.enumerable});return e},cq=(e,t,n)=>(n=e!=null?I_e(N_e(e)):{},B_e(t||!e||!e.__esModule?uq(n,"default",{value:e,enumerable:!0}):n,e)),$_e=qe((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),dq=qe((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Kx=qe((e,t)=>{var n=dq();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),F_e=qe((e,t)=>{var n=Kx(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),z_e=qe((e,t)=>{var n=Kx();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),H_e=qe((e,t)=>{var n=Kx();function r(i){return n(this.__data__,i)>-1}t.exports=r}),V_e=qe((e,t)=>{var n=Kx();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Xx=qe((e,t)=>{var n=$_e(),r=F_e(),i=z_e(),o=H_e(),a=V_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Xx();function r(){this.__data__=new n,this.size=0}t.exports=r}),U_e=qe((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),G_e=qe((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),q_e=qe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),fq=qe((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),mc=qe((e,t)=>{var n=fq(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),AP=qe((e,t)=>{var n=mc(),r=n.Symbol;t.exports=r}),Y_e=qe((e,t)=>{var n=AP(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),d=l[a];try{l[a]=void 0;var h=!0}catch{}var m=o.call(l);return h&&(u?l[a]=d:delete l[a]),m}t.exports=s}),K_e=qe((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),Zx=qe((e,t)=>{var n=AP(),r=Y_e(),i=K_e(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),hq=qe((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),pq=qe((e,t)=>{var n=Zx(),r=hq(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var d=n(u);return d==o||d==a||d==i||d==s}t.exports=l}),X_e=qe((e,t)=>{var n=mc(),r=n["__core-js_shared__"];t.exports=r}),Z_e=qe((e,t)=>{var n=X_e(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),gq=qe((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch{}try{return o+""}catch{}}return""}t.exports=i}),Q_e=qe((e,t)=>{var n=pq(),r=Z_e(),i=hq(),o=gq(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,h=u.hasOwnProperty,m=RegExp("^"+d.call(h).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(b){if(!i(b)||r(b))return!1;var S=n(b)?m:s;return S.test(o(b))}t.exports=v}),J_e=qe((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),O0=qe((e,t)=>{var n=Q_e(),r=J_e();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),OP=qe((e,t)=>{var n=O0(),r=mc(),i=n(r,"Map");t.exports=i}),Qx=qe((e,t)=>{var n=O0(),r=n(Object,"create");t.exports=r}),eke=qe((e,t)=>{var n=Qx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),tke=qe((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),nke=qe((e,t)=>{var n=Qx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),rke=qe((e,t)=>{var n=Qx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),ike=qe((e,t)=>{var n=Qx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),oke=qe((e,t)=>{var n=eke(),r=tke(),i=nke(),o=rke(),a=ike();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=oke(),r=Xx(),i=OP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),ske=qe((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),Jx=qe((e,t)=>{var n=ske();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),lke=qe((e,t)=>{var n=Jx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),uke=qe((e,t)=>{var n=Jx();function r(i){return n(this,i).get(i)}t.exports=r}),cke=qe((e,t)=>{var n=Jx();function r(i){return n(this,i).has(i)}t.exports=r}),dke=qe((e,t)=>{var n=Jx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),mq=qe((e,t)=>{var n=ake(),r=lke(),i=uke(),o=cke(),a=dke();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Xx(),r=OP(),i=mq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var d=u.__data__;if(!r||d.length{var n=Xx(),r=W_e(),i=U_e(),o=G_e(),a=q_e(),s=fke();function l(u){var d=this.__data__=new n(u);this.size=d.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),pke=qe((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),gke=qe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),mke=qe((e,t)=>{var n=mq(),r=pke(),i=gke();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),vq=qe((e,t)=>{var n=mke(),r=vke(),i=yke(),o=1,a=2;function s(l,u,d,h,m,v){var b=d&o,S=l.length,_=u.length;if(S!=_&&!(b&&_>S))return!1;var E=v.get(l),k=v.get(u);if(E&&k)return E==u&&k==l;var T=-1,A=!0,M=d&a?new n:void 0;for(v.set(l,u),v.set(u,l);++T{var n=mc(),r=n.Uint8Array;t.exports=r}),Ske=qe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),xke=qe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),wke=qe((e,t)=>{var n=AP(),r=bke(),i=dq(),o=vq(),a=Ske(),s=xke(),l=1,u=2,d="[object Boolean]",h="[object Date]",m="[object Error]",v="[object Map]",b="[object Number]",S="[object RegExp]",_="[object Set]",E="[object String]",k="[object Symbol]",T="[object ArrayBuffer]",A="[object DataView]",M=n?n.prototype:void 0,R=M?M.valueOf:void 0;function D(j,z,H,K,te,G,$){switch(H){case A:if(j.byteLength!=z.byteLength||j.byteOffset!=z.byteOffset)return!1;j=j.buffer,z=z.buffer;case T:return!(j.byteLength!=z.byteLength||!G(new r(j),new r(z)));case d:case h:case b:return i(+j,+z);case m:return j.name==z.name&&j.message==z.message;case S:case E:return j==z+"";case v:var W=a;case _:var X=K&l;if(W||(W=s),j.size!=z.size&&!X)return!1;var Z=$.get(j);if(Z)return Z==z;K|=u,$.set(j,z);var U=o(W(j),W(z),K,te,G,$);return $.delete(j),U;case k:if(R)return R.call(j)==R.call(z)}return!1}t.exports=D}),Cke=qe((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),_ke=qe((e,t)=>{var n=Cke(),r=MP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),kke=qe((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),Pke=qe((e,t)=>{var n=kke(),r=Eke(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),Tke=qe((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),Lke=qe((e,t)=>{var n=Zx(),r=ew(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),Ake=qe((e,t)=>{var n=Lke(),r=ew(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),Oke=qe((e,t)=>{function n(){return!1}t.exports=n}),yq=qe((e,t)=>{var n=mc(),r=Oke(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),Mke=qe((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a??n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),Ike=qe((e,t)=>{var n=Zx(),r=bq(),i=ew(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",h="[object Map]",m="[object Number]",v="[object Object]",b="[object RegExp]",S="[object Set]",_="[object String]",E="[object WeakMap]",k="[object ArrayBuffer]",T="[object DataView]",A="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",j="[object Int32Array]",z="[object Uint8Array]",H="[object Uint8ClampedArray]",K="[object Uint16Array]",te="[object Uint32Array]",G={};G[A]=G[M]=G[R]=G[D]=G[j]=G[z]=G[H]=G[K]=G[te]=!0,G[o]=G[a]=G[k]=G[s]=G[T]=G[l]=G[u]=G[d]=G[h]=G[m]=G[v]=G[b]=G[S]=G[_]=G[E]=!1;function $(W){return i(W)&&r(W.length)&&!!G[n(W)]}t.exports=$}),Rke=qe((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),Dke=qe((e,t)=>{var n=fq(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s}),Sq=qe((e,t)=>{var n=Ike(),r=Rke(),i=Dke(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),Nke=qe((e,t)=>{var n=Tke(),r=Ake(),i=MP(),o=yq(),a=Mke(),s=Sq(),l=Object.prototype,u=l.hasOwnProperty;function d(h,m){var v=i(h),b=!v&&r(h),S=!v&&!b&&o(h),_=!v&&!b&&!S&&s(h),E=v||b||S||_,k=E?n(h.length,String):[],T=k.length;for(var A in h)(m||u.call(h,A))&&!(E&&(A=="length"||S&&(A=="offset"||A=="parent")||_&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,T)))&&k.push(A);return k}t.exports=d}),jke=qe((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),Bke=qe((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),$ke=qe((e,t)=>{var n=Bke(),r=n(Object.keys,Object);t.exports=r}),Fke=qe((e,t)=>{var n=jke(),r=$ke(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),zke=qe((e,t)=>{var n=pq(),r=bq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),Hke=qe((e,t)=>{var n=Nke(),r=Fke(),i=zke();function o(a){return i(a)?n(a):r(a)}t.exports=o}),Vke=qe((e,t)=>{var n=_ke(),r=Pke(),i=Hke();function o(a){return n(a,i,r)}t.exports=o}),Wke=qe((e,t)=>{var n=Vke(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,d,h,m){var v=u&r,b=n(s),S=b.length,_=n(l),E=_.length;if(S!=E&&!v)return!1;for(var k=S;k--;){var T=b[k];if(!(v?T in l:o.call(l,T)))return!1}var A=m.get(s),M=m.get(l);if(A&&M)return A==l&&M==s;var R=!0;m.set(s,l),m.set(l,s);for(var D=v;++k{var n=O0(),r=mc(),i=n(r,"DataView");t.exports=i}),Gke=qe((e,t)=>{var n=O0(),r=mc(),i=n(r,"Promise");t.exports=i}),qke=qe((e,t)=>{var n=O0(),r=mc(),i=n(r,"Set");t.exports=i}),Yke=qe((e,t)=>{var n=O0(),r=mc(),i=n(r,"WeakMap");t.exports=i}),Kke=qe((e,t)=>{var n=Uke(),r=OP(),i=Gke(),o=qke(),a=Yke(),s=Zx(),l=gq(),u="[object Map]",d="[object Object]",h="[object Promise]",m="[object Set]",v="[object WeakMap]",b="[object DataView]",S=l(n),_=l(r),E=l(i),k=l(o),T=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=h||o&&A(new o)!=m||a&&A(new a)!=v)&&(A=function(M){var R=s(M),D=R==d?M.constructor:void 0,j=D?l(D):"";if(j)switch(j){case S:return b;case _:return u;case E:return h;case k:return m;case T:return v}return R}),t.exports=A}),Xke=qe((e,t)=>{var n=hke(),r=vq(),i=wke(),o=Wke(),a=Kke(),s=MP(),l=yq(),u=Sq(),d=1,h="[object Arguments]",m="[object Array]",v="[object Object]",b=Object.prototype,S=b.hasOwnProperty;function _(E,k,T,A,M,R){var D=s(E),j=s(k),z=D?m:a(E),H=j?m:a(k);z=z==h?v:z,H=H==h?v:H;var K=z==v,te=H==v,G=z==H;if(G&&l(E)){if(!l(k))return!1;D=!0,K=!1}if(G&&!K)return R||(R=new n),D||u(E)?r(E,k,T,A,M,R):i(E,k,z,T,A,M,R);if(!(T&d)){var $=K&&S.call(E,"__wrapped__"),W=te&&S.call(k,"__wrapped__");if($||W){var X=$?E.value():E,Z=W?k.value():k;return R||(R=new n),M(X,Z,T,A,R)}}return G?(R||(R=new n),o(E,k,T,A,M,R)):!1}t.exports=_}),Zke=qe((e,t)=>{var n=Xke(),r=ew();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),xq=qe((e,t)=>{var n=Zke();function r(i,o){return n(i,o)}t.exports=r}),Qke=["ctrl","shift","alt","meta","mod"],Jke={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function $C(e,t=","){return typeof e=="string"?e.split(t):e}function h2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>Jke[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!Qke.includes(o));return{...r,keys:i}}function eEe(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function tEe(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function nEe(e){return wq(e,["input","textarea","select"])}function wq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function rEe(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var iEe=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:d,metaKey:h,shiftKey:m,key:v,code:b}=e,S=b.toLowerCase().replace("key",""),_=v.toLowerCase();if(u!==r&&_!=="alt"||m!==s&&_!=="shift")return!1;if(a){if(!h&&!d)return!1}else if(h!==o&&S!=="meta"||d!==i&&S!=="ctrl")return!1;return l&&l.length===1&&(l.includes(_)||l.includes(S))?!0:l?l.every(E=>n.has(E)):!l},oEe=w.createContext(void 0),aEe=()=>w.useContext(oEe),sEe=w.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),lEe=()=>w.useContext(sEe),uEe=cq(xq());function cEe(e){let t=w.useRef(void 0);return(0,uEe.default)(t.current,e)||(t.current=e),t.current}var wD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function et(e,t,n,r){let i=w.useRef(null),{current:o}=w.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=w.useCallback(t,[...s]),u=cEe(a),{enabledScopes:d}=lEe(),h=aEe();return w.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!rEe(d,u==null?void 0:u.scopes))return;let m=S=>{var _;if(!(nEe(S)&&!wq(S,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){wD(S);return}(_=S.target)!=null&&_.isContentEditable&&!(u!=null&&u.enableOnContentEditable)||$C(e,u==null?void 0:u.splitKey).forEach(E=>{var T;let k=h2(E,u==null?void 0:u.combinationKey);if(iEe(S,k,o)||(T=k.keys)!=null&&T.includes("*")){if(eEe(S,k,u==null?void 0:u.preventDefault),!tEe(S,k,u==null?void 0:u.enabled)){wD(S);return}l(S,k)}})}},v=S=>{o.add(S.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||u!=null&&u.keydown)&&m(S)},b=S=>{S.key.toLowerCase()!=="meta"?o.delete(S.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(S)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",v),h&&$C(e,u==null?void 0:u.splitKey).forEach(S=>h.addHotkey(h2(S,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",v),h&&$C(e,u==null?void 0:u.splitKey).forEach(S=>h.removeHotkey(h2(S,u==null?void 0:u.combinationKey)))}},[e,l,u,d]),i}cq(xq());var z8=new Set;function dEe(e){(Array.isArray(e)?e:[e]).forEach(t=>z8.add(h2(t)))}function fEe(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=h2(t);for(let i of z8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&z8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{dEe(e.key)}),document.addEventListener("keyup",e=>{fEe(e.key)})});function hEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function pEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function gEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function Cq(e){return mt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function _q(e){return mt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function mEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function vEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function kq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function yEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function bEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function IP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function Eq(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function l0(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function Pq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function SEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function RP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function Tq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function xEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function wEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function Lq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function CEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function _Ee(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function Aq(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function kEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function EEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function PEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function TEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"}}]})(e)}function Oq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function LEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function AEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function Mq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function OEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function MEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function Uy(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function IEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function REe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function DEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function DP(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function NEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function jEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function CD(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function NP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function BEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function Sp(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function $Ee(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function tw(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function FEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function jP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const ln=e=>e.canvas,Ir=lt([ln,Mr,or],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Iq=e=>e.canvas.layerState.objects.find(Y5),xp=e=>e.gallery,zEe=lt([xp,qx,Ir,Mr],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,galleryWidth:b,shouldUseSingleGalleryColumn:S}=e,{isLightboxOpen:_}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,galleryGridTemplateColumns:S?"auto":`repeat(auto-fill, minmax(${d}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightboxOpen:_,isStaging:n,shouldEnableResize:!(_||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:S}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HEe=lt([xp,or,qx,Mr],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VEe=lt(or,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),iS=w.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Gh(),a=Oe(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=he(VEe),d=w.useRef(null),h=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(Q8e(e)),o()};et("delete",()=>{s?i():m()},[e,s,l,u]);const v=b=>a(XU(!b.target.checked));return y.jsxs(y.Fragment,{children:[w.cloneElement(t,{onClick:e?h:void 0,ref:n}),y.jsx(FV,{isOpen:r,leastDestructiveRef:d,onClose:o,children:y.jsx(Zd,{children:y.jsxs(zV,{className:"modal",children:[y.jsx(_0,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),y.jsx(o0,{children:y.jsxs(Ge,{direction:"column",gap:5,children:[y.jsx(Jt,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),y.jsx(fn,{children:y.jsxs(Ge,{alignItems:"center",children:[y.jsx(En,{mb:0,children:"Don't ask me again"}),y.jsx(WE,{checked:!s,onChange:v})]})})]})}),y.jsxs(wx,{children:[y.jsx(ls,{ref:d,onClick:o,className:"modal-close-btn",children:"Cancel"}),y.jsx(ls,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})});iS.displayName="DeleteImageModal";const WEe=lt([or,xp,Wy,bp,qx,Mr],(e,t,n,r,i,o)=>{const{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u}=e,{upscalingLevel:d,facetoolStrength:h}=n,{isLightboxOpen:m}=i,{shouldShowImageDetails:v}=r,{intermediateImage:b,currentImage:S}=t;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:d,facetoolStrength:h,shouldDisableToolbarButtons:Boolean(b)||!S,currentImage:S,shouldShowImageDetails:v,activeTabName:o,isLightboxOpen:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),Rq=()=>{var z,H,K,te,G,$;const e=Oe(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightboxOpen:d,activeTabName:h}=he(WEe),m=By(),{t:v}=Ue(),b=()=>{u&&(d&&e(zm(!1)),e(P0(u)),e(Yo("img2img")))},S=async()=>{if(!u)return;const W=await fetch(u.url).then(Z=>Z.blob()),X=[new ClipboardItem({[W.type]:W})];await navigator.clipboard.write(X),m({title:v("toast:imageCopied"),status:"success",duration:2500,isClosable:!0})},_=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:v("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};et("shift+i",()=>{u?(b(),m({title:v("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:imageNotLoaded"),description:v("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var W,X;u&&(u.metadata&&e(yU(u.metadata)),((W=u.metadata)==null?void 0:W.image.type)==="img2img"?e(Yo("img2img")):((X=u.metadata)==null?void 0:X.image.type)==="txt2img"&&e(Yo("txt2img")))};et("a",()=>{var W,X;["txt2img","img2img"].includes((X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)==null?void 0:X.type)?(E(),m({title:v("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:parametersNotSet"),description:v("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const k=()=>{u!=null&&u.metadata&&e(Fy(u.metadata.image.seed))};et("s",()=>{var W,X;(X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.seed?(k(),m({title:v("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:seedNotSet"),description:v("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const T=()=>{var W,X,Z,U;if((X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.prompt){const[Q,re]=fP((U=(Z=u==null?void 0:u.metadata)==null?void 0:Z.image)==null?void 0:U.prompt);Q&&e(Fx(Q)),e(ny(re||""))}};et("p",()=>{var W,X;(X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.prompt?(T(),m({title:v("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:promptNotSet"),description:v("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const A=()=>{u&&e(X8e(u))};et("Shift+U",()=>{i&&!s&&n&&!t&&o?A():m({title:v("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const M=()=>{u&&e(Z8e(u))};et("Shift+R",()=>{r&&!s&&n&&!t&&a?M():m({title:v("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(tG(!l)),D=()=>{u&&(d&&e(zm(!1)),e($x(u)),e(vi(!0)),h!=="unifiedCanvas"&&e(Yo("unifiedCanvas")),m({title:v("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};et("i",()=>{u?R():m({title:v("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const j=()=>{e(zm(!d))};return y.jsxs("div",{className:"current-image-options",children:[y.jsxs(oo,{isAttached:!0,children:[y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{"aria-label":`${v("parameters:sendTo")}...`,icon:y.jsx(jEe,{})}),children:y.jsxs("div",{className:"current-image-send-to-popover",children:[y.jsx(nr,{size:"sm",onClick:b,leftIcon:y.jsx(CD,{}),children:v("parameters:sendToImg2Img")}),y.jsx(nr,{size:"sm",onClick:D,leftIcon:y.jsx(CD,{}),children:v("parameters:sendToUnifiedCanvas")}),y.jsx(nr,{size:"sm",onClick:S,leftIcon:y.jsx(l0,{}),children:v("parameters:copyImage")}),y.jsx(nr,{size:"sm",onClick:_,leftIcon:y.jsx(l0,{}),children:v("parameters:copyImageToLink")}),y.jsx(Bh,{download:!0,href:u==null?void 0:u.url,children:y.jsx(nr,{leftIcon:y.jsx(RP,{}),size:"sm",w:"100%",children:v("parameters:downloadImage")})})]})}),y.jsx(Je,{icon:y.jsx(wEe,{}),tooltip:d?`${v("parameters:closeViewer")} (Z)`:`${v("parameters:openInViewer")} (Z)`,"aria-label":d?`${v("parameters:closeViewer")} (Z)`:`${v("parameters:openInViewer")} (Z)`,"data-selected":d,onClick:j})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{icon:y.jsx(IEe,{}),tooltip:`${v("parameters:usePrompt")} (P)`,"aria-label":`${v("parameters:usePrompt")} (P)`,isDisabled:!((H=(z=u==null?void 0:u.metadata)==null?void 0:z.image)!=null&&H.prompt),onClick:T}),y.jsx(Je,{icon:y.jsx(NEe,{}),tooltip:`${v("parameters:useSeed")} (S)`,"aria-label":`${v("parameters:useSeed")} (S)`,isDisabled:!((te=(K=u==null?void 0:u.metadata)==null?void 0:K.image)!=null&&te.seed),onClick:k}),y.jsx(Je,{icon:y.jsx(yEe,{}),tooltip:`${v("parameters:useAll")} (A)`,"aria-label":`${v("parameters:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes(($=(G=u==null?void 0:u.metadata)==null?void 0:G.image)==null?void 0:$.type),onClick:E})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{icon:y.jsx(kEe,{}),"aria-label":v("parameters:restoreFaces")}),children:y.jsxs("div",{className:"current-image-postprocessing-popover",children:[y.jsx(TP,{}),y.jsx(nr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:M,children:v("parameters:restoreFaces")})]})}),y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{icon:y.jsx(xEe,{}),"aria-label":v("parameters:upscale")}),children:y.jsxs("div",{className:"current-image-postprocessing-popover",children:[y.jsx(LP,{}),y.jsx(nr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:A,children:v("parameters:upscaleImage")})]})})]}),y.jsx(oo,{isAttached:!0,children:y.jsx(Je,{icon:y.jsx(Eq,{}),tooltip:`${v("parameters:info")} (I)`,"aria-label":`${v("parameters:info")} (I)`,"data-selected":l,onClick:R})}),y.jsx(iS,{image:u,children:y.jsx(Je,{icon:y.jsx(Sp,{}),tooltip:`${v("parameters:deleteImage")} (Del)`,"aria-label":`${v("parameters:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};yt({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});yt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});yt({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});yt({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});yt({displayName:"SunIcon",path:N.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},N.createElement("circle",{cx:"12",cy:"12",r:"5"}),N.createElement("path",{d:"M12 1v2"}),N.createElement("path",{d:"M12 21v2"}),N.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),N.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),N.createElement("path",{d:"M1 12h2"}),N.createElement("path",{d:"M21 12h2"}),N.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),N.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))});yt({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});yt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:N.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});yt({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});yt({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});yt({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});yt({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});yt({displayName:"ViewIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),N.createElement("circle",{cx:"12",cy:"12",r:"2"}))});yt({displayName:"ViewOffIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),N.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))});yt({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});var UEe=yt({displayName:"DeleteIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"}))});yt({displayName:"RepeatIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),N.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))});yt({displayName:"RepeatClockIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),N.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))});var GEe=yt({displayName:"EditIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),N.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});yt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});yt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});yt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});yt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});yt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});yt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});yt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});yt({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});yt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var Dq=yt({displayName:"ExternalLinkIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),N.createElement("path",{d:"M15 3h6v6"}),N.createElement("path",{d:"M10 14L21 3"}))});yt({displayName:"LinkIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),N.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))});yt({displayName:"PlusSquareIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),N.createElement("path",{d:"M12 8v8"}),N.createElement("path",{d:"M8 12h8"}))});yt({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});yt({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});yt({displayName:"TimeIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),N.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))});yt({displayName:"ArrowRightIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),N.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))});yt({displayName:"ArrowLeftIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),N.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))});yt({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});yt({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});yt({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});yt({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});yt({displayName:"EmailIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),N.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))});yt({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});yt({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});yt({displayName:"SpinnerIcon",path:N.createElement(N.Fragment,null,N.createElement("defs",null,N.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},N.createElement("stop",{stopColor:"currentColor",offset:"0%"}),N.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),N.createElement("g",{transform:"translate(2)",fill:"none"},N.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),N.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),N.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))});yt({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});yt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:N.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});yt({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});yt({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});yt({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});yt({displayName:"InfoOutlineIcon",path:N.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},N.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),N.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),N.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))});yt({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});yt({displayName:"QuestionOutlineIcon",path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))});yt({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});yt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});yt({viewBox:"0 0 14 14",path:N.createElement("g",{fill:"currentColor"},N.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))});yt({displayName:"MinusIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))});yt({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function qEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Qn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>y.jsxs(Ge,{gap:2,children:[n&&y.jsx(uo,{label:`Recall ${e}`,children:y.jsx(us,{"aria-label":"Use this parameter",icon:y.jsx(qEe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&y.jsx(uo,{label:`Copy ${e}`,children:y.jsx(us,{"aria-label":`Copy ${e}`,icon:y.jsx(l0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),y.jsxs(Ge,{direction:i?"column":"row",children:[y.jsxs(Jt,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?y.jsxs(Bh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",y.jsx(Dq,{mx:"2px"})]}):y.jsx(Jt,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),YEe=(e,t)=>e.image.uuid===t.image.uuid,BP=w.memo(({image:e,styleClass:t})=>{var H,K;const n=Oe();et("esc",()=>{n(tG(!1))});const r=((H=e==null?void 0:e.metadata)==null?void 0:H.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:d,orig_path:h,perlin:m,postprocessing:v,prompt:b,sampler:S,seamless:_,seed:E,steps:k,strength:T,denoise_str:A,threshold:M,type:R,variations:D,width:j}=r,z=JSON.stringify(e.metadata,null,2);return y.jsx("div",{className:`image-metadata-viewer ${t}`,children:y.jsxs(Ge,{gap:1,direction:"column",width:"100%",children:[y.jsxs(Ge,{gap:2,children:[y.jsx(Jt,{fontWeight:"semibold",children:"File:"}),y.jsxs(Bh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,y.jsx(Dq,{mx:"2px"})]})]}),Object.keys(r).length>0?y.jsxs(y.Fragment,{children:[R&&y.jsx(Qn,{label:"Generation type",value:R}),((K=e.metadata)==null?void 0:K.model_weights)&&y.jsx(Qn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(R)&&y.jsx(Qn,{label:"Original image",value:h}),b&&y.jsx(Qn,{label:"Prompt",labelPosition:"top",value:l2(b),onClick:()=>n(Fx(b))}),E!==void 0&&y.jsx(Qn,{label:"Seed",value:E,onClick:()=>n(Fy(E))}),M!==void 0&&y.jsx(Qn,{label:"Noise Threshold",value:M,onClick:()=>n(LU(M))}),m!==void 0&&y.jsx(Qn,{label:"Perlin Noise",value:m,onClick:()=>n(CU(m))}),S&&y.jsx(Qn,{label:"Sampler",value:S,onClick:()=>n(_U(S))}),k&&y.jsx(Qn,{label:"Steps",value:k,onClick:()=>n(TU(k))}),o!==void 0&&y.jsx(Qn,{label:"CFG scale",value:o,onClick:()=>n(bU(o))}),D&&D.length>0&&y.jsx(Qn,{label:"Seed-weight pairs",value:Q5(D),onClick:()=>n(EU(Q5(D)))}),_&&y.jsx(Qn,{label:"Seamless",value:_,onClick:()=>n(kU(_))}),l&&y.jsx(Qn,{label:"High Resolution Optimization",value:l,onClick:()=>n(pP(l))}),j&&y.jsx(Qn,{label:"Width",value:j,onClick:()=>n(AU(j))}),s&&y.jsx(Qn,{label:"Height",value:s,onClick:()=>n(SU(s))}),u&&y.jsx(Qn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(P0(u))}),d&&y.jsx(Qn,{label:"Mask image",value:d,isLink:!0,onClick:()=>n(wU(d))}),R==="img2img"&&T&&y.jsx(Qn,{label:"Image to image strength",value:T,onClick:()=>n(p8(T))}),a&&y.jsx(Qn,{label:"Image to image fit",value:a,onClick:()=>n(PU(a))}),v&&v.length>0&&y.jsxs(y.Fragment,{children:[y.jsx(jh,{size:"sm",children:"Postprocessing"}),v.map((te,G)=>{if(te.type==="esrgan"){const{scale:$,strength:W,denoise_str:X}=te;return y.jsxs(Ge,{pl:"2rem",gap:1,direction:"column",children:[y.jsx(Jt,{size:"md",children:`${G+1}: Upscale (ESRGAN)`}),y.jsx(Qn,{label:"Scale",value:$,onClick:()=>n(RU($))}),y.jsx(Qn,{label:"Strength",value:W,onClick:()=>n(v8(W))}),X!==void 0&&y.jsx(Qn,{label:"Denoising strength",value:X,onClick:()=>n(m8(X))})]},G)}else if(te.type==="gfpgan"){const{strength:$}=te;return y.jsxs(Ge,{pl:"2rem",gap:1,direction:"column",children:[y.jsx(Jt,{size:"md",children:`${G+1}: Face restoration (GFPGAN)`}),y.jsx(Qn,{label:"Strength",value:$,onClick:()=>{n(g8($)),n(j4("gfpgan"))}})]},G)}else if(te.type==="codeformer"){const{strength:$,fidelity:W}=te;return y.jsxs(Ge,{pl:"2rem",gap:1,direction:"column",children:[y.jsx(Jt,{size:"md",children:`${G+1}: Face restoration (Codeformer)`}),y.jsx(Qn,{label:"Strength",value:$,onClick:()=>{n(g8($)),n(j4("codeformer"))}}),W&&y.jsx(Qn,{label:"Fidelity",value:W,onClick:()=>{n(IU(W)),n(j4("codeformer"))}})]},G)}})]}),i&&y.jsx(Qn,{withCopy:!0,label:"Dream Prompt",value:i}),y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsxs(Ge,{gap:2,children:[y.jsx(uo,{label:"Copy metadata JSON",children:y.jsx(us,{"aria-label":"Copy metadata JSON",icon:y.jsx(l0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),y.jsx(Jt,{fontWeight:"semibold",children:"Metadata JSON:"})]}),y.jsx("div",{className:"image-json-viewer",children:y.jsx("pre",{children:z})})]})]}):y.jsx(yF,{width:"100%",pt:10,children:y.jsx(Jt,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},YEe);BP.displayName="ImageMetadataViewer";const Nq=lt([xp,bp],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var d;return u.uuid===((d=e==null?void 0:e.currentImage)==null?void 0:d.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function KEe(){const e=Oe(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=he(Nq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(dP())},h=()=>{e(cP())};return y.jsxs("div",{className:"current-image-preview",children:[i&&y.jsx(JS,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&y.jsxs("div",{className:"current-image-next-prev-buttons",children:[y.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&y.jsx(us,{"aria-label":"Previous image",icon:y.jsx(Cq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),y.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&y.jsx(us,{"aria-label":"Next image",icon:y.jsx(_q,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),r&&i&&y.jsx(BP,{image:i,styleClass:"current-image-metadata"})]})}var XEe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=globalThis&&globalThis.__assign||function(){return ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},rPe=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],TD="__resizable_base__",jq=function(e){JEe(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(TD):o.className+=TD,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;o&&o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||ePe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),d=u/l[s]*100;return d+"%"}return FC(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?FC(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?FC(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&$g("left",o),s=i&&$g("top",o),l,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=a?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,h=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,v=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,S=u||0;if(s){var _=(m-b)*this.ratio+S,E=(v-b)*this.ratio+S,k=(d-S)/this.ratio+b,T=(h-S)/this.ratio+b,A=Math.max(d,_),M=Math.min(h,E),R=Math.max(m,k),D=Math.min(v,T);n=Yb(n,A,M),r=Yb(r,R,D)}else n=Yb(n,d,h),r=Yb(r,m,v);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&tPe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Kb(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Bl(Bl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(h)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Kb(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Kb(n)?n.touches[0].clientX:n.clientX,d=Kb(n)?n.touches[0].clientY:n.clientY,h=this.state,m=h.direction,v=h.original,b=h.width,S=h.height,_=this.getParentSize(),E=nPe(_,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=E.maxWidth,a=E.maxHeight,s=E.minWidth,l=E.minHeight;var k=this.calculateNewSizeFromDirection(u,d),T=k.newHeight,A=k.newWidth,M=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=PD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=PD(T,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(A,T,{width:M.maxWidth,height:M.maxHeight},{width:s,height:l});if(A=R.newWidth,T=R.newHeight,this.props.grid){var D=ED(A,this.props.grid[0]),j=ED(T,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,T=z===0||Math.abs(j-T)<=z?j:T}var H={width:A-v.width,height:T-v.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var K=A/_.width*100;A=K+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var G=A/this.window.innerHeight*100;A=G+"vh"}}if(S&&typeof S=="string"){if(S.endsWith("%")){var K=T/_.height*100;T=K+"%"}else if(S.endsWith("vw")){var te=T/this.window.innerWidth*100;T=te+"vw"}else if(S.endsWith("vh")){var G=T/this.window.innerHeight*100;T=G+"vh"}}var $={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?$.flexBasis=$.width:this.flexDir==="column"&&($.flexBasis=$.height),el.flushSync(function(){r.setState($)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,H)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Bl(Bl({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(h){return i[h]!==!1?w.createElement(QEe,{key:h,direction:h,onResizeStart:n.onResizeStart,replaceStyles:o&&o[h],className:a&&a[h]},u&&u[h]?u[h]:null):null});return w.createElement("div",{className:l,style:s},d)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return rPe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Bl(Bl(Bl({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return w.createElement(o,Bl({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&w.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(w.PureComponent);const er=e=>{const{label:t,styleClass:n,...r}=e;return y.jsx(sF,{className:`invokeai__checkbox ${n}`,...r,children:t})};function Bq(e){return mt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function $q(e){return mt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function iPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function oPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function aPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function sPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function Fq(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function lPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function uPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function cPe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function dPe(e,t){e.classList?e.classList.add(t):cPe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function LD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function fPe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=LD(e.className,t):e.setAttribute("class",LD(e.className&&e.className.baseVal||"",t))}const AD={disabled:!1},zq=N.createContext(null);var Hq=function(t){return t.scrollTop},Nv="unmounted",mh="exited",vh="entering",Wg="entered",H8="exiting",vc=function(e){_E(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=mh,o.appearStatus=vh):l=Wg:r.unmountOnExit||r.mountOnEnter?l=Nv:l=mh,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Nv?{status:mh}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==vh&&a!==Wg&&(o=vh):(a===vh||a===Wg)&&(o=H8)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===vh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:xb.findDOMNode(this);a&&Hq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===mh&&this.setState({status:Nv})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[xb.findDOMNode(this),s],u=l[0],d=l[1],h=this.getTimeouts(),m=s?h.appear:h.enter;if(!i&&!a||AD.disabled){this.safeSetState({status:Wg},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:vh},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:Wg},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:xb.findDOMNode(this);if(!o||AD.disabled){this.safeSetState({status:mh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:H8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:mh},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:xb.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Nv)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=xE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return N.createElement(zq.Provider,{value:null},typeof a=="function"?a(i,s):N.cloneElement(N.Children.only(a),s))},t}(N.Component);vc.contextType=zq;vc.propTypes={};function Fg(){}vc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Fg,onEntering:Fg,onEntered:Fg,onExit:Fg,onExiting:Fg,onExited:Fg};vc.UNMOUNTED=Nv;vc.EXITED=mh;vc.ENTERING=vh;vc.ENTERED=Wg;vc.EXITING=H8;const hPe=vc;var pPe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return dPe(t,r)})},zC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return fPe(t,r)})},$P=function(e){_E(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ab,Object.values(b));return w.createElement(S.Provider,{value:_},v)}function d(h,m){const v=(m==null?void 0:m[e][l])||s,b=w.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const i=()=>{const o=n.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,gPe(i,...t)]}function gPe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...s,...h}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function mPe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Wq(...e){return t=>e.forEach(n=>mPe(n,t))}function ps(...e){return w.useCallback(Wq(...e),e)}const uy=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),o=i.find(yPe);if(o){const a=o.props.children,s=i.map(l=>l===o?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return w.createElement(V8,bn({},r,{ref:t}),w.isValidElement(a)?w.cloneElement(a,void 0,s):null)}return w.createElement(V8,bn({},r,{ref:t}),n)});uy.displayName="Slot";const V8=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...bPe(r,n.props),ref:Wq(t,n.ref)}):w.Children.count(n)>1?w.Children.only(null):null});V8.displayName="SlotClone";const vPe=({children:e})=>w.createElement(w.Fragment,null,e);function yPe(e){return w.isValidElement(e)&&e.type===vPe}function bPe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const SPe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],lc=SPe.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?uy:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(s,bn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Uq(e,t){e&&el.flushSync(()=>e.dispatchEvent(t))}function Gq(e){const t=e+"CollectionProvider",[n,r]=Gy(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:S}=v,_=N.useRef(null),E=N.useRef(new Map).current;return N.createElement(i,{scope:b,itemMap:E,collectionRef:_},S)},s=e+"CollectionSlot",l=N.forwardRef((v,b)=>{const{scope:S,children:_}=v,E=o(s,S),k=ps(b,E.collectionRef);return N.createElement(uy,{ref:k},_)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=N.forwardRef((v,b)=>{const{scope:S,children:_,...E}=v,k=N.useRef(null),T=ps(b,k),A=o(u,S);return N.useEffect(()=>(A.itemMap.set(k,{ref:k,...E}),()=>void A.itemMap.delete(k))),N.createElement(uy,{[d]:"",ref:T},_)});function m(v){const b=o(e+"CollectionConsumer",v);return N.useCallback(()=>{const _=b.collectionRef.current;if(!_)return[];const E=Array.from(_.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((A,M)=>E.indexOf(A.ref.current)-E.indexOf(M.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:h},m,r]}const xPe=w.createContext(void 0);function qq(e){const t=w.useContext(xPe);return e||t||"ltr"}function du(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function wPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const W8="dismissableLayer.update",CPe="dismissableLayer.pointerDownOutside",_Pe="dismissableLayer.focusOutside";let OD;const kPe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),EPe=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=w.useContext(kPe),[h,m]=w.useState(null),v=(n=h==null?void 0:h.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=w.useState({}),S=ps(t,j=>m(j)),_=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=_.indexOf(E),T=h?_.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,M=T>=k,R=PPe(j=>{const z=j.target,H=[...d.branches].some(K=>K.contains(z));!M||H||(o==null||o(j),s==null||s(j),j.defaultPrevented||l==null||l())},v),D=TPe(j=>{const z=j.target;[...d.branches].some(K=>K.contains(z))||(a==null||a(j),s==null||s(j),j.defaultPrevented||l==null||l())},v);return wPe(j=>{T===d.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},v),w.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(OD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),MD(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=OD)}},[h,v,r,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),MD())},[h,d]),w.useEffect(()=>{const j=()=>b({});return document.addEventListener(W8,j),()=>document.removeEventListener(W8,j)},[]),w.createElement(lc.div,bn({},u,{ref:S,style:{pointerEvents:A?M?"auto":"none":void 0,...e.style},onFocusCapture:ir(e.onFocusCapture,D.onFocusCapture),onBlurCapture:ir(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:ir(e.onPointerDownCapture,R.onPointerDownCapture)}))});function PPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){Yq(CPe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function TPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&Yq(_Pe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function MD(){const e=new CustomEvent(W8);document.dispatchEvent(e)}function Yq(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Uq(i,o):i.dispatchEvent(o)}let HC=0;function LPe(){w.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:ID()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:ID()),HC++,()=>{HC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),HC--}},[])}function ID(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const VC="focusScope.autoFocusOnMount",WC="focusScope.autoFocusOnUnmount",RD={bubbles:!1,cancelable:!0},APe=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=w.useState(null),u=du(i),d=du(o),h=w.useRef(null),m=ps(t,S=>l(S)),v=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let S=function(E){if(v.paused||!s)return;const k=E.target;s.contains(k)?h.current=k:yh(h.current,{select:!0})},_=function(E){v.paused||!s||s.contains(E.relatedTarget)||yh(h.current,{select:!0})};return document.addEventListener("focusin",S),document.addEventListener("focusout",_),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",_)}}},[r,s,v.paused]),w.useEffect(()=>{if(s){ND.add(v);const S=document.activeElement;if(!s.contains(S)){const E=new CustomEvent(VC,RD);s.addEventListener(VC,u),s.dispatchEvent(E),E.defaultPrevented||(OPe(NPe(Kq(s)),{select:!0}),document.activeElement===S&&yh(s))}return()=>{s.removeEventListener(VC,u),setTimeout(()=>{const E=new CustomEvent(WC,RD);s.addEventListener(WC,d),s.dispatchEvent(E),E.defaultPrevented||yh(S??document.body,{select:!0}),s.removeEventListener(WC,d),ND.remove(v)},0)}}},[s,u,d,v]);const b=w.useCallback(S=>{if(!n&&!r||v.paused)return;const _=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,E=document.activeElement;if(_&&E){const k=S.currentTarget,[T,A]=MPe(k);T&&A?!S.shiftKey&&E===A?(S.preventDefault(),n&&yh(T,{select:!0})):S.shiftKey&&E===T&&(S.preventDefault(),n&&yh(A,{select:!0})):E===k&&S.preventDefault()}},[n,r,v.paused]);return w.createElement(lc.div,bn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function OPe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yh(r,{select:t}),document.activeElement!==n)return}function MPe(e){const t=Kq(e),n=DD(t,e),r=DD(t.reverse(),e);return[n,r]}function Kq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function DD(e,t){for(const n of e)if(!IPe(n,{upTo:t}))return n}function IPe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function RPe(e){return e instanceof HTMLInputElement&&"select"in e}function yh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&RPe(e)&&t&&e.select()}}const ND=DPe();function DPe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jD(e,t),e.unshift(t)},remove(t){var n;e=jD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function jD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function NPe(e){return e.filter(t=>t.tagName!=="A")}const u0=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:()=>{},jPe=n7["useId".toString()]||(()=>{});let BPe=0;function $Pe(e){const[t,n]=w.useState(jPe());return u0(()=>{e||n(r=>r??String(BPe++))},[e]),e||(t?`radix-${t}`:"")}function M0(e){return e.split("-")[0]}function nw(e){return e.split("-")[1]}function I0(e){return["top","bottom"].includes(M0(e))?"x":"y"}function FP(e){return e==="y"?"height":"width"}function BD(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=I0(t),l=FP(s),u=r[l]/2-i[l]/2,d=s==="x";let h;switch(M0(t)){case"top":h={x:o,y:r.y-i.height};break;case"bottom":h={x:o,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:a};break;case"left":h={x:r.x-i.width,y:a};break;default:h={x:r.x,y:r.y}}switch(nw(t)){case"start":h[s]-=u*(n&&d?-1:1);break;case"end":h[s]+=u*(n&&d?-1:1)}return h}const FPe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=BD(l,r,s),h=r,m={},v=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=Xq(r),d={x:i,y:o},h=I0(a),m=nw(a),v=FP(h),b=await l.getDimensions(n),S=h==="y"?"top":"left",_=h==="y"?"bottom":"right",E=s.reference[v]+s.reference[h]-d[h]-s.floating[v],k=d[h]-s.reference[h],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=T?h==="y"?T.clientHeight||0:T.clientWidth||0:0;A===0&&(A=s.floating[v]);const M=E/2-k/2,R=u[S],D=A-b[v]-u[_],j=A/2-b[v]/2+M,z=U8(R,j,D),H=(m==="start"?u[S]:u[_])>0&&j!==z&&s.reference[v]<=s.floating[v];return{[h]:d[h]-(H?jVPe[t])}function WPe(e,t,n){n===void 0&&(n=!1);const r=nw(e),i=I0(e),o=FP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=sS(a)),{main:a,cross:sS(a)}}const UPe={start:"end",end:"start"};function FD(e){return e.replace(/start|end/g,t=>UPe[t])}const Zq=["top","right","bottom","left"];Zq.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const GPe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...b}=e,S=M0(r),_=h||(S===a||!v?[sS(a)]:function(j){const z=sS(j);return[FD(j),z,FD(z)]}(a)),E=[a,..._],k=await aS(t,b),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(k[S]),d){const{main:j,cross:z}=WPe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));T.push(k[j],k[z])}if(A=[...A,{placement:r,overflows:T}],!T.every(j=>j<=0)){var M,R;const j=((M=(R=i.flip)==null?void 0:R.index)!=null?M:0)+1,z=E[j];if(z)return{data:{index:j,overflows:A},reset:{placement:z}};let H="bottom";switch(m){case"bestFit":{var D;const K=(D=A.map(te=>[te,te.overflows.filter(G=>G>0).reduce((G,$)=>G+$,0)]).sort((te,G)=>te[1]-G[1])[0])==null?void 0:D[0].placement;K&&(H=K);break}case"initialPlacement":H=a}if(r!==H)return{reset:{placement:H}}}return{}}}};function zD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function HD(e){return Zq.some(t=>e[t]>=0)}const qPe=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=zD(await aS(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:HD(o)}}}case"escaped":{const o=zD(await aS(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:o,escaped:HD(o)}}}default:return{}}}}},YPe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),h=M0(s),m=nw(s),v=I0(s)==="x",b=["left","top"].includes(h)?-1:1,S=d&&v?-1:1,_=typeof a=="function"?a(o):a;let{mainAxis:E,crossAxis:k,alignmentAxis:T}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,..._};return m&&typeof T=="number"&&(k=m==="end"?-1*T:T),v?{x:k*S,y:E*b}:{x:E*b,y:k*S}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function Qq(e){return e==="x"?"y":"x"}const KPe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:_=>{let{x:E,y:k}=_;return{x:E,y:k}}},...l}=e,u={x:n,y:r},d=await aS(t,l),h=I0(M0(i)),m=Qq(h);let v=u[h],b=u[m];if(o){const _=h==="y"?"bottom":"right";v=U8(v+d[h==="y"?"top":"left"],v,v-d[_])}if(a){const _=m==="y"?"bottom":"right";b=U8(b+d[m==="y"?"top":"left"],b,b-d[_])}const S=s.fn({...t,[h]:v,[m]:b});return{...S,data:{x:S.x-n,y:S.y-r}}}}},XPe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,d={x:n,y:r},h=I0(i),m=Qq(h);let v=d[h],b=d[m];const S=typeof s=="function"?s({...o,placement:i}):s,_=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(l){const M=h==="y"?"height":"width",R=o.reference[h]-o.floating[M]+_.mainAxis,D=o.reference[h]+o.reference[M]-_.mainAxis;vD&&(v=D)}if(u){var E,k,T,A;const M=h==="y"?"width":"height",R=["top","left"].includes(M0(i)),D=o.reference[m]-o.floating[M]+(R&&(E=(k=a.offset)==null?void 0:k[m])!=null?E:0)+(R?0:_.crossAxis),j=o.reference[m]+o.reference[M]+(R?0:(T=(A=a.offset)==null?void 0:A[m])!=null?T:0)-(R?_.crossAxis:0);bj&&(b=j)}return{[h]:v,[m]:b}}}};function Jq(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function yc(e){if(e==null)return window;if(!Jq(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function qy(e){return yc(e).getComputedStyle(e)}function Qu(e){return Jq(e)?"":e?(e.nodeName||"").toLowerCase():""}function eY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function fu(e){return e instanceof yc(e).HTMLElement}function tf(e){return e instanceof yc(e).Element}function zP(e){return typeof ShadowRoot>"u"?!1:e instanceof yc(e).ShadowRoot||e instanceof ShadowRoot}function rw(e){const{overflow:t,overflowX:n,overflowY:r}=qy(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function ZPe(e){return["table","td","th"].includes(Qu(e))}function VD(e){const t=/firefox/i.test(eY()),n=qy(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function tY(){return!/^((?!chrome|android).)*safari/i.test(eY())}const WD=Math.min,p2=Math.max,lS=Math.round;function Ju(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&fu(e)&&(l=e.offsetWidth>0&&lS(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&lS(s.height)/e.offsetHeight||1);const d=tf(e)?yc(e):window,h=!tY()&&n,m=(s.left+(h&&(r=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,v=(s.top+(h&&(o=(a=d.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,S=s.height/u;return{width:b,height:S,top:v,right:m+b,bottom:v+S,left:m,x:m,y:v}}function Vd(e){return(t=e,(t instanceof yc(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function iw(e){return tf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function nY(e){return Ju(Vd(e)).left+iw(e).scrollLeft}function QPe(e,t,n){const r=fu(t),i=Vd(t),o=Ju(e,r&&function(l){const u=Ju(l);return lS(u.width)!==l.offsetWidth||lS(u.height)!==l.offsetHeight}(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Qu(t)!=="body"||rw(i))&&(a=iw(t)),fu(t)){const l=Ju(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=nY(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function rY(e){return Qu(e)==="html"?e:e.assignedSlot||e.parentNode||(zP(e)?e.host:null)||Vd(e)}function UD(e){return fu(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function G8(e){const t=yc(e);let n=UD(e);for(;n&&ZPe(n)&&getComputedStyle(n).position==="static";)n=UD(n);return n&&(Qu(n)==="html"||Qu(n)==="body"&&getComputedStyle(n).position==="static"&&!VD(n))?t:n||function(r){let i=rY(r);for(zP(i)&&(i=i.host);fu(i)&&!["html","body"].includes(Qu(i));){if(VD(i))return i;i=i.parentNode}return null}(e)||t}function GD(e){if(fu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ju(e);return{width:t.width,height:t.height}}function iY(e){const t=rY(e);return["html","body","#document"].includes(Qu(t))?e.ownerDocument.body:fu(t)&&rw(t)?t:iY(t)}function uS(e,t){var n;t===void 0&&(t=[]);const r=iY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=yc(r),a=i?[o].concat(o.visualViewport||[],rw(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(uS(a))}function qD(e,t,n){return t==="viewport"?oS(function(r,i){const o=yc(r),a=Vd(r),s=o.visualViewport;let l=a.clientWidth,u=a.clientHeight,d=0,h=0;if(s){l=s.width,u=s.height;const m=tY();(m||!m&&i==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}return{width:l,height:u,x:d,y:h}}(e,n)):tf(t)?function(r,i){const o=Ju(r,!1,i==="fixed"),a=o.top+r.clientTop,s=o.left+r.clientLeft;return{top:a,left:s,x:s,y:a,right:s+r.clientWidth,bottom:a+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):oS(function(r){var i;const o=Vd(r),a=iw(r),s=(i=r.ownerDocument)==null?void 0:i.body,l=p2(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=p2(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let d=-a.scrollLeft+nY(r);const h=-a.scrollTop;return qy(s||o).direction==="rtl"&&(d+=p2(o.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:d,y:h}}(Vd(e)))}function JPe(e){const t=uS(e),n=["absolute","fixed"].includes(qy(e).position)&&fu(e)?G8(e):e;return tf(n)?t.filter(r=>tf(r)&&function(i,o){const a=o.getRootNode==null?void 0:o.getRootNode();if(i.contains(o))return!0;if(a&&zP(a)){let s=o;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Qu(r)!=="body"):[]}const eTe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?JPe(t):[].concat(n),r],a=o[0],s=o.reduce((l,u)=>{const d=qD(t,u,i);return l.top=p2(d.top,l.top),l.right=WD(d.right,l.right),l.bottom=WD(d.bottom,l.bottom),l.left=p2(d.left,l.left),l},qD(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=fu(n),o=Vd(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Qu(n)!=="body"||rw(o))&&(a=iw(n)),fu(n))){const l=Ju(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:tf,getDimensions:GD,getOffsetParent:G8,getDocumentElement:Vd,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:QPe(t,G8(n),r),floating:{...GD(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>qy(e).direction==="rtl"};function tTe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,d=l||u?[...tf(e)?uS(e):[],...uS(t)]:[];d.forEach(b=>{l&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});let h,m=null;if(a){let b=!0;m=new ResizeObserver(()=>{b||n(),b=!1}),tf(e)&&!s&&m.observe(e),m.observe(t)}let v=s?Ju(e):null;return s&&function b(){const S=Ju(e);!v||S.x===v.x&&S.y===v.y&&S.width===v.width&&S.height===v.height||n(),v=S,h=requestAnimationFrame(b)}(),n(),()=>{var b;d.forEach(S=>{l&&S.removeEventListener("scroll",n),u&&S.removeEventListener("resize",n)}),(b=m)==null||b.disconnect(),m=null,s&&cancelAnimationFrame(h)}}const nTe=(e,t,n)=>FPe(e,t,{platform:eTe,...n});var q8=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Y8(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Y8(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Y8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function rTe(e){const t=w.useRef(e);return q8(()=>{t.current=e}),t}function iTe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=w.useRef(null),a=w.useRef(null),s=rTe(i),l=w.useRef(null),[u,d]=w.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,m]=w.useState(t);Y8(h==null?void 0:h.map(T=>{let{options:A}=T;return A}),t==null?void 0:t.map(T=>{let{options:A}=T;return A}))||m(t);const v=w.useCallback(()=>{!o.current||!a.current||nTe(o.current,a.current,{middleware:h,placement:n,strategy:r}).then(T=>{b.current&&el.flushSync(()=>{d(T)})})},[h,n,r]);q8(()=>{b.current&&v()},[v]);const b=w.useRef(!1);q8(()=>(b.current=!0,()=>{b.current=!1}),[]);const S=w.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const T=s.current(o.current,a.current,v);l.current=T}else v()},[v,s]),_=w.useCallback(T=>{o.current=T,S()},[S]),E=w.useCallback(T=>{a.current=T,S()},[S]),k=w.useMemo(()=>({reference:o,floating:a}),[]);return w.useMemo(()=>({...u,update:v,refs:k,reference:_,floating:E}),[u,v,k,_,E])}const oTe=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?$D({element:t.current,padding:n}).fn(i):{}:t?$D({element:t,padding:n}).fn(i):{}}}};function aTe(e){const[t,n]=w.useState(void 0);return u0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const oY="Popper",[HP,aY]=Gy(oY),[sTe,sY]=HP(oY),lTe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return w.createElement(sTe,{scope:t,anchor:r,onAnchorChange:i},n)},uTe="PopperAnchor",cTe=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=sY(uTe,n),a=w.useRef(null),s=ps(t,a);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:w.createElement(lc.div,bn({},i,{ref:s}))}),cS="PopperContent",[dTe,zze]=HP(cS),[fTe,hTe]=HP(cS,{hasParent:!1,positionUpdateFns:new Set}),pTe=w.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:d,side:h="bottom",sideOffset:m=0,align:v="center",alignOffset:b=0,arrowPadding:S=0,collisionBoundary:_=[],collisionPadding:E=0,sticky:k="partial",hideWhenDetached:T=!1,avoidCollisions:A=!0,...M}=e,R=sY(cS,d),[D,j]=w.useState(null),z=ps(t,ae=>j(ae)),[H,K]=w.useState(null),te=aTe(H),G=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,$=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,W=h+(v!=="center"?"-"+v:""),X=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},Z=Array.isArray(_)?_:[_],U=Z.length>0,Q={padding:X,boundary:Z.filter(mTe),altBoundary:U},{reference:re,floating:fe,strategy:Ee,x:be,y:ye,placement:Fe,middlewareData:Me,update:rt}=iTe({strategy:"fixed",placement:W,whileElementsMounted:tTe,middleware:[YPe({mainAxis:m+$,alignmentAxis:b}),A?KPe({mainAxis:!0,crossAxis:!1,limiter:k==="partial"?XPe():void 0,...Q}):void 0,H?oTe({element:H,padding:S}):void 0,A?GPe({...Q}):void 0,vTe({arrowWidth:G,arrowHeight:$}),T?qPe({strategy:"referenceHidden"}):void 0].filter(gTe)});u0(()=>{re(R.anchor)},[re,R.anchor]);const Ve=be!==null&&ye!==null,[je,wt]=lY(Fe),Be=(i=Me.arrow)===null||i===void 0?void 0:i.x,at=(o=Me.arrow)===null||o===void 0?void 0:o.y,bt=((a=Me.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Le,ut]=w.useState();u0(()=>{D&&ut(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Mt,positionUpdateFns:ct}=hTe(cS,d),_t=!Mt;w.useLayoutEffect(()=>{if(!_t)return ct.add(rt),()=>{ct.delete(rt)}},[_t,ct,rt]),w.useLayoutEffect(()=>{_t&&Ve&&Array.from(ct).reverse().forEach(ae=>requestAnimationFrame(ae))},[_t,Ve,ct]);const un={"data-side":je,"data-align":wt,...M,ref:z,style:{...M.style,animation:Ve?void 0:"none",opacity:(s=Me.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return w.createElement("div",{ref:fe,"data-radix-popper-content-wrapper":"",style:{position:Ee,left:0,top:0,transform:Ve?`translate3d(${Math.round(be)}px, ${Math.round(ye)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Le,["--radix-popper-transform-origin"]:[(l=Me.transformOrigin)===null||l===void 0?void 0:l.x,(u=Me.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},w.createElement(dTe,{scope:d,placedSide:je,onArrowChange:K,arrowX:Be,arrowY:at,shouldHideArrow:bt},_t?w.createElement(fTe,{scope:d,hasParent:!0,positionUpdateFns:ct},w.createElement(lc.div,un)):w.createElement(lc.div,un)))});function gTe(e){return e!==void 0}function mTe(e){return e!==null}const vTe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,h=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=h?0:e.arrowWidth,v=h?0:e.arrowHeight,[b,S]=lY(s),_={start:"0%",center:"50%",end:"100%"}[S],E=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,k=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+v/2;let T="",A="";return b==="bottom"?(T=h?_:`${E}px`,A=`${-v}px`):b==="top"?(T=h?_:`${E}px`,A=`${l.floating.height+v}px`):b==="right"?(T=`${-v}px`,A=h?_:`${k}px`):b==="left"&&(T=`${l.floating.width+v}px`,A=h?_:`${k}px`),{data:{x:T,y:A}}}});function lY(e){const[t,n="center"]=e.split("-");return[t,n]}const yTe=lTe,bTe=cTe,STe=pTe;function xTe(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const uY=e=>{const{present:t,children:n}=e,r=wTe(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=ps(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};uY.displayName="Presence";function wTe(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[s,l]=xTe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=Zb(r.current);o.current=s==="mounted"?u:"none"},[s]),u0(()=>{const u=r.current,d=i.current;if(d!==e){const m=o.current,v=Zb(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),u0(()=>{if(t){const u=h=>{const v=Zb(r.current).includes(h.animationName);h.target===t&&v&&el.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(o.current=Zb(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Zb(e){return(e==null?void 0:e.animationName)||"none"}function CTe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=_Te({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=du(n),l=w.useCallback(u=>{if(o){const h=typeof u=="function"?u(e):u;h!==e&&s(h)}else i(u)},[o,e,i,s]);return[a,l]}function _Te({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),o=du(t);return w.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const UC="rovingFocusGroup.onEntryFocus",kTe={bubbles:!1,cancelable:!0},VP="RovingFocusGroup",[K8,cY,ETe]=Gq(VP),[PTe,dY]=Gy(VP,[ETe]),[TTe,LTe]=PTe(VP),ATe=w.forwardRef((e,t)=>w.createElement(K8.Provider,{scope:e.__scopeRovingFocusGroup},w.createElement(K8.Slot,{scope:e.__scopeRovingFocusGroup},w.createElement(OTe,bn({},e,{ref:t}))))),OTe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=w.useRef(null),m=ps(t,h),v=qq(o),[b=null,S]=CTe({prop:a,defaultProp:s,onChange:l}),[_,E]=w.useState(!1),k=du(u),T=cY(n),A=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const D=h.current;if(D)return D.addEventListener(UC,k),()=>D.removeEventListener(UC,k)},[k]),w.createElement(TTe,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:b,onItemFocus:w.useCallback(D=>S(D),[S]),onItemShiftTab:w.useCallback(()=>E(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>R(D=>D-1),[])},w.createElement(lc.div,bn({tabIndex:_||M===0?-1:0,"data-orientation":r},d,{ref:m,style:{outline:"none",...e.style},onMouseDown:ir(e.onMouseDown,()=>{A.current=!0}),onFocus:ir(e.onFocus,D=>{const j=!A.current;if(D.target===D.currentTarget&&j&&!_){const z=new CustomEvent(UC,kTe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=T().filter(W=>W.focusable),K=H.find(W=>W.active),te=H.find(W=>W.id===b),$=[K,te,...H].filter(Boolean).map(W=>W.ref.current);fY($)}}A.current=!1}),onBlur:ir(e.onBlur,()=>E(!1))})))}),MTe="RovingFocusGroupItem",ITe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=$Pe(),s=LTe(MTe,n),l=s.currentTabStopId===a,u=cY(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=s;return w.useEffect(()=>{if(r)return d(),()=>h()},[r,d,h]),w.createElement(K8.ItemSlot,{scope:n,id:a,focusable:r,active:i},w.createElement(lc.span,bn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:ir(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:ir(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:ir(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=NTe(m,s.orientation,s.dir);if(v!==void 0){m.preventDefault();let S=u().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")S.reverse();else if(v==="prev"||v==="next"){v==="prev"&&S.reverse();const _=S.indexOf(m.currentTarget);S=s.loop?jTe(S,_+1):S.slice(_+1)}setTimeout(()=>fY(S))}})})))}),RTe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DTe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NTe(e,t,n){const r=DTe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return RTe[r]}function fY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const BTe=ATe,$Te=ITe,FTe=["Enter"," "],zTe=["ArrowDown","PageUp","Home"],hY=["ArrowUp","PageDown","End"],HTe=[...zTe,...hY],ow="Menu",[X8,VTe,WTe]=Gq(ow),[wp,pY]=Gy(ow,[WTe,aY,dY]),WP=aY(),gY=dY(),[UTe,aw]=wp(ow),[GTe,UP]=wp(ow),qTe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=WP(t),[l,u]=w.useState(null),d=w.useRef(!1),h=du(o),m=qq(i);return w.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),w.createElement(yTe,s,w.createElement(UTe,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u},w.createElement(GTe,{scope:t,onClose:w.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:m,modal:a},r)))},YTe=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=WP(n);return w.createElement(bTe,bn({},i,r,{ref:t}))}),KTe="MenuPortal",[Hze,XTe]=wp(KTe,{forceMount:void 0}),Wd="MenuContent",[ZTe,mY]=wp(Wd),QTe=w.forwardRef((e,t)=>{const n=XTe(Wd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=aw(Wd,e.__scopeMenu),a=UP(Wd,e.__scopeMenu);return w.createElement(X8.Provider,{scope:e.__scopeMenu},w.createElement(uY,{present:r||o.open},w.createElement(X8.Slot,{scope:e.__scopeMenu},a.modal?w.createElement(JTe,bn({},i,{ref:t})):w.createElement(eLe,bn({},i,{ref:t})))))}),JTe=w.forwardRef((e,t)=>{const n=aw(Wd,e.__scopeMenu),r=w.useRef(null),i=ps(t,r);return w.useEffect(()=>{const o=r.current;if(o)return ZH(o)},[]),w.createElement(vY,bn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ir(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),eLe=w.forwardRef((e,t)=>{const n=aw(Wd,e.__scopeMenu);return w.createElement(vY,bn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),vY=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m,disableOutsideScroll:v,...b}=e,S=aw(Wd,n),_=UP(Wd,n),E=WP(n),k=gY(n),T=VTe(n),[A,M]=w.useState(null),R=w.useRef(null),D=ps(t,R,S.onContentChange),j=w.useRef(0),z=w.useRef(""),H=w.useRef(0),K=w.useRef(null),te=w.useRef("right"),G=w.useRef(0),$=v?jV:w.Fragment,W=v?{as:uy,allowPinchZoom:!0}:void 0,X=U=>{var Q,re;const fe=z.current+U,Ee=T().filter(Ve=>!Ve.disabled),be=document.activeElement,ye=(Q=Ee.find(Ve=>Ve.ref.current===be))===null||Q===void 0?void 0:Q.textValue,Fe=Ee.map(Ve=>Ve.textValue),Me=uLe(Fe,fe,ye),rt=(re=Ee.find(Ve=>Ve.textValue===Me))===null||re===void 0?void 0:re.ref.current;(function Ve(je){z.current=je,window.clearTimeout(j.current),je!==""&&(j.current=window.setTimeout(()=>Ve(""),1e3))})(fe),rt&&setTimeout(()=>rt.focus())};w.useEffect(()=>()=>window.clearTimeout(j.current),[]),LPe();const Z=w.useCallback(U=>{var Q,re;return te.current===((Q=K.current)===null||Q===void 0?void 0:Q.side)&&dLe(U,(re=K.current)===null||re===void 0?void 0:re.area)},[]);return w.createElement(ZTe,{scope:n,searchRef:z,onItemEnter:w.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),onItemLeave:w.useCallback(U=>{var Q;Z(U)||((Q=R.current)===null||Q===void 0||Q.focus(),M(null))},[Z]),onTriggerLeave:w.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),pointerGraceTimerRef:H,onPointerGraceIntentChange:w.useCallback(U=>{K.current=U},[])},w.createElement($,W,w.createElement(APe,{asChild:!0,trapped:i,onMountAutoFocus:ir(o,U=>{var Q;U.preventDefault(),(Q=R.current)===null||Q===void 0||Q.focus()}),onUnmountAutoFocus:a},w.createElement(EPe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m},w.createElement(BTe,bn({asChild:!0},k,{dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:M,onEntryFocus:U=>{_.isUsingKeyboardRef.current||U.preventDefault()}}),w.createElement(STe,bn({role:"menu","aria-orientation":"vertical","data-state":aLe(S.open),"data-radix-menu-content":"",dir:_.dir},E,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:ir(b.onKeyDown,U=>{const re=U.target.closest("[data-radix-menu-content]")===U.currentTarget,fe=U.ctrlKey||U.altKey||U.metaKey,Ee=U.key.length===1;re&&(U.key==="Tab"&&U.preventDefault(),!fe&&Ee&&X(U.key));const be=R.current;if(U.target!==be||!HTe.includes(U.key))return;U.preventDefault();const Fe=T().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);hY.includes(U.key)&&Fe.reverse(),sLe(Fe)}),onBlur:ir(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(j.current),z.current="")}),onPointerMove:ir(e.onPointerMove,Q8(U=>{const Q=U.target,re=G.current!==U.clientX;if(U.currentTarget.contains(Q)&&re){const fe=U.clientX>G.current?"right":"left";te.current=fe,G.current=U.clientX}}))})))))))}),Z8="MenuItem",YD="menu.itemSelect",tLe=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=w.useRef(null),a=UP(Z8,e.__scopeMenu),s=mY(Z8,e.__scopeMenu),l=ps(t,o),u=w.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const m=new CustomEvent(YD,{bubbles:!0,cancelable:!0});h.addEventListener(YD,v=>r==null?void 0:r(v),{once:!0}),Uq(h,m),m.defaultPrevented?u.current=!1:a.onClose()}};return w.createElement(nLe,bn({},i,{ref:l,disabled:n,onClick:ir(e.onClick,d),onPointerDown:h=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,h),u.current=!0},onPointerUp:ir(e.onPointerUp,h=>{var m;u.current||(m=h.currentTarget)===null||m===void 0||m.click()}),onKeyDown:ir(e.onKeyDown,h=>{const m=s.searchRef.current!=="";n||m&&h.key===" "||FTe.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}))}),nLe=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=mY(Z8,n),s=gY(n),l=w.useRef(null),u=ps(t,l),[d,h]=w.useState(!1),[m,v]=w.useState("");return w.useEffect(()=>{const b=l.current;if(b){var S;v(((S=b.textContent)!==null&&S!==void 0?S:"").trim())}},[o.children]),w.createElement(X8.ItemSlot,{scope:n,disabled:r,textValue:i??m},w.createElement($Te,bn({asChild:!0},s,{focusable:!r}),w.createElement(lc.div,bn({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:ir(e.onPointerMove,Q8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:ir(e.onPointerLeave,Q8(b=>a.onItemLeave(b))),onFocus:ir(e.onFocus,()=>h(!0)),onBlur:ir(e.onBlur,()=>h(!1))}))))}),rLe="MenuRadioGroup";wp(rLe,{value:void 0,onValueChange:()=>{}});const iLe="MenuItemIndicator";wp(iLe,{checked:!1});const oLe="MenuSub";wp(oLe);function aLe(e){return e?"open":"closed"}function sLe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function lLe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function uLe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=lLe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function cLe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(u-s)*(r-l)/(d-l)+s&&(i=!i)}return i}function dLe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return cLe(n,t)}function Q8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const fLe=qTe,hLe=YTe,pLe=QTe,gLe=tLe,yY="ContextMenu",[mLe,Vze]=Gy(yY,[pY]),sw=pY(),[vLe,bY]=mLe(yY),yLe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=w.useState(!1),l=sw(t),u=du(r),d=w.useCallback(h=>{s(h),u(h)},[u]);return w.createElement(vLe,{scope:t,open:a,onOpenChange:d,modal:o},w.createElement(fLe,bn({},l,{dir:i,open:a,onOpenChange:d,modal:o}),n))},bLe="ContextMenuTrigger",SLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bY(bLe,n),o=sw(n),a=w.useRef({x:0,y:0}),s=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=w.useRef(0),u=w.useCallback(()=>window.clearTimeout(l.current),[]),d=h=>{a.current={x:h.clientX,y:h.clientY},i.onOpenChange(!0)};return w.useEffect(()=>u,[u]),w.createElement(w.Fragment,null,w.createElement(hLe,bn({},o,{virtualRef:s})),w.createElement(lc.span,bn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:ir(e.onContextMenu,h=>{u(),d(h),h.preventDefault()}),onPointerDown:ir(e.onPointerDown,Qb(h=>{u(),l.current=window.setTimeout(()=>d(h),700)})),onPointerMove:ir(e.onPointerMove,Qb(u)),onPointerCancel:ir(e.onPointerCancel,Qb(u)),onPointerUp:ir(e.onPointerUp,Qb(u))})))}),xLe="ContextMenuContent",wLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bY(xLe,n),o=sw(n),a=w.useRef(!1);return w.createElement(pLe,bn({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),CLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=sw(n);return w.createElement(gLe,bn({},i,r,{ref:t}))});function Qb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const _Le=yLe,kLe=SLe,ELe=wLe,dd=CLe,PLe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,SY=w.memo(e=>{var te,G,$,W,X,Z,U,Q;const t=Oe(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,shouldUseSingleGalleryColumn:a}=he(HEe),{image:s,isSelected:l}=e,{url:u,thumbnail:d,uuid:h,metadata:m}=s,[v,b]=w.useState(!1),S=By(),{t:_}=Ue(),E=()=>b(!0),k=()=>b(!1),T=()=>{var re,fe;if(s.metadata){const[Ee,be]=fP((fe=(re=s.metadata)==null?void 0:re.image)==null?void 0:fe.prompt);Ee&&t(Fx(Ee)),t(ny(be||""))}S({title:_("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},A=()=>{s.metadata&&t(Fy(s.metadata.image.seed)),S({title:_("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},M=()=>{t(P0(s)),n!=="img2img"&&t(Yo("img2img")),S({title:_("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},R=()=>{t($x(s)),t(Bx()),n!=="unifiedCanvas"&&t(Yo("unifiedCanvas")),S({title:_("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},D=()=>{m&&t(yU(m)),S({title:_("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},j=async()=>{var re;if((re=m==null?void 0:m.image)!=null&&re.init_image_path&&(await fetch(m.image.init_image_path)).ok){t(Yo("img2img")),t(hwe(m)),S({title:_("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}S({title:_("toast:initialImageNotSet"),description:_("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},z=()=>t(WI(s)),H=re=>{re.dataTransfer.setData("invokeai/imageUuid",h),re.dataTransfer.effectAllowed="move"},K=()=>{t(WI(s))};return y.jsxs(_Le,{onOpenChange:re=>{t(hU(re))},children:[y.jsx(kLe,{children:y.jsxs(Eo,{position:"relative",className:"hoverable-image",onMouseOver:E,onMouseOut:k,userSelect:"none",draggable:!0,onDragStart:H,children:[y.jsx(JS,{className:"hoverable-image-image",objectFit:a?"contain":r,rounded:"md",src:d||u,loading:"lazy"}),y.jsx("div",{className:"hoverable-image-content",onClick:z,children:l&&y.jsx(Na,{width:"50%",height:"50%",as:IP,className:"hoverable-image-check"})}),v&&i>=64&&y.jsx("div",{className:"hoverable-image-delete-button",children:y.jsx(iS,{image:s,children:y.jsx(us,{"aria-label":_("parameters:deleteImage"),icon:y.jsx(BEe,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},h)}),y.jsxs(ELe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:re=>{re.detail.originalEvent.preventDefault()},children:[y.jsx(dd,{onClickCapture:K,children:_("parameters:openInViewer")}),y.jsx(dd,{onClickCapture:T,disabled:((G=(te=s==null?void 0:s.metadata)==null?void 0:te.image)==null?void 0:G.prompt)===void 0,children:_("parameters:usePrompt")}),y.jsx(dd,{onClickCapture:A,disabled:((W=($=s==null?void 0:s.metadata)==null?void 0:$.image)==null?void 0:W.seed)===void 0,children:_("parameters:useSeed")}),y.jsx(dd,{onClickCapture:D,disabled:!["txt2img","img2img"].includes((Z=(X=s==null?void 0:s.metadata)==null?void 0:X.image)==null?void 0:Z.type),children:_("parameters:useAll")}),y.jsx(dd,{onClickCapture:j,disabled:((Q=(U=s==null?void 0:s.metadata)==null?void 0:U.image)==null?void 0:Q.type)!=="img2img",children:_("parameters:useInitImg")}),y.jsx(dd,{onClickCapture:M,children:_("parameters:sendToImg2Img")}),y.jsx(dd,{onClickCapture:R,children:_("parameters:sendToUnifiedCanvas")}),y.jsx(dd,{"data-warning":!0,children:y.jsx(iS,{image:s,children:y.jsx("p",{children:_("parameters:deleteImage")})})})]})]})},PLe);SY.displayName="HoverableImage";const Jb=320,KD=40,TLe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},XD=400;function xY(){const e=Oe(),{t}=Ue(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,areMoreImagesAvailable:b,galleryWidth:S,isLightboxOpen:_,isStaging:E,shouldEnableResize:k,shouldUseSingleGalleryColumn:T}=he(zEe),{galleryMinWidth:A,galleryMaxWidth:M}=_?{galleryMinWidth:XD,galleryMaxWidth:XD}:TLe[d],[R,D]=w.useState(S>=Jb),[j,z]=w.useState(!1),[H,K]=w.useState(0),te=w.useRef(null),G=w.useRef(null),$=w.useRef(null);w.useEffect(()=>{S>=Jb&&D(!1)},[S]);const W=()=>{e(ewe(!o)),e(vi(!0))},X=()=>{a?U():Z()},Z=()=>{e(Fd(!0)),o&&e(vi(!0))},U=w.useCallback(()=>{e(Fd(!1)),e(hU(!1)),e(twe(G.current?G.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),Q=()=>{e(F8(r))},re=ye=>{e(ov(ye))},fe=()=>{m||($.current=window.setTimeout(()=>U(),500))},Ee=()=>{$.current&&window.clearTimeout($.current)};et("g",()=>{X()},[a,o]),et("left",()=>{e(dP())},{enabled:!E||d!=="unifiedCanvas"},[E]),et("right",()=>{e(cP())},{enabled:!E||d!=="unifiedCanvas"},[E]),et("shift+g",()=>{W()},[o]),et("esc",()=>{e(Fd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const be=32;return et("shift+up",()=>{if(l<256){const ye=ke.clamp(l+be,32,256);e(ov(ye))}},[l]),et("shift+down",()=>{if(l>32){const ye=ke.clamp(l-be,32,256);e(ov(ye))}},[l]),w.useEffect(()=>{G.current&&(G.current.scrollTop=s)},[s,a]),w.useEffect(()=>{function ye(Fe){!o&&te.current&&!te.current.contains(Fe.target)&&U()}return document.addEventListener("mousedown",ye),()=>{document.removeEventListener("mousedown",ye)}},[U,o]),y.jsx(Vq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:y.jsxs("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Ee,onMouseOver:o?void 0:Ee,children:[y.jsxs(jq,{minWidth:A,maxWidth:o?M:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:k},size:{width:S,height:o?"100%":"100vh"},onResizeStart:(ye,Fe,Me)=>{K(Me.clientHeight),Me.style.height=`${Me.clientHeight}px`,o&&(Me.style.position="fixed",Me.style.right="1rem",z(!0))},onResizeStop:(ye,Fe,Me,rt)=>{const Ve=o?ke.clamp(Number(S)+rt.width,A,Number(M)):Number(S)+rt.width;e(iwe(Ve)),Me.removeAttribute("data-resize-alert"),o&&(Me.style.position="relative",Me.style.removeProperty("right"),Me.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(ye,Fe,Me,rt)=>{const Ve=ke.clamp(Number(S)+rt.width,A,Number(o?M:.95*window.innerWidth));Ve>=Jb&&!R?D(!0):VeVe-KD&&e(ov(Ve-KD)),o&&(Ve>=M?Me.setAttribute("data-resize-alert","true"):Me.removeAttribute("data-resize-alert")),Me.style.height=`${H}px`},children:[y.jsxs("div",{className:"image-gallery-header",children:[y.jsx(oo,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:R?y.jsxs(y.Fragment,{children:[y.jsx(nr,{size:"sm","data-selected":r==="result",onClick:()=>e(Lb("result")),children:t("gallery:generations")}),y.jsx(nr,{size:"sm","data-selected":r==="user",onClick:()=>e(Lb("user")),children:t("gallery:uploads")})]}):y.jsxs(y.Fragment,{children:[y.jsx(Je,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:y.jsx(EEe,{}),onClick:()=>e(Lb("result"))}),y.jsx(Je,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:y.jsx(FEe,{}),onClick:()=>e(Lb("user"))})]})}),y.jsxs("div",{className:"image-gallery-header-right-icons",children:[y.jsx(Js,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:y.jsx(Je,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:y.jsx(jP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:y.jsxs("div",{className:"image-gallery-settings-popover",children:[y.jsxs("div",{children:[y.jsx(so,{value:l,onChange:re,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),y.jsx(Je,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(ov(64)),icon:y.jsx(Yx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),y.jsx("div",{children:y.jsx(er,{label:t("gallery:maintainAspectRatio"),isChecked:h==="contain",onChange:()=>e(nwe(h==="contain"?"cover":"contain"))})}),y.jsx("div",{children:y.jsx(er,{label:t("gallery:autoSwitchNewImages"),isChecked:v,onChange:ye=>e(rwe(ye.target.checked))})}),y.jsx("div",{children:y.jsx(er,{label:t("gallery:singleColumnLayout"),isChecked:T,onChange:ye=>e(owe(ye.target.checked))})})]})}),y.jsx(Je,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:W,icon:o?y.jsx(Bq,{}):y.jsx($q,{})})]})]}),y.jsx("div",{className:"image-gallery-container",ref:G,children:n.length||b?y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(ye=>{const{uuid:Fe}=ye,Me=i===Fe;return y.jsx(SY,{image:ye,isSelected:Me},Fe)})}),y.jsx(ls,{onClick:Q,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):y.jsxs("div",{className:"image-gallery-container-placeholder",children:[y.jsx(Fq,{}),y.jsx("p",{children:t("gallery:noImagesInGallery")})]})})]}),j&&y.jsx("div",{style:{width:`${S}px`,height:"100%"}})]})})}/*! ***************************************************************************** +}`;var qt=hL(function(){return on(V,St+"return "+Re).apply(n,J)});if(qt.source=Re,Bw(qt))throw qt;return qt}function LJ(c){return An(c).toLowerCase()}function AJ(c){return An(c).toUpperCase()}function OJ(c,g,C){if(c=An(c),c&&(C||g===n))return fo(c);if(!c||!(g=go(g)))return c;var O=Xi(c),B=Xi(g),V=da(O,B),J=xs(O,B)+1;return Ts(O,V,J).join("")}function MJ(c,g,C){if(c=An(c),c&&(C||g===n))return c.slice(0,i1(c)+1);if(!c||!(g=go(g)))return c;var O=Xi(c),B=xs(O,Xi(g))+1;return Ts(O,0,B).join("")}function IJ(c,g,C){if(c=An(c),c&&(C||g===n))return c.replace(xc,"");if(!c||!(g=go(g)))return c;var O=Xi(c),B=da(O,Xi(g));return Ts(O,B).join("")}function RJ(c,g){var C=H,O=K;if(Cr(g)){var B="separator"in g?g.separator:B;C="length"in g?Vt(g.length):C,O="omission"in g?go(g.omission):O}c=An(c);var V=c.length;if(Eu(c)){var J=Xi(c);V=J.length}if(C>=V)return c;var ne=C-Va(O);if(ne<1)return O;var ce=J?Ts(J,0,ne).join(""):c.slice(0,ne);if(B===n)return ce+O;if(J&&(ne+=ce.length-ne),Fw(B)){if(c.slice(ne).search(B)){var _e,Pe=ce;for(B.global||(B=Bf(B.source,An(vs.exec(B))+"g")),B.lastIndex=0;_e=B.exec(Pe);)var Re=_e.index;ce=ce.slice(0,Re===n?ne:Re)}}else if(c.indexOf(go(B),ne)!=ne){var nt=ce.lastIndexOf(B);nt>-1&&(ce=ce.slice(0,nt))}return ce+O}function DJ(c){return c=An(c),c&&N0.test(c)?c.replace(Mi,s3):c}var NJ=Tl(function(c,g,C){return c+(C?" ":"")+g.toUpperCase()}),Hw=xg("toUpperCase");function fL(c,g,C){return c=An(c),g=C?n:g,g===n?Vp(c)?jf(c):t1(c):c.match(g)||[]}var hL=Ot(function(c,g){try{return Ri(c,n,g)}catch(C){return Bw(C)?C:new It(C)}}),jJ=vr(function(c,g){return Xn(g,function(C){C=Ll(C),ga(c,C,Nw(c[C],c))}),c});function BJ(c){var g=c==null?0:c.length,C=Ie();return c=g?Un(c,function(O){if(typeof O[1]!="function")throw new Di(a);return[C(O[0]),O[1]]}):[],Ot(function(O){for(var B=-1;++BU)return[];var C=fe,O=fi(c,fe);g=Ie(g),c-=fe;for(var B=Rf(O,g);++C0||g<0)?new Qt(C):(c<0?C=C.takeRight(-c):c&&(C=C.drop(c)),g!==n&&(g=Vt(g),C=g<0?C.dropRight(-g):C.take(g-c)),C)},Qt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Qt.prototype.toArray=function(){return this.take(fe)},ya(Qt.prototype,function(c,g){var C=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),B=$[O?"take"+(g=="last"?"Right":""):g],V=O||/^find/.test(g);B&&($.prototype[g]=function(){var J=this.__wrapped__,ne=O?[1]:arguments,ce=J instanceof Qt,_e=ne[0],Pe=ce||$t(J),Re=function(Jt){var an=B.apply($,Ha([Jt],ne));return O&&nt?an[0]:an};Pe&&C&&typeof _e=="function"&&_e.length!=1&&(ce=Pe=!1);var nt=this.__chain__,St=!!this.__actions__.length,Pt=V&&!nt,qt=ce&&!St;if(!V&&Pe){J=qt?J:new Qt(this);var Tt=c.apply(J,ne);return Tt.__actions__.push({func:M3,args:[Re],thisArg:n}),new ho(Tt,nt)}return Pt&&qt?c.apply(this,ne):(Tt=this.thru(Re),Pt?O?Tt.value()[0]:Tt.value():Tt)})}),Xn(["pop","push","shift","sort","splice","unshift"],function(c){var g=Dc[c],C=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",O=/^(?:pop|shift)$/.test(c);$.prototype[c]=function(){var B=arguments;if(O&&!this.__chain__){var V=this.value();return g.apply($t(V)?V:[],B)}return this[C](function(J){return g.apply($t(J)?J:[],B)})}}),ya(Qt.prototype,function(c,g){var C=$[g];if(C){var O=C.name+"";cn.call(Cs,O)||(Cs[O]=[]),Cs[O].push({name:g,func:C})}}),Cs[nh(n,E).name]=[{name:"wrapper",func:n}],Qt.prototype.clone=Zi,Qt.prototype.reverse=ji,Qt.prototype.value=m3,$.prototype.at=fZ,$.prototype.chain=hZ,$.prototype.commit=pZ,$.prototype.next=gZ,$.prototype.plant=vZ,$.prototype.reverse=yZ,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=bZ,$.prototype.first=$.prototype.head,$c&&($.prototype[$c]=mZ),$},Wa=Bo();Zt?((Zt.exports=Wa)._=Wa,Nt._=Wa):kt._=Wa}).call(_o)})(bxe,ke);const Rg=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Dg=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},Sxe=.999,xxe=.1,wxe=20,ov=.95,HI=30,h8=10,VI=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),lh=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Yl(s/o,64)):o<1&&(r.height=s,r.width=Yl(s*o,64)),a=r.width*r.height;return r},Cxe=e=>({width:Yl(e.width,64),height:Yl(e.height,64)}),qW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],_xe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],lP=e=>e.kind==="line"&&e.layer==="mask",kxe=e=>e.kind==="line"&&e.layer==="base",Y5=e=>e.kind==="image"&&e.layer==="base",Exe=e=>e.kind==="fillRect"&&e.layer==="base",Pxe=e=>e.kind==="eraseRect"&&e.layer==="base",Txe=e=>e.kind==="line",Lv={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},Lxe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:Lv,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},YW=pp({name:"canvas",initialState:Lxe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!lP(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Ld(ke.clamp(n.width,64,512),64),height:Ld(ke.clamp(n.height,64,512),64)},o={x:Yl(n.width/2-i.width/2,64),y:Yl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=lh(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState={...Lv,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Dg(r.width,r.height,n.width,n.height,ov),s=Rg(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=Cxe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=lh(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=VI(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...Lv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(Txe);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(ke.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState=Lv,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(Y5),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const d=Dg(i.width,i.height,512,512,ov),h=Rg(i.width,i.height,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=lh(m);e.scaledBoundingBoxDimensions=y}return}const{width:o,height:a}=r,l=Dg(t,n,o,a,.95),u=Rg(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=VI(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(Y5)){const i=Dg(r.width,r.height,512,512,ov),o=Rg(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=lh(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const d=r?1:Dg(i,o,l,u,ov),h=Rg(i,o,a,s,l,u,d);e.stageScale=d,e.stageCoordinates=h}else{const d=Dg(i,o,512,512,ov),h=Rg(i,o,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=lh(m);e.scaledBoundingBoxDimensions=y}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...Lv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Ld(ke.clamp(o,64,512),64),height:Ld(ke.clamp(a,64,512),64)},l={x:Yl(o/2-s.width/2,64),y:Yl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=lh(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=lh(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:KW,addFillRect:XW,addImageToStagingArea:Axe,addLine:Oxe,addPointToCurrentLine:ZW,clearCanvasHistory:QW,clearMask:uP,commitColorPickerColor:Mxe,commitStagingAreaImage:Ixe,discardStagedImages:Rxe,fitBoundingBoxToStage:vze,mouseLeftCanvas:Dxe,nextStagingAreaImage:Nxe,prevStagingAreaImage:jxe,redo:Bxe,resetCanvas:cP,resetCanvasInteractionState:Fxe,resetCanvasView:JW,resizeAndScaleCanvas:Bx,resizeCanvas:$xe,setBoundingBoxCoordinates:CC,setBoundingBoxDimensions:Av,setBoundingBoxPreviewFill:yze,setBoundingBoxScaleMethod:zxe,setBrushColor:$m,setBrushSize:zm,setCanvasContainerDimensions:Hxe,setColorPickerColor:Vxe,setCursorPosition:Wxe,setDoesCanvasNeedScaling:vi,setInitialCanvasImage:Fx,setIsDrawing:eU,setIsMaskEnabled:Fy,setIsMouseOverBoundingBox:Pb,setIsMoveBoundingBoxKeyHeld:bze,setIsMoveStageKeyHeld:Sze,setIsMovingBoundingBox:_C,setIsMovingStage:K5,setIsTransformingBoundingBox:kC,setLayer:X5,setMaskColor:tU,setMergedCanvas:Uxe,setShouldAutoSave:nU,setShouldCropToBoundingBoxOnSave:rU,setShouldDarkenOutsideBoundingBox:iU,setShouldLockBoundingBox:xze,setShouldPreserveMaskedArea:oU,setShouldShowBoundingBox:Gxe,setShouldShowBrush:wze,setShouldShowBrushPreview:Cze,setShouldShowCanvasDebugInfo:aU,setShouldShowCheckboardTransparency:_ze,setShouldShowGrid:sU,setShouldShowIntermediates:lU,setShouldShowStagingImage:qxe,setShouldShowStagingOutline:WI,setShouldSnapToGrid:Z5,setStageCoordinates:uU,setStageScale:Yxe,setTool:ru,toggleShouldLockBoundingBox:kze,toggleTool:Eze,undo:Kxe,setScaledBoundingBoxDimensions:Tb,setShouldRestrictStrokesToBox:cU}=YW.actions,Xxe=YW.reducer,Zxe={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},dU=pp({name:"gallery",initialState:Zxe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=ke.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:dm,clearIntermediateImage:EC,removeImage:fU,setCurrentImage:UI,addGalleryImages:Qxe,setIntermediateImage:Jxe,selectNextImage:dP,selectPrevImage:fP,setShouldPinGallery:ewe,setShouldShowGallery:zd,setGalleryScrollPosition:twe,setGalleryImageMinimumWidth:av,setGalleryImageObjectFit:nwe,setShouldHoldGalleryOpen:hU,setShouldAutoSwitchToNewImages:rwe,setCurrentCategory:Lb,setGalleryWidth:iwe,setShouldUseSingleGalleryColumn:owe}=dU.actions,awe=dU.reducer,swe={isLightboxOpen:!1},lwe=swe,pU=pp({name:"lightbox",initialState:lwe,reducers:{setIsLightboxOpen:(e,t)=>{e.isLightboxOpen=t.payload}}}),{setIsLightboxOpen:Hm}=pU.actions,uwe=pU.reducer,l2=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" ");function hP(e){let t=l2(e),n=null;const r=new RegExp(/\[([^\][]*)]/,"gi"),i=[...t.matchAll(r)].map(o=>o[1]);return i.length&&(n=i.join(" "),i.forEach(o=>{t=t.replace(`[${o}]`,"").replaceAll("[]","").trim()})),[t,n]}const cwe=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return pP(r)?r:!1},pP=e=>Boolean(typeof e=="string"?cwe(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),Q5=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),dwe=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),gU={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512},fwe=gU,mU=pp({name:"generation",initialState:fwe,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=l2(n)},setNegativePrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.negativePrompt=n:e.negativePrompt=l2(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:d,hires_fix:h,width:m,height:y}=t.payload.image;o&&o.length>0?(e.seedWeights=Q5(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=l2(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,typeof u>"u"?e.perlin=0:e.perlin=u,typeof d=="boolean"&&(e.seamless=d),m&&(e.width=m),y&&(e.height=y)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:d,seamless:h,hires_fix:m,width:y,height:b,strength:x,fit:k,init_image_path:E,mask_image_path:_}=t.payload.image;if(n==="img2img"&&(E&&(e.initialImage=E),_&&(e.maskPath=_),x&&(e.img2imgStrength=x),typeof k=="boolean"&&(e.shouldFitToWidthHeight=k)),a&&a.length>0?(e.seedWeights=Q5(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i){const[P,A]=hP(i);P&&(e.prompt=P),A?e.negativePrompt=A:e.negativePrompt=""}r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),typeof u>"u"?e.threshold=0:e.threshold=u,typeof d>"u"?e.perlin=0:e.perlin=d,typeof h=="boolean"&&(e.seamless=h),y&&(e.width=y),b&&(e.height=b)},resetParametersState:e=>({...e,...gU}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload}}}),{clearInitialImage:vU,resetParametersState:Pze,resetSeed:Tze,setAllImageToImageParameters:hwe,setAllParameters:yU,setAllTextToImageParameters:Lze,setCfgScale:bU,setHeight:SU,setImg2imgStrength:p8,setInfillMethod:xU,setInitialImage:T0,setIterations:pwe,setMaskPath:wU,setParameter:Aze,setPerlin:CU,setPrompt:$x,setNegativePrompt:ny,setSampler:_U,setSeamBlur:GI,setSeamless:kU,setSeamSize:qI,setSeamSteps:YI,setSeamStrength:KI,setSeed:$y,setSeedWeights:EU,setShouldFitToWidthHeight:PU,setShouldGenerateVariations:gwe,setShouldRandomizeSeed:mwe,setSteps:TU,setThreshold:LU,setTileSize:XI,setVariationAmount:vwe,setWidth:AU}=mU.actions,ywe=mU.reducer,OU={codeformerFidelity:.75,facetoolStrength:.8,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingDenoising:.75,upscalingStrength:.75},bwe=OU,MU=pp({name:"postprocessing",initialState:bwe,reducers:{setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingDenoising:(e,t)=>{e.upscalingDenoising=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setHiresStrength:(e,t)=>{e.hiresStrength=t.payload},resetPostprocessingState:e=>({...e,...OU}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload}}}),{resetPostprocessingState:Oze,setCodeformerFidelity:IU,setFacetoolStrength:g8,setFacetoolType:j4,setHiresFix:gP,setHiresStrength:ZI,setShouldLoopback:Swe,setShouldRunESRGAN:xwe,setShouldRunFacetool:wwe,setUpscalingLevel:RU,setUpscalingDenoising:m8,setUpscalingStrength:v8}=MU.actions,Cwe=MU.reducer;function Qs(e){return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qs(e)}function gu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _we(e,t){if(Qs(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qs(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DU(e){var t=_we(e,"string");return Qs(t)==="symbol"?t:String(t)}function QI(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};gu(this,e),this.init(t,n)}return mu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||Awe,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function rR(e,t,n){var r=mP(e,t,Object),i=r.obj,o=r.k;i[o]=n}function Iwe(e,t,n,r){var i=mP(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function J5(e,t){var n=mP(e,t),r=n.obj,i=n.k;if(r)return r[i]}function iR(e,t,n){var r=J5(e,n);return r!==void 0?r:J5(t,n)}function NU(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):NU(e[r],t[r],n):e[r]=t[r]);return e}function Ng(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Rwe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Dwe(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return Rwe[t]}):e}var Hx=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Nwe=[" ",",","?","!",";"];function jwe(e,t,n){t=t||"",n=n||"";var r=Nwe.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function oR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ab(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jU(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?jU(l,u,n):void 0}i=i[r[o]]}return i}}var $we=function(e){zx(n,e);var t=Bwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return gu(this,n),i=t.call(this),Hx&&tf.call(Hd(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return mu(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[i,o];a&&typeof a!="string"&&(d=d.concat(a)),a&&typeof a=="string"&&(d=d.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(d=i.split("."));var h=J5(this.data,d);return h||!u||typeof a!="string"?h:jU(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var d=[i,o];a&&(d=d.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(d=i.split("."),s=o,o=d[1]),this.addNamespaces(o),rR(this.data,d,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[i,o];i.indexOf(".")>-1&&(d=i.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);var h=J5(this.data,d)||{};s?NU(h,a,l):h=Ab(Ab({},h),a),rR(this.data,d,h),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Ab(Ab({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(tf),BU={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function aR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var sR={},lR=function(e){zx(n,e);var t=zwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gu(this,n),i=t.call(this),Hx&&tf.call(Hd(i)),Mwe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Hd(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Kl.create("translator"),i}return mu(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!jwe(i,a,s);if(u&&!d){var h=i.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:i,namespaces:l};var m=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),i=m.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(Qs(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,d=this.extractFromKey(i[i.length-1],o),h=d.key,m=d.namespaces,y=m[m.length-1],b=o.lng||this.language,x=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(x){var k=o.nsSeparator||this.options.nsSeparator;return l?(E.res="".concat(y).concat(k).concat(h),E):"".concat(y).concat(k).concat(h)}return l?(E.res=h,E):h}var E=this.resolve(i,o),_=E&&E.res,P=E&&E.usedKey||h,A=E&&E.exactUsedKey||h,M=Object.prototype.toString.apply(_),R=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,z=typeof _!="string"&&typeof _!="boolean"&&typeof _!="number";if(j&&_&&z&&R.indexOf(M)<0&&!(typeof D=="string"&&M==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var H=this.options.returnedObjectHandler?this.options.returnedObjectHandler(P,_,xo(xo({},o),{},{ns:m})):"key '".concat(h," (").concat(this.language,")' returned an object instead of string.");return l?(E.res=H,E):H}if(u){var K=M==="[object Array]",te=K?[]:{},G=K?A:P;for(var F in _)if(Object.prototype.hasOwnProperty.call(_,F)){var W="".concat(G).concat(u).concat(F);te[F]=this.translate(W,xo(xo({},o),{joinArrays:!1,ns:m})),te[F]===W&&(te[F]=_[F])}_=te}}else if(j&&typeof D=="string"&&M==="[object Array]")_=_.join(D),_&&(_=this.extendTranslation(_,i,o,a));else{var X=!1,Z=!1,U=o.count!==void 0&&typeof o.count!="string",Q=n.hasDefaultValue(o),re=U?this.pluralResolver.getSuffix(b,o.count,o):"",fe=o["defaultValue".concat(re)]||o.defaultValue;!this.isValidLookup(_)&&Q&&(X=!0,_=fe),this.isValidLookup(_)||(Z=!0,_=h);var Ee=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,be=Ee&&Z?void 0:_,ye=Q&&fe!==_&&this.options.updateMissing;if(Z||X||ye){if(this.logger.log(ye?"updateKey":"missingKey",b,y,h,ye?fe:_),u){var ze=this.resolve(h,xo(xo({},o),{},{keySeparator:!1}));ze&&ze.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Me=[],rt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&rt&&rt[0])for(var We=0;We1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,d,h;return typeof i=="string"&&(i=[i]),i.forEach(function(m){if(!o.isValidLookup(s)){var y=o.extractFromKey(m,a),b=y.key;l=b;var x=y.namespaces;o.options.fallbackNS&&(x=x.concat(o.options.fallbackNS));var k=a.count!==void 0&&typeof a.count!="string",E=k&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),_=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",P=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);x.forEach(function(A){o.isValidLookup(s)||(h=A,!sR["".concat(P[0],"-").concat(A)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(h)&&(sR["".concat(P[0],"-").concat(A)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(P.join(", "),`" won't get resolved as namespace "`).concat(h,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),P.forEach(function(M){if(!o.isValidLookup(s)){d=M;var R=[b];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(R,b,M,A,a);else{var D;k&&(D=o.pluralResolver.getSuffix(M,a.count,a));var j="".concat(o.options.pluralSeparator,"zero");if(k&&(R.push(b+D),E&&R.push(b+j)),_){var z="".concat(b).concat(o.options.contextSeparator).concat(a.context);R.push(z),k&&(R.push(z+D),E&&R.push(z+j))}}for(var H;H=R.pop();)o.isValidLookup(s)||(u=H,s=o.getResource(M,A,H,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:d,usedNS:h}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(tf);function PC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var uR=function(){function e(t){gu(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kl.create("languageUtils")}return mu(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=PC(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=PC(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=PC(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){u&&(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),Vwe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Wwe={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Uwe=["v1","v2","v3"],cR={zero:0,one:1,two:2,few:3,many:4,other:5};function Gwe(){var e={};return Vwe.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Wwe[t.fc]}})}),e}var qwe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gu(this,e),this.languageUtils=t,this.options=n,this.logger=Kl.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Gwe()}return mu(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return cR[a]-cR[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!Uwe.includes(this.options.compatibilityJSON)}}]),e}();function dR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function js(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};gu(this,e),this.logger=Kl.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return mu(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:Dwe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ng(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ng(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ng(r.nestingPrefix):r.nestingPrefixEscaped||Ng("$t("),this.nestingSuffix=r.nestingSuffix?Ng(r.nestingSuffix):r.nestingSuffixEscaped||Ng(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(k){return k.replace(/\$/g,"$$$$")}var m=function(E){if(E.indexOf(a.formatSeparator)<0){var _=iR(r,d,E);return a.alwaysFormat?a.format(_,void 0,i,js(js(js({},o),r),{},{interpolationkey:E})):_}var P=E.split(a.formatSeparator),A=P.shift().trim(),M=P.join(a.formatSeparator).trim();return a.format(iR(r,d,A),M,i,js(js(js({},o),r),{},{interpolationkey:A}))};this.resetRegExp();var y=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,x=[{regex:this.regexpUnescape,safeValue:function(E){return h(E)}},{regex:this.regexp,safeValue:function(E){return a.escapeValue?h(a.escape(E)):h(E)}}];return x.forEach(function(k){for(u=0;s=k.regex.exec(n);){var E=s[1].trim();if(l=m(E),l===void 0)if(typeof y=="function"){var _=y(n,s,o);l=typeof _=="string"?_:""}else if(o&&o.hasOwnProperty(E))l="";else if(b){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(E," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=nR(l));var P=k.safeValue(l);if(n=n.replace(s[0],P),b?(k.regex.lastIndex+=l.length,k.regex.lastIndex-=s[0].length):k.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(y,b){var x=this.nestingOptionsSeparator;if(y.indexOf(x)<0)return y;var k=y.split(new RegExp("".concat(x,"[ ]*{"))),E="{".concat(k[1]);y=k[0],E=this.interpolate(E,l);var _=E.match(/'/g),P=E.match(/"/g);(_&&_.length%2===0&&!P||P.length%2!==0)&&(E=E.replace(/'/g,'"'));try{l=JSON.parse(E),b&&(l=js(js({},b),l))}catch(A){return this.logger.warn("failed parsing options string in nesting for key ".concat(y),A),"".concat(y).concat(x).concat(E)}return delete l.defaultValue,y}for(;a=this.nestingRegexp.exec(n);){var d=[];l=js({},o),l.applyPostProcessor=!1,delete l.defaultValue;var h=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var m=a[1].split(this.formatSeparator).map(function(y){return y.trim()});a[1]=m.shift(),d=m,h=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=nR(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),h&&(s=d.reduce(function(y,b){return i.format(y,b,o.lng,js(js({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cd(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(a){var s=a.split(":"),l=Lwe(s),u=l[0],d=l.slice(1),h=d.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=h),h==="false"&&(n[u.trim()]=!1),h==="true"&&(n[u.trim()]=!0),isNaN(h)||(n[u.trim()]=parseInt(h,10))}})}}return{formatName:t,formatOptions:n}}function jg(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var Xwe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gu(this,e),this.logger=Kl.create("formatter"),this.options=t,this.formats={number:jg(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:jg(function(n,r){var i=new Intl.NumberFormat(n,cd(cd({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:jg(function(n,r){var i=new Intl.DateTimeFormat(n,cd({},r));return function(o){return i.format(o)}}),relativetime:jg(function(n,r){var i=new Intl.RelativeTimeFormat(n,cd({},r));return function(o){return i.format(o,r.range||"day")}}),list:jg(function(n,r){var i=new Intl.ListFormat(n,cd({},r));return function(o){return i.format(o)}})},this.init(t)}return mu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=jg(r)}},{key:"format",value:function(n,r,i,o){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,d){var h=Kwe(d),m=h.formatName,y=h.formatOptions;if(a.formats[m]){var b=u;try{var x=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},k=x.locale||x.lng||o.locale||o.lng||i;b=a.formats[m](u,k,cd(cd(cd({},y),o),x))}catch(E){a.logger.warn(E)}return b}else a.logger.warn("there was no format function for ".concat(m));return u},n);return l}}]),e}();function hR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pR(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jwe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var e6e=function(e){zx(n,e);var t=Zwe(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return gu(this,n),a=t.call(this),Hx&&tf.call(Hd(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Kl.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return mu(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},d={},h={},m={};return i.forEach(function(y){var b=!0;o.forEach(function(x){var k="".concat(y,"|").concat(x);!a.reload&&l.store.hasResourceBundle(y,x)?l.state[k]=2:l.state[k]<0||(l.state[k]===1?d[k]===void 0&&(d[k]=!0):(l.state[k]=1,b=!1,d[k]===void 0&&(d[k]=!0),u[k]===void 0&&(u[k]=!0),m[x]===void 0&&(m[x]=!0)))}),b||(h[y]=!0)}),(Object.keys(u).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(d),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var d={};this.queue.forEach(function(h){Iwe(h.loaded,[l],u),Jwe(h,i),o&&h.errors.push(o),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(function(m){d[m]||(d[m]={});var y=h.loaded[m];y.length&&y.forEach(function(b){d[m][b]===void 0&&(d[m][b]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(h){return!h.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!i.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:d});return}this.readingCalls++;var h=function(x,k){if(s.readingCalls--,s.waitingReads.length>0){var E=s.waitingReads.shift();s.read(E.lng,E.ns,E.fcName,E.tried,E.wait,E.callback)}if(x&&k&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(d){a.loadOne(d)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(d,h){d&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),d),!d&&h&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),h),o.loaded(i,d,h)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var h=pR(pR({},u),{},{isUpdate:l}),m=this.backend.create.bind(this.backend);if(m.length<6)try{var y;m.length===5?y=m(i,o,a,s,h):y=m(i,o,a,s),y&&typeof y.then=="function"?y.then(function(b){return d(null,b)}).catch(d):d(null,y)}catch(b){d(b)}else m(i,o,a,s,d,h)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(tf);function gR(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Qs(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Qs(t[2])==="object"||Qs(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function mR(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function vR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rl(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ob(){}function r6e(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var eS=function(e){zx(n,e);var t=t6e(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(gu(this,n),r=t.call(this),Hx&&tf.call(Hd(r)),r.options=mR(i),r.services={},r.logger=Kl,r.modules={external:[]},r6e(Hd(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),zy(r,Hd(r));setTimeout(function(){r.init(i,o)},0)}return r}return mu(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=gR();this.options=Rl(Rl(Rl({},s),this.options),mR(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Rl(Rl({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(E){return E?typeof E=="function"?new E:E:null}if(!this.options.isClone){this.modules.logger?Kl.init(l(this.modules.logger),this.options):Kl.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Xwe);var d=new uR(this.options);this.store=new $we(this.options.resources,this.options);var h=this.services;h.logger=Kl,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new qwe(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=l(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Ywe(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new e6e(l(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(E){for(var _=arguments.length,P=new Array(_>1?_-1:0),A=1;A<_;A++)P[A-1]=arguments[A];i.emit.apply(i,[E].concat(P))}),this.modules.languageDetector&&(h.languageDetector=l(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=l(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new lR(this.services,this.options),this.translator.on("*",function(E){for(var _=arguments.length,P=new Array(_>1?_-1:0),A=1;A<_;A++)P[A-1]=arguments[A];i.emit.apply(i,[E].concat(P))}),this.modules.external.forEach(function(E){E.init&&E.init(i)})}if(this.format=this.options.interpolation.format,a||(a=Ob),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var y=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];y.forEach(function(E){i[E]=function(){var _;return(_=i.store)[E].apply(_,arguments)}});var b=["addResource","addResources","addResourceBundle","removeResourceBundle"];b.forEach(function(E){i[E]=function(){var _;return(_=i.store)[E].apply(_,arguments),i}});var x=sv(),k=function(){var _=function(A,M){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),x.resolve(M),a(A,M)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return _(null,i.t.bind(i));i.changeLanguage(i.options.lng,_)};return this.options.resources||!this.options.initImmediate?k():setTimeout(k,0),x}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ob,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],d=function(y){if(y){var b=o.services.languageUtils.toResolveHierarchy(y);b.forEach(function(x){u.indexOf(x)<0&&u.push(x)})}};if(l)d(l);else{var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.forEach(function(m){return d(m)})}this.options.preload&&this.options.preload.forEach(function(m){return d(m)}),this.services.backendConnector.load(u,this.options.ns,function(m){!m&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=sv();return i||(i=this.languages),o||(o=this.options.ns),a||(a=Ob),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&BU.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=sv();this.emit("languageChanging",i);var l=function(m){a.language=m,a.languages=a.services.languageUtils.toResolveHierarchy(m),a.resolvedLanguage=void 0,a.setResolvedLanguage(m)},u=function(m,y){y?(l(y),a.translator.changeLanguage(y),a.isLanguageChangingTo=void 0,a.emit("languageChanged",y),a.logger.log("languageChanged",y)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(m,function(){return a.t.apply(a,arguments)})},d=function(m){!i&&!m&&a.services.languageDetector&&(m=[]);var y=typeof m=="string"?m:a.services.languageUtils.getBestMatchFromCodes(m);y&&(a.language||l(y),a.translator.language||a.translator.changeLanguage(y),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(y)),a.loadResources(y,function(b){u(b,y)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(d,h){var m;if(Qs(h)!=="object"){for(var y=arguments.length,b=new Array(y>2?y-2:0),x=2;x1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var d=function(y,b){var x=o.services.backendConnector.state["".concat(y,"|").concat(b)];return x===-1||x===2};if(a.precheck){var h=a.precheck(this,d);if(h!==void 0)return h}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,i)&&(!l||d(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=sv();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=sv();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new uR(gR());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ob,s=Rl(Rl(Rl({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(d){l[d]=i[d]}),l.services=Rl({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new lR(l.services,l.options),l.translator.on("*",function(d){for(var h=arguments.length,m=new Array(h>1?h-1:0),y=1;y0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new eS(e,t)});var zt=eS.createInstance();zt.createInstance=eS.createInstance;zt.createInstance;zt.dir;zt.init;zt.loadResources;zt.reloadResources;zt.use;zt.changeLanguage;zt.getFixedT;zt.t;zt.exists;zt.setDefaultNamespace;zt.hasLoadedNamespace;zt.loadNamespaces;zt.loadLanguages;function i6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ry(e){return ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ry(e)}function o6e(e,t){if(ry(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ry(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a6e(e){var t=o6e(e,"string");return ry(t)==="symbol"?t:String(t)}function yR(e,t){for(var n=0;n0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!bR.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!bR.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},SR={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=d6e(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},lv=null,xR=function(){if(lv!==null)return lv;try{lv=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{lv=!1}return lv},p6e={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&xR()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&xR()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},uv=null,wR=function(){if(uv!==null)return uv;try{uv=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{uv=!1}return uv},g6e={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&wR()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&wR()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},m6e={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},v6e={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},y6e={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},b6e={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function S6e(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var $U=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i6e(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return s6e(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=c6e(r,this.options||{},S6e()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(f6e),this.addDetector(h6e),this.addDetector(p6e),this.addDetector(g6e),this.addDetector(m6e),this.addDetector(v6e),this.addDetector(y6e),this.addDetector(b6e)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();$U.type="languageDetector";function b8(e){return b8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b8(e)}var zU=[],x6e=zU.forEach,w6e=zU.slice;function S8(e){return x6e.call(w6e.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function HU(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":b8(XMLHttpRequest))==="object"}function C6e(e){return!!e&&typeof e.then=="function"}function _6e(e){return C6e(e)?e:Promise.resolve(e)}function k6e(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var iy={},E6e={get exports(){return iy},set exports(e){iy=e}},u2={},P6e={get exports(){return u2},set exports(e){u2=e}},CR;function T6e(){return CR||(CR=1,function(e,t){var n=typeof self<"u"?self:_o,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(F){return F&&DataView.prototype.isPrototypeOf(F)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(F){return F&&u.indexOf(Object.prototype.toString.call(F))>-1};function h(F){if(typeof F!="string"&&(F=String(F)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(F))throw new TypeError("Invalid character in header field name");return F.toLowerCase()}function m(F){return typeof F!="string"&&(F=String(F)),F}function y(F){var W={next:function(){var X=F.shift();return{done:X===void 0,value:X}}};return s.iterable&&(W[Symbol.iterator]=function(){return W}),W}function b(F){this.map={},F instanceof b?F.forEach(function(W,X){this.append(X,W)},this):Array.isArray(F)?F.forEach(function(W){this.append(W[0],W[1])},this):F&&Object.getOwnPropertyNames(F).forEach(function(W){this.append(W,F[W])},this)}b.prototype.append=function(F,W){F=h(F),W=m(W);var X=this.map[F];this.map[F]=X?X+", "+W:W},b.prototype.delete=function(F){delete this.map[h(F)]},b.prototype.get=function(F){return F=h(F),this.has(F)?this.map[F]:null},b.prototype.has=function(F){return this.map.hasOwnProperty(h(F))},b.prototype.set=function(F,W){this.map[h(F)]=m(W)},b.prototype.forEach=function(F,W){for(var X in this.map)this.map.hasOwnProperty(X)&&F.call(W,this.map[X],X,this)},b.prototype.keys=function(){var F=[];return this.forEach(function(W,X){F.push(X)}),y(F)},b.prototype.values=function(){var F=[];return this.forEach(function(W){F.push(W)}),y(F)},b.prototype.entries=function(){var F=[];return this.forEach(function(W,X){F.push([X,W])}),y(F)},s.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function x(F){if(F.bodyUsed)return Promise.reject(new TypeError("Already read"));F.bodyUsed=!0}function k(F){return new Promise(function(W,X){F.onload=function(){W(F.result)},F.onerror=function(){X(F.error)}})}function E(F){var W=new FileReader,X=k(W);return W.readAsArrayBuffer(F),X}function _(F){var W=new FileReader,X=k(W);return W.readAsText(F),X}function P(F){for(var W=new Uint8Array(F),X=new Array(W.length),Z=0;Z-1?W:F}function j(F,W){W=W||{};var X=W.body;if(F instanceof j){if(F.bodyUsed)throw new TypeError("Already read");this.url=F.url,this.credentials=F.credentials,W.headers||(this.headers=new b(F.headers)),this.method=F.method,this.mode=F.mode,this.signal=F.signal,!X&&F._bodyInit!=null&&(X=F._bodyInit,F.bodyUsed=!0)}else this.url=String(F);if(this.credentials=W.credentials||this.credentials||"same-origin",(W.headers||!this.headers)&&(this.headers=new b(W.headers)),this.method=D(W.method||this.method||"GET"),this.mode=W.mode||this.mode||null,this.signal=W.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function z(F){var W=new FormData;return F.trim().split("&").forEach(function(X){if(X){var Z=X.split("="),U=Z.shift().replace(/\+/g," "),Q=Z.join("=").replace(/\+/g," ");W.append(decodeURIComponent(U),decodeURIComponent(Q))}}),W}function H(F){var W=new b,X=F.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(Z){var U=Z.split(":"),Q=U.shift().trim();if(Q){var re=U.join(":").trim();W.append(Q,re)}}),W}M.call(j.prototype);function K(F,W){W||(W={}),this.type="default",this.status=W.status===void 0?200:W.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in W?W.statusText:"OK",this.headers=new b(W.headers),this.url=W.url||"",this._initBody(F)}M.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},K.error=function(){var F=new K(null,{status:0,statusText:""});return F.type="error",F};var te=[301,302,303,307,308];K.redirect=function(F,W){if(te.indexOf(W)===-1)throw new RangeError("Invalid status code");return new K(null,{status:W,headers:{location:F}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(W,X){this.message=W,this.name=X;var Z=Error(W);this.stack=Z.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function G(F,W){return new Promise(function(X,Z){var U=new j(F,W);if(U.signal&&U.signal.aborted)return Z(new a.DOMException("Aborted","AbortError"));var Q=new XMLHttpRequest;function re(){Q.abort()}Q.onload=function(){var fe={status:Q.status,statusText:Q.statusText,headers:H(Q.getAllResponseHeaders()||"")};fe.url="responseURL"in Q?Q.responseURL:fe.headers.get("X-Request-URL");var Ee="response"in Q?Q.response:Q.responseText;X(new K(Ee,fe))},Q.onerror=function(){Z(new TypeError("Network request failed"))},Q.ontimeout=function(){Z(new TypeError("Network request failed"))},Q.onabort=function(){Z(new a.DOMException("Aborted","AbortError"))},Q.open(U.method,U.url,!0),U.credentials==="include"?Q.withCredentials=!0:U.credentials==="omit"&&(Q.withCredentials=!1),"responseType"in Q&&s.blob&&(Q.responseType="blob"),U.headers.forEach(function(fe,Ee){Q.setRequestHeader(Ee,fe)}),U.signal&&(U.signal.addEventListener("abort",re),Q.onreadystatechange=function(){Q.readyState===4&&U.signal.removeEventListener("abort",re)}),Q.send(typeof U._bodyInit>"u"?null:U._bodyInit)})}return G.polyfill=!0,o.fetch||(o.fetch=G,o.Headers=b,o.Request=j,o.Response=K),a.Headers=b,a.Request=j,a.Response=K,a.fetch=G,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(P6e,u2)),u2}(function(e,t){var n;if(typeof fetch=="function"&&(typeof _o<"u"&&_o.fetch?n=_o.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof k6e<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||T6e();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(E6e,iy);const VU=iy,_R=dj({__proto__:null,default:VU},[iy]);function tS(e){return tS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tS(e)}var Xu;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Xu=global.fetch:typeof window<"u"&&window.fetch?Xu=window.fetch:Xu=fetch);var oy;HU()&&(typeof global<"u"&&global.XMLHttpRequest?oy=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(oy=window.XMLHttpRequest));var nS;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?nS=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(nS=window.ActiveXObject));!Xu&&_R&&!oy&&!nS&&(Xu=VU||_R);typeof Xu!="function"&&(Xu=void 0);var x8=function(t,n){if(n&&tS(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},kR=function(t,n,r){Xu(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},ER=!1,L6e=function(t,n,r,i){t.queryStringParams&&(n=x8(n,t.queryStringParams));var o=S8({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=S8({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},ER?{}:a);try{kR(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),kR(n,s,i),ER=!0}catch(u){i(u)}}},A6e=function(t,n,r,i){r&&tS(r)==="object"&&(r=x8("",r).slice(1)),t.queryStringParams&&(n=x8(n,t.queryStringParams));try{var o;oy?o=new oy:o=new nS("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},O6e=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Xu&&n.indexOf("file:")!==0)return L6e(t,n,r,i);if(HU()||typeof ActiveXObject=="function")return A6e(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function ay(e){return ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ay(e)}function M6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PR(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};M6e(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return I6e(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=S8(i,this.options||{},N6e()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=_6e(l),l.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(d,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,d;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch{d="failed parsing "+n+" to json"}if(d)return r(d,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,d=[],h=[];n.forEach(function(m){var y=s.options.addPath;typeof s.options.addPath=="function"&&(y=s.options.addPath(m,r));var b=s.services.interpolator.interpolate(y,{lng:m,ns:r});s.options.request(s.options,b,l,function(x,k){u+=1,d.push(x),h.push(k),u===n.length&&a&&a(d,h)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(h){var m=o.toResolveHierarchy(h);m.forEach(function(y){l.indexOf(y)<0&&l.push(y)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),l.forEach(function(d){n.allOptions.ns.forEach(function(h){i.read(d,h,"read",null,null,function(m,y){m&&a.warn("loading namespace ".concat(h," for language ").concat(d," failed"),m),!m&&y&&a.log("loaded namespace ".concat(h," for language ").concat(d),y),i.loaded("".concat(d,"|").concat(h),m,y)})})})}}}]),e}();UU.type="backend";function sy(e){return sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sy(e)}function j6e(e,t){if(sy(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sy(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GU(e){var t=j6e(e,"string");return sy(t)==="symbol"?t:String(t)}function qU(e,t,n){return t=GU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B6e(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var d=t.services.backendConnector.state["".concat(l,"|").concat(u)];return d===-1||d===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function $6e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return w8("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):F6e(e,t,n)}var z6e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,H6e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},V6e=function(t){return H6e[t]},W6e=function(t){return t.replace(z6e,V6e)};function AR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OR(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};C8=OR(OR({},C8),e)}function G6e(){return C8}var YU;function q6e(e){YU=e}function Y6e(){return YU}function K6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=w.useContext(Q6e)||{},i=r.i18n,o=r.defaultNS,a=n||i||Y6e();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new J6e),!a){w8("You will need to pass in an i18next instance by using initReactI18next");var s=function(z){return Array.isArray(z)?z[z.length-1]:z},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&w8("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=TC(TC(TC({},G6e()),a.options.react),t),d=u.useSuspense,h=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var y=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(j){return $6e(j,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],h)}var x=w.useState(b),k=iCe(x,2),E=k[0],_=k[1],P=m.join(),A=oCe(P),M=w.useRef(!0);w.useEffect(function(){var j=u.bindI18n,z=u.bindI18nStore;M.current=!0,!y&&!d&&LR(a,m,function(){M.current&&_(b)}),y&&A&&A!==P&&M.current&&_(b);function H(){M.current&&_(b)}return j&&a&&a.on(j,H),z&&a&&a.store.on(z,H),function(){M.current=!1,j&&a&&j.split(" ").forEach(function(K){return a.off(K,H)}),z&&a&&z.split(" ").forEach(function(K){return a.store.off(K,H)})}},[a,P]);var R=w.useRef(!0);w.useEffect(function(){M.current&&!R.current&&_(b),R.current=!1},[a,h]);var D=[E,a,y];if(D.t=E,D.i18n=a,D.ready=y,y||!y&&!d)return D;throw new Promise(function(j){LR(a,m,function(){j()})})}zt.use(UU).use($U).use(Z6e).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","parameters","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const aCe={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:zt.isInitialized?zt.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},KU=pp({name:"system",initialState:aCe,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?zt.t("common:statusConnected"):zt.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=zt.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:sCe,setIsProcessing:ns,addLogEntry:to,setShouldShowLogViewer:LC,setIsConnected:DR,setSocketId:Mze,setShouldConfirmOnDelete:XU,setOpenAccordions:lCe,setSystemStatus:uCe,setCurrentStatus:B4,setSystemConfig:cCe,setShouldDisplayGuides:dCe,processingCanceled:fCe,errorOccurred:NR,errorSeen:ZU,setModelList:Mb,setIsCancelable:fm,modelChangeRequested:hCe,setSaveIntermediatesInterval:pCe,setEnableImageDebugging:gCe,generationRequested:mCe,addToast:Oh,clearToastQueue:vCe,setProcessingIndeterminateTask:yCe,setSearchFolder:QU,setFoundModels:JU,setOpenModel:jR}=KU.actions,bCe=KU.reducer,vP=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],SCe={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,addNewModelUIOption:null},xCe=SCe,eG=pp({name:"ui",initialState:xCe,reducers:{setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=vP.indexOf(t.payload)},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setParametersPanelScrollPosition:(e,t)=>{e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:(e,t)=>{e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:(e,t)=>{e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setAddNewModelUIOption:(e,t)=>{e.addNewModelUIOption=t.payload}}}),{setActiveTab:Yo,setCurrentTheme:wCe,setParametersPanelScrollPosition:CCe,setShouldHoldParametersPanelOpen:_Ce,setShouldPinParametersPanel:kCe,setShouldShowParametersPanel:Zu,setShouldShowDualDisplay:ECe,setShouldShowImageDetails:tG,setShouldUseCanvasBetaLayout:PCe,setShouldShowExistingModelsInSearch:TCe,setAddNewModelUIOption:Wh}=eG.actions,LCe=eG.reducer,cu=Object.create(null);cu.open="0";cu.close="1";cu.ping="2";cu.pong="3";cu.message="4";cu.upgrade="5";cu.noop="6";const F4=Object.create(null);Object.keys(cu).forEach(e=>{F4[cu[e]]=e});const ACe={type:"error",data:"parser error"},OCe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",MCe=typeof ArrayBuffer=="function",ICe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,nG=({type:e,data:t},n,r)=>OCe&&t instanceof Blob?n?r(t):BR(t,r):MCe&&(t instanceof ArrayBuffer||ICe(t))?n?r(t):BR(new Blob([t]),r):r(cu[e]+(t||"")),BR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},FR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ov=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(a&15)<<4|s>>2,d[i++]=(s&3)<<6|l&63;return u},DCe=typeof ArrayBuffer=="function",rG=(e,t)=>{if(typeof e!="string")return{type:"message",data:iG(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:NCe(e.substring(1),t)}:F4[n]?e.length>1?{type:F4[n],data:e.substring(1)}:{type:F4[n]}:ACe},NCe=(e,t)=>{if(DCe){const n=RCe(e);return iG(n,t)}else return{base64:!0,data:e}},iG=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},oG=String.fromCharCode(30),jCe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{nG(o,!1,s=>{r[a]=s,++i===n&&t(r.join(oG))})})},BCe=(e,t)=>{const n=e.split(oG),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function sG(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const $Ce=setTimeout,zCe=clearTimeout;function Vx(e,t){t.useNativeTimers?(e.setTimeoutFn=$Ce.bind(Ad),e.clearTimeoutFn=zCe.bind(Ad)):(e.setTimeoutFn=setTimeout.bind(Ad),e.clearTimeoutFn=clearTimeout.bind(Ad))}const HCe=1.33;function VCe(e){return typeof e=="string"?WCe(e):Math.ceil((e.byteLength||e.size)*HCe)}function WCe(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class UCe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class lG extends si{constructor(t){super(),this.writable=!1,Vx(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new UCe(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=rG(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const uG="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),_8=64,GCe={};let $R=0,Ib=0,zR;function HR(e){let t="";do t=uG[e%_8]+t,e=Math.floor(e/_8);while(e>0);return t}function cG(){const e=HR(+new Date);return e!==zR?($R=0,zR=e):e+"."+HR($R++)}for(;Ib<_8;Ib++)GCe[uG[Ib]]=Ib;function dG(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function qCe(e){let t={},n=e.split("&");for(let r=0,i=n.length;r{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};BCe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,jCe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=cG()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=dG(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new iu(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class iu extends si{constructor(t,n){super(),Vx(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=sG(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new hG(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=iu.requestsCount++,iu.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=KCe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete iu.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}iu.requestsCount=0;iu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",VR);else if(typeof addEventListener=="function"){const e="onpagehide"in Ad?"pagehide":"unload";addEventListener(e,VR,!1)}}function VR(){for(let e in iu.requests)iu.requests.hasOwnProperty(e)&&iu.requests[e].abort()}const pG=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Rb=Ad.WebSocket||Ad.MozWebSocket,WR=!0,QCe="arraybuffer",UR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class JCe extends lG{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=UR?{}:sG(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=WR&&!UR?n?new Rb(t,n):new Rb(t):new Rb(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||QCe,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{WR&&this.ws.send(o)}catch{}i&&pG(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=cG()),this.supportsBinary||(t.b64=1);const i=dG(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Rb}}const e7e={websocket:JCe,polling:ZCe},t7e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n7e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function k8(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=t7e.exec(e||""),o={},a=14;for(;a--;)o[n7e[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=r7e(o,o.path),o.queryKey=i7e(o,o.query),o}function r7e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function i7e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let gG=class Vg extends si{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=k8(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=k8(n.host).host),Vx(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=qCe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=aG,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new e7e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Vg.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Vg.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Vg.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=h=>{const m=new Error("probe error: "+h);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(h){n&&h.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Vg.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Vg.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,mG=Object.prototype.toString,l7e=typeof Blob=="function"||typeof Blob<"u"&&mG.call(Blob)==="[object BlobConstructor]",u7e=typeof File=="function"||typeof File<"u"&&mG.call(File)==="[object FileConstructor]";function yP(e){return a7e&&(e instanceof ArrayBuffer||s7e(e))||l7e&&e instanceof Blob||u7e&&e instanceof File}function $4(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case dn.ACK:case dn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class p7e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=d7e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const g7e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:bP,Encoder:h7e,get PacketType(){return dn},protocol:f7e},Symbol.toStringTag,{value:"Module"}));function zs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const m7e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class vG extends si{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[zs(t,"open",this.onopen.bind(this)),zs(t,"packet",this.onpacket.bind(this)),zs(t,"error",this.onerror.bind(this)),zs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(m7e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:dn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:dn.CONNECT,data:t})}):this.packet({type:dn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case dn.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case dn.EVENT:case dn.BINARY_EVENT:this.onevent(t);break;case dn.ACK:case dn.BINARY_ACK:this.onack(t);break;case dn.DISCONNECT:this.ondisconnect();break;case dn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:dn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:dn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}L0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};L0.prototype.reset=function(){this.attempts=0};L0.prototype.setMin=function(e){this.ms=e};L0.prototype.setMax=function(e){this.max=e};L0.prototype.setJitter=function(e){this.jitter=e};class T8 extends si{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Vx(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new L0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||g7e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new gG(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=zs(n,"open",function(){r.onopen(),t&&t()}),o=zs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(zs(t,"ping",this.onping.bind(this)),zs(t,"data",this.ondata.bind(this)),zs(t,"error",this.onerror.bind(this)),zs(t,"close",this.onclose.bind(this)),zs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){pG(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new vG(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const cv={};function z4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=o7e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=cv[i]&&o in cv[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new T8(r,t):(cv[i]||(cv[i]=new T8(r,t)),l=cv[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(z4,{Manager:T8,Socket:vG,io:z4,connect:z4});const v7e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],y7e=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],b7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],S7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],x7e=[{key:"2x",value:2},{key:"4x",value:4}],SP=0,xP=4294967295,w7e=["gfpgan","codeformer"],C7e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var _7e=Math.PI/180;function k7e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Vm=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},gt={_global:Vm,version:"8.3.14",isBrowser:k7e(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return gt.angleDeg?e*_7e:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return gt.DD.isDragging},isDragReady(){return!!gt.DD.node},releaseCanvasOnDestroy:!0,document:Vm.document,_injectGlobal(e){Vm.Konva=e}},Or=e=>{gt[e.prototype.getClassName()]=e};gt._injectGlobal(gt);class Ea{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new Ea(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var d=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/d):-Math.acos(r/d)),l.scaleX=s/d,l.scaleY=d,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=de._getRotation(l.rotation),l}}var E7e="[object Array]",P7e="[object Number]",T7e="[object String]",L7e="[object Boolean]",A7e=Math.PI/180,O7e=180/Math.PI,AC="#",M7e="",I7e="0",R7e="Konva warning: ",GR="Konva error: ",D7e="rgb(",OC={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},N7e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Db=[];const j7e=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},de={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===E7e},_isNumber(e){return Object.prototype.toString.call(e)===P7e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===T7e},_isBoolean(e){return Object.prototype.toString.call(e)===L7e},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){Db.push(e),Db.length===1&&j7e(function(){const t=Db;Db=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=de.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(AC,M7e);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=I7e+e;return AC+e},getRGB(e){var t;return e in OC?(t=OC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===AC?this._hexToRgb(e.substring(1)):e.substr(0,4)===D7e?(t=N7e.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",de._namedColorToRBA(e)||de._hex3ColorToRGBA(e)||de._hex6ColorToRGBA(e)||de._rgbColorToRGBA(e)||de._rgbaColorToRGBA(e)||de._hslColorToRGBA(e)},_namedColorToRBA(e){var t=OC[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,d=[0,0,0];for(let h=0;h<3;h++)s=r+1/3*-(h-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,d[h]=l*255;return{r:Math.round(d[0]),g:Math.round(d[1]),b:Math.round(d[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+d*(n-e),s=t+d*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=de.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=de._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],d=l[1],h=l[2];ht.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function pf(e){return de._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||de._isBoolean(e)?e:Object.prototype.toString.call(e)}function yG(e){return e>255?255:e<0?0:Math.round(e)}function Ye(){if(gt.isUnminified)return function(e,t){return de._isNumber(e)||de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function bG(e){if(gt.isUnminified)return function(t,n){let r=de._isNumber(t),i=de._isArray(t)&&t.length==e;return!r&&!i&&de.warn(pf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function wP(){if(gt.isUnminified)return function(e,t){var n=de._isNumber(e),r=e==="auto";return n||r||de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function A0(){if(gt.isUnminified)return function(e,t){return de._isString(e)||de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function SG(){if(gt.isUnminified)return function(e,t){const n=de._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function B7e(){if(gt.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(de._isArray(e)?e.forEach(function(r){de._isNumber(r)||de.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function il(){if(gt.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function F7e(e){if(gt.isUnminified)return function(t,n){return t==null||de.isObject(t)||de.warn(pf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var dv="get",fv="set";const ee={addGetterSetter(e,t,n,r,i){ee.addGetter(e,t,n),ee.addSetter(e,t,r,i),ee.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=dv+de._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=fv+de._capitalize(t);e.prototype[i]||ee.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=fv+de._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=de._capitalize,s=dv+a(t),l=fv+a(t),u,d;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(x),void 0)}),this._fireChangeEvent(t,y,m),i&&i.call(this),this},ee.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=de._capitalize(t),r=fv+n,i=dv+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){de.error("Adding deprecated "+t);var i=dv+de._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){de.error(o);var a=this.attrs[t];return a===void 0?n:a},ee.addSetter(e,t,r,function(){de.error(o)}),ee.addOverloadedGetterSetter(e,t)},backCompat(e,t){de.each(t,function(n,r){var i=e.prototype[r],o=dv+de._capitalize(n),a=fv+de._capitalize(n);function s(){i.apply(this,arguments),de.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function $7e(e){var t=[],n=e.length,r=de,i,o;for(i=0;itypeof d=="number"?Math.floor(d):d)),o+=z7e+u.join(qR)+H7e)):(o+=s.property,t||(o+=q7e+s.val)),o+=U7e;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=K7e&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var d=arguments,h=this._context;d.length===3?h.drawImage(t,n,r):d.length===5?h.drawImage(t,n,r,i,o):d.length===9&&h.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){return this._context.isPointInPath(t,n)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=YR.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=$7e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return vn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];vn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=de._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];vn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(vn.justDragged=!0,gt._mouseListenClick=!1,gt._touchListenClick=!1,gt._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof gt.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){vn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&vn._dragElements.delete(n)})}};gt.isBrowser&&(window.addEventListener("mouseup",vn._endDragBefore,!0),window.addEventListener("touchend",vn._endDragBefore,!0),window.addEventListener("mousemove",vn._drag),window.addEventListener("touchmove",vn._drag),window.addEventListener("mouseup",vn._endDragAfter,!1),window.addEventListener("touchend",vn._endDragAfter,!1));var H4="absoluteOpacity",jb="allEventListeners",Hu="absoluteTransform",KR="absoluteScale",uh="canvas",J7e="Change",e9e="children",t9e="konva",L8="listening",XR="mouseenter",ZR="mouseleave",QR="set",JR="Shape",V4=" ",eD="stage",pd="transform",n9e="Stage",A8="visible",r9e=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(V4);let i9e=1,Qe=class O8{constructor(t){this._id=i9e++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===pd||t===Hu)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===pd||t===Hu,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(V4);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(uh)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Hu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(uh)){const{scene:t,filter:n,hit:r}=this._cache.get(uh);de.releaseCanvas(t,n,r),this._cache.delete(uh)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,h=n.hitCanvasPixelRatio||1;if(!i||!o){de.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new Wm({pixelRatio:a,width:i,height:o}),y=new Wm({pixelRatio:a,width:0,height:0}),b=new CP({pixelRatio:h,width:i,height:o}),x=m.getContext(),k=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(uh),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),x.save(),k.save(),x.translate(-s,-l),k.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(H4),this._clearSelfAndDescendantCache(KR),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,x.restore(),k.restore(),d&&(x.save(),x.beginPath(),x.rect(0,0,i,o),x.closePath(),x.setAttr("strokeStyle","red"),x.setAttr("lineWidth",5),x.stroke(),x.restore()),this._cache.set(uh,{scene:m,filter:y,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(uh)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=l.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==e9e&&(r=QR+de._capitalize(n),de._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(L8,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(A8,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;vn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!gt.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==n9e&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(pd),this._clearSelfAndDescendantCache(Hu)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new Ea,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(pd);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(pd),this._clearSelfAndDescendantCache(Hu),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return de.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return de.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&de.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(H4,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=de.isObject(i)&&!de._isPlainObject(i)&&!de._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),de._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,de._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():gt.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(r&&!this.isDragging()){var i=!1;vn._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=vn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&vn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return de.haveIntersection(r,this.getClientRect())}static create(t,n){return de._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=O8.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),gt[r]||(de.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=gt[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(arguments.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Qe.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Qe.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const d=r===this;if(u){o.save();var h=this.getAbsoluteTransform(r),m=h.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var y=this.clipX(),b=this.clipY();o.rect(y,b,a,s)}o.clip(),m=h.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var x=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";x&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(k){k[t](n,r)}),x&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(x){if(x.visible()){var k=x.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});k.width===0&&k.height===0||(o===void 0?(o=k.x,a=k.y,s=k.x+k.width,l=k.y+k.height):(o=Math.min(o,k.x),a=Math.min(a,k.y),s=Math.max(s,k.x+k.width),l=Math.max(l,k.y+k.height)))}});for(var h=this.find("Shape"),m=!1,y=0;ye.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",Bg=e=>{const t=Dv(e);if(t==="pointer")return gt.pointerEventsEnabled&&IC.pointer;if(t==="touch")return IC.touch;if(t==="mouse")return IC.mouse};function nD(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&de.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const d9e="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",W4=[];let Gx=class extends Oa{constructor(t){super(nD(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),W4.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{nD(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||de.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===a9e){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t=this.children,n=t.length,r;for(r=0;r-1&&W4.splice(n,1),de.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(de.warn(d9e),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t=t||{},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var n=new Wm({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+tD,this.content.style.height=n+tD),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;ru9e&&de.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),gt.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return wG(t,this)}setPointerCapture(t){CG(t,this)}releaseCapture(t){c2(t)}getLayers(){return this.children}_bindContentEvents(){gt.isBrowser&&c9e.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=Bg(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=Bg(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=Bg(t.type),r=Dv(t.type);if(n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!vn.isDragging||gt.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=Bg(t.type),r=Dv(t.type);if(n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(vn.justDragged=!1,gt["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;gt.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=Bg(t.type),r=Dv(t.type);if(!n)return;vn.isDragging&&vn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!vn.isDragging||gt.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=MC(l.id)||this.getIntersection(l),d=l.id,h={evt:t,pointerId:d};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},h),u),s._fireAndBubble(n.pointerleave,Object.assign({},h),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},h),s),u._fireAndBubble(n.pointerenter,Object.assign({},h),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},h))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=Bg(t.type),r=Dv(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=MC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const d=l.id,h={evt:t,pointerId:d};let m=!1;gt["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):vn.justDragged||(gt["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){gt["_"+r+"InDblClickWindow"]=!1},gt.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},h)),gt["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},h)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},h)))):(this[r+"ClickEndShape"]=null,gt["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:d}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:d}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),gt["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(M8,{evt:t}):this._fire(M8,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(I8,{evt:t}):this._fire(I8,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=MC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(hm,_P(t)),c2(t.pointerId)}_lostpointercapture(t){c2(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}])}_setPointerPosition(t){de.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Wm({width:this.width(),height:this.height()}),this.bufferHitCanvas=new CP({pixelRatio:1,width:this.width(),height:this.height()}),!!gt.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return de.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};Gx.prototype.nodeType=o9e;Or(Gx);ee.addGetterSetter(Gx,"container");var RG="hasShadow",DG="shadowRGBA",NG="patternImage",jG="linearGradient",BG="radialGradient";let Hb;function RC(){return Hb||(Hb=de.createCanvasElement().getContext("2d"),Hb)}const d2={};function f9e(e){e.fill()}function h9e(e){e.stroke()}function p9e(e){e.fill()}function g9e(e){e.stroke()}function m9e(){this._clearCache(RG)}function v9e(){this._clearCache(DG)}function y9e(){this._clearCache(NG)}function b9e(){this._clearCache(jG)}function S9e(){this._clearCache(BG)}class $e extends Qe{constructor(t){super(t);let n;for(;n=de.getRandomColor(),!(n&&!(n in d2)););this.colorKey=n,d2[n]=this}getContext(){return de.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return de.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(RG,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(NG,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=RC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Ea;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(gt.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(jG,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=RC(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return Qe.prototype.destroy.call(this),delete d2[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){de.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),d=u?this.shadowOffsetX():0,h=u?this.shadowOffsetY():0,m=s+Math.abs(d),y=l+Math.abs(h),b=u&&this.shadowBlur()||0,x=m+b*2,k=y+b*2,E={width:x,height:k,x:-(a/2+b)+Math.min(d,0)+i.x,y:-(a/2+b)+Math.min(h,0)+i.y};return n?E:this._transformedRect(E,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,d,h,m=i.isCache,y=n===this;if(!this.isVisible()&&!y)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),d=u.bufferCanvas,h=d.getContext(),h.clear(),h.save(),h._applyLineJoin(this);var x=this.getAbsoluteTransform(n).getMatrix();h.transform(x[0],x[1],x[2],x[3],x[4],x[5]),s.call(this,h,this),h.restore();var k=d.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(d._canvas,0,0,d.width/k,d.height/k)}else{if(o._applyLineJoin(this),!y){var x=this.getAbsoluteTransform(n).getMatrix();o.transform(x[0],x[1],x[2],x[3],x[4],x[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||de.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){a.save();var d=this.getAbsoluteTransform(n).getMatrix();return a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,d,h,m,y;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,d=u.length,h=de._hexToRgb(this.colorKey),m=0;mt?(u[m]=h.r,u[m+1]=h.g,u[m+2]=h.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){de.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return wG(t,this)}setPointerCapture(t){CG(t,this)}releaseCapture(t){c2(t)}}$e.prototype._fillFunc=f9e;$e.prototype._strokeFunc=h9e;$e.prototype._fillFuncHit=p9e;$e.prototype._strokeFuncHit=g9e;$e.prototype._centroid=!1;$e.prototype.nodeType="Shape";Or($e);$e.prototype.eventListeners={};$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m9e);$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",y9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",b9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",S9e);ee.addGetterSetter($e,"stroke",void 0,SG());ee.addGetterSetter($e,"strokeWidth",2,Ye());ee.addGetterSetter($e,"fillAfterStrokeEnabled",!1);ee.addGetterSetter($e,"hitStrokeWidth","auto",wP());ee.addGetterSetter($e,"strokeHitEnabled",!0,il());ee.addGetterSetter($e,"perfectDrawEnabled",!0,il());ee.addGetterSetter($e,"shadowForStrokeEnabled",!0,il());ee.addGetterSetter($e,"lineJoin");ee.addGetterSetter($e,"lineCap");ee.addGetterSetter($e,"sceneFunc");ee.addGetterSetter($e,"hitFunc");ee.addGetterSetter($e,"dash");ee.addGetterSetter($e,"dashOffset",0,Ye());ee.addGetterSetter($e,"shadowColor",void 0,A0());ee.addGetterSetter($e,"shadowBlur",0,Ye());ee.addGetterSetter($e,"shadowOpacity",1,Ye());ee.addComponentsGetterSetter($e,"shadowOffset",["x","y"]);ee.addGetterSetter($e,"shadowOffsetX",0,Ye());ee.addGetterSetter($e,"shadowOffsetY",0,Ye());ee.addGetterSetter($e,"fillPatternImage");ee.addGetterSetter($e,"fill",void 0,SG());ee.addGetterSetter($e,"fillPatternX",0,Ye());ee.addGetterSetter($e,"fillPatternY",0,Ye());ee.addGetterSetter($e,"fillLinearGradientColorStops");ee.addGetterSetter($e,"strokeLinearGradientColorStops");ee.addGetterSetter($e,"fillRadialGradientStartRadius",0);ee.addGetterSetter($e,"fillRadialGradientEndRadius",0);ee.addGetterSetter($e,"fillRadialGradientColorStops");ee.addGetterSetter($e,"fillPatternRepeat","repeat");ee.addGetterSetter($e,"fillEnabled",!0);ee.addGetterSetter($e,"strokeEnabled",!0);ee.addGetterSetter($e,"shadowEnabled",!0);ee.addGetterSetter($e,"dashEnabled",!0);ee.addGetterSetter($e,"strokeScaleEnabled",!0);ee.addGetterSetter($e,"fillPriority","color");ee.addComponentsGetterSetter($e,"fillPatternOffset",["x","y"]);ee.addGetterSetter($e,"fillPatternOffsetX",0,Ye());ee.addGetterSetter($e,"fillPatternOffsetY",0,Ye());ee.addComponentsGetterSetter($e,"fillPatternScale",["x","y"]);ee.addGetterSetter($e,"fillPatternScaleX",1,Ye());ee.addGetterSetter($e,"fillPatternScaleY",1,Ye());ee.addComponentsGetterSetter($e,"fillLinearGradientStartPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientStartPointX",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointX",0);ee.addGetterSetter($e,"fillLinearGradientStartPointY",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillLinearGradientEndPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientEndPointX",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointX",0);ee.addGetterSetter($e,"fillLinearGradientEndPointY",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientStartPointX",0);ee.addGetterSetter($e,"fillRadialGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientEndPointX",0);ee.addGetterSetter($e,"fillRadialGradientEndPointY",0);ee.addGetterSetter($e,"fillPatternRotation",0);ee.backCompat($e,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var x9e="#",w9e="beforeDraw",C9e="draw",FG=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],_9e=FG.length;let gp=class extends Oa{constructor(t){super(t),this.canvas=new Wm,this.hitCanvas=new CP({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i<_9e;i++){const o=FG[i],a=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),s=a.shape;if(s)return s;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,i=r[3];if(i===255){const o=de._rgbToHex(r[0],r[1],r[2]),a=d2[x9e+o];return a?{shape:a}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(w9e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Oa.prototype.drawScene.call(this,i,n),this._fire(C9e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Oa.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return de.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};gp.prototype.nodeType="Layer";Or(gp);ee.addGetterSetter(gp,"imageSmoothingEnabled",!0);ee.addGetterSetter(gp,"clearBeforeDraw",!0);ee.addGetterSetter(gp,"hitGraphEnabled",!0,il());class kP extends gp{constructor(t){super(t),this.listening(!1),de.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}kP.prototype.nodeType="FastLayer";Or(kP);let l0=class extends Oa{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&de.throw("You may only add groups and shapes to groups.")}};l0.prototype.nodeType="Group";Or(l0);var DC=function(){return Vm.performance&&Vm.performance.now?function(){return Vm.performance.now()}:function(){return new Date().getTime()}}();class rs{constructor(t,n){this.id=rs.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:DC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=rD,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=iD,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;this.state===rD?this.setTime(t):this.state===iD&&this.setTime(this.duration-t)}pause(){this.state=E9e,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Xr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||f2.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=P9e++;var u=r.getLayer()||(r instanceof gt.Stage?r.getLayers():null);u||de.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new rs(function(){n.tween.onEnterFrame()},u),this.tween=new T9e(l,function(d){n._tweenFunc(d)},a,0,1,o*1e3,s),this._addListeners(),Xr.attrs[i]||(Xr.attrs[i]={}),Xr.attrs[i][this._id]||(Xr.attrs[i][this._id]={}),Xr.tweens[i]||(Xr.tweens[i]={});for(l in t)k9e[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,d,h,m;if(s=Xr.tweens[i][t],s&&delete Xr.attrs[i][s][t],o=r.getAttr(t),de._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(h=o,o=de._prepareArrayForTween(o,n,r.closed())):(d=n,n=de._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t=this.node._id,n=this._id,r=Xr.tweens[t],i;this.pause();for(i in r)delete Xr.tweens[t][i];delete Xr.attrs[t][n]}}Xr.attrs={};Xr.tweens={};Qe.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Xr(e);n.play()};const f2={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),d=a*n,h=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:h,width:d-u,height:m-h}}}fc.prototype._centroid=!0;fc.prototype.className="Arc";fc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Or(fc);ee.addGetterSetter(fc,"innerRadius",0,Ye());ee.addGetterSetter(fc,"outerRadius",0,Ye());ee.addGetterSetter(fc,"angle",0,Ye());ee.addGetterSetter(fc,"clockwise",!1,il());function R8(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),d=a*l/(s+l),h=n-u*(i-e),m=r-u*(o-t),y=n+d*(i-e),b=r+d*(o-t);return[h,m,y,b]}function aD(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);ud?u:d,k=u>d?1:u/d,E=u>d?d/u:1;t.translate(s,l),t.rotate(y),t.scale(k,E),t.arc(0,0,x,h,h+m,1-b),t.scale(1/k,1/E),t.rotate(-y),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],h=u.points[5],m=u.points[4]+h,y=Math.PI/180;if(Math.abs(d-m)m;b-=y){const x=zn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(x.x,x.y)}else for(let b=d+y;bthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return zn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return zn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return zn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],d=a[3],h=a[4],m=a[5],y=a[6];return h+=m*t/o.pathLength,zn.getPointOnEllipticalArc(s,l,u,d,h,y)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var _=null,P=[],A=l,M=u,R,D,j,z,H,K,te,G,F,W;switch(y){case"l":l+=b.shift(),u+=b.shift(),_="L",P.push(l,u);break;case"L":l=b.shift(),u=b.shift(),P.push(l,u);break;case"m":var X=b.shift(),Z=b.shift();if(l+=X,u+=Z,_="M",a.length>2&&a[a.length-1].command==="z"){for(var U=a.length-2;U>=0;U--)if(a[U].command==="M"){l=a[U].points[0]+X,u=a[U].points[1]+Z;break}}P.push(l,u),y="l";break;case"M":l=b.shift(),u=b.shift(),_="M",P.push(l,u),y="L";break;case"h":l+=b.shift(),_="L",P.push(l,u);break;case"H":l=b.shift(),_="L",P.push(l,u);break;case"v":u+=b.shift(),_="L",P.push(l,u);break;case"V":u=b.shift(),_="L",P.push(l,u);break;case"C":P.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),P.push(l,u);break;case"c":P.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",P.push(l,u);break;case"S":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),P.push(D,j,b.shift(),b.shift()),l=b.shift(),u=b.shift(),_="C",P.push(l,u);break;case"s":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),P.push(D,j,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",P.push(l,u);break;case"Q":P.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),P.push(l,u);break;case"q":P.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="Q",P.push(l,u);break;case"T":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l=b.shift(),u=b.shift(),_="Q",P.push(D,j,l,u);break;case"t":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l+=b.shift(),u+=b.shift(),_="Q",P.push(D,j,l,u);break;case"A":z=b.shift(),H=b.shift(),K=b.shift(),te=b.shift(),G=b.shift(),F=l,W=u,l=b.shift(),u=b.shift(),_="A",P=this.convertEndpointToCenterParameterization(F,W,l,u,te,G,z,H,K);break;case"a":z=b.shift(),H=b.shift(),K=b.shift(),te=b.shift(),G=b.shift(),F=l,W=u,l+=b.shift(),u+=b.shift(),_="A",P=this.convertEndpointToCenterParameterization(F,W,l,u,te,G,z,H,K);break}a.push({command:_||y,points:P,start:{x:A,y:M},pathLength:this.calcLength(A,M,_||y,P)})}(y==="z"||y==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=zn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var d=i[4],h=i[5],m=i[4]+h,y=Math.PI/180;if(Math.abs(d-m)m;l-=y)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=d+y;l1&&(s*=Math.sqrt(y),l*=Math.sqrt(y));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(h*h))/(s*s*(m*m)+l*l*(h*h)));o===a&&(b*=-1),isNaN(b)&&(b=0);var x=b*s*m/l,k=b*-l*h/s,E=(t+r)/2+Math.cos(d)*x-Math.sin(d)*k,_=(n+i)/2+Math.sin(d)*x+Math.cos(d)*k,P=function(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])},A=function(H,K){return(H[0]*K[0]+H[1]*K[1])/(P(H)*P(K))},M=function(H,K){return(H[0]*K[1]=1&&(z=0),a===0&&z>0&&(z=z-2*Math.PI),a===1&&z<0&&(z=z+2*Math.PI),[E,_,s,l,R,z,d,a]}}zn.prototype.className="Path";zn.prototype._attrsAffectingSize=["data"];Or(zn);ee.addGetterSetter(zn,"data");class mp extends hc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],y=zn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=zn.getPointOnQuadraticBezier(Math.min(1,1-a/y),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var d=(Math.atan2(u,l)+n)%n,h=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}mp.prototype.className="Arrow";Or(mp);ee.addGetterSetter(mp,"pointerLength",10,Ye());ee.addGetterSetter(mp,"pointerWidth",10,Ye());ee.addGetterSetter(mp,"pointerAtBeginning",!1);ee.addGetterSetter(mp,"pointerAtEnding",!0);let O0=class extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};O0.prototype._centroid=!0;O0.prototype.className="Circle";O0.prototype._attrsAffectingSize=["radius"];Or(O0);ee.addGetterSetter(O0,"radius",0,Ye());class gf extends $e{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}gf.prototype.className="Ellipse";gf.prototype._centroid=!0;gf.prototype._attrsAffectingSize=["radiusX","radiusY"];Or(gf);ee.addComponentsGetterSetter(gf,"radius",["x","y"]);ee.addGetterSetter(gf,"radiusX",0,Ye());ee.addGetterSetter(gf,"radiusY",0,Ye());let pc=class $G extends $e{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.attrs.image;let o;if(i){const a=this.attrs.cropWidth,s=this.attrs.cropHeight;a&&s?o=[i,this.cropX(),this.cropY(),a,s,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&t.drawImage.apply(t,o)}_hitFunc(t){var n=this.width(),r=this.height();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=de.createImageElement();i.onload=function(){var o=new $G({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};pc.prototype.className="Image";Or(pc);ee.addGetterSetter(pc,"image");ee.addComponentsGetterSetter(pc,"crop",["x","y","width","height"]);ee.addGetterSetter(pc,"cropX",0,Ye());ee.addGetterSetter(pc,"cropY",0,Ye());ee.addGetterSetter(pc,"cropWidth",0,Ye());ee.addGetterSetter(pc,"cropHeight",0,Ye());var zG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],L9e="Change.konva",A9e="none",D8="up",N8="right",j8="down",B8="left",O9e=zG.length;class EP extends l0{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}yp.prototype.className="RegularPolygon";yp.prototype._centroid=!0;yp.prototype._attrsAffectingSize=["radius"];Or(yp);ee.addGetterSetter(yp,"radius",0,Ye());ee.addGetterSetter(yp,"sides",0,Ye());var sD=Math.PI*2;class bp extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,sD,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),sD,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}bp.prototype.className="Ring";bp.prototype._centroid=!0;bp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Or(bp);ee.addGetterSetter(bp,"innerRadius",0,Ye());ee.addGetterSetter(bp,"outerRadius",0,Ye());class vu extends $e{constructor(t){super(t),this._updated=!0,this.anim=new rs(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],d=o[i+3],h=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,d),t.closePath(),t.fillStrokeShape(this)),h)if(a){var m=a[n],y=r*2;t.drawImage(h,s,l,u,d,m[y+0],m[y+1],u,d)}else t.drawImage(h,s,l,u,d,0,0,u,d)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],d=r*2;t.rect(u[d+0],u[d+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Wb;function jC(){return Wb||(Wb=de.createCanvasElement().getContext(R9e),Wb)}function U9e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function G9e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function q9e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Ar extends $e{constructor(t){super(q9e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(E+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=de._isString(t)?t:t==null?"":t+"";return this._setAttr(D9e,n),this}getWidth(){var t=this.attrs.width===Fg||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Fg||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return de.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=jC(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+Vb+this.fontVariant()+Vb+(this.fontSize()+F9e)+W9e(this.fontFamily())}_addTextLine(t){this.align()===hv&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return jC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` +`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Fg&&o!==void 0,l=a!==Fg&&a!==void 0,u=this.padding(),d=o-u*2,h=a-u*2,m=0,y=this.wrap(),b=y!==cD,x=y!==H9e&&b,k=this.ellipsis();this.textArr=[],jC().font=this._getContextFont();for(var E=k?this._getTextWidth(NC):0,_=0,P=t.length;_d)for(;A.length>0;){for(var R=0,D=A.length,j="",z=0;R>>1,K=A.slice(0,H+1),te=this._getTextWidth(K)+E;te<=d?(R=H+1,j=K,z=te):D=H}if(j){if(x){var G,F=A[j.length],W=F===Vb||F===lD;W&&z<=d?G=j.length:G=Math.max(j.lastIndexOf(Vb),j.lastIndexOf(lD))+1,G>0&&(R=G,j=j.slice(0,R),z=this._getTextWidth(j))}j=j.trimRight(),this._addTextLine(j),r=Math.max(r,z),m+=i;var X=this._shouldHandleEllipsis(m);if(X){this._tryToAddEllipsisToLastLine();break}if(A=A.slice(R),A=A.trimLeft(),A.length>0&&(M=this._getTextWidth(A),M<=d)){this._addTextLine(A),m+=i,r=Math.max(r,M);break}}else break}else this._addTextLine(A),m+=i,r=Math.max(r,M),this._shouldHandleEllipsis(m)&&_h)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Fg&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==cD;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Fg&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+NC)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var d=HG(this.text()),h=this.text().split(" ").length-1,m,y,b,x=-1,k=0,E=function(){k=0;for(var te=t.dataArray,G=x+1;G0)return x=G,te[G];te[G].command==="M"&&(m={x:te[G].points[0],y:te[G].points[1]})}return{}},_=function(te){var G=t._getTextSize(te).width+r;te===" "&&i==="justify"&&(G+=(s-a)/h);var F=0,W=0;for(y=void 0;Math.abs(G-F)/G>.01&&W<20;){W++;for(var X=F;b===void 0;)b=E(),b&&X+b.pathLengthG?y=zn.getPointOnLine(G,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var U=b.points[4],Q=b.points[5],re=b.points[4]+Q;k===0?k=U+1e-8:G>F?k+=Math.PI/180*Q/Math.abs(Q):k-=Math.PI/360*Q/Math.abs(Q),(Q<0&&k=0&&k>re)&&(k=re,Z=!0),y=zn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],k,b.points[6]);break;case"C":k===0?G>b.pathLength?k=1e-8:k=G/b.pathLength:G>F?k+=(G-F)/b.pathLength/2:k=Math.max(k-(F-G)/b.pathLength/2,0),k>1&&(k=1,Z=!0),y=zn.getPointOnCubicBezier(k,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":k===0?k=G/b.pathLength:G>F?k+=(G-F)/b.pathLength:k-=(F-G)/b.pathLength,k>1&&(k=1,Z=!0),y=zn.getPointOnQuadraticBezier(k,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}y!==void 0&&(F=zn.getLineLength(m.x,m.y,y.x,y.y)),Z&&(Z=!1,b=void 0)}},P="C",A=t._getTextSize(P).width+r,M=u/A-1,R=0;Re+`.${KG}`).join(" "),dD="nodesRect",X9e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Z9e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const Q9e="ontouchstart"in gt._global;function J9e(e,t){if(e==="rotater")return"crosshair";t+=de.degToRad(Z9e[e]||0);var n=(de.radToDeg(t)%360+360)%360;return de._inRange(n,315+22.5,360)||de._inRange(n,0,22.5)?"ns-resize":de._inRange(n,45-22.5,45+22.5)?"nesw-resize":de._inRange(n,90-22.5,90+22.5)?"ew-resize":de._inRange(n,135-22.5,135+22.5)?"nwse-resize":de._inRange(n,180-22.5,180+22.5)?"ns-resize":de._inRange(n,225-22.5,225+22.5)?"nesw-resize":de._inRange(n,270-22.5,270+22.5)?"ew-resize":de._inRange(n,315-22.5,315+22.5)?"nwse-resize":(de.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var rS=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],fD=1e8;function e8e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function XG(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function t8e(e,t){const n=e8e(e);return XG(e,t,n)}function n8e(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(X9e.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(dD),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(dD,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(gt.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return XG(d,-gt.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-fD,y:-fD,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const d=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var h=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],m=u.getAbsoluteTransform();h.forEach(function(y){var b=m.point(y);n.push(b)})});const r=new Ea;r.rotate(-gt.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var d=r.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:gt.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),rS.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new Hy({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Q9e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=gt.getAngle(this.rotation()),o=J9e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new $e({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*de._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const d=o.getAbsolutePosition();if(!(u.x===d.x&&u.y===d.y)){if(this._movingAnchorName==="rotater"){var h=this._getNodeRect();n=o.x()-h.width/2,r=-o.y()+h.height/2;let te=Math.atan2(-r,n)+Math.PI/2;h.height<0&&(te-=Math.PI);var m=gt.getAngle(this.rotation());const G=m+te,F=gt.getAngle(this.rotationSnapTolerance()),X=n8e(this.rotationSnaps(),G,F)-h.rotation,Z=t8e(h,X);this._fitNodesInto(Z,t);return}var y=this.keepRatio()||t.shiftKey,_=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var x=this.findOne(".top-left").x()>b.x?-1:1,k=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*x,r=i*this.sin*k,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-b.x,2)+Math.pow(b.y-o.y(),2));var x=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*x,r=i*this.sin*k,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var E=o.position();this.findOne(".top-left").y(E.y),this.findOne(".bottom-right").x(E.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var x=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(de._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(de._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new Ea;if(a.rotate(gt.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const h=a.point({x:-this.padding()*2,y:0});if(t.x+=h.x,t.y+=h.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const h=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const h=a.point({x:0,y:-this.padding()*2});if(t.x+=h.x,t.y+=h.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const h=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const h=this.boundBoxFunc()(r,t);h?t=h:de.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new Ea;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new Ea;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const d=u.multiply(l.invert());this._nodes.forEach(h=>{var m;const y=h.getParent().getAbsoluteTransform(),b=h.getTransform().copy();b.translate(h.offsetX(),h.offsetY());const x=new Ea;x.multiply(y.copy().invert()).multiply(d).multiply(y).multiply(b);const k=x.decompose();h.setAttrs(k),this._fire("transform",{evt:n,target:h}),h._fire("transform",{evt:n,target:h}),(m=h.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(de._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(de._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*de._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),l0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Qe.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function r8e(e){return e instanceof Array||de.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){rS.indexOf(t)===-1&&de.warn("Unknown anchor name: "+t+". Available names are: "+rS.join(", "))}),e||[]}In.prototype.className="Transformer";Or(In);ee.addGetterSetter(In,"enabledAnchors",rS,r8e);ee.addGetterSetter(In,"flipEnabled",!0,il());ee.addGetterSetter(In,"resizeEnabled",!0);ee.addGetterSetter(In,"anchorSize",10,Ye());ee.addGetterSetter(In,"rotateEnabled",!0);ee.addGetterSetter(In,"rotationSnaps",[]);ee.addGetterSetter(In,"rotateAnchorOffset",50,Ye());ee.addGetterSetter(In,"rotationSnapTolerance",5,Ye());ee.addGetterSetter(In,"borderEnabled",!0);ee.addGetterSetter(In,"anchorStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"anchorStrokeWidth",1,Ye());ee.addGetterSetter(In,"anchorFill","white");ee.addGetterSetter(In,"anchorCornerRadius",0,Ye());ee.addGetterSetter(In,"borderStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"borderStrokeWidth",1,Ye());ee.addGetterSetter(In,"borderDash");ee.addGetterSetter(In,"keepRatio",!0);ee.addGetterSetter(In,"centeredScaling",!1);ee.addGetterSetter(In,"ignoreStroke",!1);ee.addGetterSetter(In,"padding",0,Ye());ee.addGetterSetter(In,"node");ee.addGetterSetter(In,"nodes");ee.addGetterSetter(In,"boundBoxFunc");ee.addGetterSetter(In,"anchorDragBoundFunc");ee.addGetterSetter(In,"shouldOverdrawWholeArea",!1);ee.addGetterSetter(In,"useSingleNodeRotation",!0);ee.backCompat(In,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class gc extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,gt.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}gc.prototype.className="Wedge";gc.prototype._centroid=!0;gc.prototype._attrsAffectingSize=["radius"];Or(gc);ee.addGetterSetter(gc,"radius",0,Ye());ee.addGetterSetter(gc,"angle",0,Ye());ee.addGetterSetter(gc,"clockwise",!1);ee.backCompat(gc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function hD(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var i8e=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],o8e=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function a8e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,d,h,m,y,b,x,k,E,_,P,A,M,R,D,j,z,H,K,te,G=t+t+1,F=r-1,W=i-1,X=t+1,Z=X*(X+1)/2,U=new hD,Q=null,re=U,fe=null,Ee=null,be=i8e[t],ye=o8e[t];for(s=1;s>ye,K!==0?(K=255/K,n[d]=(m*be>>ye)*K,n[d+1]=(y*be>>ye)*K,n[d+2]=(b*be>>ye)*K):n[d]=n[d+1]=n[d+2]=0,m-=k,y-=E,b-=_,x-=P,k-=fe.r,E-=fe.g,_-=fe.b,P-=fe.a,l=h+((l=o+t+1)>ye,K>0?(K=255/K,n[l]=(m*be>>ye)*K,n[l+1]=(y*be>>ye)*K,n[l+2]=(b*be>>ye)*K):n[l]=n[l+1]=n[l+2]=0,m-=k,y-=E,b-=_,x-=P,k-=fe.r,E-=fe.g,_-=fe.b,P-=fe.a,l=o+((l=a+X)0&&a8e(t,n)};ee.addGetterSetter(Qe,"blurRadius",0,Ye(),ee.afterSetFilter);const l8e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};ee.addGetterSetter(Qe,"contrast",0,Ye(),ee.afterSetFilter);const c8e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,d=l*4,h=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:de.error("Unknown emboss direction: "+r)}do{var m=(h-1)*d,y=o;h+y<1&&(y=0),h+y>u&&(y=0);var b=(h-1+y)*l*4,x=l;do{var k=m+(x-1)*4,E=a;x+E<1&&(E=0),x+E>l&&(E=0);var _=b+(x-1+E)*4,P=s[k]-s[_],A=s[k+1]-s[_+1],M=s[k+2]-s[_+2],R=P,D=R>0?R:-R,j=A>0?A:-A,z=M>0?M:-M;if(j>D&&(R=A),z>D&&(R=M),R*=t,i){var H=s[k]+R,K=s[k+1]+R,te=s[k+2]+R;s[k]=H>255?255:H<0?0:H,s[k+1]=K>255?255:K<0?0:K,s[k+2]=te>255?255:te<0?0:te}else{var G=n-R;G<0?G=0:G>255&&(G=255),s[k]=s[k+1]=s[k+2]=G}}while(--x)}while(--h)};ee.addGetterSetter(Qe,"embossStrength",.5,Ye(),ee.afterSetFilter);ee.addGetterSetter(Qe,"embossWhiteLevel",.5,Ye(),ee.afterSetFilter);ee.addGetterSetter(Qe,"embossDirection","top-left",null,ee.afterSetFilter);ee.addGetterSetter(Qe,"embossBlend",!1,null,ee.afterSetFilter);function BC(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const d8e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],d=u,h,m,y=this.enhance();if(y!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),h=t[m+2],hd&&(d=h);i===r&&(i=255,r=0),s===a&&(s=255,a=0),d===u&&(d=255,u=0);var b,x,k,E,_,P,A,M,R;for(y>0?(x=i+y*(255-i),k=r-y*(r-0),_=s+y*(255-s),P=a-y*(a-0),M=d+y*(255-d),R=u-y*(u-0)):(b=(i+r)*.5,x=i+y*(i-b),k=r+y*(r-b),E=(s+a)*.5,_=s+y*(s-E),P=a+y*(a-E),A=(d+u)*.5,M=d+y*(d-A),R=u+y*(u-A)),m=0;mE?k:E;var _=a,P=o,A,M,R=360/P*Math.PI/180,D,j;for(M=0;MP?_:P;var A=a,M=o,R,D,j=n.polarRotation||0,z,H;for(d=0;dt&&(A=P,M=0,R=-1),i=0;i=0&&y=0&&b=0&&y=0&&b=255*4?255:0}return a}function _8e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&y=0&&b=n))for(o=x;o=r||(a=(n*o+i)*4,s+=A[a+0],l+=A[a+1],u+=A[a+2],d+=A[a+3],P+=1);for(s=s/P,l=l/P,u=u/P,d=d/P,i=y;i=n))for(o=x;o=r||(a=(n*o+i)*4,A[a+0]=s,A[a+1]=l,A[a+2]=u,A[a+3]=d)}};ee.addGetterSetter(Qe,"pixelSize",8,Ye(),ee.afterSetFilter);const T8e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"blue",0,yG,ee.afterSetFilter);const A8e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"blue",0,yG,ee.afterSetFilter);ee.addGetterSetter(Qe,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const O8e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),d>127&&(d=255-d),h>127&&(h=255-h),t[l]=u,t[l+1]=d,t[l+2]=h}while(--s)}while(--o)},I8e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new Wg.Stage({container:i,width:n,height:r}),a=new Wg.Layer,s=new Wg.Layer;a.add(new Wg.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new Wg.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l};let ZG=null,QG=null;const D8e=e=>{ZG=e},nl=()=>ZG,N8e=e=>{QG=e},JG=()=>QG,j8e=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},eq=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),B8e=e=>{const t=nl(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:o,systemState:a}=e,{codeformerFidelity:s,facetoolStrength:l,facetoolType:u,hiresFix:d,hiresStrength:h,shouldRunESRGAN:m,shouldRunFacetool:y,upscalingLevel:b,upscalingStrength:x,upscalingDenoising:k}=i,{cfgScale:E,height:_,img2imgStrength:P,infillMethod:A,initialImage:M,iterations:R,perlin:D,prompt:j,negativePrompt:z,sampler:H,seamBlur:K,seamless:te,seamSize:G,seamSteps:F,seamStrength:W,seed:X,seedWeights:Z,shouldFitToWidthHeight:U,shouldGenerateVariations:Q,shouldRandomizeSeed:re,steps:fe,threshold:Ee,tileSize:be,variationAmount:ye,width:ze}=r,{shouldDisplayInProgressType:Me,saveIntermediatesInterval:rt,enableImageDebugging:We}=a,Be={prompt:j,iterations:R,steps:fe,cfg_scale:E,threshold:Ee,perlin:D,height:_,width:ze,sampler_name:H,seed:X,progress_images:Me==="full-res",progress_latents:Me==="latents",save_intermediates:rt,generation_mode:n,init_mask:""};let wt=!1,Fe=!1;if(z!==""&&(Be.prompt=`${j} [${z}]`),Be.seed=re?eq(SP,xP):X,["txt2img","img2img"].includes(n)&&(Be.seamless=te,Be.hires_fix=d,d&&(Be.strength=h),m&&(wt={level:b,denoise_str:k,strength:x}),y&&(Fe={type:u,strength:l},u==="codeformer"&&(Fe.codeformer_fidelity=s))),n==="img2img"&&M&&(Be.init_img=typeof M=="string"?M:M.url,Be.strength=P,Be.fit=U),n==="unifiedCanvas"&&t){const{layerState:{objects:at},boundingBoxCoordinates:bt,boundingBoxDimensions:Le,stageScale:ut,isMaskEnabled:Mt,shouldPreserveMaskedArea:ct,boundingBoxScaleMethod:_t,scaledBoundingBoxDimensions:un}=o,ae={...bt,...Le},De=R8e(Mt?at.filter(lP):[],ae);Be.init_mask=De,Be.fit=!1,Be.strength=P,Be.invert_mask=ct,Be.bounding_box=ae;const Ke=t.scale();t.scale({x:1/ut,y:1/ut});const Xe=t.getAbsolutePosition(),xe=t.toDataURL({x:ae.x+Xe.x,y:ae.y+Xe.y,width:ae.width,height:ae.height});We&&j8e([{base64:De,caption:"mask sent as init_mask"},{base64:xe,caption:"image sent as init_img"}]),t.scale(Ke),Be.init_img=xe,Be.progress_images=!1,_t!=="none"&&(Be.inpaint_width=un.width,Be.inpaint_height=un.height),Be.seam_size=G,Be.seam_blur=K,Be.seam_strength=W,Be.seam_steps=F,Be.tile_size=be,Be.infill_method=A,Be.force_outpaint=!1}return Q?(Be.variation_amount=ye,Z&&(Be.with_variations=dwe(Z))):Be.variation_amount=0,We&&(Be.enable_image_debugging=We),{generationParameters:Be,esrganParameters:wt,facetoolParameters:Fe}};var F8e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,$8e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,z8e=/[^-+\dA-Z]/g;function no(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(pD[t]||t||pD.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},d=function(){return e[o()+"Hours"]()},h=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},y=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},x=function(){return H8e(e)},k=function(){return V8e(e)},E={d:function(){return a()},dd:function(){return Ca(a())},ddd:function(){return Go.dayNames[s()]},DDD:function(){return gD({y:u(),m:l(),d:a(),_:o(),dayName:Go.dayNames[s()],short:!0})},dddd:function(){return Go.dayNames[s()+7]},DDDD:function(){return gD({y:u(),m:l(),d:a(),_:o(),dayName:Go.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Ca(l()+1)},mmm:function(){return Go.monthNames[l()]},mmmm:function(){return Go.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return Ca(u(),4)},h:function(){return d()%12||12},hh:function(){return Ca(d()%12||12)},H:function(){return d()},HH:function(){return Ca(d())},M:function(){return h()},MM:function(){return Ca(h())},s:function(){return m()},ss:function(){return Ca(m())},l:function(){return Ca(y(),3)},L:function(){return Ca(Math.floor(y()/10))},t:function(){return d()<12?Go.timeNames[0]:Go.timeNames[1]},tt:function(){return d()<12?Go.timeNames[2]:Go.timeNames[3]},T:function(){return d()<12?Go.timeNames[4]:Go.timeNames[5]},TT:function(){return d()<12?Go.timeNames[6]:Go.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":W8e(e)},o:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60),2)+":"+Ca(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return x()},WW:function(){return Ca(x())},N:function(){return k()}};return t.replace(F8e,function(_){return _ in E?E[_]():_.slice(1,_.length-1)})}var pD={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Go={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Ca=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},gD=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,d=new Date;d.setDate(d[o+"Date"]()-1);var h=new Date;h.setDate(h[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},y=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},x=function(){return d[o+"Date"]()},k=function(){return d[o+"Month"]()},E=function(){return d[o+"FullYear"]()},_=function(){return h[o+"Date"]()},P=function(){return h[o+"Month"]()},A=function(){return h[o+"FullYear"]()};return b()===n&&y()===r&&m()===i?l?"Tdy":"Today":E()===n&&k()===r&&x()===i?l?"Ysd":"Yesterday":A()===n&&P()===r&&_()===i?l?"Tmw":"Tomorrow":a},H8e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},V8e=function(t){var n=t.getDay();return n===0&&(n=7),n},W8e=function(t){return(String(t).match($8e)||[""]).pop().replace(z8e,"").replace(/GMT\+0000/g,"UTC")};const U8e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(ns(!0));const o=r(),{generation:a,postprocessing:s,system:l,canvas:u}=o,d={generationMode:i,generationState:a,postprocessingState:s,canvasState:u,systemState:l};n(mCe());const{generationParameters:h,esrganParameters:m,facetoolParameters:y}=B8e(d);t.emit("generateImage",h,m,y),h.init_mask&&(h.init_mask=h.init_mask.substr(0,64).concat("...")),h.init_img&&(h.init_img=h.init_img.substr(0,64).concat("...")),n(to({timestamp:no(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...h,...m,...y})}`}))},emitRunESRGAN:i=>{n(ns(!0));const{postprocessing:{upscalingLevel:o,upscalingDenoising:a,upscalingStrength:s}}=r(),l={upscale:[o,a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(ns(!0));const{postprocessing:{facetoolType:o,facetoolStrength:a,codeformerFidelity:s}}=r(),l={facetool_strength:a};o==="codeformer"&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",i,{type:o,...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`Face restoration (${o}) requested: ${JSON.stringify({file:i.url,...l})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(fU(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitConvertToDiffusers:i=>{t.emit("convertToDiffusers",i)},emitRequestModelChange:i=>{n(hCe()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}};let Gb;const G8e=new Uint8Array(16);function q8e(){if(!Gb&&(Gb=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gb(G8e)}const Hi=[];for(let e=0;e<256;++e)Hi.push((e+256).toString(16).slice(1));function Y8e(e,t=0){return(Hi[e[t+0]]+Hi[e[t+1]]+Hi[e[t+2]]+Hi[e[t+3]]+"-"+Hi[e[t+4]]+Hi[e[t+5]]+"-"+Hi[e[t+6]]+Hi[e[t+7]]+"-"+Hi[e[t+8]]+Hi[e[t+9]]+"-"+Hi[e[t+10]]+Hi[e[t+11]]+Hi[e[t+12]]+Hi[e[t+13]]+Hi[e[t+14]]+Hi[e[t+15]]).toLowerCase()}const K8e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),mD={randomUUID:K8e};function pm(e,t,n){if(mD.randomUUID&&!t&&!e)return mD.randomUUID();e=e||{};const r=e.random||(e.rng||q8e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Y8e(r)}const F8=Tr("socketio/generateImage"),X8e=Tr("socketio/runESRGAN"),Z8e=Tr("socketio/runFacetool"),Q8e=Tr("socketio/deleteImage"),$8=Tr("socketio/requestImages"),vD=Tr("socketio/requestNewImages"),J8e=Tr("socketio/cancelProcessing"),e_e=Tr("socketio/requestSystemConfig"),yD=Tr("socketio/searchForModels"),Vy=Tr("socketio/addNewModel"),t_e=Tr("socketio/deleteModel"),n_e=Tr("socketio/convertToDiffusers"),tq=Tr("socketio/requestModelChange"),r_e=Tr("socketio/saveStagingAreaImageToGallery"),i_e=Tr("socketio/requestEmptyTempFolder"),o_e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(DR(!0)),t(B4(zt.t("common:statusConnected"))),t(e_e());const r=n().gallery;r.categories.result.latest_mtime?t(vD("result")):t($8("result")),r.categories.user.latest_mtime?t(vD("user")):t($8("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(DR(!1)),t(B4(zt.t("common:statusDisconnected"))),t(to({timestamp:no(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:o}=i.ui,{shouldLoopback:a}=i.postprocessing,{boundingBox:s,generationMode:l,...u}=r,d={uuid:pm(),...u};if(["txt2img","img2img"].includes(l)&&t(dm({category:"result",image:{...d,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:h}=r;t(Axe({image:{...d,category:"temp"},boundingBox:h})),i.canvas.shouldAutoSave&&t(dm({image:{...d,category:"result"},category:"result"}))}if(a)switch(vP[o]){case"img2img":{t(T0(d));break}}t(EC()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(Jxe({uuid:pm(),...r,category:"result"})),r.isBase64||t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(dm({category:"result",image:{uuid:pm(),...r,category:"result"}})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(ns(!0)),t(uCe(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(to({timestamp:no(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(NR()),t(EC())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:pm(),...l}));t(Qxe({images:s,areMoreImagesAvailable:o,category:a})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(fCe());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(dm({category:"result",image:r})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(EC())),t(to({timestamp:no(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(fU(r));const{generation:{initialImage:o,maskPath:a}}=n();(o===i||(o==null?void 0:o.url)===i)&&t(vU()),a===i&&t(wU("")),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(cCe(r)),r.infill_methods.includes("patchmatch")||t(xU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(QU(i)),t(JU(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(Mb(o)),t(ns(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t(Oh({title:a?`${zt.t("modelmanager:modelUpdated")}: ${i}`:`${zt.t("modelmanager:modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(Mb(o)),t(ns(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`${zt.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t(Oh({title:`${zt.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(Mb(o)),t(B4(zt.t("common:statusModelChanged"))),t(ns(!1)),t(fm(!0)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(Mb(o)),t(ns(!1)),t(fm(!0)),t(NR()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Oh({title:zt.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},a_e=()=>{const{origin:e}=new URL(window.location.href),t=z4(e,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:d,onGenerationResult:h,onIntermediateResult:m,onProgressUpdate:y,onGalleryImages:b,onProcessingCanceled:x,onImageDeleted:k,onSystemConfig:E,onModelChanged:_,onFoundModels:P,onNewModelAdded:A,onModelDeleted:M,onModelChangeFailed:R,onTempFolderEmptied:D}=o_e(i),{emitGenerateImage:j,emitRunESRGAN:z,emitRunFacetool:H,emitDeleteImage:K,emitRequestImages:te,emitRequestNewImages:G,emitCancelProcessing:F,emitRequestSystemConfig:W,emitSearchForModels:X,emitAddNewModel:Z,emitDeleteModel:U,emitConvertToDiffusers:Q,emitRequestModelChange:re,emitSaveStagingAreaImageToGallery:fe,emitRequestEmptyTempFolder:Ee}=U8e(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",be=>u(be)),t.on("generationResult",be=>h(be)),t.on("postprocessingResult",be=>d(be)),t.on("intermediateResult",be=>m(be)),t.on("progressUpdate",be=>y(be)),t.on("galleryImages",be=>b(be)),t.on("processingCanceled",()=>{x()}),t.on("imageDeleted",be=>{k(be)}),t.on("systemConfig",be=>{E(be)}),t.on("foundModels",be=>{P(be)}),t.on("newModelAdded",be=>{A(be)}),t.on("modelDeleted",be=>{M(be)}),t.on("modelChanged",be=>{_(be)}),t.on("modelChangeFailed",be=>{R(be)}),t.on("tempFolderEmptied",()=>{D()}),n=!0),a.type){case"socketio/generateImage":{j(a.payload);break}case"socketio/runESRGAN":{z(a.payload);break}case"socketio/runFacetool":{H(a.payload);break}case"socketio/deleteImage":{K(a.payload);break}case"socketio/requestImages":{te(a.payload);break}case"socketio/requestNewImages":{G(a.payload);break}case"socketio/cancelProcessing":{F();break}case"socketio/requestSystemConfig":{W();break}case"socketio/searchForModels":{X(a.payload);break}case"socketio/addNewModel":{Z(a.payload);break}case"socketio/deleteModel":{U(a.payload);break}case"socketio/convertToDiffusers":{Q(a.payload);break}case"socketio/requestModelChange":{re(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{fe(a.payload);break}case"socketio/requestEmptyTempFolder":{Ee();break}}o(a)}},s_e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),l_e=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map(e=>`system.${e}`),u_e=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),nq=RW({generation:ywe,postprocessing:Cwe,gallery:awe,system:bCe,canvas:Xxe,ui:LCe,lightbox:uwe}),c_e=UW.getPersistConfig({key:"root",storage:WW,rootReducer:nq,blacklist:[...s_e,...l_e,...u_e],debounce:300}),d_e=rxe(c_e,nq),rq=ISe({reducer:d_e,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(a_e()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),iq=uxe(rq),PP=w.createContext(null),Oe=q5e,he=N5e;let bD;const TP=()=>({setOpenUploader:e=>{e&&(bD=e)},openUploader:bD}),Mr=lt(e=>e.ui,e=>vP[e.activeTab],{memoizeOptions:{equalityCheck:ke.isEqual}}),f_e=lt(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:ke.isEqual}}),Sp=lt(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),SD=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Mr(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:a})).json(),u={uuid:pm(),category:"user",...l};t(dm({image:u,category:"user"})),o==="unifiedCanvas"?t(Fx(u)):o==="img2img"&&t(T0(u))};function h_e(){const{t:e}=Ge();return v.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[v.jsx("h1",{children:e("common:nodes")}),v.jsx("p",{children:e("common:nodesDesc")})]})}const p_e=()=>{const{t:e}=Ge();return v.jsxs("div",{className:"work-in-progress post-processing-work-in-progress",children:[v.jsx("h1",{children:e("common:postProcessing")}),v.jsx("p",{children:e("common:postProcessDesc1")}),v.jsx("p",{children:e("common:postProcessDesc2")}),v.jsx("p",{children:e("common:postProcessDesc3")})]})};function g_e(){const{t:e}=Ge();return v.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[v.jsx("h1",{children:e("common:training")}),v.jsxs("p",{children:[e("common:trainingDesc1"),v.jsx("br",{}),v.jsx("br",{}),e("common:trainingDesc2")]})]})}function m_e(e){const{i18n:t}=Ge(),n=localStorage.getItem("i18nextLng");N.useEffect(()=>{e()},[e]),N.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const v_e=yt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:v.jsx("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),y_e=yt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),b_e=yt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),S_e=yt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:v.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:v.jsx("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})}),x_e=yt({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),w_e=yt({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})}),Je=Ae((e,t)=>{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return v.jsx(uo,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:v.jsx(us,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})}),nr=Ae((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return v.jsx(uo,{label:r,...i,children:v.jsx(ls,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),Js=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return v.jsxs(BE,{...o,children:[v.jsx(zE,{children:t}),v.jsxs($E,{className:`invokeai__popover-content ${r}`,children:[i&&v.jsx(FE,{className:"invokeai__popover-arrow"}),n]})]})},qx=lt(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),xD=/^-?(0\.)?\.?$/,ia=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:d,min:h,max:m,isInteger:y=!0,formControlProps:b,formLabelProps:x,numberInputFieldProps:k,numberInputStepperProps:E,tooltipProps:_,...P}=e,[A,M]=w.useState(String(u));w.useEffect(()=>{!A.match(xD)&&u!==Number(A)&&M(String(u))},[u,A]);const R=j=>{M(j),j.match(xD)||d(y?Math.floor(Number(j)):Number(j))},D=j=>{const z=ke.clamp(y?Math.floor(Number(j.target.value)):Number(j.target.value),h,m);M(String(z)),d(z)};return v.jsx(uo,{..._,children:v.jsxs(fn,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&v.jsx(En,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...x,children:t}),v.jsxs(RE,{className:"invokeai__number-input-root",value:A,min:h,max:m,keepWithinRange:!0,clampValueOnBlur:!1,onChange:R,onBlur:D,width:a,...P,children:[v.jsx(DE,{className:"invokeai__number-input-field",textAlign:s,...k}),o&&v.jsxs("div",{className:"invokeai__number-input-stepper",children:[v.jsx(jE,{...E,className:"invokeai__number-input-stepper-button"}),v.jsx(NE,{...E,className:"invokeai__number-input-stepper-button"})]})]})]})})},rl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return v.jsxs(fn,{isDisabled:n,className:`invokeai__select ${l}`,onClick:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation(),d.nativeEvent.stopPropagation(),d.nativeEvent.cancelBubble=!0},children:[t&&v.jsx(En,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),v.jsx(uo,{label:i,...o,children:v.jsx(QV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(d=>typeof d=="string"||typeof d=="number"?v.jsx("option",{value:d,className:"invokeai__select-option",children:d},d):v.jsx("option",{value:d.value,className:"invokeai__select-option",children:d.key},d.value))})})]})},Wy=e=>e.postprocessing,or=e=>e.system,C_e=e=>e.system.toastQueue,oq=lt(or,e=>{const{model_list:t}=e,n=ke.reduce(t,(r,i,o)=>(i.status==="active"&&(r=o),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),__e=lt([Wy,or],({facetoolStrength:e,facetoolType:t,codeformerFidelity:n},{isGFPGANAvailable:r})=>({facetoolStrength:e,facetoolType:t,codeformerFidelity:n,isGFPGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),LP=()=>{const e=Oe(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r,isGFPGANAvailable:i}=he(__e),o=u=>e(g8(u)),a=u=>e(IU(u)),s=u=>e(j4(u.target.value)),{t:l}=Ge();return v.jsxs(je,{direction:"column",gap:2,children:[v.jsx(rl,{label:l("parameters:type"),validValues:w7e.concat(),value:n,onChange:s}),v.jsx(ia,{isDisabled:!i,label:l("parameters:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&v.jsx(ia,{isDisabled:!i,label:l("parameters:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};var aq={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},wD=N.createContext&&N.createContext(aq),Vd=globalThis&&globalThis.__assign||function(){return Vd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{Ee(i)},[i]);const be=w.useMemo(()=>W!=null&&W.max?W.max:a,[a,W==null?void 0:W.max]),ye=We=>{l(We)},ze=We=>{We.target.value===""&&(We.target.value=String(o));const Be=ke.clamp(x?Math.floor(Number(We.target.value)):Number(fe),o,be);l(Be)},Me=We=>{Ee(We)},rt=()=>{M&&M()};return v.jsxs(fn,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":h,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...H,children:[v.jsx(En,{className:"invokeai__slider-component-label",...K,children:r}),v.jsxs(Ey,{w:"100%",gap:2,alignItems:"center",children:[v.jsxs(WE,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:ye,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...re,children:[h&&v.jsxs(v.Fragment,{children:[v.jsx(Q9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),v.jsx(Q9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:y,...te,children:a})]}),v.jsx(uW,{className:"invokeai__slider_track",...G,children:v.jsx(cW,{className:"invokeai__slider_track-filled"})}),v.jsx(uo,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${d}`,hidden:P,...U,children:v.jsx(lW,{className:"invokeai__slider-thumb",...F})})]}),b&&v.jsxs(RE,{min:o,max:be,step:s,value:fe,onChange:Me,onBlur:ze,className:"invokeai__slider-number-field",isDisabled:j,...W,children:[v.jsx(DE,{className:"invokeai__slider-number-input",width:k,readOnly:E,minWidth:k,...X}),v.jsxs(WV,{...Z,children:[v.jsx(jE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"}),v.jsx(NE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"})]})]}),_&&v.jsx(Je,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:v.jsx(Yx,{}),onClick:rt,isDisabled:R,...Q})]})]})}const M_e=lt([Wy,or],({upscalingLevel:e,upscalingStrength:t,upscalingDenoising:n},{isESRGANAvailable:r})=>({upscalingLevel:e,upscalingDenoising:n,upscalingStrength:t,isESRGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),AP=()=>{const e=Oe(),{upscalingLevel:t,upscalingStrength:n,upscalingDenoising:r,isESRGANAvailable:i}=he(M_e),{t:o}=Ge(),a=l=>e(RU(Number(l.target.value))),s=l=>e(v8(l));return v.jsxs(je,{flexDir:"column",rowGap:"1rem",minWidth:"20rem",children:[v.jsx(rl,{isDisabled:!i,label:o("parameters:scale"),value:t,onChange:a,validValues:x7e}),v.jsx(so,{label:o("parameters:denoisingStrength"),value:r,min:0,max:1,step:.01,onChange:l=>{e(m8(l))},handleReset:()=>e(m8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i}),v.jsx(so,{label:`${o("parameters:upscale")} ${o("parameters:strength")}`,value:n,min:0,max:1,step:.05,onChange:s,handleReset:()=>e(v8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i})]})};var I_e=Object.create,uq=Object.defineProperty,R_e=Object.getOwnPropertyDescriptor,D_e=Object.getOwnPropertyNames,N_e=Object.getPrototypeOf,j_e=Object.prototype.hasOwnProperty,qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),B_e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of D_e(t))!j_e.call(e,i)&&i!==n&&uq(e,i,{get:()=>t[i],enumerable:!(r=R_e(t,i))||r.enumerable});return e},cq=(e,t,n)=>(n=e!=null?I_e(N_e(e)):{},B_e(t||!e||!e.__esModule?uq(n,"default",{value:e,enumerable:!0}):n,e)),F_e=qe((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),dq=qe((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Kx=qe((e,t)=>{var n=dq();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),$_e=qe((e,t)=>{var n=Kx(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),z_e=qe((e,t)=>{var n=Kx();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),H_e=qe((e,t)=>{var n=Kx();function r(i){return n(this.__data__,i)>-1}t.exports=r}),V_e=qe((e,t)=>{var n=Kx();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Xx=qe((e,t)=>{var n=F_e(),r=$_e(),i=z_e(),o=H_e(),a=V_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Xx();function r(){this.__data__=new n,this.size=0}t.exports=r}),U_e=qe((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),G_e=qe((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),q_e=qe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),fq=qe((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),mc=qe((e,t)=>{var n=fq(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),OP=qe((e,t)=>{var n=mc(),r=n.Symbol;t.exports=r}),Y_e=qe((e,t)=>{var n=OP(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),d=l[a];try{l[a]=void 0;var h=!0}catch{}var m=o.call(l);return h&&(u?l[a]=d:delete l[a]),m}t.exports=s}),K_e=qe((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),Zx=qe((e,t)=>{var n=OP(),r=Y_e(),i=K_e(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),hq=qe((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),pq=qe((e,t)=>{var n=Zx(),r=hq(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var d=n(u);return d==o||d==a||d==i||d==s}t.exports=l}),X_e=qe((e,t)=>{var n=mc(),r=n["__core-js_shared__"];t.exports=r}),Z_e=qe((e,t)=>{var n=X_e(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),gq=qe((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch{}try{return o+""}catch{}}return""}t.exports=i}),Q_e=qe((e,t)=>{var n=pq(),r=Z_e(),i=hq(),o=gq(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,h=u.hasOwnProperty,m=RegExp("^"+d.call(h).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function y(b){if(!i(b)||r(b))return!1;var x=n(b)?m:s;return x.test(o(b))}t.exports=y}),J_e=qe((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),M0=qe((e,t)=>{var n=Q_e(),r=J_e();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),MP=qe((e,t)=>{var n=M0(),r=mc(),i=n(r,"Map");t.exports=i}),Qx=qe((e,t)=>{var n=M0(),r=n(Object,"create");t.exports=r}),eke=qe((e,t)=>{var n=Qx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),tke=qe((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),nke=qe((e,t)=>{var n=Qx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),rke=qe((e,t)=>{var n=Qx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),ike=qe((e,t)=>{var n=Qx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),oke=qe((e,t)=>{var n=eke(),r=tke(),i=nke(),o=rke(),a=ike();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=oke(),r=Xx(),i=MP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),ske=qe((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),Jx=qe((e,t)=>{var n=ske();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),lke=qe((e,t)=>{var n=Jx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),uke=qe((e,t)=>{var n=Jx();function r(i){return n(this,i).get(i)}t.exports=r}),cke=qe((e,t)=>{var n=Jx();function r(i){return n(this,i).has(i)}t.exports=r}),dke=qe((e,t)=>{var n=Jx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),mq=qe((e,t)=>{var n=ake(),r=lke(),i=uke(),o=cke(),a=dke();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Xx(),r=MP(),i=mq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var d=u.__data__;if(!r||d.length{var n=Xx(),r=W_e(),i=U_e(),o=G_e(),a=q_e(),s=fke();function l(u){var d=this.__data__=new n(u);this.size=d.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),pke=qe((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),gke=qe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),mke=qe((e,t)=>{var n=mq(),r=pke(),i=gke();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),vq=qe((e,t)=>{var n=mke(),r=vke(),i=yke(),o=1,a=2;function s(l,u,d,h,m,y){var b=d&o,x=l.length,k=u.length;if(x!=k&&!(b&&k>x))return!1;var E=y.get(l),_=y.get(u);if(E&&_)return E==u&&_==l;var P=-1,A=!0,M=d&a?new n:void 0;for(y.set(l,u),y.set(u,l);++P{var n=mc(),r=n.Uint8Array;t.exports=r}),Ske=qe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),xke=qe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),wke=qe((e,t)=>{var n=OP(),r=bke(),i=dq(),o=vq(),a=Ske(),s=xke(),l=1,u=2,d="[object Boolean]",h="[object Date]",m="[object Error]",y="[object Map]",b="[object Number]",x="[object RegExp]",k="[object Set]",E="[object String]",_="[object Symbol]",P="[object ArrayBuffer]",A="[object DataView]",M=n?n.prototype:void 0,R=M?M.valueOf:void 0;function D(j,z,H,K,te,G,F){switch(H){case A:if(j.byteLength!=z.byteLength||j.byteOffset!=z.byteOffset)return!1;j=j.buffer,z=z.buffer;case P:return!(j.byteLength!=z.byteLength||!G(new r(j),new r(z)));case d:case h:case b:return i(+j,+z);case m:return j.name==z.name&&j.message==z.message;case x:case E:return j==z+"";case y:var W=a;case k:var X=K&l;if(W||(W=s),j.size!=z.size&&!X)return!1;var Z=F.get(j);if(Z)return Z==z;K|=u,F.set(j,z);var U=o(W(j),W(z),K,te,G,F);return F.delete(j),U;case _:if(R)return R.call(j)==R.call(z)}return!1}t.exports=D}),Cke=qe((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),_ke=qe((e,t)=>{var n=Cke(),r=IP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),kke=qe((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),Pke=qe((e,t)=>{var n=kke(),r=Eke(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),Tke=qe((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),Lke=qe((e,t)=>{var n=Zx(),r=ew(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),Ake=qe((e,t)=>{var n=Lke(),r=ew(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),Oke=qe((e,t)=>{function n(){return!1}t.exports=n}),yq=qe((e,t)=>{var n=mc(),r=Oke(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),Mke=qe((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a??n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),Ike=qe((e,t)=>{var n=Zx(),r=bq(),i=ew(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",h="[object Map]",m="[object Number]",y="[object Object]",b="[object RegExp]",x="[object Set]",k="[object String]",E="[object WeakMap]",_="[object ArrayBuffer]",P="[object DataView]",A="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",j="[object Int32Array]",z="[object Uint8Array]",H="[object Uint8ClampedArray]",K="[object Uint16Array]",te="[object Uint32Array]",G={};G[A]=G[M]=G[R]=G[D]=G[j]=G[z]=G[H]=G[K]=G[te]=!0,G[o]=G[a]=G[_]=G[s]=G[P]=G[l]=G[u]=G[d]=G[h]=G[m]=G[y]=G[b]=G[x]=G[k]=G[E]=!1;function F(W){return i(W)&&r(W.length)&&!!G[n(W)]}t.exports=F}),Rke=qe((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),Dke=qe((e,t)=>{var n=fq(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s}),Sq=qe((e,t)=>{var n=Ike(),r=Rke(),i=Dke(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),Nke=qe((e,t)=>{var n=Tke(),r=Ake(),i=IP(),o=yq(),a=Mke(),s=Sq(),l=Object.prototype,u=l.hasOwnProperty;function d(h,m){var y=i(h),b=!y&&r(h),x=!y&&!b&&o(h),k=!y&&!b&&!x&&s(h),E=y||b||x||k,_=E?n(h.length,String):[],P=_.length;for(var A in h)(m||u.call(h,A))&&!(E&&(A=="length"||x&&(A=="offset"||A=="parent")||k&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,P)))&&_.push(A);return _}t.exports=d}),jke=qe((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),Bke=qe((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),Fke=qe((e,t)=>{var n=Bke(),r=n(Object.keys,Object);t.exports=r}),$ke=qe((e,t)=>{var n=jke(),r=Fke(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),zke=qe((e,t)=>{var n=pq(),r=bq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),Hke=qe((e,t)=>{var n=Nke(),r=$ke(),i=zke();function o(a){return i(a)?n(a):r(a)}t.exports=o}),Vke=qe((e,t)=>{var n=_ke(),r=Pke(),i=Hke();function o(a){return n(a,i,r)}t.exports=o}),Wke=qe((e,t)=>{var n=Vke(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,d,h,m){var y=u&r,b=n(s),x=b.length,k=n(l),E=k.length;if(x!=E&&!y)return!1;for(var _=x;_--;){var P=b[_];if(!(y?P in l:o.call(l,P)))return!1}var A=m.get(s),M=m.get(l);if(A&&M)return A==l&&M==s;var R=!0;m.set(s,l),m.set(l,s);for(var D=y;++_{var n=M0(),r=mc(),i=n(r,"DataView");t.exports=i}),Gke=qe((e,t)=>{var n=M0(),r=mc(),i=n(r,"Promise");t.exports=i}),qke=qe((e,t)=>{var n=M0(),r=mc(),i=n(r,"Set");t.exports=i}),Yke=qe((e,t)=>{var n=M0(),r=mc(),i=n(r,"WeakMap");t.exports=i}),Kke=qe((e,t)=>{var n=Uke(),r=MP(),i=Gke(),o=qke(),a=Yke(),s=Zx(),l=gq(),u="[object Map]",d="[object Object]",h="[object Promise]",m="[object Set]",y="[object WeakMap]",b="[object DataView]",x=l(n),k=l(r),E=l(i),_=l(o),P=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=h||o&&A(new o)!=m||a&&A(new a)!=y)&&(A=function(M){var R=s(M),D=R==d?M.constructor:void 0,j=D?l(D):"";if(j)switch(j){case x:return b;case k:return u;case E:return h;case _:return m;case P:return y}return R}),t.exports=A}),Xke=qe((e,t)=>{var n=hke(),r=vq(),i=wke(),o=Wke(),a=Kke(),s=IP(),l=yq(),u=Sq(),d=1,h="[object Arguments]",m="[object Array]",y="[object Object]",b=Object.prototype,x=b.hasOwnProperty;function k(E,_,P,A,M,R){var D=s(E),j=s(_),z=D?m:a(E),H=j?m:a(_);z=z==h?y:z,H=H==h?y:H;var K=z==y,te=H==y,G=z==H;if(G&&l(E)){if(!l(_))return!1;D=!0,K=!1}if(G&&!K)return R||(R=new n),D||u(E)?r(E,_,P,A,M,R):i(E,_,z,P,A,M,R);if(!(P&d)){var F=K&&x.call(E,"__wrapped__"),W=te&&x.call(_,"__wrapped__");if(F||W){var X=F?E.value():E,Z=W?_.value():_;return R||(R=new n),M(X,Z,P,A,R)}}return G?(R||(R=new n),o(E,_,P,A,M,R)):!1}t.exports=k}),Zke=qe((e,t)=>{var n=Xke(),r=ew();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),xq=qe((e,t)=>{var n=Zke();function r(i,o){return n(i,o)}t.exports=r}),Qke=["ctrl","shift","alt","meta","mod"],Jke={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function FC(e,t=","){return typeof e=="string"?e.split(t):e}function h2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>Jke[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!Qke.includes(o));return{...r,keys:i}}function eEe(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function tEe(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function nEe(e){return wq(e,["input","textarea","select"])}function wq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function rEe(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var iEe=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:d,metaKey:h,shiftKey:m,key:y,code:b}=e,x=b.toLowerCase().replace("key",""),k=y.toLowerCase();if(u!==r&&k!=="alt"||m!==s&&k!=="shift")return!1;if(a){if(!h&&!d)return!1}else if(h!==o&&x!=="meta"||d!==i&&x!=="ctrl")return!1;return l&&l.length===1&&(l.includes(k)||l.includes(x))?!0:l?l.every(E=>n.has(E)):!l},oEe=w.createContext(void 0),aEe=()=>w.useContext(oEe),sEe=w.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),lEe=()=>w.useContext(sEe),uEe=cq(xq());function cEe(e){let t=w.useRef(void 0);return(0,uEe.default)(t.current,e)||(t.current=e),t.current}var CD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function et(e,t,n,r){let i=w.useRef(null),{current:o}=w.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=w.useCallback(t,[...s]),u=cEe(a),{enabledScopes:d}=lEe(),h=aEe();return w.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!rEe(d,u==null?void 0:u.scopes))return;let m=x=>{var k;if(!(nEe(x)&&!wq(x,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){CD(x);return}(k=x.target)!=null&&k.isContentEditable&&!(u!=null&&u.enableOnContentEditable)||FC(e,u==null?void 0:u.splitKey).forEach(E=>{var P;let _=h2(E,u==null?void 0:u.combinationKey);if(iEe(x,_,o)||(P=_.keys)!=null&&P.includes("*")){if(eEe(x,_,u==null?void 0:u.preventDefault),!tEe(x,_,u==null?void 0:u.enabled)){CD(x);return}l(x,_)}})}},y=x=>{o.add(x.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||u!=null&&u.keydown)&&m(x)},b=x=>{x.key.toLowerCase()!=="meta"?o.delete(x.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(x)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",y),h&&FC(e,u==null?void 0:u.splitKey).forEach(x=>h.addHotkey(h2(x,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",y),h&&FC(e,u==null?void 0:u.splitKey).forEach(x=>h.removeHotkey(h2(x,u==null?void 0:u.combinationKey)))}},[e,l,u,d]),i}cq(xq());var z8=new Set;function dEe(e){(Array.isArray(e)?e:[e]).forEach(t=>z8.add(h2(t)))}function fEe(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=h2(t);for(let i of z8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&z8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{dEe(e.key)}),document.addEventListener("keyup",e=>{fEe(e.key)})});function hEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function pEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function gEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function Cq(e){return mt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function _q(e){return mt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function mEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function vEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function kq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function yEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function bEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function RP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function Eq(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function u0(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function Pq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function SEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function DP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function Tq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function xEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function wEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function Lq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function CEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function _Ee(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function Aq(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function kEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function EEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function PEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function TEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"}}]})(e)}function Oq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function LEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function AEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function Mq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function OEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function MEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function Uy(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function IEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function REe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function DEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function NP(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function NEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function jEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function _D(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function jP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function BEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function xp(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function FEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function tw(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function $Ee(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function BP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const ln=e=>e.canvas,Ir=lt([ln,Mr,or],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Iq=e=>e.canvas.layerState.objects.find(Y5),wp=e=>e.gallery,zEe=lt([wp,qx,Ir,Mr],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,galleryWidth:b,shouldUseSingleGalleryColumn:x}=e,{isLightboxOpen:k}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,galleryGridTemplateColumns:x?"auto":`repeat(auto-fill, minmax(${d}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightboxOpen:k,isStaging:n,shouldEnableResize:!(k||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:x}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HEe=lt([wp,or,qx,Mr],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VEe=lt(or,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),iS=w.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=qh(),a=Oe(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=he(VEe),d=w.useRef(null),h=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(Q8e(e)),o()};et("delete",()=>{s?i():m()},[e,s,l,u]);const y=b=>a(XU(!b.target.checked));return v.jsxs(v.Fragment,{children:[w.cloneElement(t,{onClick:e?h:void 0,ref:n}),v.jsx(zV,{isOpen:r,leastDestructiveRef:d,onClose:o,children:v.jsx(Qd,{children:v.jsxs(HV,{className:"modal",children:[v.jsx(k0,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),v.jsx(a0,{children:v.jsxs(je,{direction:"column",gap:5,children:[v.jsx(Yt,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),v.jsx(fn,{children:v.jsxs(je,{alignItems:"center",children:[v.jsx(En,{mb:0,children:"Don't ask me again"}),v.jsx(UE,{checked:!s,onChange:y})]})})]})}),v.jsxs(wx,{children:[v.jsx(ls,{ref:d,onClick:o,className:"modal-close-btn",children:"Cancel"}),v.jsx(ls,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})});iS.displayName="DeleteImageModal";const WEe=lt([or,wp,Wy,Sp,qx,Mr],(e,t,n,r,i,o)=>{const{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u}=e,{upscalingLevel:d,facetoolStrength:h}=n,{isLightboxOpen:m}=i,{shouldShowImageDetails:y}=r,{intermediateImage:b,currentImage:x}=t;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:d,facetoolStrength:h,shouldDisableToolbarButtons:Boolean(b)||!x,currentImage:x,shouldShowImageDetails:y,activeTabName:o,isLightboxOpen:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),Rq=()=>{var z,H,K,te,G,F;const e=Oe(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightboxOpen:d,activeTabName:h}=he(WEe),m=By(),{t:y}=Ge(),b=()=>{u&&(d&&e(Hm(!1)),e(T0(u)),e(Yo("img2img")))},x=async()=>{if(!u)return;const W=await fetch(u.url).then(Z=>Z.blob()),X=[new ClipboardItem({[W.type]:W})];await navigator.clipboard.write(X),m({title:y("toast:imageCopied"),status:"success",duration:2500,isClosable:!0})},k=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:y("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};et("shift+i",()=>{u?(b(),m({title:y("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:imageNotLoaded"),description:y("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var W,X;u&&(u.metadata&&e(yU(u.metadata)),((W=u.metadata)==null?void 0:W.image.type)==="img2img"?e(Yo("img2img")):((X=u.metadata)==null?void 0:X.image.type)==="txt2img"&&e(Yo("txt2img")))};et("a",()=>{var W,X;["txt2img","img2img"].includes((X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)==null?void 0:X.type)?(E(),m({title:y("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:parametersNotSet"),description:y("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{u!=null&&u.metadata&&e($y(u.metadata.image.seed))};et("s",()=>{var W,X;(X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.seed?(_(),m({title:y("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:seedNotSet"),description:y("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const P=()=>{var W,X,Z,U;if((X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.prompt){const[Q,re]=hP((U=(Z=u==null?void 0:u.metadata)==null?void 0:Z.image)==null?void 0:U.prompt);Q&&e($x(Q)),e(ny(re||""))}};et("p",()=>{var W,X;(X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.prompt?(P(),m({title:y("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:promptNotSet"),description:y("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const A=()=>{u&&e(X8e(u))};et("Shift+U",()=>{i&&!s&&n&&!t&&o?A():m({title:y("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const M=()=>{u&&e(Z8e(u))};et("Shift+R",()=>{r&&!s&&n&&!t&&a?M():m({title:y("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(tG(!l)),D=()=>{u&&(d&&e(Hm(!1)),e(Fx(u)),e(vi(!0)),h!=="unifiedCanvas"&&e(Yo("unifiedCanvas")),m({title:y("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};et("i",()=>{u?R():m({title:y("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const j=()=>{e(Hm(!d))};return v.jsxs("div",{className:"current-image-options",children:[v.jsxs(oo,{isAttached:!0,children:[v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":`${y("parameters:sendTo")}...`,icon:v.jsx(jEe,{})}),children:v.jsxs("div",{className:"current-image-send-to-popover",children:[v.jsx(nr,{size:"sm",onClick:b,leftIcon:v.jsx(_D,{}),children:y("parameters:sendToImg2Img")}),v.jsx(nr,{size:"sm",onClick:D,leftIcon:v.jsx(_D,{}),children:y("parameters:sendToUnifiedCanvas")}),v.jsx(nr,{size:"sm",onClick:x,leftIcon:v.jsx(u0,{}),children:y("parameters:copyImage")}),v.jsx(nr,{size:"sm",onClick:k,leftIcon:v.jsx(u0,{}),children:y("parameters:copyImageToLink")}),v.jsx(Fh,{download:!0,href:u==null?void 0:u.url,children:v.jsx(nr,{leftIcon:v.jsx(DP,{}),size:"sm",w:"100%",children:y("parameters:downloadImage")})})]})}),v.jsx(Je,{icon:v.jsx(wEe,{}),tooltip:d?`${y("parameters:closeViewer")} (Z)`:`${y("parameters:openInViewer")} (Z)`,"aria-label":d?`${y("parameters:closeViewer")} (Z)`:`${y("parameters:openInViewer")} (Z)`,"data-selected":d,onClick:j})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{icon:v.jsx(IEe,{}),tooltip:`${y("parameters:usePrompt")} (P)`,"aria-label":`${y("parameters:usePrompt")} (P)`,isDisabled:!((H=(z=u==null?void 0:u.metadata)==null?void 0:z.image)!=null&&H.prompt),onClick:P}),v.jsx(Je,{icon:v.jsx(NEe,{}),tooltip:`${y("parameters:useSeed")} (S)`,"aria-label":`${y("parameters:useSeed")} (S)`,isDisabled:!((te=(K=u==null?void 0:u.metadata)==null?void 0:K.image)!=null&&te.seed),onClick:_}),v.jsx(Je,{icon:v.jsx(yEe,{}),tooltip:`${y("parameters:useAll")} (A)`,"aria-label":`${y("parameters:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((F=(G=u==null?void 0:u.metadata)==null?void 0:G.image)==null?void 0:F.type),onClick:E})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{icon:v.jsx(kEe,{}),"aria-label":y("parameters:restoreFaces")}),children:v.jsxs("div",{className:"current-image-postprocessing-popover",children:[v.jsx(LP,{}),v.jsx(nr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:M,children:y("parameters:restoreFaces")})]})}),v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{icon:v.jsx(xEe,{}),"aria-label":y("parameters:upscale")}),children:v.jsxs("div",{className:"current-image-postprocessing-popover",children:[v.jsx(AP,{}),v.jsx(nr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:A,children:y("parameters:upscaleImage")})]})})]}),v.jsx(oo,{isAttached:!0,children:v.jsx(Je,{icon:v.jsx(Eq,{}),tooltip:`${y("parameters:info")} (I)`,"aria-label":`${y("parameters:info")} (I)`,"data-selected":l,onClick:R})}),v.jsx(iS,{image:u,children:v.jsx(Je,{icon:v.jsx(xp,{}),tooltip:`${y("parameters:deleteImage")} (Del)`,"aria-label":`${y("parameters:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};yt({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});yt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});yt({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});yt({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});yt({displayName:"SunIcon",path:N.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},N.createElement("circle",{cx:"12",cy:"12",r:"5"}),N.createElement("path",{d:"M12 1v2"}),N.createElement("path",{d:"M12 21v2"}),N.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),N.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),N.createElement("path",{d:"M1 12h2"}),N.createElement("path",{d:"M21 12h2"}),N.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),N.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))});yt({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});yt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:N.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});yt({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});yt({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});yt({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});yt({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});yt({displayName:"ViewIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),N.createElement("circle",{cx:"12",cy:"12",r:"2"}))});yt({displayName:"ViewOffIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),N.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))});yt({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});var UEe=yt({displayName:"DeleteIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"}))});yt({displayName:"RepeatIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),N.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))});yt({displayName:"RepeatClockIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),N.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))});var GEe=yt({displayName:"EditIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),N.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});yt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});yt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});yt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});yt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});yt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});yt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});yt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});yt({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});yt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var Dq=yt({displayName:"ExternalLinkIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),N.createElement("path",{d:"M15 3h6v6"}),N.createElement("path",{d:"M10 14L21 3"}))});yt({displayName:"LinkIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),N.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))});yt({displayName:"PlusSquareIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),N.createElement("path",{d:"M12 8v8"}),N.createElement("path",{d:"M8 12h8"}))});yt({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});yt({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});yt({displayName:"TimeIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),N.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))});yt({displayName:"ArrowRightIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),N.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))});yt({displayName:"ArrowLeftIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),N.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))});yt({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});yt({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});yt({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});yt({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});yt({displayName:"EmailIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),N.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))});yt({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});yt({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});yt({displayName:"SpinnerIcon",path:N.createElement(N.Fragment,null,N.createElement("defs",null,N.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},N.createElement("stop",{stopColor:"currentColor",offset:"0%"}),N.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),N.createElement("g",{transform:"translate(2)",fill:"none"},N.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),N.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),N.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))});yt({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});yt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:N.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});yt({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});yt({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});yt({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});yt({displayName:"InfoOutlineIcon",path:N.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},N.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),N.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),N.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))});yt({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});yt({displayName:"QuestionOutlineIcon",path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))});yt({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});yt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});yt({viewBox:"0 0 14 14",path:N.createElement("g",{fill:"currentColor"},N.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))});yt({displayName:"MinusIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))});yt({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function qEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Qn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>v.jsxs(je,{gap:2,children:[n&&v.jsx(uo,{label:`Recall ${e}`,children:v.jsx(us,{"aria-label":"Use this parameter",icon:v.jsx(qEe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&v.jsx(uo,{label:`Copy ${e}`,children:v.jsx(us,{"aria-label":`Copy ${e}`,icon:v.jsx(u0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),v.jsxs(je,{direction:i?"column":"row",children:[v.jsxs(Yt,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?v.jsxs(Fh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",v.jsx(Dq,{mx:"2px"})]}):v.jsx(Yt,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),YEe=(e,t)=>e.image.uuid===t.image.uuid,FP=w.memo(({image:e,styleClass:t})=>{var H,K;const n=Oe();et("esc",()=>{n(tG(!1))});const r=((H=e==null?void 0:e.metadata)==null?void 0:H.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:d,orig_path:h,perlin:m,postprocessing:y,prompt:b,sampler:x,seamless:k,seed:E,steps:_,strength:P,denoise_str:A,threshold:M,type:R,variations:D,width:j}=r,z=JSON.stringify(e.metadata,null,2);return v.jsx("div",{className:`image-metadata-viewer ${t}`,children:v.jsxs(je,{gap:1,direction:"column",width:"100%",children:[v.jsxs(je,{gap:2,children:[v.jsx(Yt,{fontWeight:"semibold",children:"File:"}),v.jsxs(Fh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,v.jsx(Dq,{mx:"2px"})]})]}),Object.keys(r).length>0?v.jsxs(v.Fragment,{children:[R&&v.jsx(Qn,{label:"Generation type",value:R}),((K=e.metadata)==null?void 0:K.model_weights)&&v.jsx(Qn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(R)&&v.jsx(Qn,{label:"Original image",value:h}),b&&v.jsx(Qn,{label:"Prompt",labelPosition:"top",value:l2(b),onClick:()=>n($x(b))}),E!==void 0&&v.jsx(Qn,{label:"Seed",value:E,onClick:()=>n($y(E))}),M!==void 0&&v.jsx(Qn,{label:"Noise Threshold",value:M,onClick:()=>n(LU(M))}),m!==void 0&&v.jsx(Qn,{label:"Perlin Noise",value:m,onClick:()=>n(CU(m))}),x&&v.jsx(Qn,{label:"Sampler",value:x,onClick:()=>n(_U(x))}),_&&v.jsx(Qn,{label:"Steps",value:_,onClick:()=>n(TU(_))}),o!==void 0&&v.jsx(Qn,{label:"CFG scale",value:o,onClick:()=>n(bU(o))}),D&&D.length>0&&v.jsx(Qn,{label:"Seed-weight pairs",value:Q5(D),onClick:()=>n(EU(Q5(D)))}),k&&v.jsx(Qn,{label:"Seamless",value:k,onClick:()=>n(kU(k))}),l&&v.jsx(Qn,{label:"High Resolution Optimization",value:l,onClick:()=>n(gP(l))}),j&&v.jsx(Qn,{label:"Width",value:j,onClick:()=>n(AU(j))}),s&&v.jsx(Qn,{label:"Height",value:s,onClick:()=>n(SU(s))}),u&&v.jsx(Qn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(T0(u))}),d&&v.jsx(Qn,{label:"Mask image",value:d,isLink:!0,onClick:()=>n(wU(d))}),R==="img2img"&&P&&v.jsx(Qn,{label:"Image to image strength",value:P,onClick:()=>n(p8(P))}),a&&v.jsx(Qn,{label:"Image to image fit",value:a,onClick:()=>n(PU(a))}),y&&y.length>0&&v.jsxs(v.Fragment,{children:[v.jsx(Bh,{size:"sm",children:"Postprocessing"}),y.map((te,G)=>{if(te.type==="esrgan"){const{scale:F,strength:W,denoise_str:X}=te;return v.jsxs(je,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(Yt,{size:"md",children:`${G+1}: Upscale (ESRGAN)`}),v.jsx(Qn,{label:"Scale",value:F,onClick:()=>n(RU(F))}),v.jsx(Qn,{label:"Strength",value:W,onClick:()=>n(v8(W))}),X!==void 0&&v.jsx(Qn,{label:"Denoising strength",value:X,onClick:()=>n(m8(X))})]},G)}else if(te.type==="gfpgan"){const{strength:F}=te;return v.jsxs(je,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(Yt,{size:"md",children:`${G+1}: Face restoration (GFPGAN)`}),v.jsx(Qn,{label:"Strength",value:F,onClick:()=>{n(g8(F)),n(j4("gfpgan"))}})]},G)}else if(te.type==="codeformer"){const{strength:F,fidelity:W}=te;return v.jsxs(je,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(Yt,{size:"md",children:`${G+1}: Face restoration (Codeformer)`}),v.jsx(Qn,{label:"Strength",value:F,onClick:()=>{n(g8(F)),n(j4("codeformer"))}}),W&&v.jsx(Qn,{label:"Fidelity",value:W,onClick:()=>{n(IU(W)),n(j4("codeformer"))}})]},G)}})]}),i&&v.jsx(Qn,{withCopy:!0,label:"Dream Prompt",value:i}),v.jsxs(je,{gap:2,direction:"column",children:[v.jsxs(je,{gap:2,children:[v.jsx(uo,{label:"Copy metadata JSON",children:v.jsx(us,{"aria-label":"Copy metadata JSON",icon:v.jsx(u0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),v.jsx(Yt,{fontWeight:"semibold",children:"Metadata JSON:"})]}),v.jsx("div",{className:"image-json-viewer",children:v.jsx("pre",{children:z})})]})]}):v.jsx(b$,{width:"100%",pt:10,children:v.jsx(Yt,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},YEe);FP.displayName="ImageMetadataViewer";const Nq=lt([wp,Sp],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var d;return u.uuid===((d=e==null?void 0:e.currentImage)==null?void 0:d.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function KEe(){const e=Oe(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=he(Nq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(fP())},h=()=>{e(dP())};return v.jsxs("div",{className:"current-image-preview",children:[i&&v.jsx(JS,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&v.jsxs("div",{className:"current-image-next-prev-buttons",children:[v.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&v.jsx(us,{"aria-label":"Previous image",icon:v.jsx(Cq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),v.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&v.jsx(us,{"aria-label":"Next image",icon:v.jsx(_q,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),r&&i&&v.jsx(FP,{image:i,styleClass:"current-image-metadata"})]})}var XEe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=globalThis&&globalThis.__assign||function(){return ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},rPe=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],LD="__resizable_base__",jq=function(e){JEe(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(LD):o.className+=LD,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;o&&o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||ePe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),d=u/l[s]*100;return d+"%"}return $C(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?$C(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?$C(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&$g("left",o),s=i&&$g("top",o),l,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=a?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,h=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,y=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,x=u||0;if(s){var k=(m-b)*this.ratio+x,E=(y-b)*this.ratio+x,_=(d-x)/this.ratio+b,P=(h-x)/this.ratio+b,A=Math.max(d,k),M=Math.min(h,E),R=Math.max(m,_),D=Math.min(y,P);n=Yb(n,A,M),r=Yb(r,R,D)}else n=Yb(n,d,h),r=Yb(r,m,y);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&tPe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Kb(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Bl(Bl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(h)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Kb(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Kb(n)?n.touches[0].clientX:n.clientX,d=Kb(n)?n.touches[0].clientY:n.clientY,h=this.state,m=h.direction,y=h.original,b=h.width,x=h.height,k=this.getParentSize(),E=nPe(k,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=E.maxWidth,a=E.maxHeight,s=E.minWidth,l=E.minHeight;var _=this.calculateNewSizeFromDirection(u,d),P=_.newHeight,A=_.newWidth,M=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=TD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(P=TD(P,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(A,P,{width:M.maxWidth,height:M.maxHeight},{width:s,height:l});if(A=R.newWidth,P=R.newHeight,this.props.grid){var D=PD(A,this.props.grid[0]),j=PD(P,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,P=z===0||Math.abs(j-P)<=z?j:P}var H={width:A-y.width,height:P-y.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var K=A/k.width*100;A=K+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var G=A/this.window.innerHeight*100;A=G+"vh"}}if(x&&typeof x=="string"){if(x.endsWith("%")){var K=P/k.height*100;P=K+"%"}else if(x.endsWith("vw")){var te=P/this.window.innerWidth*100;P=te+"vw"}else if(x.endsWith("vh")){var G=P/this.window.innerHeight*100;P=G+"vh"}}var F={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(P,"height")};this.flexDir==="row"?F.flexBasis=F.width:this.flexDir==="column"&&(F.flexBasis=F.height),el.flushSync(function(){r.setState(F)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,H)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Bl(Bl({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(h){return i[h]!==!1?w.createElement(QEe,{key:h,direction:h,onResizeStart:n.onResizeStart,replaceStyles:o&&o[h],className:a&&a[h]},u&&u[h]?u[h]:null):null});return w.createElement("div",{className:l,style:s},d)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return rPe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Bl(Bl(Bl({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return w.createElement(o,Bl({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&w.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(w.PureComponent);const er=e=>{const{label:t,styleClass:n,...r}=e;return v.jsx(l$,{className:`invokeai__checkbox ${n}`,...r,children:t})};function Bq(e){return mt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function Fq(e){return mt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function iPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function oPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function aPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function sPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function $q(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function lPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function uPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function cPe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function dPe(e,t){e.classList?e.classList.add(t):cPe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function AD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function fPe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=AD(e.className,t):e.setAttribute("class",AD(e.className&&e.className.baseVal||"",t))}const OD={disabled:!1},zq=N.createContext(null);var Hq=function(t){return t.scrollTop},Nv="unmounted",vh="exited",yh="entering",Ug="entered",H8="exiting",vc=function(e){_E(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=vh,o.appearStatus=yh):l=Ug:r.unmountOnExit||r.mountOnEnter?l=Nv:l=vh,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Nv?{status:vh}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==yh&&a!==Ug&&(o=yh):(a===yh||a===Ug)&&(o=H8)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===yh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:xb.findDOMNode(this);a&&Hq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===vh&&this.setState({status:Nv})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[xb.findDOMNode(this),s],u=l[0],d=l[1],h=this.getTimeouts(),m=s?h.appear:h.enter;if(!i&&!a||OD.disabled){this.safeSetState({status:Ug},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:yh},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:Ug},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:xb.findDOMNode(this);if(!o||OD.disabled){this.safeSetState({status:vh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:H8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:vh},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:xb.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Nv)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=xE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return N.createElement(zq.Provider,{value:null},typeof a=="function"?a(i,s):N.cloneElement(N.Children.only(a),s))},t}(N.Component);vc.contextType=zq;vc.propTypes={};function zg(){}vc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:zg,onEntering:zg,onEntered:zg,onExit:zg,onExiting:zg,onExited:zg};vc.UNMOUNTED=Nv;vc.EXITED=vh;vc.ENTERING=yh;vc.ENTERED=Ug;vc.EXITING=H8;const hPe=vc;var pPe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return dPe(t,r)})},zC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return fPe(t,r)})},$P=function(e){_E(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ab,Object.values(b));return w.createElement(x.Provider,{value:k},y)}function d(h,m){const y=(m==null?void 0:m[e][l])||s,b=w.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const i=()=>{const o=n.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,gPe(i,...t)]}function gPe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...s,...h}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function mPe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Wq(...e){return t=>e.forEach(n=>mPe(n,t))}function ps(...e){return w.useCallback(Wq(...e),e)}const uy=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),o=i.find(yPe);if(o){const a=o.props.children,s=i.map(l=>l===o?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return w.createElement(V8,bn({},r,{ref:t}),w.isValidElement(a)?w.cloneElement(a,void 0,s):null)}return w.createElement(V8,bn({},r,{ref:t}),n)});uy.displayName="Slot";const V8=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...bPe(r,n.props),ref:Wq(t,n.ref)}):w.Children.count(n)>1?w.Children.only(null):null});V8.displayName="SlotClone";const vPe=({children:e})=>w.createElement(w.Fragment,null,e);function yPe(e){return w.isValidElement(e)&&e.type===vPe}function bPe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const SPe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],lc=SPe.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?uy:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(s,bn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Uq(e,t){e&&el.flushSync(()=>e.dispatchEvent(t))}function Gq(e){const t=e+"CollectionProvider",[n,r]=Gy(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:b,children:x}=y,k=N.useRef(null),E=N.useRef(new Map).current;return N.createElement(i,{scope:b,itemMap:E,collectionRef:k},x)},s=e+"CollectionSlot",l=N.forwardRef((y,b)=>{const{scope:x,children:k}=y,E=o(s,x),_=ps(b,E.collectionRef);return N.createElement(uy,{ref:_},k)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=N.forwardRef((y,b)=>{const{scope:x,children:k,...E}=y,_=N.useRef(null),P=ps(b,_),A=o(u,x);return N.useEffect(()=>(A.itemMap.set(_,{ref:_,...E}),()=>void A.itemMap.delete(_))),N.createElement(uy,{[d]:"",ref:P},k)});function m(y){const b=o(e+"CollectionConsumer",y);return N.useCallback(()=>{const k=b.collectionRef.current;if(!k)return[];const E=Array.from(k.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((A,M)=>E.indexOf(A.ref.current)-E.indexOf(M.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:h},m,r]}const xPe=w.createContext(void 0);function qq(e){const t=w.useContext(xPe);return e||t||"ltr"}function du(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function wPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const W8="dismissableLayer.update",CPe="dismissableLayer.pointerDownOutside",_Pe="dismissableLayer.focusOutside";let MD;const kPe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),EPe=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=w.useContext(kPe),[h,m]=w.useState(null),y=(n=h==null?void 0:h.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=w.useState({}),x=ps(t,j=>m(j)),k=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=k.indexOf(E),P=h?k.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,M=P>=_,R=PPe(j=>{const z=j.target,H=[...d.branches].some(K=>K.contains(z));!M||H||(o==null||o(j),s==null||s(j),j.defaultPrevented||l==null||l())},y),D=TPe(j=>{const z=j.target;[...d.branches].some(K=>K.contains(z))||(a==null||a(j),s==null||s(j),j.defaultPrevented||l==null||l())},y);return wPe(j=>{P===d.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},y),w.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(MD=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),ID(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=MD)}},[h,y,r,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),ID())},[h,d]),w.useEffect(()=>{const j=()=>b({});return document.addEventListener(W8,j),()=>document.removeEventListener(W8,j)},[]),w.createElement(lc.div,bn({},u,{ref:x,style:{pointerEvents:A?M?"auto":"none":void 0,...e.style},onFocusCapture:ir(e.onFocusCapture,D.onFocusCapture),onBlurCapture:ir(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:ir(e.onPointerDownCapture,R.onPointerDownCapture)}))});function PPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){Yq(CPe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function TPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&Yq(_Pe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ID(){const e=new CustomEvent(W8);document.dispatchEvent(e)}function Yq(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Uq(i,o):i.dispatchEvent(o)}let HC=0;function LPe(){w.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:RD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:RD()),HC++,()=>{HC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),HC--}},[])}function RD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const VC="focusScope.autoFocusOnMount",WC="focusScope.autoFocusOnUnmount",DD={bubbles:!1,cancelable:!0},APe=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=w.useState(null),u=du(i),d=du(o),h=w.useRef(null),m=ps(t,x=>l(x)),y=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let x=function(E){if(y.paused||!s)return;const _=E.target;s.contains(_)?h.current=_:bh(h.current,{select:!0})},k=function(E){y.paused||!s||s.contains(E.relatedTarget)||bh(h.current,{select:!0})};return document.addEventListener("focusin",x),document.addEventListener("focusout",k),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",k)}}},[r,s,y.paused]),w.useEffect(()=>{if(s){jD.add(y);const x=document.activeElement;if(!s.contains(x)){const E=new CustomEvent(VC,DD);s.addEventListener(VC,u),s.dispatchEvent(E),E.defaultPrevented||(OPe(NPe(Kq(s)),{select:!0}),document.activeElement===x&&bh(s))}return()=>{s.removeEventListener(VC,u),setTimeout(()=>{const E=new CustomEvent(WC,DD);s.addEventListener(WC,d),s.dispatchEvent(E),E.defaultPrevented||bh(x??document.body,{select:!0}),s.removeEventListener(WC,d),jD.remove(y)},0)}}},[s,u,d,y]);const b=w.useCallback(x=>{if(!n&&!r||y.paused)return;const k=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,E=document.activeElement;if(k&&E){const _=x.currentTarget,[P,A]=MPe(_);P&&A?!x.shiftKey&&E===A?(x.preventDefault(),n&&bh(P,{select:!0})):x.shiftKey&&E===P&&(x.preventDefault(),n&&bh(A,{select:!0})):E===_&&x.preventDefault()}},[n,r,y.paused]);return w.createElement(lc.div,bn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function OPe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bh(r,{select:t}),document.activeElement!==n)return}function MPe(e){const t=Kq(e),n=ND(t,e),r=ND(t.reverse(),e);return[n,r]}function Kq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ND(e,t){for(const n of e)if(!IPe(n,{upTo:t}))return n}function IPe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function RPe(e){return e instanceof HTMLInputElement&&"select"in e}function bh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&RPe(e)&&t&&e.select()}}const jD=DPe();function DPe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=BD(e,t),e.unshift(t)},remove(t){var n;e=BD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function BD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function NPe(e){return e.filter(t=>t.tagName!=="A")}const c0=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:()=>{},jPe=n7["useId".toString()]||(()=>{});let BPe=0;function FPe(e){const[t,n]=w.useState(jPe());return c0(()=>{e||n(r=>r??String(BPe++))},[e]),e||(t?`radix-${t}`:"")}function I0(e){return e.split("-")[0]}function nw(e){return e.split("-")[1]}function R0(e){return["top","bottom"].includes(I0(e))?"x":"y"}function zP(e){return e==="y"?"height":"width"}function FD(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=R0(t),l=zP(s),u=r[l]/2-i[l]/2,d=s==="x";let h;switch(I0(t)){case"top":h={x:o,y:r.y-i.height};break;case"bottom":h={x:o,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:a};break;case"left":h={x:r.x-i.width,y:a};break;default:h={x:r.x,y:r.y}}switch(nw(t)){case"start":h[s]-=u*(n&&d?-1:1);break;case"end":h[s]+=u*(n&&d?-1:1)}return h}const $Pe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=FD(l,r,s),h=r,m={},y=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=Xq(r),d={x:i,y:o},h=R0(a),m=nw(a),y=zP(h),b=await l.getDimensions(n),x=h==="y"?"top":"left",k=h==="y"?"bottom":"right",E=s.reference[y]+s.reference[h]-d[h]-s.floating[y],_=d[h]-s.reference[h],P=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=P?h==="y"?P.clientHeight||0:P.clientWidth||0:0;A===0&&(A=s.floating[y]);const M=E/2-_/2,R=u[x],D=A-b[y]-u[k],j=A/2-b[y]/2+M,z=U8(R,j,D),H=(m==="start"?u[x]:u[k])>0&&j!==z&&s.reference[y]<=s.floating[y];return{[h]:d[h]-(H?jVPe[t])}function WPe(e,t,n){n===void 0&&(n=!1);const r=nw(e),i=R0(e),o=zP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=sS(a)),{main:a,cross:sS(a)}}const UPe={start:"end",end:"start"};function zD(e){return e.replace(/start|end/g,t=>UPe[t])}const Zq=["top","right","bottom","left"];Zq.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const GPe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",flipAlignment:y=!0,...b}=e,x=I0(r),k=h||(x===a||!y?[sS(a)]:function(j){const z=sS(j);return[zD(j),z,zD(z)]}(a)),E=[a,...k],_=await aS(t,b),P=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&P.push(_[x]),d){const{main:j,cross:z}=WPe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));P.push(_[j],_[z])}if(A=[...A,{placement:r,overflows:P}],!P.every(j=>j<=0)){var M,R;const j=((M=(R=i.flip)==null?void 0:R.index)!=null?M:0)+1,z=E[j];if(z)return{data:{index:j,overflows:A},reset:{placement:z}};let H="bottom";switch(m){case"bestFit":{var D;const K=(D=A.map(te=>[te,te.overflows.filter(G=>G>0).reduce((G,F)=>G+F,0)]).sort((te,G)=>te[1]-G[1])[0])==null?void 0:D[0].placement;K&&(H=K);break}case"initialPlacement":H=a}if(r!==H)return{reset:{placement:H}}}return{}}}};function HD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function VD(e){return Zq.some(t=>e[t]>=0)}const qPe=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=HD(await aS(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:VD(o)}}}case"escaped":{const o=HD(await aS(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:o,escaped:VD(o)}}}default:return{}}}}},YPe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),h=I0(s),m=nw(s),y=R0(s)==="x",b=["left","top"].includes(h)?-1:1,x=d&&y?-1:1,k=typeof a=="function"?a(o):a;let{mainAxis:E,crossAxis:_,alignmentAxis:P}=typeof k=="number"?{mainAxis:k,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...k};return m&&typeof P=="number"&&(_=m==="end"?-1*P:P),y?{x:_*x,y:E*b}:{x:E*b,y:_*x}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function Qq(e){return e==="x"?"y":"x"}const KPe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:k=>{let{x:E,y:_}=k;return{x:E,y:_}}},...l}=e,u={x:n,y:r},d=await aS(t,l),h=R0(I0(i)),m=Qq(h);let y=u[h],b=u[m];if(o){const k=h==="y"?"bottom":"right";y=U8(y+d[h==="y"?"top":"left"],y,y-d[k])}if(a){const k=m==="y"?"bottom":"right";b=U8(b+d[m==="y"?"top":"left"],b,b-d[k])}const x=s.fn({...t,[h]:y,[m]:b});return{...x,data:{x:x.x-n,y:x.y-r}}}}},XPe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,d={x:n,y:r},h=R0(i),m=Qq(h);let y=d[h],b=d[m];const x=typeof s=="function"?s({...o,placement:i}):s,k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const M=h==="y"?"height":"width",R=o.reference[h]-o.floating[M]+k.mainAxis,D=o.reference[h]+o.reference[M]-k.mainAxis;yD&&(y=D)}if(u){var E,_,P,A;const M=h==="y"?"width":"height",R=["top","left"].includes(I0(i)),D=o.reference[m]-o.floating[M]+(R&&(E=(_=a.offset)==null?void 0:_[m])!=null?E:0)+(R?0:k.crossAxis),j=o.reference[m]+o.reference[M]+(R?0:(P=(A=a.offset)==null?void 0:A[m])!=null?P:0)-(R?k.crossAxis:0);bj&&(b=j)}return{[h]:y,[m]:b}}}};function Jq(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function yc(e){if(e==null)return window;if(!Jq(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function qy(e){return yc(e).getComputedStyle(e)}function Qu(e){return Jq(e)?"":e?(e.nodeName||"").toLowerCase():""}function eY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function fu(e){return e instanceof yc(e).HTMLElement}function nf(e){return e instanceof yc(e).Element}function HP(e){return typeof ShadowRoot>"u"?!1:e instanceof yc(e).ShadowRoot||e instanceof ShadowRoot}function rw(e){const{overflow:t,overflowX:n,overflowY:r}=qy(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function ZPe(e){return["table","td","th"].includes(Qu(e))}function WD(e){const t=/firefox/i.test(eY()),n=qy(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function tY(){return!/^((?!chrome|android).)*safari/i.test(eY())}const UD=Math.min,p2=Math.max,lS=Math.round;function Ju(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&fu(e)&&(l=e.offsetWidth>0&&lS(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&lS(s.height)/e.offsetHeight||1);const d=nf(e)?yc(e):window,h=!tY()&&n,m=(s.left+(h&&(r=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,y=(s.top+(h&&(o=(a=d.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,x=s.height/u;return{width:b,height:x,top:y,right:m+b,bottom:y+x,left:m,x:m,y}}function Wd(e){return(t=e,(t instanceof yc(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function iw(e){return nf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function nY(e){return Ju(Wd(e)).left+iw(e).scrollLeft}function QPe(e,t,n){const r=fu(t),i=Wd(t),o=Ju(e,r&&function(l){const u=Ju(l);return lS(u.width)!==l.offsetWidth||lS(u.height)!==l.offsetHeight}(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Qu(t)!=="body"||rw(i))&&(a=iw(t)),fu(t)){const l=Ju(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=nY(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function rY(e){return Qu(e)==="html"?e:e.assignedSlot||e.parentNode||(HP(e)?e.host:null)||Wd(e)}function GD(e){return fu(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function G8(e){const t=yc(e);let n=GD(e);for(;n&&ZPe(n)&&getComputedStyle(n).position==="static";)n=GD(n);return n&&(Qu(n)==="html"||Qu(n)==="body"&&getComputedStyle(n).position==="static"&&!WD(n))?t:n||function(r){let i=rY(r);for(HP(i)&&(i=i.host);fu(i)&&!["html","body"].includes(Qu(i));){if(WD(i))return i;i=i.parentNode}return null}(e)||t}function qD(e){if(fu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ju(e);return{width:t.width,height:t.height}}function iY(e){const t=rY(e);return["html","body","#document"].includes(Qu(t))?e.ownerDocument.body:fu(t)&&rw(t)?t:iY(t)}function uS(e,t){var n;t===void 0&&(t=[]);const r=iY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=yc(r),a=i?[o].concat(o.visualViewport||[],rw(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(uS(a))}function YD(e,t,n){return t==="viewport"?oS(function(r,i){const o=yc(r),a=Wd(r),s=o.visualViewport;let l=a.clientWidth,u=a.clientHeight,d=0,h=0;if(s){l=s.width,u=s.height;const m=tY();(m||!m&&i==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}return{width:l,height:u,x:d,y:h}}(e,n)):nf(t)?function(r,i){const o=Ju(r,!1,i==="fixed"),a=o.top+r.clientTop,s=o.left+r.clientLeft;return{top:a,left:s,x:s,y:a,right:s+r.clientWidth,bottom:a+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):oS(function(r){var i;const o=Wd(r),a=iw(r),s=(i=r.ownerDocument)==null?void 0:i.body,l=p2(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=p2(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let d=-a.scrollLeft+nY(r);const h=-a.scrollTop;return qy(s||o).direction==="rtl"&&(d+=p2(o.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:d,y:h}}(Wd(e)))}function JPe(e){const t=uS(e),n=["absolute","fixed"].includes(qy(e).position)&&fu(e)?G8(e):e;return nf(n)?t.filter(r=>nf(r)&&function(i,o){const a=o.getRootNode==null?void 0:o.getRootNode();if(i.contains(o))return!0;if(a&&HP(a)){let s=o;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Qu(r)!=="body"):[]}const eTe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?JPe(t):[].concat(n),r],a=o[0],s=o.reduce((l,u)=>{const d=YD(t,u,i);return l.top=p2(d.top,l.top),l.right=UD(d.right,l.right),l.bottom=UD(d.bottom,l.bottom),l.left=p2(d.left,l.left),l},YD(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=fu(n),o=Wd(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Qu(n)!=="body"||rw(o))&&(a=iw(n)),fu(n))){const l=Ju(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:nf,getDimensions:qD,getOffsetParent:G8,getDocumentElement:Wd,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:QPe(t,G8(n),r),floating:{...qD(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>qy(e).direction==="rtl"};function tTe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,d=l||u?[...nf(e)?uS(e):[],...uS(t)]:[];d.forEach(b=>{l&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});let h,m=null;if(a){let b=!0;m=new ResizeObserver(()=>{b||n(),b=!1}),nf(e)&&!s&&m.observe(e),m.observe(t)}let y=s?Ju(e):null;return s&&function b(){const x=Ju(e);!y||x.x===y.x&&x.y===y.y&&x.width===y.width&&x.height===y.height||n(),y=x,h=requestAnimationFrame(b)}(),n(),()=>{var b;d.forEach(x=>{l&&x.removeEventListener("scroll",n),u&&x.removeEventListener("resize",n)}),(b=m)==null||b.disconnect(),m=null,s&&cancelAnimationFrame(h)}}const nTe=(e,t,n)=>$Pe(e,t,{platform:eTe,...n});var q8=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Y8(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Y8(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Y8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function rTe(e){const t=w.useRef(e);return q8(()=>{t.current=e}),t}function iTe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=w.useRef(null),a=w.useRef(null),s=rTe(i),l=w.useRef(null),[u,d]=w.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,m]=w.useState(t);Y8(h==null?void 0:h.map(P=>{let{options:A}=P;return A}),t==null?void 0:t.map(P=>{let{options:A}=P;return A}))||m(t);const y=w.useCallback(()=>{!o.current||!a.current||nTe(o.current,a.current,{middleware:h,placement:n,strategy:r}).then(P=>{b.current&&el.flushSync(()=>{d(P)})})},[h,n,r]);q8(()=>{b.current&&y()},[y]);const b=w.useRef(!1);q8(()=>(b.current=!0,()=>{b.current=!1}),[]);const x=w.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const P=s.current(o.current,a.current,y);l.current=P}else y()},[y,s]),k=w.useCallback(P=>{o.current=P,x()},[x]),E=w.useCallback(P=>{a.current=P,x()},[x]),_=w.useMemo(()=>({reference:o,floating:a}),[]);return w.useMemo(()=>({...u,update:y,refs:_,reference:k,floating:E}),[u,y,_,k,E])}const oTe=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?$D({element:t.current,padding:n}).fn(i):{}:t?$D({element:t,padding:n}).fn(i):{}}}};function aTe(e){const[t,n]=w.useState(void 0);return c0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const oY="Popper",[VP,aY]=Gy(oY),[sTe,sY]=VP(oY),lTe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return w.createElement(sTe,{scope:t,anchor:r,onAnchorChange:i},n)},uTe="PopperAnchor",cTe=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=sY(uTe,n),a=w.useRef(null),s=ps(t,a);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:w.createElement(lc.div,bn({},i,{ref:s}))}),cS="PopperContent",[dTe,zze]=VP(cS),[fTe,hTe]=VP(cS,{hasParent:!1,positionUpdateFns:new Set}),pTe=w.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:d,side:h="bottom",sideOffset:m=0,align:y="center",alignOffset:b=0,arrowPadding:x=0,collisionBoundary:k=[],collisionPadding:E=0,sticky:_="partial",hideWhenDetached:P=!1,avoidCollisions:A=!0,...M}=e,R=sY(cS,d),[D,j]=w.useState(null),z=ps(t,ae=>j(ae)),[H,K]=w.useState(null),te=aTe(H),G=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,F=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,W=h+(y!=="center"?"-"+y:""),X=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},Z=Array.isArray(k)?k:[k],U=Z.length>0,Q={padding:X,boundary:Z.filter(mTe),altBoundary:U},{reference:re,floating:fe,strategy:Ee,x:be,y:ye,placement:ze,middlewareData:Me,update:rt}=iTe({strategy:"fixed",placement:W,whileElementsMounted:tTe,middleware:[YPe({mainAxis:m+F,alignmentAxis:b}),A?KPe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?XPe():void 0,...Q}):void 0,H?oTe({element:H,padding:x}):void 0,A?GPe({...Q}):void 0,vTe({arrowWidth:G,arrowHeight:F}),P?qPe({strategy:"referenceHidden"}):void 0].filter(gTe)});c0(()=>{re(R.anchor)},[re,R.anchor]);const We=be!==null&&ye!==null,[Be,wt]=lY(ze),Fe=(i=Me.arrow)===null||i===void 0?void 0:i.x,at=(o=Me.arrow)===null||o===void 0?void 0:o.y,bt=((a=Me.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Le,ut]=w.useState();c0(()=>{D&&ut(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Mt,positionUpdateFns:ct}=hTe(cS,d),_t=!Mt;w.useLayoutEffect(()=>{if(!_t)return ct.add(rt),()=>{ct.delete(rt)}},[_t,ct,rt]),w.useLayoutEffect(()=>{_t&&We&&Array.from(ct).reverse().forEach(ae=>requestAnimationFrame(ae))},[_t,We,ct]);const un={"data-side":Be,"data-align":wt,...M,ref:z,style:{...M.style,animation:We?void 0:"none",opacity:(s=Me.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return w.createElement("div",{ref:fe,"data-radix-popper-content-wrapper":"",style:{position:Ee,left:0,top:0,transform:We?`translate3d(${Math.round(be)}px, ${Math.round(ye)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Le,["--radix-popper-transform-origin"]:[(l=Me.transformOrigin)===null||l===void 0?void 0:l.x,(u=Me.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},w.createElement(dTe,{scope:d,placedSide:Be,onArrowChange:K,arrowX:Fe,arrowY:at,shouldHideArrow:bt},_t?w.createElement(fTe,{scope:d,hasParent:!0,positionUpdateFns:ct},w.createElement(lc.div,un)):w.createElement(lc.div,un)))});function gTe(e){return e!==void 0}function mTe(e){return e!==null}const vTe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,h=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=h?0:e.arrowWidth,y=h?0:e.arrowHeight,[b,x]=lY(s),k={start:"0%",center:"50%",end:"100%"}[x],E=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+y/2;let P="",A="";return b==="bottom"?(P=h?k:`${E}px`,A=`${-y}px`):b==="top"?(P=h?k:`${E}px`,A=`${l.floating.height+y}px`):b==="right"?(P=`${-y}px`,A=h?k:`${_}px`):b==="left"&&(P=`${l.floating.width+y}px`,A=h?k:`${_}px`),{data:{x:P,y:A}}}});function lY(e){const[t,n="center"]=e.split("-");return[t,n]}const yTe=lTe,bTe=cTe,STe=pTe;function xTe(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const uY=e=>{const{present:t,children:n}=e,r=wTe(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=ps(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};uY.displayName="Presence";function wTe(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[s,l]=xTe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=Zb(r.current);o.current=s==="mounted"?u:"none"},[s]),c0(()=>{const u=r.current,d=i.current;if(d!==e){const m=o.current,y=Zb(u);e?l("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),c0(()=>{if(t){const u=h=>{const y=Zb(r.current).includes(h.animationName);h.target===t&&y&&el.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(o.current=Zb(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Zb(e){return(e==null?void 0:e.animationName)||"none"}function CTe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=_Te({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=du(n),l=w.useCallback(u=>{if(o){const h=typeof u=="function"?u(e):u;h!==e&&s(h)}else i(u)},[o,e,i,s]);return[a,l]}function _Te({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),o=du(t);return w.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const UC="rovingFocusGroup.onEntryFocus",kTe={bubbles:!1,cancelable:!0},WP="RovingFocusGroup",[K8,cY,ETe]=Gq(WP),[PTe,dY]=Gy(WP,[ETe]),[TTe,LTe]=PTe(WP),ATe=w.forwardRef((e,t)=>w.createElement(K8.Provider,{scope:e.__scopeRovingFocusGroup},w.createElement(K8.Slot,{scope:e.__scopeRovingFocusGroup},w.createElement(OTe,bn({},e,{ref:t}))))),OTe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=w.useRef(null),m=ps(t,h),y=qq(o),[b=null,x]=CTe({prop:a,defaultProp:s,onChange:l}),[k,E]=w.useState(!1),_=du(u),P=cY(n),A=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const D=h.current;if(D)return D.addEventListener(UC,_),()=>D.removeEventListener(UC,_)},[_]),w.createElement(TTe,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:b,onItemFocus:w.useCallback(D=>x(D),[x]),onItemShiftTab:w.useCallback(()=>E(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>R(D=>D-1),[])},w.createElement(lc.div,bn({tabIndex:k||M===0?-1:0,"data-orientation":r},d,{ref:m,style:{outline:"none",...e.style},onMouseDown:ir(e.onMouseDown,()=>{A.current=!0}),onFocus:ir(e.onFocus,D=>{const j=!A.current;if(D.target===D.currentTarget&&j&&!k){const z=new CustomEvent(UC,kTe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=P().filter(W=>W.focusable),K=H.find(W=>W.active),te=H.find(W=>W.id===b),F=[K,te,...H].filter(Boolean).map(W=>W.ref.current);fY(F)}}A.current=!1}),onBlur:ir(e.onBlur,()=>E(!1))})))}),MTe="RovingFocusGroupItem",ITe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=FPe(),s=LTe(MTe,n),l=s.currentTabStopId===a,u=cY(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=s;return w.useEffect(()=>{if(r)return d(),()=>h()},[r,d,h]),w.createElement(K8.ItemSlot,{scope:n,id:a,focusable:r,active:i},w.createElement(lc.span,bn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:ir(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:ir(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:ir(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=NTe(m,s.orientation,s.dir);if(y!==void 0){m.preventDefault();let x=u().filter(k=>k.focusable).map(k=>k.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const k=x.indexOf(m.currentTarget);x=s.loop?jTe(x,k+1):x.slice(k+1)}setTimeout(()=>fY(x))}})})))}),RTe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DTe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NTe(e,t,n){const r=DTe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return RTe[r]}function fY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const BTe=ATe,FTe=ITe,$Te=["Enter"," "],zTe=["ArrowDown","PageUp","Home"],hY=["ArrowUp","PageDown","End"],HTe=[...zTe,...hY],ow="Menu",[X8,VTe,WTe]=Gq(ow),[Cp,pY]=Gy(ow,[WTe,aY,dY]),UP=aY(),gY=dY(),[UTe,aw]=Cp(ow),[GTe,GP]=Cp(ow),qTe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=UP(t),[l,u]=w.useState(null),d=w.useRef(!1),h=du(o),m=qq(i);return w.useEffect(()=>{const y=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),w.createElement(yTe,s,w.createElement(UTe,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u},w.createElement(GTe,{scope:t,onClose:w.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:m,modal:a},r)))},YTe=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=UP(n);return w.createElement(bTe,bn({},i,r,{ref:t}))}),KTe="MenuPortal",[Hze,XTe]=Cp(KTe,{forceMount:void 0}),Ud="MenuContent",[ZTe,mY]=Cp(Ud),QTe=w.forwardRef((e,t)=>{const n=XTe(Ud,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=aw(Ud,e.__scopeMenu),a=GP(Ud,e.__scopeMenu);return w.createElement(X8.Provider,{scope:e.__scopeMenu},w.createElement(uY,{present:r||o.open},w.createElement(X8.Slot,{scope:e.__scopeMenu},a.modal?w.createElement(JTe,bn({},i,{ref:t})):w.createElement(eLe,bn({},i,{ref:t})))))}),JTe=w.forwardRef((e,t)=>{const n=aw(Ud,e.__scopeMenu),r=w.useRef(null),i=ps(t,r);return w.useEffect(()=>{const o=r.current;if(o)return QH(o)},[]),w.createElement(vY,bn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ir(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),eLe=w.forwardRef((e,t)=>{const n=aw(Ud,e.__scopeMenu);return w.createElement(vY,bn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),vY=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m,disableOutsideScroll:y,...b}=e,x=aw(Ud,n),k=GP(Ud,n),E=UP(n),_=gY(n),P=VTe(n),[A,M]=w.useState(null),R=w.useRef(null),D=ps(t,R,x.onContentChange),j=w.useRef(0),z=w.useRef(""),H=w.useRef(0),K=w.useRef(null),te=w.useRef("right"),G=w.useRef(0),F=y?BV:w.Fragment,W=y?{as:uy,allowPinchZoom:!0}:void 0,X=U=>{var Q,re;const fe=z.current+U,Ee=P().filter(We=>!We.disabled),be=document.activeElement,ye=(Q=Ee.find(We=>We.ref.current===be))===null||Q===void 0?void 0:Q.textValue,ze=Ee.map(We=>We.textValue),Me=uLe(ze,fe,ye),rt=(re=Ee.find(We=>We.textValue===Me))===null||re===void 0?void 0:re.ref.current;(function We(Be){z.current=Be,window.clearTimeout(j.current),Be!==""&&(j.current=window.setTimeout(()=>We(""),1e3))})(fe),rt&&setTimeout(()=>rt.focus())};w.useEffect(()=>()=>window.clearTimeout(j.current),[]),LPe();const Z=w.useCallback(U=>{var Q,re;return te.current===((Q=K.current)===null||Q===void 0?void 0:Q.side)&&dLe(U,(re=K.current)===null||re===void 0?void 0:re.area)},[]);return w.createElement(ZTe,{scope:n,searchRef:z,onItemEnter:w.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),onItemLeave:w.useCallback(U=>{var Q;Z(U)||((Q=R.current)===null||Q===void 0||Q.focus(),M(null))},[Z]),onTriggerLeave:w.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),pointerGraceTimerRef:H,onPointerGraceIntentChange:w.useCallback(U=>{K.current=U},[])},w.createElement(F,W,w.createElement(APe,{asChild:!0,trapped:i,onMountAutoFocus:ir(o,U=>{var Q;U.preventDefault(),(Q=R.current)===null||Q===void 0||Q.focus()}),onUnmountAutoFocus:a},w.createElement(EPe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m},w.createElement(BTe,bn({asChild:!0},_,{dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:M,onEntryFocus:U=>{k.isUsingKeyboardRef.current||U.preventDefault()}}),w.createElement(STe,bn({role:"menu","aria-orientation":"vertical","data-state":aLe(x.open),"data-radix-menu-content":"",dir:k.dir},E,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:ir(b.onKeyDown,U=>{const re=U.target.closest("[data-radix-menu-content]")===U.currentTarget,fe=U.ctrlKey||U.altKey||U.metaKey,Ee=U.key.length===1;re&&(U.key==="Tab"&&U.preventDefault(),!fe&&Ee&&X(U.key));const be=R.current;if(U.target!==be||!HTe.includes(U.key))return;U.preventDefault();const ze=P().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);hY.includes(U.key)&&ze.reverse(),sLe(ze)}),onBlur:ir(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(j.current),z.current="")}),onPointerMove:ir(e.onPointerMove,Q8(U=>{const Q=U.target,re=G.current!==U.clientX;if(U.currentTarget.contains(Q)&&re){const fe=U.clientX>G.current?"right":"left";te.current=fe,G.current=U.clientX}}))})))))))}),Z8="MenuItem",KD="menu.itemSelect",tLe=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=w.useRef(null),a=GP(Z8,e.__scopeMenu),s=mY(Z8,e.__scopeMenu),l=ps(t,o),u=w.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const m=new CustomEvent(KD,{bubbles:!0,cancelable:!0});h.addEventListener(KD,y=>r==null?void 0:r(y),{once:!0}),Uq(h,m),m.defaultPrevented?u.current=!1:a.onClose()}};return w.createElement(nLe,bn({},i,{ref:l,disabled:n,onClick:ir(e.onClick,d),onPointerDown:h=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,h),u.current=!0},onPointerUp:ir(e.onPointerUp,h=>{var m;u.current||(m=h.currentTarget)===null||m===void 0||m.click()}),onKeyDown:ir(e.onKeyDown,h=>{const m=s.searchRef.current!=="";n||m&&h.key===" "||$Te.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}))}),nLe=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=mY(Z8,n),s=gY(n),l=w.useRef(null),u=ps(t,l),[d,h]=w.useState(!1),[m,y]=w.useState("");return w.useEffect(()=>{const b=l.current;if(b){var x;y(((x=b.textContent)!==null&&x!==void 0?x:"").trim())}},[o.children]),w.createElement(X8.ItemSlot,{scope:n,disabled:r,textValue:i??m},w.createElement(FTe,bn({asChild:!0},s,{focusable:!r}),w.createElement(lc.div,bn({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:ir(e.onPointerMove,Q8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:ir(e.onPointerLeave,Q8(b=>a.onItemLeave(b))),onFocus:ir(e.onFocus,()=>h(!0)),onBlur:ir(e.onBlur,()=>h(!1))}))))}),rLe="MenuRadioGroup";Cp(rLe,{value:void 0,onValueChange:()=>{}});const iLe="MenuItemIndicator";Cp(iLe,{checked:!1});const oLe="MenuSub";Cp(oLe);function aLe(e){return e?"open":"closed"}function sLe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function lLe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function uLe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=lLe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function cLe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(u-s)*(r-l)/(d-l)+s&&(i=!i)}return i}function dLe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return cLe(n,t)}function Q8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const fLe=qTe,hLe=YTe,pLe=QTe,gLe=tLe,yY="ContextMenu",[mLe,Vze]=Gy(yY,[pY]),sw=pY(),[vLe,bY]=mLe(yY),yLe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=w.useState(!1),l=sw(t),u=du(r),d=w.useCallback(h=>{s(h),u(h)},[u]);return w.createElement(vLe,{scope:t,open:a,onOpenChange:d,modal:o},w.createElement(fLe,bn({},l,{dir:i,open:a,onOpenChange:d,modal:o}),n))},bLe="ContextMenuTrigger",SLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bY(bLe,n),o=sw(n),a=w.useRef({x:0,y:0}),s=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=w.useRef(0),u=w.useCallback(()=>window.clearTimeout(l.current),[]),d=h=>{a.current={x:h.clientX,y:h.clientY},i.onOpenChange(!0)};return w.useEffect(()=>u,[u]),w.createElement(w.Fragment,null,w.createElement(hLe,bn({},o,{virtualRef:s})),w.createElement(lc.span,bn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:ir(e.onContextMenu,h=>{u(),d(h),h.preventDefault()}),onPointerDown:ir(e.onPointerDown,Qb(h=>{u(),l.current=window.setTimeout(()=>d(h),700)})),onPointerMove:ir(e.onPointerMove,Qb(u)),onPointerCancel:ir(e.onPointerCancel,Qb(u)),onPointerUp:ir(e.onPointerUp,Qb(u))})))}),xLe="ContextMenuContent",wLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bY(xLe,n),o=sw(n),a=w.useRef(!1);return w.createElement(pLe,bn({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),CLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=sw(n);return w.createElement(gLe,bn({},i,r,{ref:t}))});function Qb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const _Le=yLe,kLe=SLe,ELe=wLe,dd=CLe,PLe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,SY=w.memo(e=>{var te,G,F,W,X,Z,U,Q;const t=Oe(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,shouldUseSingleGalleryColumn:a}=he(HEe),{image:s,isSelected:l}=e,{url:u,thumbnail:d,uuid:h,metadata:m}=s,[y,b]=w.useState(!1),x=By(),{t:k}=Ge(),E=()=>b(!0),_=()=>b(!1),P=()=>{var re,fe;if(s.metadata){const[Ee,be]=hP((fe=(re=s.metadata)==null?void 0:re.image)==null?void 0:fe.prompt);Ee&&t($x(Ee)),t(ny(be||""))}x({title:k("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},A=()=>{s.metadata&&t($y(s.metadata.image.seed)),x({title:k("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},M=()=>{t(T0(s)),n!=="img2img"&&t(Yo("img2img")),x({title:k("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},R=()=>{t(Fx(s)),t(Bx()),n!=="unifiedCanvas"&&t(Yo("unifiedCanvas")),x({title:k("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},D=()=>{m&&t(yU(m)),x({title:k("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},j=async()=>{var re;if((re=m==null?void 0:m.image)!=null&&re.init_image_path&&(await fetch(m.image.init_image_path)).ok){t(Yo("img2img")),t(hwe(m)),x({title:k("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}x({title:k("toast:initialImageNotSet"),description:k("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},z=()=>t(UI(s)),H=re=>{re.dataTransfer.setData("invokeai/imageUuid",h),re.dataTransfer.effectAllowed="move"},K=()=>{t(UI(s))};return v.jsxs(_Le,{onOpenChange:re=>{t(hU(re))},children:[v.jsx(kLe,{children:v.jsxs(Eo,{position:"relative",className:"hoverable-image",onMouseOver:E,onMouseOut:_,userSelect:"none",draggable:!0,onDragStart:H,children:[v.jsx(JS,{className:"hoverable-image-image",objectFit:a?"contain":r,rounded:"md",src:d||u,loading:"lazy"}),v.jsx("div",{className:"hoverable-image-content",onClick:z,children:l&&v.jsx(Na,{width:"50%",height:"50%",as:RP,className:"hoverable-image-check"})}),y&&i>=64&&v.jsx("div",{className:"hoverable-image-delete-button",children:v.jsx(iS,{image:s,children:v.jsx(us,{"aria-label":k("parameters:deleteImage"),icon:v.jsx(BEe,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},h)}),v.jsxs(ELe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:re=>{re.detail.originalEvent.preventDefault()},children:[v.jsx(dd,{onClickCapture:K,children:k("parameters:openInViewer")}),v.jsx(dd,{onClickCapture:P,disabled:((G=(te=s==null?void 0:s.metadata)==null?void 0:te.image)==null?void 0:G.prompt)===void 0,children:k("parameters:usePrompt")}),v.jsx(dd,{onClickCapture:A,disabled:((W=(F=s==null?void 0:s.metadata)==null?void 0:F.image)==null?void 0:W.seed)===void 0,children:k("parameters:useSeed")}),v.jsx(dd,{onClickCapture:D,disabled:!["txt2img","img2img"].includes((Z=(X=s==null?void 0:s.metadata)==null?void 0:X.image)==null?void 0:Z.type),children:k("parameters:useAll")}),v.jsx(dd,{onClickCapture:j,disabled:((Q=(U=s==null?void 0:s.metadata)==null?void 0:U.image)==null?void 0:Q.type)!=="img2img",children:k("parameters:useInitImg")}),v.jsx(dd,{onClickCapture:M,children:k("parameters:sendToImg2Img")}),v.jsx(dd,{onClickCapture:R,children:k("parameters:sendToUnifiedCanvas")}),v.jsx(dd,{"data-warning":!0,children:v.jsx(iS,{image:s,children:v.jsx("p",{children:k("parameters:deleteImage")})})})]})]})},PLe);SY.displayName="HoverableImage";const Jb=320,XD=40,TLe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},ZD=400;function xY(){const e=Oe(),{t}=Ge(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,areMoreImagesAvailable:b,galleryWidth:x,isLightboxOpen:k,isStaging:E,shouldEnableResize:_,shouldUseSingleGalleryColumn:P}=he(zEe),{galleryMinWidth:A,galleryMaxWidth:M}=k?{galleryMinWidth:ZD,galleryMaxWidth:ZD}:TLe[d],[R,D]=w.useState(x>=Jb),[j,z]=w.useState(!1),[H,K]=w.useState(0),te=w.useRef(null),G=w.useRef(null),F=w.useRef(null);w.useEffect(()=>{x>=Jb&&D(!1)},[x]);const W=()=>{e(ewe(!o)),e(vi(!0))},X=()=>{a?U():Z()},Z=()=>{e(zd(!0)),o&&e(vi(!0))},U=w.useCallback(()=>{e(zd(!1)),e(hU(!1)),e(twe(G.current?G.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),Q=()=>{e($8(r))},re=ye=>{e(av(ye))},fe=()=>{m||(F.current=window.setTimeout(()=>U(),500))},Ee=()=>{F.current&&window.clearTimeout(F.current)};et("g",()=>{X()},[a,o]),et("left",()=>{e(fP())},{enabled:!E||d!=="unifiedCanvas"},[E]),et("right",()=>{e(dP())},{enabled:!E||d!=="unifiedCanvas"},[E]),et("shift+g",()=>{W()},[o]),et("esc",()=>{e(zd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const be=32;return et("shift+up",()=>{if(l<256){const ye=ke.clamp(l+be,32,256);e(av(ye))}},[l]),et("shift+down",()=>{if(l>32){const ye=ke.clamp(l-be,32,256);e(av(ye))}},[l]),w.useEffect(()=>{G.current&&(G.current.scrollTop=s)},[s,a]),w.useEffect(()=>{function ye(ze){!o&&te.current&&!te.current.contains(ze.target)&&U()}return document.addEventListener("mousedown",ye),()=>{document.removeEventListener("mousedown",ye)}},[U,o]),v.jsx(Vq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:v.jsxs("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Ee,onMouseOver:o?void 0:Ee,children:[v.jsxs(jq,{minWidth:A,maxWidth:o?M:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:_},size:{width:x,height:o?"100%":"100vh"},onResizeStart:(ye,ze,Me)=>{K(Me.clientHeight),Me.style.height=`${Me.clientHeight}px`,o&&(Me.style.position="fixed",Me.style.right="1rem",z(!0))},onResizeStop:(ye,ze,Me,rt)=>{const We=o?ke.clamp(Number(x)+rt.width,A,Number(M)):Number(x)+rt.width;e(iwe(We)),Me.removeAttribute("data-resize-alert"),o&&(Me.style.position="relative",Me.style.removeProperty("right"),Me.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(ye,ze,Me,rt)=>{const We=ke.clamp(Number(x)+rt.width,A,Number(o?M:.95*window.innerWidth));We>=Jb&&!R?D(!0):WeWe-XD&&e(av(We-XD)),o&&(We>=M?Me.setAttribute("data-resize-alert","true"):Me.removeAttribute("data-resize-alert")),Me.style.height=`${H}px`},children:[v.jsxs("div",{className:"image-gallery-header",children:[v.jsx(oo,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:R?v.jsxs(v.Fragment,{children:[v.jsx(nr,{size:"sm","data-selected":r==="result",onClick:()=>e(Lb("result")),children:t("gallery:generations")}),v.jsx(nr,{size:"sm","data-selected":r==="user",onClick:()=>e(Lb("user")),children:t("gallery:uploads")})]}):v.jsxs(v.Fragment,{children:[v.jsx(Je,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:v.jsx(EEe,{}),onClick:()=>e(Lb("result"))}),v.jsx(Je,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:v.jsx($Ee,{}),onClick:()=>e(Lb("user"))})]})}),v.jsxs("div",{className:"image-gallery-header-right-icons",children:[v.jsx(Js,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:v.jsx(Je,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:v.jsx(BP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:v.jsxs("div",{className:"image-gallery-settings-popover",children:[v.jsxs("div",{children:[v.jsx(so,{value:l,onChange:re,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),v.jsx(Je,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(av(64)),icon:v.jsx(Yx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:maintainAspectRatio"),isChecked:h==="contain",onChange:()=>e(nwe(h==="contain"?"cover":"contain"))})}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:autoSwitchNewImages"),isChecked:y,onChange:ye=>e(rwe(ye.target.checked))})}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:singleColumnLayout"),isChecked:P,onChange:ye=>e(owe(ye.target.checked))})})]})}),v.jsx(Je,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:W,icon:o?v.jsx(Bq,{}):v.jsx(Fq,{})})]})]}),v.jsx("div",{className:"image-gallery-container",ref:G,children:n.length||b?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(ye=>{const{uuid:ze}=ye,Me=i===ze;return v.jsx(SY,{image:ye,isSelected:Me},ze)})}),v.jsx(ls,{onClick:Q,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):v.jsxs("div",{className:"image-gallery-container-placeholder",children:[v.jsx($q,{}),v.jsx("p",{children:t("gallery:noImagesInGallery")})]})})]}),j&&v.jsx("div",{style:{width:`${x}px`,height:"100%"}})]})})}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -489,7 +489,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var J8=function(e,t){return J8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},J8(e,t)};function LLe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");J8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ou=function(){return ou=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function mf(e,t,n,r){var i=ULe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=t.scale-s,h=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):_Y(e,r,n,function(v){var b=s+d*v,S=l+h*v,_=u+m*v;o(b,S,_)})}}function ULe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function GLe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,d=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:d}}var qLe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,d=s,h=r-i-l,m=l;return{minPositionX:u,maxPositionX:d,minPositionY:h,maxPositionY:m}},GP=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=GLe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,d=o.newContentHeight,h=o.newDiffHeight,m=qLe(a,l,u,s,d,h,Boolean(i));return m},c0=function(e,t){var n=GP(e,t);return e.bounds=n,n};function lw(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,d=n.maxPositionY,h=0,m=0;a&&(h=i,m=o);var v=e_(e,s-h,u+h,r),b=e_(t,l-m,d+m,r);return{x:v,y:b}}var e_=function(e,t,n,r){return r?en?os(n,2):os(e,2):os(e,2)};function uw(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var h=l-t*d,m=u-n*d,v=lw(h,m,i,o,0,0,null);return v}function Yy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var QD=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=cw(o,n);return!l},JD=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},YLe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},KLe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function XLe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var d=e.bounds,h=d.maxPositionX,m=d.minPositionX,v=d.maxPositionY,b=d.minPositionY,S=n>h||nv||rh?u.offsetWidth:e.setup.minPositionX||0,k=r>v?u.offsetHeight:e.setup.minPositionY||0,T=uw(e,E,k,i,e.bounds,s||l),A=T.x,M=T.y;return{scale:i,positionX:S?A:n,positionY:_?M:r}}}function ZLe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,d=l.positionX,h=l.positionY,m=t!==d,v=n!==h,b=!m||!v;if(!(!a||b||!s)){var S=lw(t,n,s,o,r,i,a),_=S.x,E=S.y;e.setTransformState(u,_,E)}}var QLe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var d=t-r.x,h=n-r.y,m=a?l:d,v=s?u:h;return{x:m,y:v}},dS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},JLe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},eAe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function tAe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function eN(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var d=a+(e-a)*u;return d>l?l:do?o:d}}return r?t:e_(e,o,a,i)}function nAe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function rAe(e,t){var n=JLe(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=nAe(a,s),d=t.x-r.x,h=t.y-r.y,m=d/u,v=h/u,b=l-i,S=d*d+h*h,_=Math.sqrt(S)/b;e.velocity={velocityX:m,velocityY:v,total:_}}e.lastMousePosition=t,e.velocityTime=l}}function iAe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=eAe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,d=n.minPositionX,h=n.maxPositionY,m=n.minPositionY,v=r.limitToBounds,b=r.alignmentAnimation,S=r.zoomAnimation,_=r.panning,E=_.lockAxisY,k=_.lockAxisX,T=S.animationType,A=b.sizeX,M=b.sizeY,R=b.velocityAlignmentTime,D=R,j=tAe(e,l),z=Math.max(j,D),H=dS(e,A),K=dS(e,M),te=H*i.offsetWidth/100,G=K*i.offsetHeight/100,$=u+te,W=d-te,X=h+G,Z=m-G,U=e.transformState,Q=new Date().getTime();_Y(e,T,z,function(re){var fe=e.transformState,Ee=fe.scale,be=fe.positionX,ye=fe.positionY,Fe=new Date().getTime()-Q,Me=Fe/D,rt=wY[b.animationType],Ve=1-rt(Math.min(1,Me)),je=1-re,wt=be+a*je,Be=ye+s*je,at=eN(wt,U.positionX,be,k,v,d,u,W,$,Ve),bt=eN(Be,U.positionY,ye,E,v,m,h,Z,X,Ve);(be!==wt||ye!==Be)&&e.setTransformState(Ee,at,bt)})}}function tN(e,t){var n=e.transformState.scale;Ul(e),c0(e,n),t.touches?KLe(e,t):YLe(e,t)}function nN(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(r){var l=QLe(e,t,n),u=l.x,d=l.y,h=dS(e,a),m=dS(e,s);rAe(e,{x:u,y:d}),ZLe(e,u,d,h,m)}}function oAe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,d=(a==null?void 0:a.height)||0,h=s.1&&h;m?iAe(e):kY(e)}}function kY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,d=o||t=a;if((r>=1||s)&&kY(e),!(m||!i||!e.mounted)){var v=t||i.offsetWidth/2,b=n||i.offsetHeight/2,S=qP(e,a,v,b);S&&mf(e,S,d,h)}}function qP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Yy(os(t,2),o,a,0,!1),u=c0(e,l),d=uw(e,n,r,l,u,s),h=d.x,m=d.y;return{scale:l,positionX:h,positionY:m}}var pm={previousScale:1,scale:1,positionX:0,positionY:0},aAe=ou(ou({},pm),{setComponents:function(){},contextInstance:null}),pv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},PY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:pm.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:pm.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:pm.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:pm.positionY}},rN=function(e){var t=ou({},pv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof pv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(pv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=ou(ou({},pv[n]),e[n]):s?t[n]=ZD(ZD([],pv[n]),e[n]):t[n]=e[n]}}),t},TY=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var d=r*Math.exp(t*n),h=Yy(os(d,3),s,a,u,!1);return h};function LY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var d=o.offsetWidth,h=o.offsetHeight,m=(d/2-l)/s,v=(h/2-u)/s,b=TY(e,t,n),S=qP(e,b,m,v);if(!S)return console.error("Error during zoom event. New transformation state was not calculated.");mf(e,S,r,i)}function AY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=PY(e.props),s=e.transformState,l=s.scale,u=s.positionX,d=s.positionY;if(i){var h=GP(e,a.scale),m=lw(a.positionX,a.positionY,h,o,0,0,i),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&d===a.positionY||mf(e,v,t,n)}}function sAe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return pm;var l=r.getBoundingClientRect(),u=lAe(t),d=u.x,h=u.y,m=t.offsetWidth,v=t.offsetHeight,b=r.offsetWidth/m,S=r.offsetHeight/v,_=Yy(n||Math.min(b,S),a,s,0,!1),E=(l.width-m*_)/2,k=(l.height-v*_)/2,T=(l.left-d)*_+E,A=(l.top-h)*_+k,M=GP(e,_),R=lw(T,A,M,o,0,0,r),D=R.x,j=R.y;return{positionX:D,positionY:j,scale:_}}function lAe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function uAe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var cAe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),LY(e,1,t,n,r)}},dAe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),LY(e,-1,t,n,r)}},fAe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,d=e.wrapperComponent,h=e.contentComponent,m=e.setup.disabled;if(!(m||!d||!h)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};mf(e,v,i,o)}}},hAe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),AY(e,t,n)}},pAe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=OY(t||i.scale,o,a);mf(e,s,n,r)}}},gAe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Ul(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&uAe(a)&&a&&o.contains(a)){var s=sAe(e,a,n);mf(e,s,r,i)}}},ri=function(e){return{instance:e,state:e.transformState,zoomIn:cAe(e),zoomOut:dAe(e),setTransform:fAe(e),resetTransform:hAe(e),centerView:pAe(e),zoomToElement:gAe(e)}},GC=!1;function qC(){try{var e={get passive(){return GC=!0,!1}};return e}catch{return GC=!1,GC}}var cw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},iN=function(e){e&&clearTimeout(e)},mAe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},OY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},vAe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,d=s&&!l&&!r&&u;if(!d||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var h=cw(u,a);return!h};function yAe(e,t){var n=e?e.deltaY<0?1:-1:0,r=ALe(t,n);return r}function MY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var bAe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,d=s.zoomAnimation,h=d.size,m=d.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*n)*n;if(i)return v;var b=r?!1:!m,S=Yy(os(v,3),u,l,h,b);return S},SAe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},xAe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=cw(a,i);return!l},wAe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},CAe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=os(i[0].clientX-r.left,5),a=os(i[0].clientY-r.top,5),s=os(i[1].clientX-r.left,5),l=os(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},IY=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},_Ae=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var d=t/r,h=d*n;return Yy(os(h,2),a,o,l,!u)},kAe=160,EAe=100,PAe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Ul(e),Pi(ri(e),t,r),Pi(ri(e),t,i))},TAe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,d=a.centerZoomedOut,h=a.zoomAnimation,m=a.wheel,v=h.size,b=h.disabled,S=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var _=yAe(t,null),E=bAe(e,_,S,!t.ctrlKey);if(l!==E){var k=c0(e,E),T=MY(t,o,l),A=b||v===0||d,M=u&&A,R=uw(e,T.x,T.y,E,k,M),D=R.x,j=R.y;e.previousWheelEvent=t,e.setTransformState(E,D,j),Pi(ri(e),t,r),Pi(ri(e),t,i)}},LAe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;iN(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(EY(e,t.x,t.y),e.wheelAnimationTimer=null)},EAe);var o=SAe(e,t);o&&(iN(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Pi(ri(e),t,r),Pi(ri(e),t,i))},kAe))},AAe=function(e,t){var n=IY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Ul(e)},OAe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,d=l.size;if(!(r===null||!n)){var h=CAe(t,i,n);if(!(!isFinite(h.x)||!isFinite(h.y))){var m=IY(t),v=_Ae(e,m);if(v!==i){var b=c0(e,v),S=u||d===0||s,_=a&&S,E=uw(e,h.x,h.y,v,b,_),k=E.x,T=E.y;e.pinchMidpoint=h,e.lastDistance=m,e.setTransformState(v,k,T)}}}},MAe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,EY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function IAe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return AY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var d=i==="zoomOut"?-1:1,h=TY(e,d,o),m=MY(t,u,l),v=qP(e,h,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");mf(e,v,a,s)}}var RAe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),d=n&&l&&u&&!a;if(!d)return!1;var h=cw(l,s);return!(h||!d)},RY=N.createContext(aAe),DAe=function(e){LLe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=PY(n.props),n.setup=rN(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=qC();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=vAe(n,r);if(o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(PAe(n,r),TAe(n,r),LAe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=QD(n,r);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),Ul(n),tN(n,r),Pi(ri(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=JD(n);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),nN(n,r.clientX,r.clientY),Pi(ri(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(oAe(n),Pi(ri(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=xAe(n,r);l&&(AAe(n,r),Ul(n),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=wAe(n);l&&(r.preventDefault(),r.stopPropagation(),OAe(n,r),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(MAe(n),Pi(ri(n),r,o),Pi(ri(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=QD(n,r);if(a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Ul(n);var l=r.touches,u=l.length===1,d=l.length===2;u&&(Ul(n),tN(n,r),Pi(ri(n),r,o)),d&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=JD(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];nN(n,s.clientX,s.clientY),Pi(ri(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=RAe(n,r);o&&IAe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,c0(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Pi(ri(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=OY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=mAe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ri(n))},n}return t.prototype.componentDidMount=function(){var n=qC();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=qC();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Ul(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(c0(this,this.transformState.scale),this.setup=rN(this.props))},t.prototype.render=function(){var n=ri(this),r=this.props.children,i=typeof r=="function"?r(n):r;return N.createElement(RY.Provider,{value:ou(ou({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},i)},t}(w.Component),NAe=N.forwardRef(function(e,t){var n=w.useState(null),r=n[0],i=n[1];return w.useImperativeHandle(t,function(){return r},[r]),N.createElement(DAe,ou({},e,{setRef:i}))});function jAe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var BAe=`.transform-component-module_wrapper__1_Fgj { +***************************************************************************** */var J8=function(e,t){return J8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},J8(e,t)};function LLe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");J8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ou=function(){return ou=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function vf(e,t,n,r){var i=ULe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=t.scale-s,h=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):_Y(e,r,n,function(y){var b=s+d*y,x=l+h*y,k=u+m*y;o(b,x,k)})}}function ULe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function GLe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,d=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:d}}var qLe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,d=s,h=r-i-l,m=l;return{minPositionX:u,maxPositionX:d,minPositionY:h,maxPositionY:m}},qP=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=GLe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,d=o.newContentHeight,h=o.newDiffHeight,m=qLe(a,l,u,s,d,h,Boolean(i));return m},d0=function(e,t){var n=qP(e,t);return e.bounds=n,n};function lw(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,d=n.maxPositionY,h=0,m=0;a&&(h=i,m=o);var y=e_(e,s-h,u+h,r),b=e_(t,l-m,d+m,r);return{x:y,y:b}}var e_=function(e,t,n,r){return r?en?os(n,2):os(e,2):os(e,2)};function uw(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var h=l-t*d,m=u-n*d,y=lw(h,m,i,o,0,0,null);return y}function Yy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var JD=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=cw(o,n);return!l},eN=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},YLe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},KLe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function XLe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var d=e.bounds,h=d.maxPositionX,m=d.minPositionX,y=d.maxPositionY,b=d.minPositionY,x=n>h||ny||rh?u.offsetWidth:e.setup.minPositionX||0,_=r>y?u.offsetHeight:e.setup.minPositionY||0,P=uw(e,E,_,i,e.bounds,s||l),A=P.x,M=P.y;return{scale:i,positionX:x?A:n,positionY:k?M:r}}}function ZLe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,d=l.positionX,h=l.positionY,m=t!==d,y=n!==h,b=!m||!y;if(!(!a||b||!s)){var x=lw(t,n,s,o,r,i,a),k=x.x,E=x.y;e.setTransformState(u,k,E)}}var QLe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var d=t-r.x,h=n-r.y,m=a?l:d,y=s?u:h;return{x:m,y}},dS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},JLe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},eAe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function tAe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function tN(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var d=a+(e-a)*u;return d>l?l:do?o:d}}return r?t:e_(e,o,a,i)}function nAe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function rAe(e,t){var n=JLe(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=nAe(a,s),d=t.x-r.x,h=t.y-r.y,m=d/u,y=h/u,b=l-i,x=d*d+h*h,k=Math.sqrt(x)/b;e.velocity={velocityX:m,velocityY:y,total:k}}e.lastMousePosition=t,e.velocityTime=l}}function iAe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=eAe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,d=n.minPositionX,h=n.maxPositionY,m=n.minPositionY,y=r.limitToBounds,b=r.alignmentAnimation,x=r.zoomAnimation,k=r.panning,E=k.lockAxisY,_=k.lockAxisX,P=x.animationType,A=b.sizeX,M=b.sizeY,R=b.velocityAlignmentTime,D=R,j=tAe(e,l),z=Math.max(j,D),H=dS(e,A),K=dS(e,M),te=H*i.offsetWidth/100,G=K*i.offsetHeight/100,F=u+te,W=d-te,X=h+G,Z=m-G,U=e.transformState,Q=new Date().getTime();_Y(e,P,z,function(re){var fe=e.transformState,Ee=fe.scale,be=fe.positionX,ye=fe.positionY,ze=new Date().getTime()-Q,Me=ze/D,rt=wY[b.animationType],We=1-rt(Math.min(1,Me)),Be=1-re,wt=be+a*Be,Fe=ye+s*Be,at=tN(wt,U.positionX,be,_,y,d,u,W,F,We),bt=tN(Fe,U.positionY,ye,E,y,m,h,Z,X,We);(be!==wt||ye!==Fe)&&e.setTransformState(Ee,at,bt)})}}function nN(e,t){var n=e.transformState.scale;Ul(e),d0(e,n),t.touches?KLe(e,t):YLe(e,t)}function rN(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(r){var l=QLe(e,t,n),u=l.x,d=l.y,h=dS(e,a),m=dS(e,s);rAe(e,{x:u,y:d}),ZLe(e,u,d,h,m)}}function oAe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,d=(a==null?void 0:a.height)||0,h=s.1&&h;m?iAe(e):kY(e)}}function kY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,d=o||t=a;if((r>=1||s)&&kY(e),!(m||!i||!e.mounted)){var y=t||i.offsetWidth/2,b=n||i.offsetHeight/2,x=YP(e,a,y,b);x&&vf(e,x,d,h)}}function YP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Yy(os(t,2),o,a,0,!1),u=d0(e,l),d=uw(e,n,r,l,u,s),h=d.x,m=d.y;return{scale:l,positionX:h,positionY:m}}var gm={previousScale:1,scale:1,positionX:0,positionY:0},aAe=ou(ou({},gm),{setComponents:function(){},contextInstance:null}),gv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},PY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:gm.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:gm.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:gm.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:gm.positionY}},iN=function(e){var t=ou({},gv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof gv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(gv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=ou(ou({},gv[n]),e[n]):s?t[n]=QD(QD([],gv[n]),e[n]):t[n]=e[n]}}),t},TY=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var d=r*Math.exp(t*n),h=Yy(os(d,3),s,a,u,!1);return h};function LY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var d=o.offsetWidth,h=o.offsetHeight,m=(d/2-l)/s,y=(h/2-u)/s,b=TY(e,t,n),x=YP(e,b,m,y);if(!x)return console.error("Error during zoom event. New transformation state was not calculated.");vf(e,x,r,i)}function AY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=PY(e.props),s=e.transformState,l=s.scale,u=s.positionX,d=s.positionY;if(i){var h=qP(e,a.scale),m=lw(a.positionX,a.positionY,h,o,0,0,i),y={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&d===a.positionY||vf(e,y,t,n)}}function sAe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return gm;var l=r.getBoundingClientRect(),u=lAe(t),d=u.x,h=u.y,m=t.offsetWidth,y=t.offsetHeight,b=r.offsetWidth/m,x=r.offsetHeight/y,k=Yy(n||Math.min(b,x),a,s,0,!1),E=(l.width-m*k)/2,_=(l.height-y*k)/2,P=(l.left-d)*k+E,A=(l.top-h)*k+_,M=qP(e,k),R=lw(P,A,M,o,0,0,r),D=R.x,j=R.y;return{positionX:D,positionY:j,scale:k}}function lAe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function uAe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var cAe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),LY(e,1,t,n,r)}},dAe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),LY(e,-1,t,n,r)}},fAe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,d=e.wrapperComponent,h=e.contentComponent,m=e.setup.disabled;if(!(m||!d||!h)){var y={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};vf(e,y,i,o)}}},hAe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),AY(e,t,n)}},pAe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=OY(t||i.scale,o,a);vf(e,s,n,r)}}},gAe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Ul(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&uAe(a)&&a&&o.contains(a)){var s=sAe(e,a,n);vf(e,s,r,i)}}},ri=function(e){return{instance:e,state:e.transformState,zoomIn:cAe(e),zoomOut:dAe(e),setTransform:fAe(e),resetTransform:hAe(e),centerView:pAe(e),zoomToElement:gAe(e)}},GC=!1;function qC(){try{var e={get passive(){return GC=!0,!1}};return e}catch{return GC=!1,GC}}var cw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},oN=function(e){e&&clearTimeout(e)},mAe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},OY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},vAe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,d=s&&!l&&!r&&u;if(!d||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var h=cw(u,a);return!h};function yAe(e,t){var n=e?e.deltaY<0?1:-1:0,r=ALe(t,n);return r}function MY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var bAe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,d=s.zoomAnimation,h=d.size,m=d.disabled;if(!a)throw new Error("Wrapper is not mounted");var y=o+t*(o-o*n)*n;if(i)return y;var b=r?!1:!m,x=Yy(os(y,3),u,l,h,b);return x},SAe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},xAe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=cw(a,i);return!l},wAe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},CAe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=os(i[0].clientX-r.left,5),a=os(i[0].clientY-r.top,5),s=os(i[1].clientX-r.left,5),l=os(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},IY=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},_Ae=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var d=t/r,h=d*n;return Yy(os(h,2),a,o,l,!u)},kAe=160,EAe=100,PAe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Ul(e),Pi(ri(e),t,r),Pi(ri(e),t,i))},TAe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,d=a.centerZoomedOut,h=a.zoomAnimation,m=a.wheel,y=h.size,b=h.disabled,x=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var k=yAe(t,null),E=bAe(e,k,x,!t.ctrlKey);if(l!==E){var _=d0(e,E),P=MY(t,o,l),A=b||y===0||d,M=u&&A,R=uw(e,P.x,P.y,E,_,M),D=R.x,j=R.y;e.previousWheelEvent=t,e.setTransformState(E,D,j),Pi(ri(e),t,r),Pi(ri(e),t,i)}},LAe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;oN(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(EY(e,t.x,t.y),e.wheelAnimationTimer=null)},EAe);var o=SAe(e,t);o&&(oN(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Pi(ri(e),t,r),Pi(ri(e),t,i))},kAe))},AAe=function(e,t){var n=IY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Ul(e)},OAe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,d=l.size;if(!(r===null||!n)){var h=CAe(t,i,n);if(!(!isFinite(h.x)||!isFinite(h.y))){var m=IY(t),y=_Ae(e,m);if(y!==i){var b=d0(e,y),x=u||d===0||s,k=a&&x,E=uw(e,h.x,h.y,y,b,k),_=E.x,P=E.y;e.pinchMidpoint=h,e.lastDistance=m,e.setTransformState(y,_,P)}}}},MAe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,EY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function IAe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return AY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var d=i==="zoomOut"?-1:1,h=TY(e,d,o),m=MY(t,u,l),y=YP(e,h,m.x,m.y);if(!y)return console.error("Error during zoom event. New transformation state was not calculated.");vf(e,y,a,s)}}var RAe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),d=n&&l&&u&&!a;if(!d)return!1;var h=cw(l,s);return!(h||!d)},RY=N.createContext(aAe),DAe=function(e){LLe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=PY(n.props),n.setup=iN(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=qC();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=vAe(n,r);if(o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(PAe(n,r),TAe(n,r),LAe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=JD(n,r);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),Ul(n),nN(n,r),Pi(ri(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=eN(n);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),rN(n,r.clientX,r.clientY),Pi(ri(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(oAe(n),Pi(ri(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=xAe(n,r);l&&(AAe(n,r),Ul(n),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=wAe(n);l&&(r.preventDefault(),r.stopPropagation(),OAe(n,r),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(MAe(n),Pi(ri(n),r,o),Pi(ri(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=JD(n,r);if(a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Ul(n);var l=r.touches,u=l.length===1,d=l.length===2;u&&(Ul(n),nN(n,r),Pi(ri(n),r,o)),d&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=eN(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];rN(n,s.clientX,s.clientY),Pi(ri(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=RAe(n,r);o&&IAe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,d0(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Pi(ri(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=OY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=mAe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ri(n))},n}return t.prototype.componentDidMount=function(){var n=qC();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=qC();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Ul(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(d0(this,this.transformState.scale),this.setup=iN(this.props))},t.prototype.render=function(){var n=ri(this),r=this.props.children,i=typeof r=="function"?r(n):r;return N.createElement(RY.Provider,{value:ou(ou({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},i)},t}(w.Component),NAe=N.forwardRef(function(e,t){var n=w.useState(null),r=n[0],i=n[1];return w.useImperativeHandle(t,function(){return r},[r]),N.createElement(DAe,ou({},e,{setRef:i}))});function jAe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var BAe=`.transform-component-module_wrapper__1_Fgj { position: relative; width: -moz-fit-content; width: fit-content; @@ -519,7 +519,7 @@ PERFORMANCE OF THIS SOFTWARE. .transform-component-module_content__2jYgh img { pointer-events: none; } -`,oN={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};jAe(BAe);var $Ae=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=w.useContext(RY).setComponents,u=w.useRef(null),d=w.useRef(null);return w.useEffect(function(){var h=u.current,m=d.current;h!==null&&m!==null&&l&&l(h,m)},[]),N.createElement("div",{ref:u,className:"react-transform-wrapper "+oN.wrapper+" "+r,style:a},N.createElement("div",{ref:d,className:"react-transform-component "+oN.content+" "+o,style:s},t))};function FAe({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=w.useState(0),[a,s]=w.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},d=()=>{s(!a)};return y.jsx(NAe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:h,zoomOut:m,resetTransform:v,centerView:b})=>y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"lightbox-image-options",children:[y.jsx(Je,{icon:y.jsx(A_e,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>h(),fontSize:20}),y.jsx(Je,{icon:y.jsx(O_e,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),y.jsx(Je,{icon:y.jsx(T_e,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),y.jsx(Je,{icon:y.jsx(L_e,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),y.jsx(Je,{icon:y.jsx(sPe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),y.jsx(Je,{icon:y.jsx(Yx,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{v(),o(0),s(!1)},fontSize:20})]}),y.jsx($Ae,{wrapperStyle:{width:"100%",height:"100%"},children:y.jsx("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function zAe(){const e=Oe(),t=he(m=>m.lightbox.isLightboxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=he(Nq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(dP())},h=()=>{e(cP())};return et("Esc",()=>{t&&e(zm(!1))},[t]),y.jsxs("div",{className:"lightbox-container",children:[y.jsx(Je,{icon:y.jsx(P_e,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(zm(!1))},fontSize:20}),y.jsxs("div",{className:"lightbox-display-container",children:[y.jsxs("div",{className:"lightbox-preview-wrapper",children:[y.jsx(Rq,{}),!r&&y.jsxs("div",{className:"current-image-next-prev-buttons",children:[y.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&y.jsx(us,{"aria-label":"Previous image",icon:y.jsx(Cq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),y.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&y.jsx(us,{"aria-label":"Next image",icon:y.jsx(_q,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),n&&y.jsxs(y.Fragment,{children:[y.jsx(FAe,{image:n.url,styleClass:"lightbox-image"}),r&&y.jsx(BP,{image:n})]})]}),y.jsx(xY,{})]})]})}function HAe(e){return mt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}const VAe=lt(xp,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),WAe=()=>{const{resultImages:e,userImages:t}=he(VAe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},UAe=lt([bp,qx,Mr],(e,t,n)=>{const{shouldShowDualDisplay:r,shouldPinParametersPanel:i}=e,{isLightboxOpen:o}=t;return{shouldShowDualDisplay:r,shouldPinParametersPanel:i,isLightboxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),YP=e=>{const t=Oe(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,shouldShowDualDisplay:a,isLightboxOpen:s,shouldShowDualDisplayButton:l}=he(UAe),u=WAe(),d=()=>{t(ECe(!a)),t(vi(!0))},h=m=>{const v=m.dataTransfer.getData("invokeai/imageUuid"),b=u(v);b&&(o==="img2img"?t(P0(b)):o==="unifiedCanvas"&&t($x(b)))};return y.jsx("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:y.jsxs("div",{className:"workarea-main",children:[n,y.jsxs("div",{className:"workarea-children-wrapper",onDrop:h,children:[r,l&&y.jsx(uo,{label:"Toggle Split View",children:y.jsx("div",{className:"workarea-split-button","data-selected":a,onClick:d,children:y.jsx(HAe,{})})})]}),!s&&y.jsx(xY,{})]})})},GAe=e=>{const{styleClass:t}=e,n=w.useContext(EP),r=()=>{n&&n()};return y.jsx("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:y.jsxs("div",{className:"image-upload-button",children:[y.jsx(tw,{}),y.jsx(jh,{size:"lg",children:"Click or Drag and Drop"})]})})},qAe=lt([xp,bp,Mr],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),DY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=he(qAe);return y.jsx("div",{className:"current-image-area","data-tab-name":t,children:e?y.jsxs(y.Fragment,{children:[y.jsx(Rq,{}),y.jsx(KEe,{})]}):y.jsx("div",{className:"current-image-display-placeholder",children:y.jsx(lPe,{})})})},YAe=()=>{const e=w.useContext(EP);return y.jsx(Je,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:y.jsx(tw,{}),onClick:e||void 0})};function KAe(){const e=he(o=>o.generation.initialImage),{t}=Ue(),n=Oe(),r=By(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(vU())};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"init-image-preview-header",children:[y.jsx("h2",{children:t("parameters:initialImage")}),y.jsx(YAe,{})]}),e&&y.jsx("div",{className:"init-image-preview",children:y.jsx(JS,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const XAe=()=>{const e=he(r=>r.generation.initialImage),{currentImage:t}=he(r=>r.gallery),n=e?y.jsx("div",{className:"image-to-image-area",children:y.jsx(KAe,{})}):y.jsx(GAe,{});return y.jsxs("div",{className:"workarea-split-view",children:[y.jsx("div",{className:"workarea-split-view-left",children:n}),t&&y.jsx("div",{className:"workarea-split-view-right",children:y.jsx(DY,{})})]})};var ao=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(ao||{});const ZAe=()=>{const{t:e}=Ue();return w.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},QAe=e=>ZAe()[e],Us=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return y.jsxs(fn,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[y.jsx(En,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),y.jsx(WE,{className:"invokeai__switch-root",...s})]})};function NY(){const e=he(i=>i.system.isGFPGANAvailable),t=he(i=>i.postprocessing.shouldRunFacetool),n=Oe(),r=i=>n(wwe(i.target.checked));return y.jsx(Us,{isDisabled:!e,isChecked:t,onChange:r})}function JAe(){const e=Oe(),t=he(i=>i.generation.shouldFitToWidthHeight),n=i=>e(PU(i.target.checked)),{t:r}=Ue();return y.jsx(Us,{label:r("parameters:imageFit"),isChecked:t,onChange:n})}function jY(e){const{t}=Ue(),{label:n=`${t("parameters:strength")}`,styleClass:r}=e,i=he(l=>l.generation.img2imgStrength),o=Oe(),a=l=>o(p8(l)),s=()=>{o(p8(.75))};return y.jsx(so,{label:n,step:.01,min:.01,max:1,onChange:a,value:i,isInteger:!1,styleClass:r,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:s})}const BY=()=>{const e=Oe(),t=he(i=>i.generation.seamless),n=i=>e(kU(i.target.checked)),{t:r}=Ue();return y.jsx(Ge,{gap:2,direction:"column",children:y.jsx(Us,{label:r("parameters:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},eOe=()=>y.jsx(Ge,{gap:2,direction:"column",children:y.jsx(BY,{})});function tOe(){const e=Oe(),t=he(i=>i.generation.perlin),{t:n}=Ue(),r=i=>e(CU(i));return y.jsx(ia,{label:n("parameters:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}function nOe(){const e=Oe(),{t}=Ue(),n=he(i=>i.generation.shouldRandomizeSeed),r=i=>e(mwe(i.target.checked));return y.jsx(Us,{label:t("parameters:randomizeSeed"),isChecked:n,onChange:r})}function rOe(){const e=he(a=>a.generation.seed),t=he(a=>a.generation.shouldRandomizeSeed),n=he(a=>a.generation.shouldGenerateVariations),{t:r}=Ue(),i=Oe(),o=a=>i(Fy(a));return y.jsx(ia,{label:r("parameters:seed"),step:1,precision:0,flexGrow:1,min:bP,max:SP,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function iOe(){const e=Oe(),t=he(i=>i.generation.shouldRandomizeSeed),{t:n}=Ue(),r=()=>e(Fy(eq(bP,SP)));return y.jsx(ls,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:y.jsx("p",{children:n("parameters:shuffle")})})}function oOe(){const e=Oe(),t=he(i=>i.generation.threshold),{t:n}=Ue(),r=i=>e(LU(i));return y.jsx(ia,{label:n("parameters:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}const KP=()=>y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(nOe,{}),y.jsxs(Ge,{gap:2,children:[y.jsx(rOe,{}),y.jsx(iOe,{})]}),y.jsx(Ge,{gap:2,children:y.jsx(oOe,{})}),y.jsx(Ge,{gap:2,children:y.jsx(tOe,{})})]});function $Y(){const e=he(i=>i.system.isESRGANAvailable),t=he(i=>i.postprocessing.shouldRunESRGAN),n=Oe(),r=i=>n(xwe(i.target.checked));return y.jsx(Us,{isDisabled:!e,isChecked:t,onChange:r})}function XP(){const e=he(r=>r.generation.shouldGenerateVariations),t=Oe(),n=r=>t(gwe(r.target.checked));return y.jsx(Us,{isChecked:e,width:"auto",onChange:n})}function br(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return y.jsxs(fn,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&y.jsx(En,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),y.jsx(bk,{...l,className:"input-entry",size:a,width:o})]})}function aOe(){const e=he(o=>o.generation.seedWeights),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ue(),r=Oe(),i=o=>r(EU(o.target.value));return y.jsx(br,{label:n("parameters:seedWeights"),value:e,isInvalid:t&&!(hP(e)||e===""),isDisabled:!t,onChange:i})}function sOe(){const e=he(o=>o.generation.variationAmount),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ue(),r=Oe(),i=o=>r(vwe(o));return y.jsx(ia,{label:n("parameters:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const ZP=()=>y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(sOe,{}),y.jsx(aOe,{})]});function lOe(){const e=Oe(),t=he(i=>i.generation.cfgScale),{t:n}=Ue(),r=i=>e(bU(i));return y.jsx(ia,{label:n("parameters:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function uOe(){const e=he(o=>o.generation.height),t=he(Mr),n=Oe(),{t:r}=Ue(),i=o=>n(SU(Number(o.target.value)));return y.jsx(rl,{isDisabled:t==="unifiedCanvas",label:r("parameters:height"),value:e,flexGrow:1,onChange:i,validValues:S7e,styleClass:"main-settings-block"})}const cOe=lt([e=>e.generation],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function dOe(){const e=Oe(),{iterations:t}=he(cOe),{t:n}=Ue(),r=i=>e(pwe(i));return y.jsx(ia,{label:n("parameters:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function fOe(){const e=he(o=>o.generation.sampler),t=he(oq),n=Oe(),{t:r}=Ue(),i=o=>n(_U(o.target.value));return y.jsx(rl,{label:r("parameters:sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?y7e:v7e,styleClass:"main-settings-block"})}function hOe(){const e=Oe(),t=he(i=>i.generation.steps),{t:n}=Ue(),r=i=>e(TU(i));return y.jsx(ia,{label:n("parameters:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function pOe(){const e=he(o=>o.generation.width),t=he(Mr),{t:n}=Ue(),r=Oe(),i=o=>r(AU(Number(o.target.value)));return y.jsx(rl,{isDisabled:t==="unifiedCanvas",label:n("parameters:width"),value:e,flexGrow:1,onChange:i,validValues:b7e,styleClass:"main-settings-block"})}function QP(){return y.jsx("div",{className:"main-settings",children:y.jsxs("div",{className:"main-settings-list",children:[y.jsxs("div",{className:"main-settings-row",children:[y.jsx(dOe,{}),y.jsx(hOe,{}),y.jsx(lOe,{})]}),y.jsxs("div",{className:"main-settings-row",children:[y.jsx(pOe,{}),y.jsx(uOe,{}),y.jsx(fOe,{})]})]})})}const gOe=lt(or,e=>e.shouldDisplayGuides),mOe=({children:e,feature:t})=>{const n=he(gOe),{text:r}=QAe(t);return n?y.jsxs(BE,{trigger:"hover",children:[y.jsx(zE,{children:y.jsx(Eo,{children:e})}),y.jsxs(FE,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[y.jsx($E,{className:"guide-popover-arrow"}),y.jsx("div",{className:"guide-popover-guide-content",children:r})]})]}):null},vOe=Ae(({feature:e,icon:t=oPe},n)=>y.jsx(mOe,{feature:e,children:y.jsx(Eo,{ref:n,children:y.jsx(Na,{marginBottom:"-.15rem",as:t})})}));function yOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return y.jsxs(Kg,{className:"advanced-parameters-item",children:[y.jsx(qg,{className:"advanced-parameters-header",children:y.jsxs(Ge,{width:"100%",gap:"0.5rem",align:"center",children:[y.jsx(Eo,{flexGrow:1,textAlign:"left",children:t}),i,n&&y.jsx(vOe,{feature:n}),y.jsx(Yg,{})]})}),y.jsx(Xg,{className:"advanced-parameters-panel",children:r})]})}const JP=e=>{const{accordionInfo:t}=e,n=he(a=>a.system.openAccordions),r=Oe(),i=a=>r(lCe(a)),o=()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:d,additionalHeaderComponents:h}=t[s];a.push(y.jsx(yOe,{header:l,feature:u,content:d,additionalHeaderComponents:h},s))}),a};return y.jsx(dk,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:i,className:"advanced-parameters",children:o()})},bOe=lt(or,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function eT(e){const{...t}=e,n=Oe(),{isProcessing:r,isConnected:i,isCancelable:o}=he(bOe),a=()=>n(J8e()),{t:s}=Ue();return et("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),y.jsx(Je,{icon:y.jsx(uPe,{}),tooltip:s("parameters:cancel"),"aria-label":s("parameters:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const tT=e=>e.generation;lt(tT,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:ke.isEqual}});const FY=lt([tT,or,Iq,Mr],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:d}=t;let h=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(h=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(h=!1,m.push("No initial image selected")),u&&(h=!1,m.push("System Busy")),d||(h=!1,m.push("System Disconnected")),o&&(!(hP(a)||a==="")||l===-1)&&(h=!1,m.push("Seed-Weights badly formatted.")),{isReady:h,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:ke.isEqual,resultEqualityCheck:ke.isEqual}});function nT(e){const{iconButton:t=!1,...n}=e,r=Oe(),{isReady:i}=he(FY),o=he(Mr),a=()=>{r($8(o))},{t:s}=Ue();return et(["ctrl+enter","meta+enter"],()=>{r($8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),y.jsx("div",{style:{flexGrow:4},children:t?y.jsx(Je,{"aria-label":s("parameters:invoke"),type:"submit",icon:y.jsx(MEe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("parameters:invoke"),tooltipProps:{placement:"bottom"},...n}):y.jsx(nr,{"aria-label":s("parameters:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const SOe=lt(Wy,({shouldLoopback:e})=>e),xOe=()=>{const e=Oe(),t=he(SOe),{t:n}=Ue();return y.jsx(Je,{"aria-label":n("parameters:toggleLoopback"),tooltip:n("parameters:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:y.jsx(REe,{}),onClick:()=>{e(Swe(!t))}})},rT=()=>{const e=he(Mr);return y.jsxs("div",{className:"process-buttons",children:[y.jsx(nT,{}),e==="img2img"&&y.jsx(xOe,{}),y.jsx(eT,{})]})},iT=()=>{const e=he(r=>r.generation.negativePrompt),t=Oe(),{t:n}=Ue();return y.jsx(fn,{children:y.jsx(UE,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(ny(r.target.value)),background:"var(--prompt-bg-color)",placeholder:n("parameters:negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},wOe=lt([e=>e.generation,Mr],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),oT=()=>{const e=Oe(),{prompt:t,activeTabName:n}=he(wOe),{isReady:r}=he(FY),i=w.useRef(null),{t:o}=Ue(),a=l=>{e(Fx(l.target.value))};et("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e($8(n)))};return y.jsx("div",{className:"prompt-bar",children:y.jsx(fn,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:y.jsx(UE,{id:"prompt",name:"prompt",placeholder:o("parameters:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},zY=""+new URL("logo-13003d72.png",import.meta.url).href,COe=lt(bp,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),aT=e=>{const t=Oe(),{shouldShowParametersPanel:n,shouldHoldParametersPanelOpen:r,shouldPinParametersPanel:i}=he(COe),o=w.useRef(null),a=w.useRef(null),s=w.useRef(null),{children:l}=e;et("o",()=>{t(Zu(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),et("esc",()=>{t(Zu(!1))},{enabled:()=>!i,preventDefault:!0},[i]),et("shift+o",()=>{m(),t(vi(!0))},[i]);const u=w.useCallback(()=>{i||(t(CCe(a.current?a.current.scrollTop:0)),t(Zu(!1)),t(_Ce(!1)))},[t,i]),d=()=>{s.current=window.setTimeout(()=>u(),500)},h=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(kCe(!i)),t(vi(!0))};return w.useEffect(()=>{function v(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[u]),y.jsx(Vq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:y.jsx("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:h,onMouseOver:i?void 0:h,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:y.jsx("div",{className:"parameters-panel-margin",children:y.jsxs("div",{className:"parameters-panel",ref:a,onMouseLeave:v=>{v.target!==a.current?h():!i&&d()},children:[y.jsx(uo,{label:"Pin Options Panel",children:y.jsx("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:m,children:i?y.jsx(Bq,{}):y.jsx($q,{})})}),!i&&y.jsxs("div",{className:"invoke-ai-logo-wrapper",children:[y.jsx("img",{src:zY,alt:"invoke-ai-logo"}),y.jsxs("h1",{children:["invoke ",y.jsx("strong",{children:"ai"})]})]}),l]})})})})};function _Oe(){const{t:e}=Ue(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:y.jsx(KP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:y.jsx(ZP,{}),additionalHeaderComponents:y.jsx(XP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:y.jsx(TP,{}),additionalHeaderComponents:y.jsx(NY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:y.jsx(LP,{}),additionalHeaderComponents:y.jsx($Y,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:y.jsx(eOe,{})}},n=Oe(),r=he(Mr);return w.useEffect(()=>{r==="img2img"&&n(pP(!1))},[r,n]),y.jsxs(aT,{children:[y.jsxs(Ge,{flexDir:"column",rowGap:"0.5rem",children:[y.jsx(oT,{}),y.jsx(iT,{})]}),y.jsx(rT,{}),y.jsx(QP,{}),y.jsx(jY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),y.jsx(JAe,{}),y.jsx(JP,{accordionInfo:t})]})}function kOe(){return y.jsx(YP,{optionsPanel:y.jsx(_Oe,{}),children:y.jsx(XAe,{})})}const EOe=()=>y.jsx("div",{className:"workarea-single-view",children:y.jsx("div",{className:"text-to-image-area",children:y.jsx(DY,{})})}),POe=lt([Wy],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),TOe=()=>{const{hiresFix:e,hiresStrength:t}=he(POe),n=Oe(),{t:r}=Ue(),i=a=>{n(XI(a))},o=()=>{n(XI(.75))};return y.jsx(so,{label:r("parameters:hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:o,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},LOe=()=>{const e=Oe(),t=he(i=>i.postprocessing.hiresFix),{t:n}=Ue(),r=i=>e(pP(i.target.checked));return y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(Us,{label:n("parameters:hiresOptim"),fontSize:"md",isChecked:t,onChange:r}),y.jsx(TOe,{})]})},AOe=()=>y.jsxs(Ge,{gap:2,direction:"column",children:[y.jsx(BY,{}),y.jsx(LOe,{})]});function OOe(){const{t:e}=Ue(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:y.jsx(KP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:y.jsx(ZP,{}),additionalHeaderComponents:y.jsx(XP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:y.jsx(TP,{}),additionalHeaderComponents:y.jsx(NY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:y.jsx(LP,{}),additionalHeaderComponents:y.jsx($Y,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:y.jsx(AOe,{})}};return y.jsxs(aT,{children:[y.jsxs(Ge,{flexDir:"column",rowGap:"0.5rem",children:[y.jsx(oT,{}),y.jsx(iT,{})]}),y.jsx(rT,{}),y.jsx(QP,{}),y.jsx(JP,{accordionInfo:t})]})}function MOe(){return y.jsx(YP,{optionsPanel:y.jsx(OOe,{}),children:y.jsx(EOe,{})})}var t_={},IOe={get exports(){return t_},set exports(e){t_=e}};/** +`,aN={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};jAe(BAe);var FAe=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=w.useContext(RY).setComponents,u=w.useRef(null),d=w.useRef(null);return w.useEffect(function(){var h=u.current,m=d.current;h!==null&&m!==null&&l&&l(h,m)},[]),N.createElement("div",{ref:u,className:"react-transform-wrapper "+aN.wrapper+" "+r,style:a},N.createElement("div",{ref:d,className:"react-transform-component "+aN.content+" "+o,style:s},t))};function $Ae({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=w.useState(0),[a,s]=w.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},d=()=>{s(!a)};return v.jsx(NAe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:h,zoomOut:m,resetTransform:y,centerView:b})=>v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"lightbox-image-options",children:[v.jsx(Je,{icon:v.jsx(A_e,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>h(),fontSize:20}),v.jsx(Je,{icon:v.jsx(O_e,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),v.jsx(Je,{icon:v.jsx(T_e,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),v.jsx(Je,{icon:v.jsx(L_e,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),v.jsx(Je,{icon:v.jsx(sPe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),v.jsx(Je,{icon:v.jsx(Yx,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{y(),o(0),s(!1)},fontSize:20})]}),v.jsx(FAe,{wrapperStyle:{width:"100%",height:"100%"},children:v.jsx("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function zAe(){const e=Oe(),t=he(m=>m.lightbox.isLightboxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=he(Nq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(fP())},h=()=>{e(dP())};return et("Esc",()=>{t&&e(Hm(!1))},[t]),v.jsxs("div",{className:"lightbox-container",children:[v.jsx(Je,{icon:v.jsx(P_e,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Hm(!1))},fontSize:20}),v.jsxs("div",{className:"lightbox-display-container",children:[v.jsxs("div",{className:"lightbox-preview-wrapper",children:[v.jsx(Rq,{}),!r&&v.jsxs("div",{className:"current-image-next-prev-buttons",children:[v.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&v.jsx(us,{"aria-label":"Previous image",icon:v.jsx(Cq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),v.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&v.jsx(us,{"aria-label":"Next image",icon:v.jsx(_q,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),n&&v.jsxs(v.Fragment,{children:[v.jsx($Ae,{image:n.url,styleClass:"lightbox-image"}),r&&v.jsx(FP,{image:n})]})]}),v.jsx(xY,{})]})]})}function HAe(e){return mt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}const VAe=lt(wp,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),WAe=()=>{const{resultImages:e,userImages:t}=he(VAe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},UAe=lt([Sp,qx,Mr],(e,t,n)=>{const{shouldShowDualDisplay:r,shouldPinParametersPanel:i}=e,{isLightboxOpen:o}=t;return{shouldShowDualDisplay:r,shouldPinParametersPanel:i,isLightboxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KP=e=>{const t=Oe(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,shouldShowDualDisplay:a,isLightboxOpen:s,shouldShowDualDisplayButton:l}=he(UAe),u=WAe(),d=()=>{t(ECe(!a)),t(vi(!0))},h=m=>{const y=m.dataTransfer.getData("invokeai/imageUuid"),b=u(y);b&&(o==="img2img"?t(T0(b)):o==="unifiedCanvas"&&t(Fx(b)))};return v.jsx("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:v.jsxs("div",{className:"workarea-main",children:[n,v.jsxs("div",{className:"workarea-children-wrapper",onDrop:h,children:[r,l&&v.jsx(uo,{label:"Toggle Split View",children:v.jsx("div",{className:"workarea-split-button","data-selected":a,onClick:d,children:v.jsx(HAe,{})})})]}),!s&&v.jsx(xY,{})]})})},GAe=e=>{const{styleClass:t}=e,n=w.useContext(PP),r=()=>{n&&n()};return v.jsx("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:v.jsxs("div",{className:"image-upload-button",children:[v.jsx(tw,{}),v.jsx(Bh,{size:"lg",children:"Click or Drag and Drop"})]})})},qAe=lt([wp,Sp,Mr],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),DY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=he(qAe);return v.jsx("div",{className:"current-image-area","data-tab-name":t,children:e?v.jsxs(v.Fragment,{children:[v.jsx(Rq,{}),v.jsx(KEe,{})]}):v.jsx("div",{className:"current-image-display-placeholder",children:v.jsx(lPe,{})})})},YAe=()=>{const e=w.useContext(PP);return v.jsx(Je,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:v.jsx(tw,{}),onClick:e||void 0})};function KAe(){const e=he(o=>o.generation.initialImage),{t}=Ge(),n=Oe(),r=By(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(vU())};return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"init-image-preview-header",children:[v.jsx("h2",{children:t("parameters:initialImage")}),v.jsx(YAe,{})]}),e&&v.jsx("div",{className:"init-image-preview",children:v.jsx(JS,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const XAe=()=>{const e=he(r=>r.generation.initialImage),{currentImage:t}=he(r=>r.gallery),n=e?v.jsx("div",{className:"image-to-image-area",children:v.jsx(KAe,{})}):v.jsx(GAe,{});return v.jsxs("div",{className:"workarea-split-view",children:[v.jsx("div",{className:"workarea-split-view-left",children:n}),t&&v.jsx("div",{className:"workarea-split-view-right",children:v.jsx(DY,{})})]})};var ao=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(ao||{});const ZAe=()=>{const{t:e}=Ge();return w.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},QAe=e=>ZAe()[e],Us=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return v.jsxs(fn,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[v.jsx(En,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),v.jsx(UE,{className:"invokeai__switch-root",...s})]})};function NY(){const e=he(i=>i.system.isGFPGANAvailable),t=he(i=>i.postprocessing.shouldRunFacetool),n=Oe(),r=i=>n(wwe(i.target.checked));return v.jsx(Us,{isDisabled:!e,isChecked:t,onChange:r})}function JAe(){const e=Oe(),t=he(i=>i.generation.shouldFitToWidthHeight),n=i=>e(PU(i.target.checked)),{t:r}=Ge();return v.jsx(Us,{label:r("parameters:imageFit"),isChecked:t,onChange:n})}function jY(e){const{t}=Ge(),{label:n=`${t("parameters:strength")}`,styleClass:r}=e,i=he(l=>l.generation.img2imgStrength),o=Oe(),a=l=>o(p8(l)),s=()=>{o(p8(.75))};return v.jsx(so,{label:n,step:.01,min:.01,max:1,onChange:a,value:i,isInteger:!1,styleClass:r,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:s})}const BY=()=>{const e=Oe(),t=he(i=>i.generation.seamless),n=i=>e(kU(i.target.checked)),{t:r}=Ge();return v.jsx(je,{gap:2,direction:"column",children:v.jsx(Us,{label:r("parameters:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},eOe=()=>v.jsx(je,{gap:2,direction:"column",children:v.jsx(BY,{})});function tOe(){const e=Oe(),t=he(i=>i.generation.perlin),{t:n}=Ge(),r=i=>e(CU(i));return v.jsx(ia,{label:n("parameters:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}function nOe(){const e=Oe(),{t}=Ge(),n=he(i=>i.generation.shouldRandomizeSeed),r=i=>e(mwe(i.target.checked));return v.jsx(Us,{label:t("parameters:randomizeSeed"),isChecked:n,onChange:r})}function rOe(){const e=he(a=>a.generation.seed),t=he(a=>a.generation.shouldRandomizeSeed),n=he(a=>a.generation.shouldGenerateVariations),{t:r}=Ge(),i=Oe(),o=a=>i($y(a));return v.jsx(ia,{label:r("parameters:seed"),step:1,precision:0,flexGrow:1,min:SP,max:xP,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function iOe(){const e=Oe(),t=he(i=>i.generation.shouldRandomizeSeed),{t:n}=Ge(),r=()=>e($y(eq(SP,xP)));return v.jsx(ls,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:v.jsx("p",{children:n("parameters:shuffle")})})}function oOe(){const e=Oe(),t=he(i=>i.generation.threshold),{t:n}=Ge(),r=i=>e(LU(i));return v.jsx(ia,{label:n("parameters:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}const XP=()=>v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(nOe,{}),v.jsxs(je,{gap:2,children:[v.jsx(rOe,{}),v.jsx(iOe,{})]}),v.jsx(je,{gap:2,children:v.jsx(oOe,{})}),v.jsx(je,{gap:2,children:v.jsx(tOe,{})})]});function FY(){const e=he(i=>i.system.isESRGANAvailable),t=he(i=>i.postprocessing.shouldRunESRGAN),n=Oe(),r=i=>n(xwe(i.target.checked));return v.jsx(Us,{isDisabled:!e,isChecked:t,onChange:r})}function ZP(){const e=he(r=>r.generation.shouldGenerateVariations),t=Oe(),n=r=>t(gwe(r.target.checked));return v.jsx(Us,{isChecked:e,width:"auto",onChange:n})}function fr(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return v.jsxs(fn,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&v.jsx(En,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),v.jsx(bk,{...l,className:"input-entry",size:a,width:o})]})}function aOe(){const e=he(o=>o.generation.seedWeights),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ge(),r=Oe(),i=o=>r(EU(o.target.value));return v.jsx(fr,{label:n("parameters:seedWeights"),value:e,isInvalid:t&&!(pP(e)||e===""),isDisabled:!t,onChange:i})}function sOe(){const e=he(o=>o.generation.variationAmount),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ge(),r=Oe(),i=o=>r(vwe(o));return v.jsx(ia,{label:n("parameters:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const QP=()=>v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(sOe,{}),v.jsx(aOe,{})]});function lOe(){const e=Oe(),t=he(i=>i.generation.cfgScale),{t:n}=Ge(),r=i=>e(bU(i));return v.jsx(ia,{label:n("parameters:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function uOe(){const e=he(o=>o.generation.height),t=he(Mr),n=Oe(),{t:r}=Ge(),i=o=>n(SU(Number(o.target.value)));return v.jsx(rl,{isDisabled:t==="unifiedCanvas",label:r("parameters:height"),value:e,flexGrow:1,onChange:i,validValues:S7e,styleClass:"main-settings-block"})}const cOe=lt([e=>e.generation],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function dOe(){const e=Oe(),{iterations:t}=he(cOe),{t:n}=Ge(),r=i=>e(pwe(i));return v.jsx(ia,{label:n("parameters:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function fOe(){const e=he(o=>o.generation.sampler),t=he(oq),n=Oe(),{t:r}=Ge(),i=o=>n(_U(o.target.value));return v.jsx(rl,{label:r("parameters:sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?y7e:v7e,styleClass:"main-settings-block"})}function hOe(){const e=Oe(),t=he(i=>i.generation.steps),{t:n}=Ge(),r=i=>e(TU(i));return v.jsx(ia,{label:n("parameters:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function pOe(){const e=he(o=>o.generation.width),t=he(Mr),{t:n}=Ge(),r=Oe(),i=o=>r(AU(Number(o.target.value)));return v.jsx(rl,{isDisabled:t==="unifiedCanvas",label:n("parameters:width"),value:e,flexGrow:1,onChange:i,validValues:b7e,styleClass:"main-settings-block"})}function JP(){return v.jsx("div",{className:"main-settings",children:v.jsxs("div",{className:"main-settings-list",children:[v.jsxs("div",{className:"main-settings-row",children:[v.jsx(dOe,{}),v.jsx(hOe,{}),v.jsx(lOe,{})]}),v.jsxs("div",{className:"main-settings-row",children:[v.jsx(pOe,{}),v.jsx(uOe,{}),v.jsx(fOe,{})]})]})})}const gOe=lt(or,e=>e.shouldDisplayGuides),mOe=({children:e,feature:t})=>{const n=he(gOe),{text:r}=QAe(t);return n?v.jsxs(BE,{trigger:"hover",children:[v.jsx(zE,{children:v.jsx(Eo,{children:e})}),v.jsxs($E,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[v.jsx(FE,{className:"guide-popover-arrow"}),v.jsx("div",{className:"guide-popover-guide-content",children:r})]})]}):null},vOe=Ae(({feature:e,icon:t=oPe},n)=>v.jsx(mOe,{feature:e,children:v.jsx(Eo,{ref:n,children:v.jsx(Na,{marginBottom:"-.15rem",as:t})})}));function yOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return v.jsxs(Xg,{className:"advanced-parameters-item",children:[v.jsx(Yg,{className:"advanced-parameters-header",children:v.jsxs(je,{width:"100%",gap:"0.5rem",align:"center",children:[v.jsx(Eo,{flexGrow:1,textAlign:"left",children:t}),i,n&&v.jsx(vOe,{feature:n}),v.jsx(Kg,{})]})}),v.jsx(Zg,{className:"advanced-parameters-panel",children:r})]})}const eT=e=>{const{accordionInfo:t}=e,n=he(a=>a.system.openAccordions),r=Oe(),i=a=>r(lCe(a)),o=()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:d,additionalHeaderComponents:h}=t[s];a.push(v.jsx(yOe,{header:l,feature:u,content:d,additionalHeaderComponents:h},s))}),a};return v.jsx(dk,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:i,className:"advanced-parameters",children:o()})},bOe=lt(or,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function tT(e){const{...t}=e,n=Oe(),{isProcessing:r,isConnected:i,isCancelable:o}=he(bOe),a=()=>n(J8e()),{t:s}=Ge();return et("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),v.jsx(Je,{icon:v.jsx(uPe,{}),tooltip:s("parameters:cancel"),"aria-label":s("parameters:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const nT=e=>e.generation;lt(nT,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:ke.isEqual}});const $Y=lt([nT,or,Iq,Mr],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:d}=t;let h=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(h=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(h=!1,m.push("No initial image selected")),u&&(h=!1,m.push("System Busy")),d||(h=!1,m.push("System Disconnected")),o&&(!(pP(a)||a==="")||l===-1)&&(h=!1,m.push("Seed-Weights badly formatted.")),{isReady:h,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:ke.isEqual,resultEqualityCheck:ke.isEqual}});function rT(e){const{iconButton:t=!1,...n}=e,r=Oe(),{isReady:i}=he($Y),o=he(Mr),a=()=>{r(F8(o))},{t:s}=Ge();return et(["ctrl+enter","meta+enter"],()=>{r(F8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),v.jsx("div",{style:{flexGrow:4},children:t?v.jsx(Je,{"aria-label":s("parameters:invoke"),type:"submit",icon:v.jsx(MEe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("parameters:invoke"),tooltipProps:{placement:"bottom"},...n}):v.jsx(nr,{"aria-label":s("parameters:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const SOe=lt(Wy,({shouldLoopback:e})=>e),xOe=()=>{const e=Oe(),t=he(SOe),{t:n}=Ge();return v.jsx(Je,{"aria-label":n("parameters:toggleLoopback"),tooltip:n("parameters:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:v.jsx(REe,{}),onClick:()=>{e(Swe(!t))}})},iT=()=>{const e=he(Mr);return v.jsxs("div",{className:"process-buttons",children:[v.jsx(rT,{}),e==="img2img"&&v.jsx(xOe,{}),v.jsx(tT,{})]})},oT=()=>{const e=he(r=>r.generation.negativePrompt),t=Oe(),{t:n}=Ge();return v.jsx(fn,{children:v.jsx(GE,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(ny(r.target.value)),background:"var(--prompt-bg-color)",placeholder:n("parameters:negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},wOe=lt([e=>e.generation,Mr],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),aT=()=>{const e=Oe(),{prompt:t,activeTabName:n}=he(wOe),{isReady:r}=he($Y),i=w.useRef(null),{t:o}=Ge(),a=l=>{e($x(l.target.value))};et("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(F8(n)))};return v.jsx("div",{className:"prompt-bar",children:v.jsx(fn,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:v.jsx(GE,{id:"prompt",name:"prompt",placeholder:o("parameters:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},zY=""+new URL("logo-13003d72.png",import.meta.url).href,COe=lt(Sp,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),sT=e=>{const t=Oe(),{shouldShowParametersPanel:n,shouldHoldParametersPanelOpen:r,shouldPinParametersPanel:i}=he(COe),o=w.useRef(null),a=w.useRef(null),s=w.useRef(null),{children:l}=e;et("o",()=>{t(Zu(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),et("esc",()=>{t(Zu(!1))},{enabled:()=>!i,preventDefault:!0},[i]),et("shift+o",()=>{m(),t(vi(!0))},[i]);const u=w.useCallback(()=>{i||(t(CCe(a.current?a.current.scrollTop:0)),t(Zu(!1)),t(_Ce(!1)))},[t,i]),d=()=>{s.current=window.setTimeout(()=>u(),500)},h=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(kCe(!i)),t(vi(!0))};return w.useEffect(()=>{function y(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[u]),v.jsx(Vq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:v.jsx("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:h,onMouseOver:i?void 0:h,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:v.jsx("div",{className:"parameters-panel-margin",children:v.jsxs("div",{className:"parameters-panel",ref:a,onMouseLeave:y=>{y.target!==a.current?h():!i&&d()},children:[v.jsx(uo,{label:"Pin Options Panel",children:v.jsx("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:m,children:i?v.jsx(Bq,{}):v.jsx(Fq,{})})}),!i&&v.jsxs("div",{className:"invoke-ai-logo-wrapper",children:[v.jsx("img",{src:zY,alt:"invoke-ai-logo"}),v.jsxs("h1",{children:["invoke ",v.jsx("strong",{children:"ai"})]})]}),l]})})})})};function _Oe(){const{t:e}=Ge(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:v.jsx(XP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:v.jsx(QP,{}),additionalHeaderComponents:v.jsx(ZP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:v.jsx(LP,{}),additionalHeaderComponents:v.jsx(NY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:v.jsx(AP,{}),additionalHeaderComponents:v.jsx(FY,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:v.jsx(eOe,{})}},n=Oe(),r=he(Mr);return w.useEffect(()=>{r==="img2img"&&n(gP(!1))},[r,n]),v.jsxs(sT,{children:[v.jsxs(je,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(aT,{}),v.jsx(oT,{})]}),v.jsx(iT,{}),v.jsx(JP,{}),v.jsx(jY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),v.jsx(JAe,{}),v.jsx(eT,{accordionInfo:t})]})}function kOe(){return v.jsx(KP,{optionsPanel:v.jsx(_Oe,{}),children:v.jsx(XAe,{})})}const EOe=()=>v.jsx("div",{className:"workarea-single-view",children:v.jsx("div",{className:"text-to-image-area",children:v.jsx(DY,{})})}),POe=lt([Wy],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),TOe=()=>{const{hiresFix:e,hiresStrength:t}=he(POe),n=Oe(),{t:r}=Ge(),i=a=>{n(ZI(a))},o=()=>{n(ZI(.75))};return v.jsx(so,{label:r("parameters:hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:o,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},LOe=()=>{const e=Oe(),t=he(i=>i.postprocessing.hiresFix),{t:n}=Ge(),r=i=>e(gP(i.target.checked));return v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(Us,{label:n("parameters:hiresOptim"),fontSize:"md",isChecked:t,onChange:r}),v.jsx(TOe,{})]})},AOe=()=>v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(BY,{}),v.jsx(LOe,{})]});function OOe(){const{t:e}=Ge(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:v.jsx(XP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:v.jsx(QP,{}),additionalHeaderComponents:v.jsx(ZP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:v.jsx(LP,{}),additionalHeaderComponents:v.jsx(NY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:v.jsx(AP,{}),additionalHeaderComponents:v.jsx(FY,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:v.jsx(AOe,{})}};return v.jsxs(sT,{children:[v.jsxs(je,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(aT,{}),v.jsx(oT,{})]}),v.jsx(iT,{}),v.jsx(JP,{}),v.jsx(eT,{accordionInfo:t})]})}function MOe(){return v.jsx(KP,{optionsPanel:v.jsx(OOe,{}),children:v.jsx(EOe,{})})}var t_={},IOe={get exports(){return t_},set exports(e){t_=e}};/** * @license React * react-reconciler.production.min.js * @@ -527,17 +527,17 @@ PERFORMANCE OF THIS SOFTWARE. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ROe=function(t){var n={},r=w,i=Fh,o=Object.assign;function a(f){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+f,x=1;xle||L[q]!==I[le]){var pe=` -`+L[q].replace(" at new "," at ");return f.displayName&&pe.includes("")&&(pe=pe.replace("",f.displayName)),pe}while(1<=q&&0<=le);break}}}finally{ll=!1,Error.prepareStackTrace=x}return(f=f?f.displayName||f.name:"")?Su(f):""}var Op=Object.prototype.hasOwnProperty,Cc=[],ul=-1;function aa(f){return{current:f}}function Dn(f){0>ul||(f.current=Cc[ul],Cc[ul]=null,ul--)}function Tn(f,p){ul++,Cc[ul]=f.current,f.current=p}var sa={},Hr=aa(sa),li=aa(!1),la=sa;function cl(f,p){var x=f.type.contextTypes;if(!x)return sa;var P=f.stateNode;if(P&&P.__reactInternalMemoizedUnmaskedChildContext===p)return P.__reactInternalMemoizedMaskedChildContext;var L={},I;for(I in x)L[I]=p[I];return P&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=p,f.__reactInternalMemoizedMaskedChildContext=L),L}function ui(f){return f=f.childContextTypes,f!=null}function bs(){Dn(li),Dn(Hr)}function xf(f,p,x){if(Hr.current!==sa)throw Error(a(168));Tn(Hr,p),Tn(li,x)}function wu(f,p,x){var P=f.stateNode;if(p=p.childContextTypes,typeof P.getChildContext!="function")return x;P=P.getChildContext();for(var L in P)if(!(L in p))throw Error(a(108,j(f)||"Unknown",L));return o({},x,P)}function Ss(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||sa,la=Hr.current,Tn(Hr,f),Tn(li,li.current),!0}function wf(f,p,x){var P=f.stateNode;if(!P)throw Error(a(169));x?(f=wu(f,p,la),P.__reactInternalMemoizedMergedChildContext=f,Dn(li),Dn(Hr),Tn(Hr,f)):Dn(li),Tn(li,x)}var Ii=Math.clz32?Math.clz32:Cf,Mp=Math.log,Ip=Math.LN2;function Cf(f){return f>>>=0,f===0?32:31-(Mp(f)/Ip|0)|0}var dl=64,Ro=4194304;function fl(f){switch(f&-f){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function Cu(f,p){var x=f.pendingLanes;if(x===0)return 0;var P=0,L=f.suspendedLanes,I=f.pingedLanes,q=x&268435455;if(q!==0){var le=q&~L;le!==0?P=fl(le):(I&=q,I!==0&&(P=fl(I)))}else q=x&~L,q!==0?P=fl(q):I!==0&&(P=fl(I));if(P===0)return 0;if(p!==0&&p!==P&&!(p&L)&&(L=P&-P,I=p&-p,L>=I||L===16&&(I&4194240)!==0))return p;if(P&4&&(P|=x&16),p=f.entangledLanes,p!==0)for(f=f.entanglements,p&=P;0x;x++)p.push(f);return p}function Fa(f,p,x){f.pendingLanes|=p,p!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,p=31-Ii(p),f[p]=x}function kf(f,p){var x=f.pendingLanes&~p;f.pendingLanes=p,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=p,f.mutableReadLanes&=p,f.entangledLanes&=p,p=f.entanglements;var P=f.eventTimes;for(f=f.expirationTimes;0>=q,L-=q,co=1<<32-Ii(p)+L|x<Gt?(ti=Rt,Rt=null):ti=Rt.sibling;var en=ot(me,Rt,Se[Gt],tt);if(en===null){Rt===null&&(Rt=ti);break}f&&Rt&&en.alternate===null&&p(me,Rt),ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en,Rt=ti}if(Gt===Se.length)return x(me,Rt),Wn&&hl(me,Gt),Ie;if(Rt===null){for(;GtGt?(ti=Rt,Rt=null):ti=Rt.sibling;var Ls=ot(me,Rt,en.value,tt);if(Ls===null){Rt===null&&(Rt=ti);break}f&&Rt&&Ls.alternate===null&&p(me,Rt),ue=I(Ls,ue,Gt),Bt===null?Ie=Ls:Bt.sibling=Ls,Bt=Ls,Rt=ti}if(en.done)return x(me,Rt),Wn&&hl(me,Gt),Ie;if(Rt===null){for(;!en.done;Gt++,en=Se.next())en=jt(me,en.value,tt),en!==null&&(ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en);return Wn&&hl(me,Gt),Ie}for(Rt=P(me,Rt);!en.done;Gt++,en=Se.next())en=Gn(Rt,me,Gt,en.value,tt),en!==null&&(f&&en.alternate!==null&&Rt.delete(en.key===null?Gt:en.key),ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en);return f&&Rt.forEach(function(ki){return p(me,ki)}),Wn&&hl(me,Gt),Ie}function ba(me,ue,Se,tt){if(typeof Se=="object"&&Se!==null&&Se.type===d&&Se.key===null&&(Se=Se.props.children),typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case l:e:{for(var Ie=Se.key,Bt=ue;Bt!==null;){if(Bt.key===Ie){if(Ie=Se.type,Ie===d){if(Bt.tag===7){x(me,Bt.sibling),ue=L(Bt,Se.props.children),ue.return=me,me=ue;break e}}else if(Bt.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===T&&r1(Ie)===Bt.type){x(me,Bt.sibling),ue=L(Bt,Se.props),ue.ref=Va(me,Bt,Se),ue.return=me,me=ue;break e}x(me,Bt);break}else p(me,Bt);Bt=Bt.sibling}Se.type===d?(ue=Pl(Se.props.children,me.mode,tt,Se.key),ue.return=me,me=ue):(tt=Jf(Se.type,Se.key,Se.props,null,me.mode,tt),tt.ref=Va(me,ue,Se),tt.return=me,me=tt)}return q(me);case u:e:{for(Bt=Se.key;ue!==null;){if(ue.key===Bt)if(ue.tag===4&&ue.stateNode.containerInfo===Se.containerInfo&&ue.stateNode.implementation===Se.implementation){x(me,ue.sibling),ue=L(ue,Se.children||[]),ue.return=me,me=ue;break e}else{x(me,ue);break}else p(me,ue);ue=ue.sibling}ue=Tl(Se,me.mode,tt),ue.return=me,me=ue}return q(me);case T:return Bt=Se._init,ba(me,ue,Bt(Se._payload),tt)}if(W(Se))return Nn(me,ue,Se,tt);if(R(Se))return mr(me,ue,Se,tt);Xi(me,Se)}return typeof Se=="string"&&Se!==""||typeof Se=="number"?(Se=""+Se,ue!==null&&ue.tag===6?(x(me,ue.sibling),ue=L(ue,Se),ue.return=me,me=ue):(x(me,ue),ue=Sg(Se,me.mode,tt),ue.return=me,me=ue),q(me)):x(me,ue)}return ba}var Rc=s3(!0),l3=s3(!1),Nf={},Bo=aa(Nf),Wa=aa(Nf),oe=aa(Nf);function we(f){if(f===Nf)throw Error(a(174));return f}function ve(f,p){Tn(oe,p),Tn(Wa,f),Tn(Bo,Nf),f=Z(p),Dn(Bo),Tn(Bo,f)}function it(){Dn(Bo),Dn(Wa),Dn(oe)}function It(f){var p=we(oe.current),x=we(Bo.current);p=U(x,f.type,p),x!==p&&(Tn(Wa,f),Tn(Bo,p))}function on(f){Wa.current===f&&(Dn(Bo),Dn(Wa))}var $t=aa(0);function mn(f){for(var p=f;p!==null;){if(p.tag===13){var x=p.memoizedState;if(x!==null&&(x=x.dehydrated,x===null||xc(x)||Sf(x)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if(p.flags&128)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var jf=[];function i1(){for(var f=0;fx?x:4,f(!0);var P=Dc.transition;Dc.transition={};try{f(!1),p()}finally{Yt=x,Dc.transition=P}}function Hc(){return Ni().memoizedState}function f1(f,p,x){var P=qr(f);if(x={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null},Wc(f))Uc(p,x);else if(x=Ic(f,p,x,P),x!==null){var L=_i();zo(x,f,P,L),Vf(x,p,P)}}function Vc(f,p,x){var P=qr(f),L={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null};if(Wc(f))Uc(p,L);else{var I=f.alternate;if(f.lanes===0&&(I===null||I.lanes===0)&&(I=p.lastRenderedReducer,I!==null))try{var q=p.lastRenderedState,le=I(q,x);if(L.hasEagerState=!0,L.eagerState=le,Y(le,q)){var pe=p.interleaved;pe===null?(L.next=L,Rf(p)):(L.next=pe.next,pe.next=L),p.interleaved=L;return}}catch{}finally{}x=Ic(f,p,L,P),x!==null&&(L=_i(),zo(x,f,P,L),Vf(x,p,P))}}function Wc(f){var p=f.alternate;return f===Ln||p!==null&&p===Ln}function Uc(f,p){Bf=cn=!0;var x=f.pending;x===null?p.next=p:(p.next=x.next,x.next=p),f.pending=p}function Vf(f,p,x){if(x&4194240){var P=p.lanes;P&=f.pendingLanes,x|=P,p.lanes=x,_u(f,x)}}var Cs={readContext:fo,useCallback:Si,useContext:Si,useEffect:Si,useImperativeHandle:Si,useInsertionEffect:Si,useLayoutEffect:Si,useMemo:Si,useReducer:Si,useRef:Si,useState:Si,useDebugValue:Si,useDeferredValue:Si,useTransition:Si,useMutableSource:Si,useSyncExternalStore:Si,useId:Si,unstable_isNewReconciler:!1},Sw={readContext:fo,useCallback:function(f,p){return di().memoizedState=[f,p===void 0?null:p],f},useContext:fo,useEffect:d3,useImperativeHandle:function(f,p,x){return x=x!=null?x.concat([f]):null,Tu(4194308,4,Dr.bind(null,p,f),x)},useLayoutEffect:function(f,p){return Tu(4194308,4,f,p)},useInsertionEffect:function(f,p){return Tu(4,2,f,p)},useMemo:function(f,p){var x=di();return p=p===void 0?null:p,f=f(),x.memoizedState=[f,p],f},useReducer:function(f,p,x){var P=di();return p=x!==void 0?x(p):p,P.memoizedState=P.baseState=p,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:p},P.queue=f,f=f.dispatch=f1.bind(null,Ln,f),[P.memoizedState,f]},useRef:function(f){var p=di();return f={current:f},p.memoizedState=f},useState:c3,useDebugValue:u1,useDeferredValue:function(f){return di().memoizedState=f},useTransition:function(){var f=c3(!1),p=f[0];return f=d1.bind(null,f[1]),di().memoizedState=f,[p,f]},useMutableSource:function(){},useSyncExternalStore:function(f,p,x){var P=Ln,L=di();if(Wn){if(x===void 0)throw Error(a(407));x=x()}else{if(x=p(),ei===null)throw Error(a(349));Pu&30||l1(P,p,x)}L.memoizedState=x;var I={value:x,getSnapshot:p};return L.queue=I,d3(ml.bind(null,P,I,f),[f]),P.flags|=2048,zf(9,Fc.bind(null,P,I,x,p),void 0,null),x},useId:function(){var f=di(),p=ei.identifierPrefix;if(Wn){var x=za,P=co;x=(P&~(1<<32-Ii(P)-1)).toString(32)+x,p=":"+p+"R"+x,x=Nc++,0")&&(pe=pe.replace("",f.displayName)),pe}while(1<=q&&0<=le);break}}}finally{ll=!1,Error.prepareStackTrace=S}return(f=f?f.displayName||f.name:"")?Su(f):""}var Mp=Object.prototype.hasOwnProperty,Cc=[],ul=-1;function aa(f){return{current:f}}function Dn(f){0>ul||(f.current=Cc[ul],Cc[ul]=null,ul--)}function Tn(f,p){ul++,Cc[ul]=f.current,f.current=p}var sa={},Hr=aa(sa),li=aa(!1),la=sa;function cl(f,p){var S=f.type.contextTypes;if(!S)return sa;var T=f.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===p)return T.__reactInternalMemoizedMaskedChildContext;var L={},I;for(I in S)L[I]=p[I];return T&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=p,f.__reactInternalMemoizedMaskedChildContext=L),L}function ui(f){return f=f.childContextTypes,f!=null}function bs(){Dn(li),Dn(Hr)}function wf(f,p,S){if(Hr.current!==sa)throw Error(a(168));Tn(Hr,p),Tn(li,S)}function wu(f,p,S){var T=f.stateNode;if(p=p.childContextTypes,typeof T.getChildContext!="function")return S;T=T.getChildContext();for(var L in T)if(!(L in p))throw Error(a(108,j(f)||"Unknown",L));return o({},S,T)}function Ss(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||sa,la=Hr.current,Tn(Hr,f),Tn(li,li.current),!0}function Cf(f,p,S){var T=f.stateNode;if(!T)throw Error(a(169));S?(f=wu(f,p,la),T.__reactInternalMemoizedMergedChildContext=f,Dn(li),Dn(Hr),Tn(Hr,f)):Dn(li),Tn(li,S)}var Ii=Math.clz32?Math.clz32:_f,Ip=Math.log,Rp=Math.LN2;function _f(f){return f>>>=0,f===0?32:31-(Ip(f)/Rp|0)|0}var dl=64,Ro=4194304;function fl(f){switch(f&-f){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function Cu(f,p){var S=f.pendingLanes;if(S===0)return 0;var T=0,L=f.suspendedLanes,I=f.pingedLanes,q=S&268435455;if(q!==0){var le=q&~L;le!==0?T=fl(le):(I&=q,I!==0&&(T=fl(I)))}else q=S&~L,q!==0?T=fl(q):I!==0&&(T=fl(I));if(T===0)return 0;if(p!==0&&p!==T&&!(p&L)&&(L=T&-T,I=p&-p,L>=I||L===16&&(I&4194240)!==0))return p;if(T&4&&(T|=S&16),p=f.entangledLanes,p!==0)for(f=f.entanglements,p&=T;0S;S++)p.push(f);return p}function $a(f,p,S){f.pendingLanes|=p,p!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,p=31-Ii(p),f[p]=S}function Ef(f,p){var S=f.pendingLanes&~p;f.pendingLanes=p,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=p,f.mutableReadLanes&=p,f.entangledLanes&=p,p=f.entanglements;var T=f.eventTimes;for(f=f.expirationTimes;0>=q,L-=q,co=1<<32-Ii(p)+L|S<Gt?(ti=Rt,Rt=null):ti=Rt.sibling;var en=ot(me,Rt,Se[Gt],tt);if(en===null){Rt===null&&(Rt=ti);break}f&&Rt&&en.alternate===null&&p(me,Rt),ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en,Rt=ti}if(Gt===Se.length)return S(me,Rt),Wn&&hl(me,Gt),Ie;if(Rt===null){for(;GtGt?(ti=Rt,Rt=null):ti=Rt.sibling;var Ls=ot(me,Rt,en.value,tt);if(Ls===null){Rt===null&&(Rt=ti);break}f&&Rt&&Ls.alternate===null&&p(me,Rt),ue=I(Ls,ue,Gt),Bt===null?Ie=Ls:Bt.sibling=Ls,Bt=Ls,Rt=ti}if(en.done)return S(me,Rt),Wn&&hl(me,Gt),Ie;if(Rt===null){for(;!en.done;Gt++,en=Se.next())en=jt(me,en.value,tt),en!==null&&(ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en);return Wn&&hl(me,Gt),Ie}for(Rt=T(me,Rt);!en.done;Gt++,en=Se.next())en=Gn(Rt,me,Gt,en.value,tt),en!==null&&(f&&en.alternate!==null&&Rt.delete(en.key===null?Gt:en.key),ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en);return f&&Rt.forEach(function(ki){return p(me,ki)}),Wn&&hl(me,Gt),Ie}function ba(me,ue,Se,tt){if(typeof Se=="object"&&Se!==null&&Se.type===d&&Se.key===null&&(Se=Se.props.children),typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case l:e:{for(var Ie=Se.key,Bt=ue;Bt!==null;){if(Bt.key===Ie){if(Ie=Se.type,Ie===d){if(Bt.tag===7){S(me,Bt.sibling),ue=L(Bt,Se.props.children),ue.return=me,me=ue;break e}}else if(Bt.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===P&&i1(Ie)===Bt.type){S(me,Bt.sibling),ue=L(Bt,Se.props),ue.ref=Va(me,Bt,Se),ue.return=me,me=ue;break e}S(me,Bt);break}else p(me,Bt);Bt=Bt.sibling}Se.type===d?(ue=Pl(Se.props.children,me.mode,tt,Se.key),ue.return=me,me=ue):(tt=eh(Se.type,Se.key,Se.props,null,me.mode,tt),tt.ref=Va(me,ue,Se),tt.return=me,me=tt)}return q(me);case u:e:{for(Bt=Se.key;ue!==null;){if(ue.key===Bt)if(ue.tag===4&&ue.stateNode.containerInfo===Se.containerInfo&&ue.stateNode.implementation===Se.implementation){S(me,ue.sibling),ue=L(ue,Se.children||[]),ue.return=me,me=ue;break e}else{S(me,ue);break}else p(me,ue);ue=ue.sibling}ue=Tl(Se,me.mode,tt),ue.return=me,me=ue}return q(me);case P:return Bt=Se._init,ba(me,ue,Bt(Se._payload),tt)}if(W(Se))return Nn(me,ue,Se,tt);if(R(Se))return vr(me,ue,Se,tt);Xi(me,Se)}return typeof Se=="string"&&Se!==""||typeof Se=="number"?(Se=""+Se,ue!==null&&ue.tag===6?(S(me,ue.sibling),ue=L(ue,Se),ue.return=me,me=ue):(S(me,ue),ue=xg(Se,me.mode,tt),ue.return=me,me=ue),q(me)):S(me,ue)}return ba}var Rc=s3(!0),l3=s3(!1),jf={},Bo=aa(jf),Wa=aa(jf),oe=aa(jf);function we(f){if(f===jf)throw Error(a(174));return f}function ve(f,p){Tn(oe,p),Tn(Wa,f),Tn(Bo,jf),f=Z(p),Dn(Bo),Tn(Bo,f)}function it(){Dn(Bo),Dn(Wa),Dn(oe)}function It(f){var p=we(oe.current),S=we(Bo.current);p=U(S,f.type,p),S!==p&&(Tn(Wa,f),Tn(Bo,p))}function on(f){Wa.current===f&&(Dn(Bo),Dn(Wa))}var Ft=aa(0);function mn(f){for(var p=f;p!==null;){if(p.tag===13){var S=p.memoizedState;if(S!==null&&(S=S.dehydrated,S===null||xc(S)||xf(S)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if(p.flags&128)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var Bf=[];function o1(){for(var f=0;fS?S:4,f(!0);var T=Dc.transition;Dc.transition={};try{f(!1),p()}finally{Kt=S,Dc.transition=T}}function Hc(){return Ni().memoizedState}function h1(f,p,S){var T=qr(f);if(S={lane:T,action:S,hasEagerState:!1,eagerState:null,next:null},Wc(f))Uc(p,S);else if(S=Ic(f,p,S,T),S!==null){var L=_i();zo(S,f,T,L),Wf(S,p,T)}}function Vc(f,p,S){var T=qr(f),L={lane:T,action:S,hasEagerState:!1,eagerState:null,next:null};if(Wc(f))Uc(p,L);else{var I=f.alternate;if(f.lanes===0&&(I===null||I.lanes===0)&&(I=p.lastRenderedReducer,I!==null))try{var q=p.lastRenderedState,le=I(q,S);if(L.hasEagerState=!0,L.eagerState=le,Y(le,q)){var pe=p.interleaved;pe===null?(L.next=L,Df(p)):(L.next=pe.next,pe.next=L),p.interleaved=L;return}}catch{}finally{}S=Ic(f,p,L,T),S!==null&&(L=_i(),zo(S,f,T,L),Wf(S,p,T))}}function Wc(f){var p=f.alternate;return f===Ln||p!==null&&p===Ln}function Uc(f,p){Ff=cn=!0;var S=f.pending;S===null?p.next=p:(p.next=S.next,S.next=p),f.pending=p}function Wf(f,p,S){if(S&4194240){var T=p.lanes;T&=f.pendingLanes,S|=T,p.lanes=S,_u(f,S)}}var Cs={readContext:fo,useCallback:Si,useContext:Si,useEffect:Si,useImperativeHandle:Si,useInsertionEffect:Si,useLayoutEffect:Si,useMemo:Si,useReducer:Si,useRef:Si,useState:Si,useDebugValue:Si,useDeferredValue:Si,useTransition:Si,useMutableSource:Si,useSyncExternalStore:Si,useId:Si,unstable_isNewReconciler:!1},Sw={readContext:fo,useCallback:function(f,p){return di().memoizedState=[f,p===void 0?null:p],f},useContext:fo,useEffect:d3,useImperativeHandle:function(f,p,S){return S=S!=null?S.concat([f]):null,Tu(4194308,4,Dr.bind(null,p,f),S)},useLayoutEffect:function(f,p){return Tu(4194308,4,f,p)},useInsertionEffect:function(f,p){return Tu(4,2,f,p)},useMemo:function(f,p){var S=di();return p=p===void 0?null:p,f=f(),S.memoizedState=[f,p],f},useReducer:function(f,p,S){var T=di();return p=S!==void 0?S(p):p,T.memoizedState=T.baseState=p,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:p},T.queue=f,f=f.dispatch=h1.bind(null,Ln,f),[T.memoizedState,f]},useRef:function(f){var p=di();return f={current:f},p.memoizedState=f},useState:c3,useDebugValue:c1,useDeferredValue:function(f){return di().memoizedState=f},useTransition:function(){var f=c3(!1),p=f[0];return f=f1.bind(null,f[1]),di().memoizedState=f,[p,f]},useMutableSource:function(){},useSyncExternalStore:function(f,p,S){var T=Ln,L=di();if(Wn){if(S===void 0)throw Error(a(407));S=S()}else{if(S=p(),ei===null)throw Error(a(349));Pu&30||u1(T,p,S)}L.memoizedState=S;var I={value:S,getSnapshot:p};return L.queue=I,d3(ml.bind(null,T,I,f),[f]),T.flags|=2048,Hf(9,$c.bind(null,T,I,S,p),void 0,null),S},useId:function(){var f=di(),p=ei.identifierPrefix;if(Wn){var S=za,T=co;S=(T&~(1<<32-Ii(T)-1)).toString(32)+S,p=":"+p+"R"+S,S=Nc++,0cg&&(p.flags|=128,P=!0,Yc(L,!1),p.lanes=4194304)}else{if(!P)if(f=mn(I),f!==null){if(p.flags|=128,P=!0,f=f.updateQueue,f!==null&&(p.updateQueue=f,p.flags|=4),Yc(L,!0),L.tail===null&&L.tailMode==="hidden"&&!I.alternate&&!Wn)return xi(p),null}else 2*Kn()-L.renderingStartTime>cg&&x!==1073741824&&(p.flags|=128,P=!0,Yc(L,!1),p.lanes=4194304);L.isBackwards?(I.sibling=p.child,p.child=I):(f=L.last,f!==null?f.sibling=I:p.child=I,L.last=I)}return L.tail!==null?(p=L.tail,L.rendering=p,L.tail=p.sibling,L.renderingStartTime=Kn(),p.sibling=null,f=$t.current,Tn($t,P?f&1|2:f&1),p):(xi(p),null);case 22:case 23:return rd(),x=p.memoizedState!==null,f!==null&&f.memoizedState!==null!==x&&(p.flags|=8192),x&&p.mode&1?po&1073741824&&(xi(p),Be&&p.subtreeFlags&6&&(p.flags|=8192)):xi(p),null;case 24:return null;case 25:return null}throw Error(a(156,p.tag))}function S1(f,p){switch(J0(p),p.tag){case 1:return ui(p.type)&&bs(),f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 3:return it(),Dn(li),Dn(Hr),i1(),f=p.flags,f&65536&&!(f&128)?(p.flags=f&-65537|128,p):null;case 5:return on(p),null;case 13:if(Dn($t),f=p.memoizedState,f!==null&&f.dehydrated!==null){if(p.alternate===null)throw Error(a(340));Ac()}return f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 19:return Dn($t),null;case 4:return it(),null;case 10:return Mf(p.type._context),null;case 22:case 23:return rd(),null;case 24:return null;default:return null}}var yl=!1,Wr=!1,Ew=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Kc(f,p){var x=f.ref;if(x!==null)if(typeof x=="function")try{x(null)}catch(P){Zn(f,p,P)}else x.current=null}function ga(f,p,x){try{x()}catch(P){Zn(f,p,P)}}var Zp=!1;function Au(f,p){for(Q(f.containerInfo),dt=p;dt!==null;)if(f=dt,p=f.child,(f.subtreeFlags&1028)!==0&&p!==null)p.return=f,dt=p;else for(;dt!==null;){f=dt;try{var x=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var P=x.memoizedProps,L=x.memoizedState,I=f.stateNode,q=I.getSnapshotBeforeUpdate(f.elementType===f.type?P:ca(f.type,P),L);I.__reactInternalSnapshotBeforeUpdate=q}break;case 3:Be&&ol(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(le){Zn(f,f.return,le)}if(p=f.sibling,p!==null){p.return=f.return,dt=p;break}dt=f.return}return x=Zp,Zp=!1,x}function wi(f,p,x){var P=p.updateQueue;if(P=P!==null?P.lastEffect:null,P!==null){var L=P=P.next;do{if((L.tag&f)===f){var I=L.destroy;L.destroy=void 0,I!==void 0&&ga(p,x,I)}L=L.next}while(L!==P)}}function Qp(f,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var x=p=p.next;do{if((x.tag&f)===f){var P=x.create;x.destroy=P()}x=x.next}while(x!==p)}}function Jp(f){var p=f.ref;if(p!==null){var x=f.stateNode;switch(f.tag){case 5:f=X(x);break;default:f=x}typeof p=="function"?p(f):p.current=f}}function x1(f){var p=f.alternate;p!==null&&(f.alternate=null,x1(p)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(p=f.stateNode,p!==null&&ct(p)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Xc(f){return f.tag===5||f.tag===3||f.tag===4}function ks(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Xc(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function eg(f,p,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,p?Ze(x,f,p):At(x,f);else if(P!==4&&(f=f.child,f!==null))for(eg(f,p,x),f=f.sibling;f!==null;)eg(f,p,x),f=f.sibling}function w1(f,p,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,p?Rn(x,f,p):Te(x,f);else if(P!==4&&(f=f.child,f!==null))for(w1(f,p,x),f=f.sibling;f!==null;)w1(f,p,x),f=f.sibling}var jr=null,ma=!1;function va(f,p,x){for(x=x.child;x!==null;)Ur(f,p,x),x=x.sibling}function Ur(f,p,x){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(gn,x)}catch{}switch(x.tag){case 5:Wr||Kc(x,p);case 6:if(Be){var P=jr,L=ma;jr=null,va(f,p,x),jr=P,ma=L,jr!==null&&(ma?ht(jr,x.stateNode):xt(jr,x.stateNode))}else va(f,p,x);break;case 18:Be&&jr!==null&&(ma?Y0(jr,x.stateNode):q0(jr,x.stateNode));break;case 4:Be?(P=jr,L=ma,jr=x.stateNode.containerInfo,ma=!0,va(f,p,x),jr=P,ma=L):(at&&(P=x.stateNode.containerInfo,L=$a(P),Sc(P,L)),va(f,p,x));break;case 0:case 11:case 14:case 15:if(!Wr&&(P=x.updateQueue,P!==null&&(P=P.lastEffect,P!==null))){L=P=P.next;do{var I=L,q=I.destroy;I=I.tag,q!==void 0&&(I&2||I&4)&&ga(x,p,q),L=L.next}while(L!==P)}va(f,p,x);break;case 1:if(!Wr&&(Kc(x,p),P=x.stateNode,typeof P.componentWillUnmount=="function"))try{P.props=x.memoizedProps,P.state=x.memoizedState,P.componentWillUnmount()}catch(le){Zn(x,p,le)}va(f,p,x);break;case 21:va(f,p,x);break;case 22:x.mode&1?(Wr=(P=Wr)||x.memoizedState!==null,va(f,p,x),Wr=P):va(f,p,x);break;default:va(f,p,x)}}function tg(f){var p=f.updateQueue;if(p!==null){f.updateQueue=null;var x=f.stateNode;x===null&&(x=f.stateNode=new Ew),p.forEach(function(P){var L=L3.bind(null,f,P);x.has(P)||(x.add(P),P.then(L,L))})}}function $o(f,p){var x=p.deletions;if(x!==null)for(var P=0;P";case og:return":has("+(k1(f)||"")+")";case ag:return'[role="'+f.value+'"]';case sg:return'"'+f.value+'"';case Zc:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Qc(f,p){var x=[];f=[f,0];for(var P=0;PL&&(L=q),P&=~I}if(P=L,P=Kn()-P,P=(120>P?120:480>P?480:1080>P?1080:1920>P?1920:3e3>P?3e3:4320>P?4320:1960*Pw(P/1960))-P,10f?16:f,Ot===null)var P=!1;else{if(f=Ot,Ot=null,dg=0,Ut&6)throw Error(a(331));var L=Ut;for(Ut|=4,dt=f.current;dt!==null;){var I=dt,q=I.child;if(dt.flags&16){var le=I.deletions;if(le!==null){for(var pe=0;peKn()-T1?_l(f,0):P1|=x),hi(f,p)}function I1(f,p){p===0&&(f.mode&1?(p=Ro,Ro<<=1,!(Ro&130023424)&&(Ro=4194304)):p=1);var x=_i();f=da(f,p),f!==null&&(Fa(f,p,x),hi(f,x))}function Lw(f){var p=f.memoizedState,x=0;p!==null&&(x=p.retryLane),I1(f,x)}function L3(f,p){var x=0;switch(f.tag){case 13:var P=f.stateNode,L=f.memoizedState;L!==null&&(x=L.retryLane);break;case 19:P=f.stateNode;break;default:throw Error(a(314))}P!==null&&P.delete(p),I1(f,x)}var R1;R1=function(f,p,x){if(f!==null)if(f.memoizedProps!==p.pendingProps||li.current)Zi=!0;else{if(!(f.lanes&x)&&!(p.flags&128))return Zi=!1,_w(f,p,x);Zi=!!(f.flags&131072)}else Zi=!1,Wn&&p.flags&1048576&&Q0(p,Rr,p.index);switch(p.lanes=0,p.tag){case 2:var P=p.type;Ua(f,p),f=p.pendingProps;var L=cl(p,Hr.current);Mc(p,x),L=a1(null,p,P,f,L,x);var I=jc();return p.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,ui(P)?(I=!0,Ss(p)):I=!1,p.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,t1(p),L.updater=fa,p.stateNode=L,L._reactInternals=p,n1(p,P,f,x),p=ha(null,p,P,!0,I,x)):(p.tag=0,Wn&&I&&Ri(p),ji(null,p,L,x),p=p.child),p;case 16:P=p.elementType;e:{switch(Ua(f,p),f=p.pendingProps,L=P._init,P=L(P._payload),p.type=P,L=p.tag=yg(P),f=ca(P,f),L){case 0:p=g1(null,p,P,f,x);break e;case 1:p=S3(null,p,P,f,x);break e;case 11:p=m3(null,p,P,f,x);break e;case 14:p=vl(null,p,P,ca(P.type,f),x);break e}throw Error(a(306,P,""))}return p;case 0:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ca(P,L),g1(f,p,P,L,x);case 1:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ca(P,L),S3(f,p,P,L,x);case 3:e:{if(x3(p),f===null)throw Error(a(387));P=p.pendingProps,I=p.memoizedState,L=I.element,r3(f,p),Hp(p,P,null,x);var q=p.memoizedState;if(P=q.element,bt&&I.isDehydrated)if(I={element:P,isDehydrated:!1,cache:q.cache,pendingSuspenseBoundaries:q.pendingSuspenseBoundaries,transitions:q.transitions},p.updateQueue.baseState=I,p.memoizedState=I,p.flags&256){L=Gc(Error(a(423)),p),p=w3(f,p,P,x,L);break e}else if(P!==L){L=Gc(Error(a(424)),p),p=w3(f,p,P,x,L);break e}else for(bt&&(No=F0(p.stateNode.containerInfo),Xn=p,Wn=!0,Ki=null,jo=!1),x=l3(p,null,P,x),p.child=x;x;)x.flags=x.flags&-3|4096,x=x.sibling;else{if(Ac(),P===L){p=_s(f,p,x);break e}ji(f,p,P,x)}p=p.child}return p;case 5:return It(p),f===null&&Tf(p),P=p.type,L=p.pendingProps,I=f!==null?f.memoizedProps:null,q=L.children,Fe(P,L)?q=null:I!==null&&Fe(P,I)&&(p.flags|=32),b3(f,p),ji(f,p,q,x),p.child;case 6:return f===null&&Tf(p),null;case 13:return C3(f,p,x);case 4:return ve(p,p.stateNode.containerInfo),P=p.pendingProps,f===null?p.child=Rc(p,null,P,x):ji(f,p,P,x),p.child;case 11:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ca(P,L),m3(f,p,P,L,x);case 7:return ji(f,p,p.pendingProps,x),p.child;case 8:return ji(f,p,p.pendingProps.children,x),p.child;case 12:return ji(f,p,p.pendingProps.children,x),p.child;case 10:e:{if(P=p.type._context,L=p.pendingProps,I=p.memoizedProps,q=L.value,n3(p,P,q),I!==null)if(Y(I.value,q)){if(I.children===L.children&&!li.current){p=_s(f,p,x);break e}}else for(I=p.child,I!==null&&(I.return=p);I!==null;){var le=I.dependencies;if(le!==null){q=I.child;for(var pe=le.firstContext;pe!==null;){if(pe.context===P){if(I.tag===1){pe=ws(-1,x&-x),pe.tag=2;var We=I.updateQueue;if(We!==null){We=We.shared;var ft=We.pending;ft===null?pe.next=pe:(pe.next=ft.next,ft.next=pe),We.pending=pe}}I.lanes|=x,pe=I.alternate,pe!==null&&(pe.lanes|=x),If(I.return,x,p),le.lanes|=x;break}pe=pe.next}}else if(I.tag===10)q=I.type===p.type?null:I.child;else if(I.tag===18){if(q=I.return,q===null)throw Error(a(341));q.lanes|=x,le=q.alternate,le!==null&&(le.lanes|=x),If(q,x,p),q=I.sibling}else q=I.child;if(q!==null)q.return=I;else for(q=I;q!==null;){if(q===p){q=null;break}if(I=q.sibling,I!==null){I.return=q.return,q=I;break}q=q.return}I=q}ji(f,p,L.children,x),p=p.child}return p;case 9:return L=p.type,P=p.pendingProps.children,Mc(p,x),L=fo(L),P=P(L),p.flags|=1,ji(f,p,P,x),p.child;case 14:return P=p.type,L=ca(P,p.pendingProps),L=ca(P.type,L),vl(f,p,P,L,x);case 15:return v3(f,p,p.type,p.pendingProps,x);case 17:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ca(P,L),Ua(f,p),p.tag=1,ui(P)?(f=!0,Ss(p)):f=!1,Mc(p,x),o3(p,P,L),n1(p,P,L,x),ha(null,p,P,!0,f,x);case 19:return k3(f,p,x);case 22:return y3(f,p,x)}throw Error(a(156,p.tag))};function Fi(f,p){return Pc(f,p)}function Ga(f,p,x,P){this.tag=f,this.key=x,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=P,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ho(f,p,x,P){return new Ga(f,p,x,P)}function D1(f){return f=f.prototype,!(!f||!f.isReactComponent)}function yg(f){if(typeof f=="function")return D1(f)?1:0;if(f!=null){if(f=f.$$typeof,f===S)return 11;if(f===k)return 14}return 2}function mo(f,p){var x=f.alternate;return x===null?(x=Ho(f.tag,p,f.key,f.mode),x.elementType=f.elementType,x.type=f.type,x.stateNode=f.stateNode,x.alternate=f,f.alternate=x):(x.pendingProps=p,x.type=f.type,x.flags=0,x.subtreeFlags=0,x.deletions=null),x.flags=f.flags&14680064,x.childLanes=f.childLanes,x.lanes=f.lanes,x.child=f.child,x.memoizedProps=f.memoizedProps,x.memoizedState=f.memoizedState,x.updateQueue=f.updateQueue,p=f.dependencies,x.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},x.sibling=f.sibling,x.index=f.index,x.ref=f.ref,x}function Jf(f,p,x,P,L,I){var q=2;if(P=f,typeof f=="function")D1(f)&&(q=1);else if(typeof f=="string")q=5;else e:switch(f){case d:return Pl(x.children,L,I,p);case h:q=8,L|=8;break;case m:return f=Ho(12,x,p,L|2),f.elementType=m,f.lanes=I,f;case _:return f=Ho(13,x,p,L),f.elementType=_,f.lanes=I,f;case E:return f=Ho(19,x,p,L),f.elementType=E,f.lanes=I,f;case A:return bg(x,L,I,p);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case v:q=10;break e;case b:q=9;break e;case S:q=11;break e;case k:q=14;break e;case T:q=16,P=null;break e}throw Error(a(130,f==null?f:typeof f,""))}return p=Ho(q,x,p,L),p.elementType=f,p.type=P,p.lanes=I,p}function Pl(f,p,x,P){return f=Ho(7,f,P,p),f.lanes=x,f}function bg(f,p,x,P){return f=Ho(22,f,P,p),f.elementType=A,f.lanes=x,f.stateNode={isHidden:!1},f}function Sg(f,p,x){return f=Ho(6,f,null,p),f.lanes=x,f}function Tl(f,p,x){return p=Ho(4,f.children!==null?f.children:[],f.key,p),p.lanes=x,p.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},p}function eh(f,p,x,P,L){this.tag=p,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=je,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ec(0),this.expirationTimes=Ec(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ec(0),this.identifierPrefix=P,this.onRecoverableError=L,bt&&(this.mutableSourceEagerHydrationData=null)}function A3(f,p,x,P,L,I,q,le,pe){return f=new eh(f,p,x,le,pe),p===1?(p=1,I===!0&&(p|=8)):p=0,I=Ho(3,null,null,p),f.current=I,I.stateNode=f,I.memoizedState={element:P,isDehydrated:x,cache:null,transitions:null,pendingSuspenseBoundaries:null},t1(I),f}function N1(f){if(!f)return sa;f=f._reactInternals;e:{if(z(f)!==f||f.tag!==1)throw Error(a(170));var p=f;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(ui(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(a(171))}if(f.tag===1){var x=f.type;if(ui(x))return wu(f,x,p)}return p}function j1(f){var p=f._reactInternals;if(p===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=te(p),f===null?null:f.stateNode}function th(f,p){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var x=f.retryLane;f.retryLane=x!==0&&x=We&&I>=jt&&L<=ft&&q<=ot){f.splice(p,1);break}else if(P!==We||x.width!==pe.width||otq){if(!(I!==jt||x.height!==pe.height||ftL)){We>P&&(pe.width+=We-P,pe.x=P),ftI&&(pe.height+=jt-I,pe.y=I),otx&&(x=q)),q ")+` +`+I.stack}return{value:f,source:p,stack:L,digest:null}}function p1(f,p,S){return{value:f,source:null,stack:S??null,digest:p??null}}function qc(f,p){try{console.error(p.value)}catch(S){setTimeout(function(){throw S})}}var Uf=typeof WeakMap=="function"?WeakMap:Map;function g1(f,p,S){S=ws(-1,S),S.tag=3,S.payload={element:null};var T=p.value;return S.callback=function(){Kf||(Kf=!0,Xf=T),qc(f,p)},S}function $(f,p,S){S=ws(-1,S),S.tag=3;var T=f.type.getDerivedStateFromError;if(typeof T=="function"){var L=p.value;S.payload=function(){return T(L)},S.callback=function(){qc(f,p)}}var I=f.stateNode;return I!==null&&typeof I.componentDidCatch=="function"&&(S.callback=function(){qc(f,p),typeof T!="function"&&(Cl===null?Cl=new Set([this]):Cl.add(this));var q=p.stack;this.componentDidCatch(p.value,{componentStack:q!==null?q:""})}),S}function Lu(f,p,S){var T=f.pingCache;if(T===null){T=f.pingCache=new Uf;var L=new Set;T.set(p,L)}else L=T.get(p),L===void 0&&(L=new Set,T.set(p,L));L.has(S)||(L.add(S),f=T3.bind(null,f,p,S),p.then(f,f))}function Gf(f){do{var p;if((p=f.tag===13)&&(p=f.memoizedState,p=p!==null?p.dehydrated!==null:!0),p)return f;f=f.return}while(f!==null);return null}function ho(f,p,S,T,L){return f.mode&1?(f.flags|=65536,f.lanes=L,f):(f===p?f.flags|=65536:(f.flags|=128,S.flags|=131072,S.flags&=-52805,S.tag===1&&(S.alternate===null?S.tag=17:(p=ws(-1,1),p.tag=2,gl(S,p,1))),S.lanes|=1),f)}var Qt=s.ReactCurrentOwner,Zi=!1;function ji(f,p,S,T){p.child=f===null?l3(p,null,S,T):Rc(p,f.child,S,T)}function m3(f,p,S,T,L){S=S.render;var I=p.ref;return Mc(p,L),T=s1(f,p,S,T,I,L),S=jc(),f!==null&&!Zi?(p.updateQueue=f.updateQueue,p.flags&=-2053,f.lanes&=~L,_s(f,p,L)):(Wn&&S&&Ri(p),p.flags|=1,ji(f,p,T,L),p.child)}function vl(f,p,S,T,L){if(f===null){var I=S.type;return typeof I=="function"&&!N1(I)&&I.defaultProps===void 0&&S.compare===null&&S.defaultProps===void 0?(p.tag=15,p.type=I,v3(f,p,I,T,L)):(f=eh(S.type,null,T,p,p.mode,L),f.ref=p.ref,f.return=p,p.child=f)}if(I=f.child,!(f.lanes&L)){var q=I.memoizedProps;if(S=S.compare,S=S!==null?S:ku,S(q,T)&&f.ref===p.ref)return _s(f,p,L)}return p.flags|=1,f=mo(I,T),f.ref=p.ref,f.return=p,p.child=f}function v3(f,p,S,T,L){if(f!==null){var I=f.memoizedProps;if(ku(I,T)&&f.ref===p.ref)if(Zi=!1,p.pendingProps=T=I,(f.lanes&L)!==0)f.flags&131072&&(Zi=!0);else return p.lanes=f.lanes,_s(f,p,L)}return m1(f,p,S,T,L)}function y3(f,p,S){var T=p.pendingProps,L=T.children,I=f!==null?f.memoizedState:null;if(T.mode==="hidden")if(!(p.mode&1))p.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tn(Sl,po),po|=S;else{if(!(S&1073741824))return f=I!==null?I.baseLanes|S:S,p.lanes=p.childLanes=1073741824,p.memoizedState={baseLanes:f,cachePool:null,transitions:null},p.updateQueue=null,Tn(Sl,po),po|=f,null;p.memoizedState={baseLanes:0,cachePool:null,transitions:null},T=I!==null?I.baseLanes:S,Tn(Sl,po),po|=T}else I!==null?(T=I.baseLanes|S,p.memoizedState=null):T=S,Tn(Sl,po),po|=T;return ji(f,p,L,S),p.child}function b3(f,p){var S=p.ref;(f===null&&S!==null||f!==null&&f.ref!==S)&&(p.flags|=512,p.flags|=2097152)}function m1(f,p,S,T,L){var I=ui(S)?la:Hr.current;return I=cl(p,I),Mc(p,L),S=s1(f,p,S,T,I,L),T=jc(),f!==null&&!Zi?(p.updateQueue=f.updateQueue,p.flags&=-2053,f.lanes&=~L,_s(f,p,L)):(Wn&&T&&Ri(p),p.flags|=1,ji(f,p,S,L),p.child)}function S3(f,p,S,T,L){if(ui(S)){var I=!0;Ss(p)}else I=!1;if(Mc(p,L),p.stateNode===null)Ua(f,p),o3(p,S,T),r1(p,S,T,L),T=!0;else if(f===null){var q=p.stateNode,le=p.memoizedProps;q.props=le;var pe=q.context,Ue=S.contextType;typeof Ue=="object"&&Ue!==null?Ue=fo(Ue):(Ue=ui(S)?la:Hr.current,Ue=cl(p,Ue));var ft=S.getDerivedStateFromProps,jt=typeof ft=="function"||typeof q.getSnapshotBeforeUpdate=="function";jt||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(le!==T||pe!==Ue)&&a3(p,q,T,Ue),xs=!1;var ot=p.memoizedState;q.state=ot,Vp(p,T,q,L),pe=p.memoizedState,le!==T||ot!==pe||li.current||xs?(typeof ft=="function"&&(Up(p,S,ft,T),pe=p.memoizedState),(le=xs||Nf(p,S,le,T,ot,pe,Ue))?(jt||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount()),typeof q.componentDidMount=="function"&&(p.flags|=4194308)):(typeof q.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=T,p.memoizedState=pe),q.props=T,q.state=pe,q.context=Ue,T=le):(typeof q.componentDidMount=="function"&&(p.flags|=4194308),T=!1)}else{q=p.stateNode,r3(f,p),le=p.memoizedProps,Ue=p.type===p.elementType?le:ca(p.type,le),q.props=Ue,jt=p.pendingProps,ot=q.context,pe=S.contextType,typeof pe=="object"&&pe!==null?pe=fo(pe):(pe=ui(S)?la:Hr.current,pe=cl(p,pe));var Gn=S.getDerivedStateFromProps;(ft=typeof Gn=="function"||typeof q.getSnapshotBeforeUpdate=="function")||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(le!==jt||ot!==pe)&&a3(p,q,T,pe),xs=!1,ot=p.memoizedState,q.state=ot,Vp(p,T,q,L);var Nn=p.memoizedState;le!==jt||ot!==Nn||li.current||xs?(typeof Gn=="function"&&(Up(p,S,Gn,T),Nn=p.memoizedState),(Ue=xs||Nf(p,S,Ue,T,ot,Nn,pe)||!1)?(ft||typeof q.UNSAFE_componentWillUpdate!="function"&&typeof q.componentWillUpdate!="function"||(typeof q.componentWillUpdate=="function"&&q.componentWillUpdate(T,Nn,pe),typeof q.UNSAFE_componentWillUpdate=="function"&&q.UNSAFE_componentWillUpdate(T,Nn,pe)),typeof q.componentDidUpdate=="function"&&(p.flags|=4),typeof q.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof q.componentDidUpdate!="function"||le===f.memoizedProps&&ot===f.memoizedState||(p.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||le===f.memoizedProps&&ot===f.memoizedState||(p.flags|=1024),p.memoizedProps=T,p.memoizedState=Nn),q.props=T,q.state=Nn,q.context=pe,T=Ue):(typeof q.componentDidUpdate!="function"||le===f.memoizedProps&&ot===f.memoizedState||(p.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||le===f.memoizedProps&&ot===f.memoizedState||(p.flags|=1024),T=!1)}return ha(f,p,S,T,I,L)}function ha(f,p,S,T,L,I){b3(f,p);var q=(p.flags&128)!==0;if(!T&&!q)return L&&Cf(p,S,!1),_s(f,p,I);T=p.stateNode,Qt.current=p;var le=q&&typeof S.getDerivedStateFromError!="function"?null:T.render();return p.flags|=1,f!==null&&q?(p.child=Rc(p,f.child,null,I),p.child=Rc(p,null,le,I)):ji(f,p,le,I),p.memoizedState=T.state,L&&Cf(p,S,!0),p.child}function x3(f){var p=f.stateNode;p.pendingContext?wf(f,p.pendingContext,p.pendingContext!==p.context):p.context&&wf(f,p.context,!1),ve(f,p.containerInfo)}function w3(f,p,S,T,L){return Ac(),t1(L),p.flags|=256,ji(f,p,S,T),p.child}var v1={dehydrated:null,treeContext:null,retryLane:0};function y1(f){return{baseLanes:f,cachePool:null,transitions:null}}function C3(f,p,S){var T=p.pendingProps,L=Ft.current,I=!1,q=(p.flags&128)!==0,le;if((le=q)||(le=f!==null&&f.memoizedState===null?!1:(L&2)!==0),le?(I=!0,p.flags&=-129):(f===null||f.memoizedState!==null)&&(L|=1),Tn(Ft,L&1),f===null)return Lf(p),f=p.memoizedState,f!==null&&(f=f.dehydrated,f!==null)?(p.mode&1?xf(f)?p.lanes=8:p.lanes=1073741824:p.lanes=1,null):(q=T.children,f=T.fallback,I?(T=p.mode,I=p.child,q={mode:"hidden",children:q},!(T&1)&&I!==null?(I.childLanes=0,I.pendingProps=q):I=Sg(q,T,0,null),f=Pl(f,T,S,null),I.return=p,f.return=p,I.sibling=f,p.child=I,p.child.memoizedState=y1(S),p.memoizedState=v1,f):pa(p,q));if(L=f.memoizedState,L!==null&&(le=L.dehydrated,le!==null))return Cw(f,p,q,T,le,L,S);if(I){I=T.fallback,q=p.mode,L=f.child,le=L.sibling;var pe={mode:"hidden",children:T.children};return!(q&1)&&p.child!==L?(T=p.child,T.childLanes=0,T.pendingProps=pe,p.deletions=null):(T=mo(L,pe),T.subtreeFlags=L.subtreeFlags&14680064),le!==null?I=mo(le,I):(I=Pl(I,q,S,null),I.flags|=2),I.return=p,T.return=p,T.sibling=I,p.child=T,T=I,I=p.child,q=f.child.memoizedState,q=q===null?y1(S):{baseLanes:q.baseLanes|S,cachePool:null,transitions:q.transitions},I.memoizedState=q,I.childLanes=f.childLanes&~S,p.memoizedState=v1,T}return I=f.child,f=I.sibling,T=mo(I,{mode:"visible",children:T.children}),!(p.mode&1)&&(T.lanes=S),T.return=p,T.sibling=null,f!==null&&(S=p.deletions,S===null?(p.deletions=[f],p.flags|=16):S.push(f)),p.child=T,p.memoizedState=null,T}function pa(f,p){return p=Sg({mode:"visible",children:p},f.mode,0,null),p.return=f,f.child=p}function Kp(f,p,S,T){return T!==null&&t1(T),Rc(p,f.child,null,S),f=pa(p,p.pendingProps.children),f.flags|=2,p.memoizedState=null,f}function Cw(f,p,S,T,L,I,q){if(S)return p.flags&256?(p.flags&=-257,T=p1(Error(a(422))),Kp(f,p,q,T)):p.memoizedState!==null?(p.child=f.child,p.flags|=128,null):(I=T.fallback,L=p.mode,T=Sg({mode:"visible",children:T.children},L,0,null),I=Pl(I,L,q,null),I.flags|=2,T.return=p,I.return=p,T.sibling=I,p.child=T,p.mode&1&&Rc(p,f.child,null,q),p.child.memoizedState=y1(q),p.memoizedState=v1,I);if(!(p.mode&1))return Kp(f,p,q,null);if(xf(L))return T=F0(L).digest,I=Error(a(419)),T=p1(I,T,void 0),Kp(f,p,q,T);if(S=(q&f.childLanes)!==0,Zi||S){if(T=ei,T!==null){switch(q&-q){case 4:L=2;break;case 16:L=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:L=32;break;case 536870912:L=268435456;break;default:L=0}L=L&(T.suspendedLanes|q)?0:L,L!==0&&L!==I.retryLane&&(I.retryLane=L,da(f,L),zo(T,f,L,-1))}return Jf(),T=p1(Error(a(421))),Kp(f,p,q,T)}return xc(L)?(p.flags|=128,p.child=f.child,p=Lw.bind(null,f),al(L,p),null):(f=I.treeContext,bt&&(No=H0(L),Xn=p,Wn=!0,Ki=null,jo=!1,f!==null&&(wn[ci++]=co,wn[ci++]=za,wn[ci++]=Do,co=f.id,za=f.overflow,Do=p)),p=pa(p,T.children),p.flags|=4096,p)}function _3(f,p,S){f.lanes|=p;var T=f.alternate;T!==null&&(T.lanes|=p),Rf(f.return,p,S)}function b1(f,p,S,T,L){var I=f.memoizedState;I===null?f.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:T,tail:S,tailMode:L}:(I.isBackwards=p,I.rendering=null,I.renderingStartTime=0,I.last=T,I.tail=S,I.tailMode=L)}function k3(f,p,S){var T=p.pendingProps,L=T.revealOrder,I=T.tail;if(ji(f,p,T.children,S),T=Ft.current,T&2)T=T&1|2,p.flags|=128;else{if(f!==null&&f.flags&128)e:for(f=p.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&_3(f,S,p);else if(f.tag===19)_3(f,S,p);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===p)break e;for(;f.sibling===null;){if(f.return===null||f.return===p)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}T&=1}if(Tn(Ft,T),!(p.mode&1))p.memoizedState=null;else switch(L){case"forwards":for(S=p.child,L=null;S!==null;)f=S.alternate,f!==null&&mn(f)===null&&(L=S),S=S.sibling;S=L,S===null?(L=p.child,p.child=null):(L=S.sibling,S.sibling=null),b1(p,!1,L,S,I);break;case"backwards":for(S=null,L=p.child,p.child=null;L!==null;){if(f=L.alternate,f!==null&&mn(f)===null){p.child=L;break}f=L.sibling,L.sibling=S,S=L,L=f}b1(p,!0,S,null,I);break;case"together":b1(p,!1,null,null,void 0);break;default:p.memoizedState=null}return p.child}function Ua(f,p){!(p.mode&1)&&f!==null&&(f.alternate=null,p.alternate=null,p.flags|=2)}function _s(f,p,S){if(f!==null&&(p.dependencies=f.dependencies),xl|=p.lanes,!(S&p.childLanes))return null;if(f!==null&&p.child!==f.child)throw Error(a(153));if(p.child!==null){for(f=p.child,S=mo(f,f.pendingProps),p.child=S,S.return=p;f.sibling!==null;)f=f.sibling,S=S.sibling=mo(f,f.pendingProps),S.return=p;S.sibling=null}return p.child}function _w(f,p,S){switch(p.tag){case 3:x3(p),Ac();break;case 5:It(p);break;case 1:ui(p.type)&&Ss(p);break;case 4:ve(p,p.stateNode.containerInfo);break;case 10:n3(p,p.type._context,p.memoizedProps.value);break;case 13:var T=p.memoizedState;if(T!==null)return T.dehydrated!==null?(Tn(Ft,Ft.current&1),p.flags|=128,null):S&p.child.childLanes?C3(f,p,S):(Tn(Ft,Ft.current&1),f=_s(f,p,S),f!==null?f.sibling:null);Tn(Ft,Ft.current&1);break;case 19:if(T=(S&p.childLanes)!==0,f.flags&128){if(T)return k3(f,p,S);p.flags|=128}var L=p.memoizedState;if(L!==null&&(L.rendering=null,L.tail=null,L.lastEffect=null),Tn(Ft,Ft.current),T)break;return null;case 22:case 23:return p.lanes=0,y3(f,p,S)}return _s(f,p,S)}function Nr(f){f.flags|=4}function E3(f,p){if(f!==null&&f.child===p.child)return!0;if(p.flags&16)return!1;for(f=p.child;f!==null;){if(f.flags&12854||f.subtreeFlags&12854)return!1;f=f.sibling}return!0}var qf,Yf,Xp,Zp;if(Fe)qf=function(f,p){for(var S=p.child;S!==null;){if(S.tag===5||S.tag===6)Ee(f,S.stateNode);else if(S.tag!==4&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===p)break;for(;S.sibling===null;){if(S.return===null||S.return===p)return;S=S.return}S.sibling.return=S.return,S=S.sibling}},Yf=function(){},Xp=function(f,p,S,T,L){if(f=f.memoizedProps,f!==T){var I=p.stateNode,q=we(Bo.current);S=ye(I,S,f,T,L,q),(p.updateQueue=S)&&Nr(p)}},Zp=function(f,p,S,T){S!==T&&Nr(p)};else if(at){qf=function(f,p,S,T){for(var L=p.child;L!==null;){if(L.tag===5){var I=L.stateNode;S&&T&&(I=Ap(I,L.type,L.memoizedProps,L)),Ee(f,I)}else if(L.tag===6)I=L.stateNode,S&&T&&(I=Op(I,L.memoizedProps,L)),Ee(f,I);else if(L.tag!==4){if(L.tag===22&&L.memoizedState!==null)I=L.child,I!==null&&(I.return=L),qf(f,L,!0,!0);else if(L.child!==null){L.child.return=L,L=L.child;continue}}if(L===p)break;for(;L.sibling===null;){if(L.return===null||L.return===p)return;L=L.return}L.sibling.return=L.return,L=L.sibling}};var S1=function(f,p,S,T){for(var L=p.child;L!==null;){if(L.tag===5){var I=L.stateNode;S&&T&&(I=Ap(I,L.type,L.memoizedProps,L)),Lp(f,I)}else if(L.tag===6)I=L.stateNode,S&&T&&(I=Op(I,L.memoizedProps,L)),Lp(f,I);else if(L.tag!==4){if(L.tag===22&&L.memoizedState!==null)I=L.child,I!==null&&(I.return=L),S1(f,L,!0,!0);else if(L.child!==null){L.child.return=L,L=L.child;continue}}if(L===p)break;for(;L.sibling===null;){if(L.return===null||L.return===p)return;L=L.return}L.sibling.return=L.return,L=L.sibling}};Yf=function(f,p){var S=p.stateNode;if(!E3(f,p)){f=S.containerInfo;var T=Fa(f);S1(T,p,!1,!1),S.pendingChildren=T,Nr(p),j0(f,T)}},Xp=function(f,p,S,T,L){var I=f.stateNode,q=f.memoizedProps;if((f=E3(f,p))&&q===T)p.stateNode=I;else{var le=p.stateNode,pe=we(Bo.current),Ue=null;q!==T&&(Ue=ye(le,S,q,T,L,pe)),f&&Ue===null?p.stateNode=I:(I=N0(I,Ue,S,q,T,p,f,le),be(I,S,T,L,pe)&&Nr(p),p.stateNode=I,f?Nr(p):qf(I,p,!1,!1))}},Zp=function(f,p,S,T){S!==T?(f=we(oe.current),S=we(Bo.current),p.stateNode=Me(T,f,S,p),Nr(p)):p.stateNode=f.stateNode}}else Yf=function(){},Xp=function(){},Zp=function(){};function Yc(f,p){if(!Wn)switch(f.tailMode){case"hidden":p=f.tail;for(var S=null;p!==null;)p.alternate!==null&&(S=p),p=p.sibling;S===null?f.tail=null:S.sibling=null;break;case"collapsed":S=f.tail;for(var T=null;S!==null;)S.alternate!==null&&(T=S),S=S.sibling;T===null?p||f.tail===null?f.tail=null:f.tail.sibling=null:T.sibling=null}}function xi(f){var p=f.alternate!==null&&f.alternate.child===f.child,S=0,T=0;if(p)for(var L=f.child;L!==null;)S|=L.lanes|L.childLanes,T|=L.subtreeFlags&14680064,T|=L.flags&14680064,L.return=f,L=L.sibling;else for(L=f.child;L!==null;)S|=L.lanes|L.childLanes,T|=L.subtreeFlags,T|=L.flags,L.return=f,L=L.sibling;return f.subtreeFlags|=T,f.childLanes=S,p}function kw(f,p,S){var T=p.pendingProps;switch(e1(p),p.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xi(p),null;case 1:return ui(p.type)&&bs(),xi(p),null;case 3:return S=p.stateNode,it(),Dn(li),Dn(Hr),o1(),S.pendingContext&&(S.context=S.pendingContext,S.pendingContext=null),(f===null||f.child===null)&&(Lc(p)?Nr(p):f===null||f.memoizedState.isDehydrated&&!(p.flags&256)||(p.flags|=1024,Ki!==null&&(mg(Ki),Ki=null))),Yf(f,p),xi(p),null;case 5:on(p),S=we(oe.current);var L=p.type;if(f!==null&&p.stateNode!=null)Xp(f,p,L,T,S),f.ref!==p.ref&&(p.flags|=512,p.flags|=2097152);else{if(!T){if(p.stateNode===null)throw Error(a(166));return xi(p),null}if(f=we(Bo.current),Lc(p)){if(!bt)throw Error(a(175));f=V0(p.stateNode,p.type,p.memoizedProps,S,f,p,!jo),p.updateQueue=f,f!==null&&Nr(p)}else{var I=fe(L,T,S,f,p);qf(I,p,!1,!1),p.stateNode=I,be(I,L,T,S,f)&&Nr(p)}p.ref!==null&&(p.flags|=512,p.flags|=2097152)}return xi(p),null;case 6:if(f&&p.stateNode!=null)Zp(f,p,f.memoizedProps,T);else{if(typeof T!="string"&&p.stateNode===null)throw Error(a(166));if(f=we(oe.current),S=we(Bo.current),Lc(p)){if(!bt)throw Error(a(176));if(f=p.stateNode,S=p.memoizedProps,(T=vs(f,S,p,!jo))&&(L=Xn,L!==null))switch(L.tag){case 3:X0(L.stateNode.containerInfo,f,S,(L.mode&1)!==0);break;case 5:ys(L.type,L.memoizedProps,L.stateNode,f,S,(L.mode&1)!==0)}T&&Nr(p)}else p.stateNode=Me(T,f,S,p)}return xi(p),null;case 13:if(Dn(Ft),T=p.memoizedState,f===null||f.memoizedState!==null&&f.memoizedState.dehydrated!==null){if(Wn&&No!==null&&p.mode&1&&!(p.flags&128))e3(),Ac(),p.flags|=98560,L=!1;else if(L=Lc(p),T!==null&&T.dehydrated!==null){if(f===null){if(!L)throw Error(a(318));if(!bt)throw Error(a(344));if(L=p.memoizedState,L=L!==null?L.dehydrated:null,!L)throw Error(a(317));W0(L,p)}else Ac(),!(p.flags&128)&&(p.memoizedState=null),p.flags|=4;xi(p),L=!1}else Ki!==null&&(mg(Ki),Ki=null),L=!0;if(!L)return p.flags&65536?p:null}return p.flags&128?(p.lanes=S,p):(S=T!==null,S!==(f!==null&&f.memoizedState!==null)&&S&&(p.child.flags|=8192,p.mode&1&&(f===null||Ft.current&1?Br===0&&(Br=3):Jf())),p.updateQueue!==null&&(p.flags|=4),xi(p),null);case 4:return it(),Yf(f,p),f===null&&ut(p.stateNode.containerInfo),xi(p),null;case 10:return If(p.type._context),xi(p),null;case 17:return ui(p.type)&&bs(),xi(p),null;case 19:if(Dn(Ft),L=p.memoizedState,L===null)return xi(p),null;if(T=(p.flags&128)!==0,I=L.rendering,I===null)if(T)Yc(L,!1);else{if(Br!==0||f!==null&&f.flags&128)for(f=p.child;f!==null;){if(I=mn(f),I!==null){for(p.flags|=128,Yc(L,!1),f=I.updateQueue,f!==null&&(p.updateQueue=f,p.flags|=4),p.subtreeFlags=0,f=S,S=p.child;S!==null;)T=S,L=f,T.flags&=14680066,I=T.alternate,I===null?(T.childLanes=0,T.lanes=L,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=I.childLanes,T.lanes=I.lanes,T.child=I.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=I.memoizedProps,T.memoizedState=I.memoizedState,T.updateQueue=I.updateQueue,T.type=I.type,L=I.dependencies,T.dependencies=L===null?null:{lanes:L.lanes,firstContext:L.firstContext}),S=S.sibling;return Tn(Ft,Ft.current&1|2),p.child}f=f.sibling}L.tail!==null&&Kn()>dg&&(p.flags|=128,T=!0,Yc(L,!1),p.lanes=4194304)}else{if(!T)if(f=mn(I),f!==null){if(p.flags|=128,T=!0,f=f.updateQueue,f!==null&&(p.updateQueue=f,p.flags|=4),Yc(L,!0),L.tail===null&&L.tailMode==="hidden"&&!I.alternate&&!Wn)return xi(p),null}else 2*Kn()-L.renderingStartTime>dg&&S!==1073741824&&(p.flags|=128,T=!0,Yc(L,!1),p.lanes=4194304);L.isBackwards?(I.sibling=p.child,p.child=I):(f=L.last,f!==null?f.sibling=I:p.child=I,L.last=I)}return L.tail!==null?(p=L.tail,L.rendering=p,L.tail=p.sibling,L.renderingStartTime=Kn(),p.sibling=null,f=Ft.current,Tn(Ft,T?f&1|2:f&1),p):(xi(p),null);case 22:case 23:return rd(),S=p.memoizedState!==null,f!==null&&f.memoizedState!==null!==S&&(p.flags|=8192),S&&p.mode&1?po&1073741824&&(xi(p),Fe&&p.subtreeFlags&6&&(p.flags|=8192)):xi(p),null;case 24:return null;case 25:return null}throw Error(a(156,p.tag))}function x1(f,p){switch(e1(p),p.tag){case 1:return ui(p.type)&&bs(),f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 3:return it(),Dn(li),Dn(Hr),o1(),f=p.flags,f&65536&&!(f&128)?(p.flags=f&-65537|128,p):null;case 5:return on(p),null;case 13:if(Dn(Ft),f=p.memoizedState,f!==null&&f.dehydrated!==null){if(p.alternate===null)throw Error(a(340));Ac()}return f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 19:return Dn(Ft),null;case 4:return it(),null;case 10:return If(p.type._context),null;case 22:case 23:return rd(),null;case 24:return null;default:return null}}var yl=!1,Wr=!1,Ew=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Kc(f,p){var S=f.ref;if(S!==null)if(typeof S=="function")try{S(null)}catch(T){Zn(f,p,T)}else S.current=null}function ga(f,p,S){try{S()}catch(T){Zn(f,p,T)}}var Qp=!1;function Au(f,p){for(Q(f.containerInfo),dt=p;dt!==null;)if(f=dt,p=f.child,(f.subtreeFlags&1028)!==0&&p!==null)p.return=f,dt=p;else for(;dt!==null;){f=dt;try{var S=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var T=S.memoizedProps,L=S.memoizedState,I=f.stateNode,q=I.getSnapshotBeforeUpdate(f.elementType===f.type?T:ca(f.type,T),L);I.__reactInternalSnapshotBeforeUpdate=q}break;case 3:Fe&&ol(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(le){Zn(f,f.return,le)}if(p=f.sibling,p!==null){p.return=f.return,dt=p;break}dt=f.return}return S=Qp,Qp=!1,S}function wi(f,p,S){var T=p.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var L=T=T.next;do{if((L.tag&f)===f){var I=L.destroy;L.destroy=void 0,I!==void 0&&ga(p,S,I)}L=L.next}while(L!==T)}}function Jp(f,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var S=p=p.next;do{if((S.tag&f)===f){var T=S.create;S.destroy=T()}S=S.next}while(S!==p)}}function eg(f){var p=f.ref;if(p!==null){var S=f.stateNode;switch(f.tag){case 5:f=X(S);break;default:f=S}typeof p=="function"?p(f):p.current=f}}function w1(f){var p=f.alternate;p!==null&&(f.alternate=null,w1(p)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(p=f.stateNode,p!==null&&ct(p)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Xc(f){return f.tag===5||f.tag===3||f.tag===4}function ks(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Xc(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function tg(f,p,S){var T=f.tag;if(T===5||T===6)f=f.stateNode,p?Ze(S,f,p):At(S,f);else if(T!==4&&(f=f.child,f!==null))for(tg(f,p,S),f=f.sibling;f!==null;)tg(f,p,S),f=f.sibling}function C1(f,p,S){var T=f.tag;if(T===5||T===6)f=f.stateNode,p?Rn(S,f,p):Te(S,f);else if(T!==4&&(f=f.child,f!==null))for(C1(f,p,S),f=f.sibling;f!==null;)C1(f,p,S),f=f.sibling}var jr=null,ma=!1;function va(f,p,S){for(S=S.child;S!==null;)Ur(f,p,S),S=S.sibling}function Ur(f,p,S){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(gn,S)}catch{}switch(S.tag){case 5:Wr||Kc(S,p);case 6:if(Fe){var T=jr,L=ma;jr=null,va(f,p,S),jr=T,ma=L,jr!==null&&(ma?ht(jr,S.stateNode):xt(jr,S.stateNode))}else va(f,p,S);break;case 18:Fe&&jr!==null&&(ma?K0(jr,S.stateNode):Y0(jr,S.stateNode));break;case 4:Fe?(T=jr,L=ma,jr=S.stateNode.containerInfo,ma=!0,va(f,p,S),jr=T,ma=L):(at&&(T=S.stateNode.containerInfo,L=Fa(T),Sc(T,L)),va(f,p,S));break;case 0:case 11:case 14:case 15:if(!Wr&&(T=S.updateQueue,T!==null&&(T=T.lastEffect,T!==null))){L=T=T.next;do{var I=L,q=I.destroy;I=I.tag,q!==void 0&&(I&2||I&4)&&ga(S,p,q),L=L.next}while(L!==T)}va(f,p,S);break;case 1:if(!Wr&&(Kc(S,p),T=S.stateNode,typeof T.componentWillUnmount=="function"))try{T.props=S.memoizedProps,T.state=S.memoizedState,T.componentWillUnmount()}catch(le){Zn(S,p,le)}va(f,p,S);break;case 21:va(f,p,S);break;case 22:S.mode&1?(Wr=(T=Wr)||S.memoizedState!==null,va(f,p,S),Wr=T):va(f,p,S);break;default:va(f,p,S)}}function ng(f){var p=f.updateQueue;if(p!==null){f.updateQueue=null;var S=f.stateNode;S===null&&(S=f.stateNode=new Ew),p.forEach(function(T){var L=L3.bind(null,f,T);S.has(T)||(S.add(T),T.then(L,L))})}}function Fo(f,p){var S=p.deletions;if(S!==null)for(var T=0;T";case ag:return":has("+(E1(f)||"")+")";case sg:return'[role="'+f.value+'"]';case lg:return'"'+f.value+'"';case Zc:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Qc(f,p){var S=[];f=[f,0];for(var T=0;TL&&(L=q),T&=~I}if(T=L,T=Kn()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*Pw(T/1960))-T,10f?16:f,Ot===null)var T=!1;else{if(f=Ot,Ot=null,fg=0,Ut&6)throw Error(a(331));var L=Ut;for(Ut|=4,dt=f.current;dt!==null;){var I=dt,q=I.child;if(dt.flags&16){var le=I.deletions;if(le!==null){for(var pe=0;peKn()-L1?_l(f,0):T1|=S),hi(f,p)}function R1(f,p){p===0&&(f.mode&1?(p=Ro,Ro<<=1,!(Ro&130023424)&&(Ro=4194304)):p=1);var S=_i();f=da(f,p),f!==null&&($a(f,p,S),hi(f,S))}function Lw(f){var p=f.memoizedState,S=0;p!==null&&(S=p.retryLane),R1(f,S)}function L3(f,p){var S=0;switch(f.tag){case 13:var T=f.stateNode,L=f.memoizedState;L!==null&&(S=L.retryLane);break;case 19:T=f.stateNode;break;default:throw Error(a(314))}T!==null&&T.delete(p),R1(f,S)}var D1;D1=function(f,p,S){if(f!==null)if(f.memoizedProps!==p.pendingProps||li.current)Zi=!0;else{if(!(f.lanes&S)&&!(p.flags&128))return Zi=!1,_w(f,p,S);Zi=!!(f.flags&131072)}else Zi=!1,Wn&&p.flags&1048576&&J0(p,Rr,p.index);switch(p.lanes=0,p.tag){case 2:var T=p.type;Ua(f,p),f=p.pendingProps;var L=cl(p,Hr.current);Mc(p,S),L=s1(null,p,T,f,L,S);var I=jc();return p.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,ui(T)?(I=!0,Ss(p)):I=!1,p.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,n1(p),L.updater=fa,p.stateNode=L,L._reactInternals=p,r1(p,T,f,S),p=ha(null,p,T,!0,I,S)):(p.tag=0,Wn&&I&&Ri(p),ji(null,p,L,S),p=p.child),p;case 16:T=p.elementType;e:{switch(Ua(f,p),f=p.pendingProps,L=T._init,T=L(T._payload),p.type=T,L=p.tag=bg(T),f=ca(T,f),L){case 0:p=m1(null,p,T,f,S);break e;case 1:p=S3(null,p,T,f,S);break e;case 11:p=m3(null,p,T,f,S);break e;case 14:p=vl(null,p,T,ca(T.type,f),S);break e}throw Error(a(306,T,""))}return p;case 0:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),m1(f,p,T,L,S);case 1:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),S3(f,p,T,L,S);case 3:e:{if(x3(p),f===null)throw Error(a(387));T=p.pendingProps,I=p.memoizedState,L=I.element,r3(f,p),Vp(p,T,null,S);var q=p.memoizedState;if(T=q.element,bt&&I.isDehydrated)if(I={element:T,isDehydrated:!1,cache:q.cache,pendingSuspenseBoundaries:q.pendingSuspenseBoundaries,transitions:q.transitions},p.updateQueue.baseState=I,p.memoizedState=I,p.flags&256){L=Gc(Error(a(423)),p),p=w3(f,p,T,S,L);break e}else if(T!==L){L=Gc(Error(a(424)),p),p=w3(f,p,T,S,L);break e}else for(bt&&(No=z0(p.stateNode.containerInfo),Xn=p,Wn=!0,Ki=null,jo=!1),S=l3(p,null,T,S),p.child=S;S;)S.flags=S.flags&-3|4096,S=S.sibling;else{if(Ac(),T===L){p=_s(f,p,S);break e}ji(f,p,T,S)}p=p.child}return p;case 5:return It(p),f===null&&Lf(p),T=p.type,L=p.pendingProps,I=f!==null?f.memoizedProps:null,q=L.children,ze(T,L)?q=null:I!==null&&ze(T,I)&&(p.flags|=32),b3(f,p),ji(f,p,q,S),p.child;case 6:return f===null&&Lf(p),null;case 13:return C3(f,p,S);case 4:return ve(p,p.stateNode.containerInfo),T=p.pendingProps,f===null?p.child=Rc(p,null,T,S):ji(f,p,T,S),p.child;case 11:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),m3(f,p,T,L,S);case 7:return ji(f,p,p.pendingProps,S),p.child;case 8:return ji(f,p,p.pendingProps.children,S),p.child;case 12:return ji(f,p,p.pendingProps.children,S),p.child;case 10:e:{if(T=p.type._context,L=p.pendingProps,I=p.memoizedProps,q=L.value,n3(p,T,q),I!==null)if(Y(I.value,q)){if(I.children===L.children&&!li.current){p=_s(f,p,S);break e}}else for(I=p.child,I!==null&&(I.return=p);I!==null;){var le=I.dependencies;if(le!==null){q=I.child;for(var pe=le.firstContext;pe!==null;){if(pe.context===T){if(I.tag===1){pe=ws(-1,S&-S),pe.tag=2;var Ue=I.updateQueue;if(Ue!==null){Ue=Ue.shared;var ft=Ue.pending;ft===null?pe.next=pe:(pe.next=ft.next,ft.next=pe),Ue.pending=pe}}I.lanes|=S,pe=I.alternate,pe!==null&&(pe.lanes|=S),Rf(I.return,S,p),le.lanes|=S;break}pe=pe.next}}else if(I.tag===10)q=I.type===p.type?null:I.child;else if(I.tag===18){if(q=I.return,q===null)throw Error(a(341));q.lanes|=S,le=q.alternate,le!==null&&(le.lanes|=S),Rf(q,S,p),q=I.sibling}else q=I.child;if(q!==null)q.return=I;else for(q=I;q!==null;){if(q===p){q=null;break}if(I=q.sibling,I!==null){I.return=q.return,q=I;break}q=q.return}I=q}ji(f,p,L.children,S),p=p.child}return p;case 9:return L=p.type,T=p.pendingProps.children,Mc(p,S),L=fo(L),T=T(L),p.flags|=1,ji(f,p,T,S),p.child;case 14:return T=p.type,L=ca(T,p.pendingProps),L=ca(T.type,L),vl(f,p,T,L,S);case 15:return v3(f,p,p.type,p.pendingProps,S);case 17:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),Ua(f,p),p.tag=1,ui(T)?(f=!0,Ss(p)):f=!1,Mc(p,S),o3(p,T,L),r1(p,T,L,S),ha(null,p,T,!0,f,S);case 19:return k3(f,p,S);case 22:return y3(f,p,S)}throw Error(a(156,p.tag))};function $i(f,p){return Pc(f,p)}function Ga(f,p,S,T){this.tag=f,this.key=S,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ho(f,p,S,T){return new Ga(f,p,S,T)}function N1(f){return f=f.prototype,!(!f||!f.isReactComponent)}function bg(f){if(typeof f=="function")return N1(f)?1:0;if(f!=null){if(f=f.$$typeof,f===x)return 11;if(f===_)return 14}return 2}function mo(f,p){var S=f.alternate;return S===null?(S=Ho(f.tag,p,f.key,f.mode),S.elementType=f.elementType,S.type=f.type,S.stateNode=f.stateNode,S.alternate=f,f.alternate=S):(S.pendingProps=p,S.type=f.type,S.flags=0,S.subtreeFlags=0,S.deletions=null),S.flags=f.flags&14680064,S.childLanes=f.childLanes,S.lanes=f.lanes,S.child=f.child,S.memoizedProps=f.memoizedProps,S.memoizedState=f.memoizedState,S.updateQueue=f.updateQueue,p=f.dependencies,S.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},S.sibling=f.sibling,S.index=f.index,S.ref=f.ref,S}function eh(f,p,S,T,L,I){var q=2;if(T=f,typeof f=="function")N1(f)&&(q=1);else if(typeof f=="string")q=5;else e:switch(f){case d:return Pl(S.children,L,I,p);case h:q=8,L|=8;break;case m:return f=Ho(12,S,p,L|2),f.elementType=m,f.lanes=I,f;case k:return f=Ho(13,S,p,L),f.elementType=k,f.lanes=I,f;case E:return f=Ho(19,S,p,L),f.elementType=E,f.lanes=I,f;case A:return Sg(S,L,I,p);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case y:q=10;break e;case b:q=9;break e;case x:q=11;break e;case _:q=14;break e;case P:q=16,T=null;break e}throw Error(a(130,f==null?f:typeof f,""))}return p=Ho(q,S,p,L),p.elementType=f,p.type=T,p.lanes=I,p}function Pl(f,p,S,T){return f=Ho(7,f,T,p),f.lanes=S,f}function Sg(f,p,S,T){return f=Ho(22,f,T,p),f.elementType=A,f.lanes=S,f.stateNode={isHidden:!1},f}function xg(f,p,S){return f=Ho(6,f,null,p),f.lanes=S,f}function Tl(f,p,S){return p=Ho(4,f.children!==null?f.children:[],f.key,p),p.lanes=S,p.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},p}function th(f,p,S,T,L){this.tag=p,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Be,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ec(0),this.expirationTimes=Ec(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ec(0),this.identifierPrefix=T,this.onRecoverableError=L,bt&&(this.mutableSourceEagerHydrationData=null)}function A3(f,p,S,T,L,I,q,le,pe){return f=new th(f,p,S,le,pe),p===1?(p=1,I===!0&&(p|=8)):p=0,I=Ho(3,null,null,p),f.current=I,I.stateNode=f,I.memoizedState={element:T,isDehydrated:S,cache:null,transitions:null,pendingSuspenseBoundaries:null},n1(I),f}function j1(f){if(!f)return sa;f=f._reactInternals;e:{if(z(f)!==f||f.tag!==1)throw Error(a(170));var p=f;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(ui(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(a(171))}if(f.tag===1){var S=f.type;if(ui(S))return wu(f,S,p)}return p}function B1(f){var p=f._reactInternals;if(p===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=te(p),f===null?null:f.stateNode}function nh(f,p){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var S=f.retryLane;f.retryLane=S!==0&&S=Ue&&I>=jt&&L<=ft&&q<=ot){f.splice(p,1);break}else if(T!==Ue||S.width!==pe.width||otq){if(!(I!==jt||S.height!==pe.height||ftL)){Ue>T&&(pe.width+=Ue-T,pe.x=T),ftI&&(pe.height+=jt-I,pe.y=I),otS&&(S=q)),q ")+` No matching component was found for: - `)+f.join(" > ")}return null},n.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return X(f.child.stateNode);default:return f.child.stateNode}},n.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:xg,findFiberByHostInstance:f.findFiberByHostInstance||B1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(p.isDisabled||!p.supportsFiber)f=!0;else{try{gn=p.inject(f),Kt=p}catch{}f=!!p.checkDCE}}return f},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(f,p,x,P){if(!ae)throw Error(a(363));f=E1(f,p);var L=Dt(f,x,P).disconnect;return{disconnect:function(){L()}}},n.registerMutableSourceForHydration=function(f,p){var x=p._getVersion;x=x(p._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[p,x]:f.mutableSourceEagerHydrationData.push(p,x)},n.runWithPriority=function(f,p){var x=Yt;try{return Yt=f,p()}finally{Yt=x}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(f,p,x,P){var L=p.current,I=_i(),q=qr(L);return x=N1(x),p.context===null?p.context=x:p.pendingContext=x,p=ws(I,q),p.payload={element:f},P=P===void 0?null:P,P!==null&&(p.callback=P),f=gl(L,p,q),f!==null&&(zo(f,L,q,I),zp(f,L,q)),q},n};(function(e){e.exports=ROe})(IOe);const DOe=v_(t_);var fS={},NOe={get exports(){return fS},set exports(e){fS=e}},Cp={};/** + `)+f.join(" > ")}return null},n.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return X(f.child.stateNode);default:return f.child.stateNode}},n.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:wg,findFiberByHostInstance:f.findFiberByHostInstance||F1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(p.isDisabled||!p.supportsFiber)f=!0;else{try{gn=p.inject(f),Xt=p}catch{}f=!!p.checkDCE}}return f},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(f,p,S,T){if(!ae)throw Error(a(363));f=P1(f,p);var L=Dt(f,S,T).disconnect;return{disconnect:function(){L()}}},n.registerMutableSourceForHydration=function(f,p){var S=p._getVersion;S=S(p._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[p,S]:f.mutableSourceEagerHydrationData.push(p,S)},n.runWithPriority=function(f,p){var S=Kt;try{return Kt=f,p()}finally{Kt=S}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(f,p,S,T){var L=p.current,I=_i(),q=qr(L);return S=j1(S),p.context===null?p.context=S:p.pendingContext=S,p=ws(I,q),p.payload={element:f},T=T===void 0?null:T,T!==null&&(p.callback=T),f=gl(L,p,q),f!==null&&(zo(f,L,q,I),Hp(f,L,q)),q},n};(function(e){e.exports=ROe})(IOe);const DOe=v_(t_);var fS={},NOe={get exports(){return fS},set exports(e){fS=e}},_p={};/** * @license React * react-reconciler-constants.production.min.js * @@ -545,14 +545,14 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */Cp.ConcurrentRoot=1;Cp.ContinuousEventPriority=4;Cp.DefaultEventPriority=16;Cp.DiscreteEventPriority=1;Cp.IdleEventPriority=536870912;Cp.LegacyRoot=0;(function(e){e.exports=Cp})(NOe);const aN={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let sN=!1,lN=!1;const sT=".react-konva-event",jOe=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. + */_p.ConcurrentRoot=1;_p.ContinuousEventPriority=4;_p.DefaultEventPriority=16;_p.DiscreteEventPriority=1;_p.IdleEventPriority=536870912;_p.LegacyRoot=0;(function(e){e.exports=_p})(NOe);const sN={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let lN=!1,uN=!1;const lT=".react-konva-event",jOe=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. Position of a node will be changed during drag&drop, so you should update state of the react app as well. Consider to add onDragMove or onDragEnd events. For more info see: https://github.com/konvajs/react-konva/issues/256 `,BOe=`ReactKonva: You are using "zIndex" attribute for a Konva node. react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. For more info see: https://github.com/konvajs/react-konva/issues/194 -`,$Oe={};function dw(e,t,n=$Oe){if(!sN&&"zIndex"in t&&(console.warn(BOe),sN=!0),!lN&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(jOe),lN=!0)}for(var o in n)if(!aN[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var d=t._useStrictMode,h={},m=!1;const v={};for(var o in t)if(!aN[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(v[l]=t[o])}!a&&(t[o]!==n[o]||d&&t[o]!==e.getAttr(o))&&(m=!0,h[o]=t[o])}m&&(e.setAttrs(h),vf(e));for(var l in v)e.on(l+sT,v[l])}function vf(e){if(!gt.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const HY={},FOe={};np.Node.prototype._applyProps=dw;function zOe(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),vf(e)}function HOe(e,t,n){let r=np[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=np.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return dw(l,o),l}function VOe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function WOe(e,t,n){return!1}function UOe(e){return e}function GOe(){return null}function qOe(){return null}function YOe(e,t,n,r){return FOe}function KOe(){}function XOe(e){}function ZOe(e,t){return!1}function QOe(){return HY}function JOe(){return HY}const eMe=setTimeout,tMe=clearTimeout,nMe=-1;function rMe(e,t){return!1}const iMe=!1,oMe=!0,aMe=!0;function sMe(e,t){t.parent===e?t.moveToTop():e.add(t),vf(e)}function lMe(e,t){t.parent===e?t.moveToTop():e.add(t),vf(e)}function VY(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),vf(e)}function uMe(e,t,n){VY(e,t,n)}function cMe(e,t){t.destroy(),t.off(sT),vf(e)}function dMe(e,t){t.destroy(),t.off(sT),vf(e)}function fMe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function hMe(e,t,n){}function pMe(e,t,n,r,i){dw(e,i,r)}function gMe(e){e.hide(),vf(e)}function mMe(e){}function vMe(e,t){(t.visible==null||t.visible)&&e.show()}function yMe(e,t){}function bMe(e){}function SMe(){}const xMe=()=>fS.DefaultEventPriority,wMe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:sMe,appendChildToContainer:lMe,appendInitialChild:zOe,cancelTimeout:tMe,clearContainer:bMe,commitMount:hMe,commitTextUpdate:fMe,commitUpdate:pMe,createInstance:HOe,createTextInstance:VOe,detachDeletedInstance:SMe,finalizeInitialChildren:WOe,getChildHostContext:JOe,getCurrentEventPriority:xMe,getPublicInstance:UOe,getRootHostContext:QOe,hideInstance:gMe,hideTextInstance:mMe,idlePriority:Fh.unstable_IdlePriority,insertBefore:VY,insertInContainerBefore:uMe,isPrimaryRenderer:iMe,noTimeout:nMe,now:Fh.unstable_now,prepareForCommit:GOe,preparePortalMount:qOe,prepareUpdate:YOe,removeChild:cMe,removeChildFromContainer:dMe,resetAfterCommit:KOe,resetTextContent:XOe,run:Fh.unstable_runWithPriority,scheduleTimeout:eMe,shouldDeprioritizeSubtree:ZOe,shouldSetTextContent:rMe,supportsMutation:aMe,unhideInstance:vMe,unhideTextInstance:yMe,warnsIfNotActing:oMe},Symbol.toStringTag,{value:"Module"}));var CMe=Object.defineProperty,_Me=Object.defineProperties,kMe=Object.getOwnPropertyDescriptors,uN=Object.getOwnPropertySymbols,EMe=Object.prototype.hasOwnProperty,PMe=Object.prototype.propertyIsEnumerable,cN=(e,t,n)=>t in e?CMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dN=(e,t)=>{for(var n in t||(t={}))EMe.call(t,n)&&cN(e,n,t[n]);if(uN)for(var n of uN(t))PMe.call(t,n)&&cN(e,n,t[n]);return e},TMe=(e,t)=>_Me(e,kMe(t));function lT(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=lT(r,t,n);if(i)return i;r=t?null:r.sibling}}function WY(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const uT=WY(w.createContext(null));class UY extends w.Component{render(){return w.createElement(uT.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:LMe,ReactCurrentDispatcher:AMe}=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function OMe(){const e=w.useContext(uT);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=w.useId();return w.useMemo(()=>{var r;return(r=LMe.current)!=null?r:lT(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const gv=[],fN=new WeakMap;function MMe(){var e;const t=OMe();gv.splice(0,gv.length),lT(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==uT&&gv.push(WY(i))});for(const n of gv){const r=(e=AMe.current)==null?void 0:e.readContext(n);fN.set(n,r)}return w.useMemo(()=>gv.reduce((n,r)=>i=>w.createElement(n,null,w.createElement(r.Provider,TMe(dN({},i),{value:fN.get(r)}))),n=>w.createElement(UY,dN({},n))),[])}function IMe(e){const t=N.useRef();return N.useLayoutEffect(()=>{t.current=e}),t.current}const RMe=e=>{const t=N.useRef(),n=N.useRef(),r=N.useRef(),i=IMe(e),o=MMe(),a=s=>{const{forwardedRef:l}=e;l&&(typeof l=="function"?l(s):l.current=s)};return N.useLayoutEffect(()=>(n.current=new np.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=jv.createContainer(n.current,fS.LegacyRoot,!1,null),jv.updateContainer(N.createElement(o,{},e.children),r.current),()=>{np.isBrowser&&(a(null),jv.updateContainer(null,r.current,null),n.current.destroy())}),[]),N.useLayoutEffect(()=>{a(n.current),dw(n.current,e,i),jv.updateContainer(N.createElement(o,{},e.children),r.current,null)}),N.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},mv="Layer",uc="Group",cc="Rect",uh="Circle",hS="Line",GY="Image",DMe="Transformer",jv=DOe(wMe);jv.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:N.version,rendererPackageName:"react-konva"});const NMe=N.forwardRef((e,t)=>N.createElement(UY,{},N.createElement(RMe,{...e,forwardedRef:t}))),jMe=lt([ln,Ir],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),BMe=()=>{const e=Oe(),{tool:t,isStaging:n,isMovingBoundingBox:r}=he(jMe);return{handleDragStart:w.useCallback(()=>{(t==="move"||n)&&!r&&e(K5(!0))},[e,r,n,t]),handleDragMove:w.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(uU(o))},[e,r,n,t]),handleDragEnd:w.useCallback(()=>{(t==="move"||n)&&!r&&e(K5(!1))},[e,r,n,t])}},$Me=lt([ln,Mr,Ir],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),FMe=()=>{const e=Oe(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=he($Me),s=w.useRef(null),l=JG(),u=()=>e(lP());et(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const d=()=>e($y(!o));et(["h"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[o]),et(["n"],()=>{e(Z5(!a))},{enabled:!0,preventDefault:!0},[a]),et("esc",()=>{e($xe())},{enabled:()=>!0,preventDefault:!0}),et("shift+h",()=>{e(Gxe(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),et(["space"],h=>{h.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(ru("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(ru(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},cT=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},qY=()=>{const e=Oe(),t=nl(),n=JG();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=Vg.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(Vxe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(Mxe())}}},zMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HMe=e=>{const t=Oe(),{tool:n,isStaging:r}=he(zMe),{commitColorUnderCursor:i}=qY();return w.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(K5(!0));return}if(n==="colorPicker"){i();return}const a=cT(e.current);a&&(o.evt.preventDefault(),t(eU(!0)),t(Oxe([a.x,a.y])))},[e,n,r,t,i])},VMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WMe=(e,t,n)=>{const r=Oe(),{isDrawing:i,tool:o,isStaging:a}=he(VMe),{updateColorUnderCursor:s}=qY();return w.useCallback(()=>{if(!e.current)return;const l=cT(e.current);if(l){if(r(Wxe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(ZW([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},UMe=()=>{const e=Oe();return w.useCallback(()=>{e(Dxe())},[e])},GMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),qMe=(e,t)=>{const n=Oe(),{tool:r,isDrawing:i,isStaging:o}=he(GMe);return w.useCallback(()=>{if(r==="move"||o){n(K5(!1));return}if(!t.current&&i&&e.current){const a=cT(e.current);if(!a)return;n(ZW([a.x,a.y]))}else t.current=!1;n(eU(!1))},[t,n,i,o,e,r])},YMe=lt([ln],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KMe=e=>{const t=Oe(),{isMoveStageKeyHeld:n,stageScale:r}=he(YMe);return w.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=ke.clamp(r*Sxe**s,xxe,wxe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(Yxe(l)),t(uU(u))},[e,n,r,t])},XMe=lt(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ZMe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(XMe);return y.jsxs(uc,{children:[y.jsx(cc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),y.jsx(cc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},QMe=lt([ln],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),JMe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},eIe=()=>{const{colorMode:e}=gy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=he(QMe),[i,o]=w.useState([]),a=w.useCallback(s=>s/t,[t]);return w.useLayoutEffect(()=>{const s=JMe[e],{width:l,height:u}=r,{x:d,y:h}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(d),y:a(h)}},v={x:Math.ceil(a(d)/64)*64,y:Math.ceil(a(h)/64)*64},b={x1:-v.x,y1:-v.y,x2:a(l)-v.x+64,y2:a(u)-v.y+64},_={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},E=_.x2-_.x1,k=_.y2-_.y1,T=Math.round(E/64)+1,A=Math.round(k/64)+1,M=ke.range(0,T).map(D=>y.jsx(hS,{x:_.x1+D*64,y:_.y1,points:[0,0,0,k],stroke:s,strokeWidth:1},`x_${D}`)),R=ke.range(0,A).map(D=>y.jsx(hS,{x:_.x1,y:_.y1+D*64,points:[0,0,E,0],stroke:s,strokeWidth:1},`y_${D}`));o(M.concat(R))},[t,n,r,e,a]),y.jsx(uc,{children:i})},tIe=lt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),nIe=e=>{const{...t}=e,n=he(tIe),[r,i]=w.useState(null);if(w.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?y.jsx(GY,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},Wh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},rIe=lt(ln,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:Wh(t)}}),hN=e=>`data:image/svg+xml;utf8, +`,FOe={};function dw(e,t,n=FOe){if(!lN&&"zIndex"in t&&(console.warn(BOe),lN=!0),!uN&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(jOe),uN=!0)}for(var o in n)if(!sN[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var d=t._useStrictMode,h={},m=!1;const y={};for(var o in t)if(!sN[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(y[l]=t[o])}!a&&(t[o]!==n[o]||d&&t[o]!==e.getAttr(o))&&(m=!0,h[o]=t[o])}m&&(e.setAttrs(h),yf(e));for(var l in y)e.on(l+lT,y[l])}function yf(e){if(!gt.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const HY={},$Oe={};rp.Node.prototype._applyProps=dw;function zOe(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),yf(e)}function HOe(e,t,n){let r=rp[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=rp.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return dw(l,o),l}function VOe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function WOe(e,t,n){return!1}function UOe(e){return e}function GOe(){return null}function qOe(){return null}function YOe(e,t,n,r){return $Oe}function KOe(){}function XOe(e){}function ZOe(e,t){return!1}function QOe(){return HY}function JOe(){return HY}const eMe=setTimeout,tMe=clearTimeout,nMe=-1;function rMe(e,t){return!1}const iMe=!1,oMe=!0,aMe=!0;function sMe(e,t){t.parent===e?t.moveToTop():e.add(t),yf(e)}function lMe(e,t){t.parent===e?t.moveToTop():e.add(t),yf(e)}function VY(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),yf(e)}function uMe(e,t,n){VY(e,t,n)}function cMe(e,t){t.destroy(),t.off(lT),yf(e)}function dMe(e,t){t.destroy(),t.off(lT),yf(e)}function fMe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function hMe(e,t,n){}function pMe(e,t,n,r,i){dw(e,i,r)}function gMe(e){e.hide(),yf(e)}function mMe(e){}function vMe(e,t){(t.visible==null||t.visible)&&e.show()}function yMe(e,t){}function bMe(e){}function SMe(){}const xMe=()=>fS.DefaultEventPriority,wMe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:sMe,appendChildToContainer:lMe,appendInitialChild:zOe,cancelTimeout:tMe,clearContainer:bMe,commitMount:hMe,commitTextUpdate:fMe,commitUpdate:pMe,createInstance:HOe,createTextInstance:VOe,detachDeletedInstance:SMe,finalizeInitialChildren:WOe,getChildHostContext:JOe,getCurrentEventPriority:xMe,getPublicInstance:UOe,getRootHostContext:QOe,hideInstance:gMe,hideTextInstance:mMe,idlePriority:zh.unstable_IdlePriority,insertBefore:VY,insertInContainerBefore:uMe,isPrimaryRenderer:iMe,noTimeout:nMe,now:zh.unstable_now,prepareForCommit:GOe,preparePortalMount:qOe,prepareUpdate:YOe,removeChild:cMe,removeChildFromContainer:dMe,resetAfterCommit:KOe,resetTextContent:XOe,run:zh.unstable_runWithPriority,scheduleTimeout:eMe,shouldDeprioritizeSubtree:ZOe,shouldSetTextContent:rMe,supportsMutation:aMe,unhideInstance:vMe,unhideTextInstance:yMe,warnsIfNotActing:oMe},Symbol.toStringTag,{value:"Module"}));var CMe=Object.defineProperty,_Me=Object.defineProperties,kMe=Object.getOwnPropertyDescriptors,cN=Object.getOwnPropertySymbols,EMe=Object.prototype.hasOwnProperty,PMe=Object.prototype.propertyIsEnumerable,dN=(e,t,n)=>t in e?CMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fN=(e,t)=>{for(var n in t||(t={}))EMe.call(t,n)&&dN(e,n,t[n]);if(cN)for(var n of cN(t))PMe.call(t,n)&&dN(e,n,t[n]);return e},TMe=(e,t)=>_Me(e,kMe(t));function uT(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=uT(r,t,n);if(i)return i;r=t?null:r.sibling}}function WY(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const cT=WY(w.createContext(null));class UY extends w.Component{render(){return w.createElement(cT.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:LMe,ReactCurrentDispatcher:AMe}=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function OMe(){const e=w.useContext(cT);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=w.useId();return w.useMemo(()=>{var r;return(r=LMe.current)!=null?r:uT(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const mv=[],hN=new WeakMap;function MMe(){var e;const t=OMe();mv.splice(0,mv.length),uT(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==cT&&mv.push(WY(i))});for(const n of mv){const r=(e=AMe.current)==null?void 0:e.readContext(n);hN.set(n,r)}return w.useMemo(()=>mv.reduce((n,r)=>i=>w.createElement(n,null,w.createElement(r.Provider,TMe(fN({},i),{value:hN.get(r)}))),n=>w.createElement(UY,fN({},n))),[])}function IMe(e){const t=N.useRef();return N.useLayoutEffect(()=>{t.current=e}),t.current}const RMe=e=>{const t=N.useRef(),n=N.useRef(),r=N.useRef(),i=IMe(e),o=MMe(),a=s=>{const{forwardedRef:l}=e;l&&(typeof l=="function"?l(s):l.current=s)};return N.useLayoutEffect(()=>(n.current=new rp.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=jv.createContainer(n.current,fS.LegacyRoot,!1,null),jv.updateContainer(N.createElement(o,{},e.children),r.current),()=>{rp.isBrowser&&(a(null),jv.updateContainer(null,r.current,null),n.current.destroy())}),[]),N.useLayoutEffect(()=>{a(n.current),dw(n.current,e,i),jv.updateContainer(N.createElement(o,{},e.children),r.current,null)}),N.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},vv="Layer",uc="Group",cc="Rect",ch="Circle",hS="Line",GY="Image",DMe="Transformer",jv=DOe(wMe);jv.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:N.version,rendererPackageName:"react-konva"});const NMe=N.forwardRef((e,t)=>N.createElement(UY,{},N.createElement(RMe,{...e,forwardedRef:t}))),jMe=lt([ln,Ir],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),BMe=()=>{const e=Oe(),{tool:t,isStaging:n,isMovingBoundingBox:r}=he(jMe);return{handleDragStart:w.useCallback(()=>{(t==="move"||n)&&!r&&e(K5(!0))},[e,r,n,t]),handleDragMove:w.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(uU(o))},[e,r,n,t]),handleDragEnd:w.useCallback(()=>{(t==="move"||n)&&!r&&e(K5(!1))},[e,r,n,t])}},FMe=lt([ln,Mr,Ir],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),$Me=()=>{const e=Oe(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=he(FMe),s=w.useRef(null),l=JG(),u=()=>e(uP());et(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const d=()=>e(Fy(!o));et(["h"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[o]),et(["n"],()=>{e(Z5(!a))},{enabled:!0,preventDefault:!0},[a]),et("esc",()=>{e(Fxe())},{enabled:()=>!0,preventDefault:!0}),et("shift+h",()=>{e(Gxe(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),et(["space"],h=>{h.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(ru("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(ru(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},dT=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},qY=()=>{const e=Oe(),t=nl(),n=JG();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=Wg.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(Vxe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(Mxe())}}},zMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HMe=e=>{const t=Oe(),{tool:n,isStaging:r}=he(zMe),{commitColorUnderCursor:i}=qY();return w.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(K5(!0));return}if(n==="colorPicker"){i();return}const a=dT(e.current);a&&(o.evt.preventDefault(),t(eU(!0)),t(Oxe([a.x,a.y])))},[e,n,r,t,i])},VMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WMe=(e,t,n)=>{const r=Oe(),{isDrawing:i,tool:o,isStaging:a}=he(VMe),{updateColorUnderCursor:s}=qY();return w.useCallback(()=>{if(!e.current)return;const l=dT(e.current);if(l){if(r(Wxe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(ZW([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},UMe=()=>{const e=Oe();return w.useCallback(()=>{e(Dxe())},[e])},GMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),qMe=(e,t)=>{const n=Oe(),{tool:r,isDrawing:i,isStaging:o}=he(GMe);return w.useCallback(()=>{if(r==="move"||o){n(K5(!1));return}if(!t.current&&i&&e.current){const a=dT(e.current);if(!a)return;n(ZW([a.x,a.y]))}else t.current=!1;n(eU(!1))},[t,n,i,o,e,r])},YMe=lt([ln],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KMe=e=>{const t=Oe(),{isMoveStageKeyHeld:n,stageScale:r}=he(YMe);return w.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=ke.clamp(r*Sxe**s,xxe,wxe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(Yxe(l)),t(uU(u))},[e,n,r,t])},XMe=lt(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ZMe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(XMe);return v.jsxs(uc,{children:[v.jsx(cc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),v.jsx(cc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},QMe=lt([ln],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),JMe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},eIe=()=>{const{colorMode:e}=gy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=he(QMe),[i,o]=w.useState([]),a=w.useCallback(s=>s/t,[t]);return w.useLayoutEffect(()=>{const s=JMe[e],{width:l,height:u}=r,{x:d,y:h}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(d),y:a(h)}},y={x:Math.ceil(a(d)/64)*64,y:Math.ceil(a(h)/64)*64},b={x1:-y.x,y1:-y.y,x2:a(l)-y.x+64,y2:a(u)-y.y+64},k={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},E=k.x2-k.x1,_=k.y2-k.y1,P=Math.round(E/64)+1,A=Math.round(_/64)+1,M=ke.range(0,P).map(D=>v.jsx(hS,{x:k.x1+D*64,y:k.y1,points:[0,0,0,_],stroke:s,strokeWidth:1},`x_${D}`)),R=ke.range(0,A).map(D=>v.jsx(hS,{x:k.x1,y:k.y1+D*64,points:[0,0,E,0],stroke:s,strokeWidth:1},`y_${D}`));o(M.concat(R))},[t,n,r,e,a]),v.jsx(uc,{children:i})},tIe=lt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),nIe=e=>{const{...t}=e,n=he(tIe),[r,i]=w.useState(null);if(w.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?v.jsx(GY,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},Uh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},rIe=lt(ln,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:Uh(t)}}),pN=e=>`data:image/svg+xml;utf8, @@ -630,9 +630,9 @@ For more info see: https://github.com/konvajs/react-konva/issues/194 -`.replaceAll("black",e),iIe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(rIe),[a,s]=w.useState(null),[l,u]=w.useState(0),d=w.useRef(null),h=w.useCallback(()=>{u(l+1),setTimeout(h,500)},[l]);return w.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=hN(n)},[a,n]),w.useEffect(()=>{a&&(a.src=hN(n))},[a,n]),w.useEffect(()=>{const m=setInterval(()=>u(v=>(v+1)%5),50);return()=>clearInterval(m)},[]),!a||!ke.isNumber(r.x)||!ke.isNumber(r.y)||!ke.isNumber(o)||!ke.isNumber(i.width)||!ke.isNumber(i.height)?null:y.jsx(cc,{ref:d,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:ke.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},oIe=lt([ln],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),aIe=e=>{const{...t}=e,{objects:n}=he(oIe);return y.jsx(uc,{listening:!1,...t,children:n.filter(sP).map((r,i)=>y.jsx(hS,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})};var ch=w,sIe=function(t,n,r){const i=ch.useRef("loading"),o=ch.useRef(),[a,s]=ch.useState(0),l=ch.useRef(),u=ch.useRef(),d=ch.useRef();return(l.current!==t||u.current!==n||d.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,d.current=r),ch.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function m(){i.current="loaded",o.current=h,s(Math.random())}function v(){i.current="failed",o.current=void 0,s(Math.random())}return h.addEventListener("load",m),h.addEventListener("error",v),n&&(h.crossOrigin=n),r&&(h.referrerpolicy=r),h.src=t,function(){h.removeEventListener("load",m),h.removeEventListener("error",v)}},[t,n,r]),[o.current,i.current]};const YY=e=>{const{url:t,x:n,y:r}=e,[i]=sIe(t);return y.jsx(GY,{x:n,y:r,image:i,listening:!1})},lIe=lt([ln],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),uIe=()=>{const{objects:e}=he(lIe);return e?y.jsx(uc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(Y5(t))return y.jsx(YY,{x:t.x,y:t.y,url:t.image.url},n);if(kxe(t)){const r=y.jsx(hS,{points:t.points,stroke:t.color?Wh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?y.jsx(uc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(Exe(t))return y.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Wh(t.color)},n);if(Pxe(t))return y.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},cIe=lt([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),dIe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=he(cIe);return y.jsxs(uc,{...t,children:[r&&n&&y.jsx(YY,{url:n.image.url,x:o,y:a}),i&&y.jsxs(uc,{children:[y.jsx(cc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),y.jsx(cc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},fIe=lt([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),hIe=()=>{const e=Oe(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=he(fIe),{t:o}=Ue(),a=w.useCallback(()=>{e(VI(!0))},[e]),s=w.useCallback(()=>{e(VI(!1))},[e]);et(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),et(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),et(["enter"],()=>{d()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(jxe()),u=()=>e(Nxe()),d=()=>e(Ixe());return r?y.jsx(Ge,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{tooltip:`${o("unifiedcanvas:previous")} (Left)`,"aria-label":`${o("unifiedcanvas:previous")} (Left)`,icon:y.jsx(mEe,{}),onClick:l,"data-selected":!0,isDisabled:t}),y.jsx(Je,{tooltip:`${o("unifiedcanvas:next")} (Right)`,"aria-label":`${o("unifiedcanvas:next")} (Right)`,icon:y.jsx(vEe,{}),onClick:u,"data-selected":!0,isDisabled:n}),y.jsx(Je,{tooltip:`${o("unifiedcanvas:accept")} (Enter)`,"aria-label":`${o("unifiedcanvas:accept")} (Enter)`,icon:y.jsx(IP,{}),onClick:d,"data-selected":!0}),y.jsx(Je,{tooltip:o("unifiedcanvas:showHide"),"aria-label":o("unifiedcanvas:showHide"),"data-alert":!i,icon:i?y.jsx(_Ee,{}):y.jsx(CEe,{}),onClick:()=>e(qxe(!i)),"data-selected":!0}),y.jsx(Je,{tooltip:o("unifiedcanvas:saveToGallery"),"aria-label":o("unifiedcanvas:saveToGallery"),icon:y.jsx(DP,{}),onClick:()=>e(r_e(r.image.url)),"data-selected":!0}),y.jsx(Je,{tooltip:o("unifiedcanvas:discardAll"),"aria-label":o("unifiedcanvas:discardAll"),icon:y.jsx(Uy,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(Rxe()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},gm=e=>Math.round(e*100)/100,pIe=lt([ln],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${gm(n)}, ${gm(r)})`}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function gIe(){const{cursorCoordinatesString:e}=he(pIe),{t}=Ue();return y.jsx("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const mIe=lt([ln],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:d},stageScale:h,shouldShowCanvasDebugInfo:m,layer:v,boundingBoxScaleMethod:b,shouldPreserveMaskedArea:S}=e;let _="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(_="var(--status-working-color)"),{activeLayerColor:v==="mask"?"var(--status-working-color)":"inherit",activeLayerString:v.charAt(0).toUpperCase()+v.slice(1),boundingBoxColor:_,boundingBoxCoordinatesString:`(${gm(u)}, ${gm(d)})`,boundingBoxDimensionsString:`${o}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${gm(r)}×${gm(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none",shouldPreserveMaskedArea:S}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),vIe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:d,shouldShowBoundingBox:h,shouldPreserveMaskedArea:m}=he(mIe),{t:v}=Ue();return y.jsxs("div",{className:"canvas-status-text",children:[y.jsx("div",{style:{color:e},children:`${v("unifiedcanvas:activeLayer")}: ${t}`}),y.jsx("div",{children:`${v("unifiedcanvas:canvasScale")}: ${u}%`}),m&&y.jsx("div",{style:{color:"var(--status-working-color)"},children:"Preserve Masked Area: On"}),h&&y.jsx("div",{style:{color:n},children:`${v("unifiedcanvas:boundingBox")}: ${i}`}),a&&y.jsx("div",{style:{color:n},children:`${v("unifiedcanvas:scaledBoundingBox")}: ${o}`}),d&&y.jsxs(y.Fragment,{children:[y.jsx("div",{children:`${v("unifiedcanvas:boundingBoxPosition")}: ${r}`}),y.jsx("div",{children:`${v("unifiedcanvas:canvasDimensions")}: ${l}`}),y.jsx("div",{children:`${v("unifiedcanvas:canvasPosition")}: ${s}`}),y.jsx(gIe,{})]})]})},yIe=lt(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),bIe=e=>{const{...t}=e,n=Oe(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:d,hitStrokeWidth:h}=he(yIe),m=w.useRef(null),v=w.useRef(null),[b,S]=w.useState(!1);w.useEffect(()=>{var te;!m.current||!v.current||(m.current.nodes([v.current]),(te=m.current.getLayer())==null||te.batchDraw())},[]);const _=64*l,E=w.useCallback(te=>{if(!u){n(CC({x:Math.floor(te.target.x()),y:Math.floor(te.target.y())}));return}const G=te.target.x(),$=te.target.y(),W=Yl(G,64),X=Yl($,64);te.target.x(W),te.target.y(X),n(CC({x:W,y:X}))},[n,u]),k=w.useCallback(()=>{if(!v.current)return;const te=v.current,G=te.scaleX(),$=te.scaleY(),W=Math.round(te.width()*G),X=Math.round(te.height()*$),Z=Math.round(te.x()),U=Math.round(te.y());n(Av({width:W,height:X})),n(CC({x:u?Td(Z,64):Z,y:u?Td(U,64):U})),te.scaleX(1),te.scaleY(1)},[n,u]),T=w.useCallback((te,G,$)=>{const W=te.x%_,X=te.y%_;return{x:Td(G.x,_)+W,y:Td(G.y,_)+X}},[_]),A=()=>{n(kC(!0))},M=()=>{n(kC(!1)),n(_C(!1)),n(Pb(!1)),S(!1)},R=()=>{n(_C(!0))},D=()=>{n(kC(!1)),n(_C(!1)),n(Pb(!1)),S(!1)},j=()=>{S(!0)},z=()=>{!s&&!a&&S(!1)},H=()=>{n(Pb(!0))},K=()=>{n(Pb(!1))};return y.jsxs(uc,{...t,children:[y.jsx(cc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:H,onMouseOver:H,onMouseLeave:K,onMouseOut:K}),y.jsx(cc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:h,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onDragMove:E,onMouseDown:R,onMouseOut:z,onMouseOver:j,onMouseEnter:j,onMouseUp:D,onTransform:k,onTransformEnd:M,ref:v,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),y.jsx(DMe,{anchorCornerRadius:3,anchorDragBoundFunc:T,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:d==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onMouseDown:A,onMouseUp:M,onTransformEnd:M,ref:m,rotateEnabled:!1})]})},SIe=lt(ln,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:d,stageScale:h,stageDimensions:m,boundingBoxCoordinates:v,boundingBoxDimensions:b,shouldRestrictStrokesToBox:S}=e,_=S?{clipX:v.x,clipY:v.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:zI/h,colorPickerInnerRadius:(zI-h8+1)/h,maskColorString:Wh({...i,a:.5}),brushColorString:Wh(o),colorPickerColorString:Wh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||d||!t)&&l,strokeWidth:1.5/h,dotRadius:1.5/h,clip:_}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),xIe=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:d,brushColorString:h,colorPickerColorString:m,colorPickerInnerRadius:v,colorPickerOuterRadius:b,clip:S}=he(SIe);return l?y.jsxs(uc,{listening:!1,...S,...t,children:[a==="colorPicker"?y.jsxs(y.Fragment,{children:[y.jsx(uh,{x:n,y:r,radius:b,stroke:h,strokeWidth:h8,strokeScaleEnabled:!1}),y.jsx(uh,{x:n,y:r,radius:v,stroke:m,strokeWidth:h8,strokeScaleEnabled:!1})]}):y.jsxs(y.Fragment,{children:[y.jsx(uh,{x:n,y:r,radius:i,fill:s==="mask"?o:h,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),y.jsx(uh,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:d*2,strokeEnabled:!0,listening:!1}),y.jsx(uh,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),y.jsx(uh,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),y.jsx(uh,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},wIe=lt([ln,Ir],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:d,isMovingStage:h,shouldShowIntermediates:m,shouldShowGrid:v,shouldRestrictStrokesToBox:b}=e;let S="none";return d==="move"||t?h?S="grabbing":S="grab":o?S=void 0:b&&!a&&(S="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:v,stageCoordinates:u,stageCursor:S,stageDimensions:l,stageScale:r,tool:d,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KY=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:d}=he(wIe);FMe();const h=w.useRef(null),m=w.useRef(null),v=w.useCallback(z=>{N8e(z),h.current=z},[]),b=w.useCallback(z=>{D8e(z),m.current=z},[]),S=w.useRef({x:0,y:0}),_=w.useRef(!1),E=KMe(h),k=HMe(h),T=qMe(h,_),A=WMe(h,_,S),M=UMe(),{handleDragStart:R,handleDragMove:D,handleDragEnd:j}=BMe();return y.jsx("div",{className:"inpainting-canvas-container",children:y.jsxs("div",{className:"inpainting-canvas-wrapper",children:[y.jsxs(NMe,{tabIndex:-1,ref:v,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:k,onTouchMove:A,onTouchEnd:T,onMouseDown:k,onMouseLeave:M,onMouseMove:A,onMouseUp:T,onDragStart:R,onDragMove:D,onDragEnd:j,onContextMenu:z=>z.evt.preventDefault(),onWheel:E,draggable:(l==="move"||u)&&!t,children:[y.jsx(mv,{id:"grid",visible:r,children:y.jsx(eIe,{})}),y.jsx(mv,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:y.jsx(uIe,{})}),y.jsxs(mv,{id:"mask",visible:e,listening:!1,children:[y.jsx(aIe,{visible:!0,listening:!1}),y.jsx(iIe,{listening:!1})]}),y.jsx(mv,{children:y.jsx(ZMe,{})}),y.jsxs(mv,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&y.jsx(xIe,{visible:l!=="move",listening:!1}),y.jsx(dIe,{visible:u}),d&&y.jsx(nIe,{}),y.jsx(bIe,{visible:n&&!u})]})]}),y.jsx(vIe,{}),y.jsx(hIe,{})]})})},CIe=lt(ln,Iq,Mr,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),XY=()=>{const e=Oe(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=he(CIe),o=w.useRef(null);return w.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(Hxe({width:a,height:s})),e(i?Fxe():Bx()),e(vi(!1))},0)},[e,r,t,n,i]),y.jsx("div",{ref:o,className:"inpainting-canvas-area",children:y.jsx(ky,{thickness:"2px",speed:"1s",size:"xl"})})},_Ie=lt([ln,Mr,or],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function ZY(){const e=Oe(),{canRedo:t,activeTabName:n}=he(_Ie),{t:r}=Ue(),i=()=>{e(Bxe())};return et(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),y.jsx(Je,{"aria-label":`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,icon:y.jsx(DEe,{}),onClick:i,isDisabled:!t})}const kIe=lt([ln,Mr,or],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function QY(){const e=Oe(),{t}=Ue(),{canUndo:n,activeTabName:r}=he(kIe),i=()=>{e(Kxe())};return et(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),y.jsx(Je,{"aria-label":`${t("unifiedcanvas:undo")} (Ctrl+Z)`,tooltip:`${t("unifiedcanvas:undo")} (Ctrl+Z)`,icon:y.jsx($Ee,{}),onClick:i,isDisabled:!n})}const EIe=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");o&&(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},PIe=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},TIe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:a,y:s,width:l,height:u},h=e.toDataURL(d);return e.scale(i),{dataURL:h,boundingBox:{x:o.x,y:o.y,width:l,height:u}}},LIe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Ad=(e=LIe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(yCe("Exporting Image")),t(dm(!1));const u=n(),{stageScale:d,boundingBoxCoordinates:h,boundingBoxDimensions:m,stageCoordinates:v}=u.canvas,b=nl();if(!b){t(ns(!1)),t(dm(!0));return}const{dataURL:S,boundingBox:_}=TIe(b,d,v,i?{...h,...m}:void 0);if(!S){t(ns(!1)),t(dm(!0));return}const E=new FormData;E.append("data",JSON.stringify({dataURL:S,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:E})).json(),{url:A,width:M,height:R}=T,D={uuid:hm(),category:o?"result":"user",...T};a&&(PIe(A),t(Ah({title:zt.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(EIe(A,M,R),t(Ah({title:zt.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(cm({image:D,category:"result"})),t(Ah({title:zt.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(Uxe({kind:"image",layer:"base",..._,image:D})),t(Ah({title:zt.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(ns(!1)),t(B4(zt.t("common:statusConnected"))),t(dm(!0))};function AIe(){const e=he(Ir),t=nl(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Oe(),{t:o}=Ue();et(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Ad({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return y.jsx(Je,{"aria-label":`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:y.jsx(l0,{}),onClick:a,isDisabled:e})}function OIe(){const e=Oe(),{t}=Ue(),n=nl(),r=he(Ir),i=he(s=>s.system.isProcessing),o=he(s=>s.canvas.shouldCropToBoundingBoxOnSave);et(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Ad({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return y.jsx(Je,{"aria-label":`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:y.jsx(RP,{}),onClick:a,isDisabled:r})}function MIe(){const e=he(Ir),{openUploader:t}=PP(),{t:n}=Ue();return y.jsx(Je,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:y.jsx(tw,{}),onClick:t,isDisabled:e})}const IIe=lt([ln,Ir],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function RIe(){const e=Oe(),{t}=Ue(),{layer:n,isMaskEnabled:r,isStaging:i}=he(IIe),o=()=>{e(X5(n==="mask"?"base":"mask"))};et(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(X5(l)),l==="mask"&&!r&&e($y(!0))};return y.jsx(rl,{tooltip:`${t("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:qW,onChange:a,isDisabled:i})}function DIe(){const e=Oe(),{t}=Ue(),n=nl(),r=he(Ir),i=he(a=>a.system.isProcessing);et(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Ad({cropVisible:!1,shouldSetAsInitialImage:!0}))};return y.jsx(Je,{"aria-label":`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:y.jsx(Oq,{}),onClick:o,isDisabled:r})}function NIe(){const e=he(o=>o.canvas.tool),t=he(Ir),n=Oe(),{t:r}=Ue();et(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(ru("move"));return y.jsx(Je,{"aria-label":`${r("unifiedcanvas:move")} (V)`,tooltip:`${r("unifiedcanvas:move")} (V)`,icon:y.jsx(kq,{}),"data-selected":e==="move"||t,onClick:i})}function jIe(){const e=he(i=>i.ui.shouldPinParametersPanel),t=Oe(),{t:n}=Ue(),r=()=>{t(Zu(!0)),e&&setTimeout(()=>t(vi(!0)),400)};return y.jsxs(Ge,{flexDirection:"column",gap:"0.5rem",children:[y.jsx(Je,{tooltip:`${n("parameters:showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters:showOptionsPanel"),onClick:r,children:y.jsx(NP,{})}),y.jsx(Ge,{children:y.jsx(nT,{iconButton:!0})}),y.jsx(Ge,{children:y.jsx(eT,{width:"100%",height:"40px"})})]})}function BIe(){const e=Oe(),{t}=Ue(),n=he(Ir),r=()=>{e(uP()),e(Bx())};return y.jsx(Je,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:y.jsx(Sp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function JY(e,t,n=250){const[r,i]=w.useState(0);return w.useEffect(()=>{const o=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(o)},[r,e,t,n]),()=>i(o=>o+1)}function $Ie(){const e=nl(),t=Oe(),{t:n}=Ue();et(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=JY(()=>i(!1),()=>i(!0)),i=(o=!1)=>{const a=nl();if(!a)return;const s=a.getClientRect({skipTransform:!0});t(JW({contentRect:s,shouldScaleTo1:o}))};return y.jsx(Je,{"aria-label":`${n("unifiedcanvas:resetView")} (R)`,tooltip:`${n("unifiedcanvas:resetView")} (R)`,icon:y.jsx(Pq,{}),onClick:r})}function FIe(){const e=he(Ir),t=nl(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Oe(),{t:o}=Ue();et(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Ad({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return y.jsx(Je,{"aria-label":`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:y.jsx(DP,{}),onClick:a,isDisabled:e})}const zIe=lt([ln,Ir,or],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HIe=()=>{const e=Oe(),{t}=Ue(),{tool:n,isStaging:r}=he(zIe);et(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),et(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),et(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),et(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),et(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(ru("brush")),o=()=>e(ru("eraser")),a=()=>e(ru("colorPicker")),s=()=>e(XW()),l=()=>e(KW());return y.jsxs(Ge,{flexDirection:"column",gap:"0.5rem",children:[y.jsxs(oo,{children:[y.jsx(Je,{"aria-label":`${t("unifiedcanvas:brush")} (B)`,tooltip:`${t("unifiedcanvas:brush")} (B)`,icon:y.jsx(Mq,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),y.jsx(Je,{"aria-label":`${t("unifiedcanvas:eraser")} (E)`,tooltip:`${t("unifiedcanvas:eraser")} (B)`,icon:y.jsx(Tq,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),y.jsxs(oo,{children:[y.jsx(Je,{"aria-label":`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:y.jsx(Aq,{}),isDisabled:r,onClick:s}),y.jsx(Je,{"aria-label":`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:y.jsx(Uy,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),y.jsx(Je,{"aria-label":`${t("unifiedcanvas:colorPicker")} (C)`,tooltip:`${t("unifiedcanvas:colorPicker")} (C)`,icon:y.jsx(Lq,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},fw=Ae((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:d,onClose:h}=Gh(),m=w.useRef(null),v=()=>{r(),h()},b=()=>{o&&o(),h()};return y.jsxs(y.Fragment,{children:[w.cloneElement(l,{onClick:d,ref:t}),y.jsx(FV,{isOpen:u,leastDestructiveRef:m,onClose:h,children:y.jsx(Zd,{children:y.jsxs(zV,{className:"modal",children:[y.jsx(_0,{fontSize:"lg",fontWeight:"bold",children:s}),y.jsx(o0,{children:a}),y.jsxs(wx,{children:[y.jsx(ls,{ref:m,onClick:b,className:"modal-close-btn",children:i}),y.jsx(ls,{colorScheme:"red",onClick:v,ml:3,children:n})]})]})})})]})}),eK=()=>{const e=he(Ir),t=Oe(),{t:n}=Ue(),r=()=>{t(i_e()),t(uP()),t(QW())};return y.jsxs(fw,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:y.jsx(nr,{leftIcon:y.jsx(Sp,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[y.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),y.jsx("br",{}),y.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},tK=()=>{const e=he(Ir),t=Oe(),{t:n}=Ue();return y.jsxs(fw,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:()=>t(QW()),acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:y.jsx(nr,{size:"sm",leftIcon:y.jsx(Sp,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[y.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),y.jsx("br",{}),y.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},VIe=lt([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WIe=()=>{const e=Oe(),{t}=Ue(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=he(VIe);return y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:y.jsx(jP,{})}),children:y.jsxs(Ge,{direction:"column",gap:"0.5rem",children:[y.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:o,onChange:a=>e(lU(a.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:a=>e(nU(a.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:a=>e(rU(a.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:a=>e(aU(a.target.checked))}),y.jsx(tK,{}),y.jsx(eK,{})]})})},UIe=()=>{const e=he(t=>t.ui.shouldShowParametersPanel);return y.jsxs(Ge,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[y.jsx(RIe,{}),y.jsx(HIe,{}),y.jsxs(Ge,{gap:"0.5rem",children:[y.jsx(NIe,{}),y.jsx($Ie,{})]}),y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(DIe,{}),y.jsx(FIe,{})]}),y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(AIe,{}),y.jsx(OIe,{})]}),y.jsxs(Ge,{gap:"0.5rem",children:[y.jsx(QY,{}),y.jsx(ZY,{})]}),y.jsxs(Ge,{gap:"0.5rem",children:[y.jsx(MIe,{}),y.jsx(BIe,{})]}),y.jsx(WIe,{}),!e&&y.jsx(jIe,{})]})};function GIe(){const e=Oe(),t=he(i=>i.canvas.brushSize),{t:n}=Ue(),r=he(Ir);return et(["BracketLeft"],()=>{e(Fm(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),et(["BracketRight"],()=>{e(Fm(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),y.jsx(so,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:i=>e(Fm(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function hw(){return(hw=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function n_(e){var t=w.useRef(e),n=w.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var d0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:_.buttons>0)&&i.current?o(pN(i.current,_,s.current)):S(!1)},b=function(){return S(!1)};function S(_){var E=l.current,k=r_(i.current),T=_?k.addEventListener:k.removeEventListener;T(E?"touchmove":"mousemove",v),T(E?"touchend":"mouseup",b)}return[function(_){var E=_.nativeEvent,k=i.current;if(k&&(gN(E),!function(A,M){return M&&!g2(A)}(E,l.current)&&k)){if(g2(E)){l.current=!0;var T=E.changedTouches||[];T.length&&(s.current=T[0].identifier)}k.focus(),o(pN(k,E,s.current)),S(!0)}},function(_){var E=_.which||_.keyCode;E<37||E>40||(_.preventDefault(),a({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},S]},[a,o]),d=u[0],h=u[1],m=u[2];return w.useEffect(function(){return m},[m]),N.createElement("div",hw({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),pw=function(e){return e.filter(Boolean).join(" ")},fT=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=pw(["react-colorful__pointer",e.className]);return N.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},N.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Po=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},rK=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Po(e.h),s:Po(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Po(i/2),a:Po(r,2)}},i_=function(e){var t=rK(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},YC=function(e){var t=rK(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},qIe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:Po(255*[r,s,a,a,l,r][u]),g:Po(255*[l,r,r,s,a,a][u]),b:Po(255*[a,a,l,r,r,s][u]),a:Po(i,2)}},YIe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Po(60*(s<0?s+6:s)),s:Po(o?a/o*100:0),v:Po(o/255*100),a:i}},KIe=N.memo(function(e){var t=e.hue,n=e.onChange,r=pw(["react-colorful__hue",e.className]);return N.createElement("div",{className:r},N.createElement(dT,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:d0(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Po(t),"aria-valuemax":"360","aria-valuemin":"0"},N.createElement(fT,{className:"react-colorful__hue-pointer",left:t/360,color:i_({h:t,s:100,v:100,a:1})})))}),XIe=N.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:i_({h:t.h,s:100,v:100,a:1})};return N.createElement("div",{className:"react-colorful__saturation",style:r},N.createElement(dT,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:d0(t.s+100*i.left,0,100),v:d0(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Po(t.s)+"%, Brightness "+Po(t.v)+"%"},N.createElement(fT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:i_(t)})))}),iK=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function ZIe(e,t,n){var r=n_(n),i=w.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=w.useRef({color:t,hsva:o});w.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),w.useEffect(function(){var u;iK(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=w.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var QIe=typeof window<"u"?w.useLayoutEffect:w.useEffect,JIe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},mN=new Map,eRe=function(e){QIe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!mN.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,mN.set(t,n);var r=JIe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},tRe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+YC(Object.assign({},n,{a:0}))+", "+YC(Object.assign({},n,{a:1}))+")"},o=pw(["react-colorful__alpha",t]),a=Po(100*n.a);return N.createElement("div",{className:o},N.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),N.createElement(dT,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:d0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},N.createElement(fT,{className:"react-colorful__alpha-pointer",left:n.a,color:YC(n)})))},nRe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=nK(e,["className","colorModel","color","onChange"]),s=w.useRef(null);eRe(s);var l=ZIe(n,i,o),u=l[0],d=l[1],h=pw(["react-colorful",t]);return N.createElement("div",hw({},a,{ref:s,className:h}),N.createElement(XIe,{hsva:u,onChange:d}),N.createElement(KIe,{hue:u.h,onChange:d}),N.createElement(tRe,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},rRe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:YIe,fromHsva:qIe,equal:iK},iRe=function(e){return N.createElement(nRe,hw({},e,{colorModel:rRe}))};const pS=e=>{const{styleClass:t,...n}=e;return y.jsx(iRe,{className:`invokeai__color-picker ${t}`,...n})},oRe=lt([ln,Ir],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function aRe(){const e=Oe(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=he(oRe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return et(["shift+BracketLeft"],()=>{e($m({...t,a:ke.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),et(["shift+BracketRight"],()=>{e($m({...t,a:ke.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Eo,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:y.jsxs(Ge,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&y.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e($m(a))}),r==="mask"&&y.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(tU(a))})]})})}function oK(){return y.jsxs(Ge,{columnGap:"1rem",alignItems:"center",children:[y.jsx(GIe,{}),y.jsx(aRe,{})]})}function sRe(){const e=Oe(),t=he(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ue();return y.jsx(er,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:r=>e(cU(r.target.checked))})}function lRe(){return y.jsxs(Ge,{gap:"1rem",alignItems:"center",children:[y.jsx(oK,{}),y.jsx(sRe,{})]})}function uRe(){const e=Oe(),{t}=Ue(),n=()=>e(lP());return y.jsx(nr,{size:"sm",leftIcon:y.jsx(Sp,{}),onClick:n,tooltip:`${t("unifiedcanvas:clearMask")} (Shift+C)`,children:t("unifiedcanvas:betaClear")})}function cRe(){const e=he(i=>i.canvas.isMaskEnabled),t=Oe(),{t:n}=Ue(),r=()=>t($y(!e));return y.jsx(er,{label:`${n("unifiedcanvas:enableMask")} (H)`,isChecked:e,onChange:r})}function dRe(){const e=Oe(),{t}=Ue(),n=he(r=>r.canvas.shouldPreserveMaskedArea);return y.jsx(er,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:r=>e(oU(r.target.checked))})}function fRe(){return y.jsxs(Ge,{gap:"1rem",alignItems:"center",children:[y.jsx(oK,{}),y.jsx(cRe,{}),y.jsx(dRe,{}),y.jsx(uRe,{})]})}function hRe(){const e=he(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Oe(),{t:n}=Ue();return y.jsx(er,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:r=>t(iU(r.target.checked))})}function pRe(){const e=he(r=>r.canvas.shouldShowGrid),t=Oe(),{t:n}=Ue();return y.jsx(er,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:r=>t(sU(r.target.checked))})}function gRe(){const e=he(i=>i.canvas.shouldSnapToGrid),t=Oe(),{t:n}=Ue(),r=i=>t(Z5(i.target.checked));return y.jsx(er,{label:`${n("unifiedcanvas:snapToGrid")} (N)`,isChecked:e,onChange:r})}function mRe(){return y.jsxs(Ge,{alignItems:"center",gap:"1rem",children:[y.jsx(pRe,{}),y.jsx(gRe,{}),y.jsx(hRe,{})]})}const vRe=lt([ln],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function yRe(){const{tool:e,layer:t}=he(vRe);return y.jsxs(Ge,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&y.jsx(lRe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&y.jsx(fRe,{}),e=="move"&&y.jsx(mRe,{})]})}const bRe=lt([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),SRe=()=>{const e=Oe(),{doesCanvasNeedScaling:t}=he(bRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),y.jsx("div",{className:"workarea-single-view",children:y.jsxs(Ge,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[y.jsx(UIe,{}),y.jsxs(Ge,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[y.jsx(yRe,{}),t?y.jsx(XY,{}):y.jsx(KY,{})]})]})})},xRe=lt([ln,Ir],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:Wh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),wRe=()=>{const e=Oe(),{t}=Ue(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=he(xRe);et(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),et(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),et(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(X5(n==="mask"?"base":"mask"))},l=()=>e(lP()),u=()=>e($y(!i));return y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(oo,{children:y.jsx(Je,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:y.jsx(LEe,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:y.jsxs(Ge,{direction:"column",gap:"0.5rem",children:[y.jsx(er,{label:`${t("unifiedcanvas:enableMask")} (H)`,isChecked:i,onChange:u}),y.jsx(er,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:o,onChange:d=>e(oU(d.target.checked))}),y.jsx(pS,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:d=>e(tU(d))}),y.jsxs(nr,{size:"sm",leftIcon:y.jsx(Sp,{}),onClick:l,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},CRe=lt([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),_Re=()=>{const e=Oe(),{t}=Ue(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=he(CRe);et(["n"],()=>{e(Z5(!l))},{enabled:!0,preventDefault:!0},[l]);const d=h=>e(Z5(h.target.checked));return y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:y.jsx(jP,{})}),children:y.jsxs(Ge,{direction:"column",gap:"0.5rem",children:[y.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:s,onChange:h=>e(lU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:showGrid"),isChecked:a,onChange:h=>e(sU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:snapToGrid"),isChecked:l,onChange:d}),y.jsx(er,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:h=>e(iU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:h=>e(nU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:h=>e(rU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:u,onChange:h=>e(cU(h.target.checked))}),y.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:o,onChange:h=>e(aU(h.target.checked))}),y.jsx(tK,{}),y.jsx(eK,{})]})})},kRe=lt([ln,Ir,or],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ERe=()=>{const e=Oe(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=he(kRe),{t:o}=Ue();et(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),et(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),et(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),et(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),et(["delete","backspace"],()=>{d()},{enabled:()=>!i,preventDefault:!0}),et(["BracketLeft"],()=>{e(Fm(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),et(["BracketRight"],()=>{e(Fm(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),et(["shift+BracketLeft"],()=>{e($m({...n,a:ke.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),et(["shift+BracketRight"],()=>{e($m({...n,a:ke.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(ru("brush")),s=()=>e(ru("eraser")),l=()=>e(ru("colorPicker")),u=()=>e(XW()),d=()=>e(KW());return y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{"aria-label":`${o("unifiedcanvas:brush")} (B)`,tooltip:`${o("unifiedcanvas:brush")} (B)`,icon:y.jsx(Mq,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),y.jsx(Je,{"aria-label":`${o("unifiedcanvas:eraser")} (E)`,tooltip:`${o("unifiedcanvas:eraser")} (E)`,icon:y.jsx(Tq,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),y.jsx(Je,{"aria-label":`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:y.jsx(Aq,{}),isDisabled:i,onClick:u}),y.jsx(Je,{"aria-label":`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:y.jsx(Uy,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),y.jsx(Je,{"aria-label":`${o("unifiedcanvas:colorPicker")} (C)`,tooltip:`${o("unifiedcanvas:colorPicker")} (C)`,icon:y.jsx(Lq,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{"aria-label":o("unifiedcanvas:brushOptions"),tooltip:o("unifiedcanvas:brushOptions"),icon:y.jsx(NP,{})}),children:y.jsxs(Ge,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[y.jsx(Ge,{gap:"1rem",justifyContent:"space-between",children:y.jsx(so,{label:o("unifiedcanvas:brushSize"),value:r,withInput:!0,onChange:h=>e(Fm(h)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),y.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:h=>e($m(h))})]})})]})},PRe=lt([or,ln,Ir],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),TRe=()=>{const e=Oe(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=he(PRe),s=nl(),{t:l}=Ue(),{openUploader:u}=PP();et(["v"],()=>{d()},{enabled:()=>!n,preventDefault:!0},[]),et(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[s]),et(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["shift+s"],()=>{S()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["meta+c","ctrl+c"],()=>{_()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["shift+d"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]);const d=()=>e(ru("move")),h=JY(()=>m(!1),()=>m(!0)),m=(T=!1)=>{const A=nl();if(!A)return;const M=A.getClientRect({skipTransform:!0});e(JW({contentRect:M,shouldScaleTo1:T}))},v=()=>{e(uP()),e(Bx())},b=()=>{e(Ad({cropVisible:!1,shouldSetAsInitialImage:!0}))},S=()=>{e(Ad({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},_=()=>{e(Ad({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},E=()=>{e(Ad({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},k=T=>{const A=T.target.value;e(X5(A)),A==="mask"&&!r&&e($y(!0))};return y.jsxs("div",{className:"inpainting-settings",children:[y.jsx(rl,{tooltip:`${l("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:qW,onChange:k,isDisabled:n}),y.jsx(wRe,{}),y.jsx(ERe,{}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{"aria-label":`${l("unifiedcanvas:move")} (V)`,tooltip:`${l("unifiedcanvas:move")} (V)`,icon:y.jsx(kq,{}),"data-selected":o==="move"||n,onClick:d}),y.jsx(Je,{"aria-label":`${l("unifiedcanvas:resetView")} (R)`,tooltip:`${l("unifiedcanvas:resetView")} (R)`,icon:y.jsx(Pq,{}),onClick:h})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{"aria-label":`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:y.jsx(Oq,{}),onClick:b,isDisabled:n}),y.jsx(Je,{"aria-label":`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:y.jsx(DP,{}),onClick:S,isDisabled:n}),y.jsx(Je,{"aria-label":`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:y.jsx(l0,{}),onClick:_,isDisabled:n}),y.jsx(Je,{"aria-label":`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:y.jsx(RP,{}),onClick:E,isDisabled:n})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(QY,{}),y.jsx(ZY,{})]}),y.jsxs(oo,{isAttached:!0,children:[y.jsx(Je,{"aria-label":`${l("common:upload")}`,tooltip:`${l("common:upload")}`,icon:y.jsx(tw,{}),onClick:u,isDisabled:n}),y.jsx(Je,{"aria-label":`${l("unifiedcanvas:clearCanvas")}`,tooltip:`${l("unifiedcanvas:clearCanvas")}`,icon:y.jsx(Sp,{}),onClick:v,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),y.jsx(oo,{isAttached:!0,children:y.jsx(_Re,{})})]})},LRe=lt([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ARe=()=>{const e=Oe(),{doesCanvasNeedScaling:t}=he(LRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),y.jsx("div",{className:"workarea-single-view",children:y.jsx("div",{className:"workarea-split-view-left",children:y.jsxs("div",{className:"inpainting-main-area",children:[y.jsx(TRe,{}),y.jsx("div",{className:"inpainting-canvas-area",children:t?y.jsx(XY,{}):y.jsx(KY,{})})]})})})},ORe=lt(ln,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),MRe=()=>{const e=Oe(),{boundingBoxDimensions:t}=he(ORe),{t:n}=Ue(),r=s=>{e(Av({...t,width:Math.floor(s)}))},i=s=>{e(Av({...t,height:Math.floor(s)}))},o=()=>{e(Av({...t,width:Math.floor(512)}))},a=()=>{e(Av({...t,height:Math.floor(512)}))};return y.jsxs(Ge,{direction:"column",gap:"1rem",children:[y.jsx(so,{label:n("parameters:width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:o}),y.jsx(so,{label:n("parameters:height"),min:64,max:1024,step:64,value:t.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:a})]})},IRe=lt([tT,or,ln],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),RRe=()=>{const e=Oe(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=he(IRe),{t:s}=Ue(),l=v=>{e(Tb({...a,width:Math.floor(v)}))},u=v=>{e(Tb({...a,height:Math.floor(v)}))},d=()=>{e(Tb({...a,width:Math.floor(512)}))},h=()=>{e(Tb({...a,height:Math.floor(512)}))},m=v=>{e(zxe(v.target.value))};return y.jsxs(Ge,{direction:"column",gap:"1rem",children:[y.jsx(rl,{label:s("parameters:scaleBeforeProcessing"),validValues:_xe,value:i,onChange:m}),y.jsx(so,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:d}),y.jsx(so,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:h}),y.jsx(rl,{label:s("parameters:infillMethod"),value:n,validValues:r,onChange:v=>e(xU(v.target.value))}),y.jsx(so,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("parameters:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:v=>{e(KI(v))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(KI(32))}})]})};function DRe(){const e=Oe(),t=he(r=>r.generation.seamBlur),{t:n}=Ue();return y.jsx(so,{sliderMarkRightOffset:-4,label:n("parameters:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(UI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(UI(16))}})}function NRe(){const e=Oe(),{t}=Ue(),n=he(r=>r.generation.seamSize);return y.jsx(so,{sliderMarkRightOffset:-6,label:t("parameters:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(GI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(GI(96))})}function jRe(){const{t:e}=Ue(),t=he(r=>r.generation.seamSteps),n=Oe();return y.jsx(so,{sliderMarkRightOffset:-4,label:e("parameters:seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(qI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(qI(30))}})}function BRe(){const e=Oe(),{t}=Ue(),n=he(r=>r.generation.seamStrength);return y.jsx(so,{sliderMarkRightOffset:-7,label:t("parameters:seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(YI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(YI(.7))}})}const $Re=()=>y.jsxs(Ge,{direction:"column",gap:"1rem",children:[y.jsx(NRe,{}),y.jsx(DRe,{}),y.jsx(BRe,{}),y.jsx(jRe,{})]});function FRe(){const{t:e}=Ue(),t={boundingBox:{header:`${e("parameters:boundingBoxHeader")}`,feature:ao.BOUNDING_BOX,content:y.jsx(MRe,{})},seamCorrection:{header:`${e("parameters:seamCorrectionHeader")}`,feature:ao.SEAM_CORRECTION,content:y.jsx($Re,{})},infillAndScaling:{header:`${e("parameters:infillScalingHeader")}`,feature:ao.INFILL_AND_SCALING,content:y.jsx(RRe,{})},seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:y.jsx(KP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:y.jsx(ZP,{}),additionalHeaderComponents:y.jsx(XP,{})}};return y.jsxs(aT,{children:[y.jsxs(Ge,{flexDir:"column",rowGap:"0.5rem",children:[y.jsx(oT,{}),y.jsx(iT,{})]}),y.jsx(rT,{}),y.jsx(QP,{}),y.jsx(jY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),y.jsx(JP,{accordionInfo:t})]})}function zRe(){const e=he(t=>t.ui.shouldUseCanvasBetaLayout);return y.jsx(YP,{optionsPanel:y.jsx(FRe,{}),styleClass:"inpainting-workarea-overrides",children:e?y.jsx(SRe,{}):y.jsx(ARe,{})})}const ts={txt2img:{title:y.jsx(S_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(MOe,{}),tooltip:"Text To Image"},img2img:{title:y.jsx(v_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(kOe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:y.jsx(w_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(zRe,{}),tooltip:"Unified Canvas"},nodes:{title:y.jsx(y_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(h_e,{}),tooltip:"Nodes"},postprocess:{title:y.jsx(b_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(p_e,{}),tooltip:"Post Processing"},training:{title:y.jsx(x_e,{fill:"black",boxSize:"2.5rem"}),workarea:y.jsx(g_e,{}),tooltip:"Training"}};function HRe(){ts.txt2img.tooltip=zt.t("common:text2img"),ts.img2img.tooltip=zt.t("common:img2img"),ts.unifiedCanvas.tooltip=zt.t("common:unifiedCanvas"),ts.nodes.tooltip=zt.t("common:nodes"),ts.postprocess.tooltip=zt.t("common:postProcessing"),ts.training.tooltip=zt.t("common:training")}function VRe(){const e=he(f_e),t=he(o=>o.lightbox.isLightboxOpen);m_e(HRe);const n=Oe();et("1",()=>{n(Yo(0))}),et("2",()=>{n(Yo(1))}),et("3",()=>{n(Yo(2))}),et("4",()=>{n(Yo(3))}),et("5",()=>{n(Yo(4))}),et("6",()=>{n(Yo(5))}),et("z",()=>{n(zm(!t))},[t]);const r=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(y.jsx(uo,{hasArrow:!0,label:ts[a].tooltip,placement:"right",children:y.jsx(vW,{children:ts[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(y.jsx(gW,{className:"app-tabs-panel",children:ts[a].workarea},a))}),o};return y.jsxs(pW,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(Yo(o))},children:[y.jsx("div",{className:"app-tabs-list",children:r()}),y.jsx(mW,{className:"app-tabs-panels",children:t?y.jsx(zAe,{}):i()})]})}var WRe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Ky(e,t){var n=URe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function URe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=WRe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var GRe=[".DS_Store","Thumbs.db"];function qRe(e){return b0(this,void 0,void 0,function(){return S0(this,function(t){return gS(e)&&YRe(e.dataTransfer)?[2,QRe(e.dataTransfer,e.type)]:KRe(e)?[2,XRe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,ZRe(e)]:[2,[]]})})}function YRe(e){return gS(e)}function KRe(e){return gS(e)&&gS(e.target)}function gS(e){return typeof e=="object"&&e!==null}function XRe(e){return o_(e.target.files).map(function(t){return Ky(t)})}function ZRe(e){return b0(this,void 0,void 0,function(){var t;return S0(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Ky(r)})]}})})}function QRe(e,t){return b0(this,void 0,void 0,function(){var n,r;return S0(this,function(i){switch(i.label){case 0:return e.items?(n=o_(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(JRe))]):[3,2];case 1:return r=i.sent(),[2,vN(aK(r))];case 2:return[2,vN(o_(e.files).map(function(o){return Ky(o)}))]}})})}function vN(e){return e.filter(function(t){return GRe.indexOf(t.name)===-1})}function o_(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,wN(n)];if(e.sizen)return[!1,wN(n)]}return[!0,null]}function wh(e){return e!=null}function gDe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=cK(l,n),d=cy(u,1),h=d[0],m=dK(l,r,i),v=cy(m,1),b=v[0],S=s?s(l):null;return h&&b&&!S})}function mS(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function e4(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function _N(e){e.preventDefault()}function mDe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function vDe(e){return e.indexOf("Edge/")!==-1}function yDe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return mDe(e)||vDe(e)}function Dl(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;a`.replaceAll("black",e),iIe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(rIe),[a,s]=w.useState(null),[l,u]=w.useState(0),d=w.useRef(null),h=w.useCallback(()=>{u(l+1),setTimeout(h,500)},[l]);return w.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=pN(n)},[a,n]),w.useEffect(()=>{a&&(a.src=pN(n))},[a,n]),w.useEffect(()=>{const m=setInterval(()=>u(y=>(y+1)%5),50);return()=>clearInterval(m)},[]),!a||!ke.isNumber(r.x)||!ke.isNumber(r.y)||!ke.isNumber(o)||!ke.isNumber(i.width)||!ke.isNumber(i.height)?null:v.jsx(cc,{ref:d,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:ke.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},oIe=lt([ln],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),aIe=e=>{const{...t}=e,{objects:n}=he(oIe);return v.jsx(uc,{listening:!1,...t,children:n.filter(lP).map((r,i)=>v.jsx(hS,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})};var dh=w,sIe=function(t,n,r){const i=dh.useRef("loading"),o=dh.useRef(),[a,s]=dh.useState(0),l=dh.useRef(),u=dh.useRef(),d=dh.useRef();return(l.current!==t||u.current!==n||d.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,d.current=r),dh.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function m(){i.current="loaded",o.current=h,s(Math.random())}function y(){i.current="failed",o.current=void 0,s(Math.random())}return h.addEventListener("load",m),h.addEventListener("error",y),n&&(h.crossOrigin=n),r&&(h.referrerpolicy=r),h.src=t,function(){h.removeEventListener("load",m),h.removeEventListener("error",y)}},[t,n,r]),[o.current,i.current]};const YY=e=>{const{url:t,x:n,y:r}=e,[i]=sIe(t);return v.jsx(GY,{x:n,y:r,image:i,listening:!1})},lIe=lt([ln],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),uIe=()=>{const{objects:e}=he(lIe);return e?v.jsx(uc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(Y5(t))return v.jsx(YY,{x:t.x,y:t.y,url:t.image.url},n);if(kxe(t)){const r=v.jsx(hS,{points:t.points,stroke:t.color?Uh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?v.jsx(uc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(Exe(t))return v.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Uh(t.color)},n);if(Pxe(t))return v.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},cIe=lt([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),dIe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=he(cIe);return v.jsxs(uc,{...t,children:[r&&n&&v.jsx(YY,{url:n.image.url,x:o,y:a}),i&&v.jsxs(uc,{children:[v.jsx(cc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),v.jsx(cc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},fIe=lt([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),hIe=()=>{const e=Oe(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=he(fIe),{t:o}=Ge(),a=w.useCallback(()=>{e(WI(!0))},[e]),s=w.useCallback(()=>{e(WI(!1))},[e]);et(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),et(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),et(["enter"],()=>{d()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(jxe()),u=()=>e(Nxe()),d=()=>e(Ixe());return r?v.jsx(je,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{tooltip:`${o("unifiedcanvas:previous")} (Left)`,"aria-label":`${o("unifiedcanvas:previous")} (Left)`,icon:v.jsx(mEe,{}),onClick:l,"data-selected":!0,isDisabled:t}),v.jsx(Je,{tooltip:`${o("unifiedcanvas:next")} (Right)`,"aria-label":`${o("unifiedcanvas:next")} (Right)`,icon:v.jsx(vEe,{}),onClick:u,"data-selected":!0,isDisabled:n}),v.jsx(Je,{tooltip:`${o("unifiedcanvas:accept")} (Enter)`,"aria-label":`${o("unifiedcanvas:accept")} (Enter)`,icon:v.jsx(RP,{}),onClick:d,"data-selected":!0}),v.jsx(Je,{tooltip:o("unifiedcanvas:showHide"),"aria-label":o("unifiedcanvas:showHide"),"data-alert":!i,icon:i?v.jsx(_Ee,{}):v.jsx(CEe,{}),onClick:()=>e(qxe(!i)),"data-selected":!0}),v.jsx(Je,{tooltip:o("unifiedcanvas:saveToGallery"),"aria-label":o("unifiedcanvas:saveToGallery"),icon:v.jsx(NP,{}),onClick:()=>e(r_e(r.image.url)),"data-selected":!0}),v.jsx(Je,{tooltip:o("unifiedcanvas:discardAll"),"aria-label":o("unifiedcanvas:discardAll"),icon:v.jsx(Uy,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(Rxe()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},mm=e=>Math.round(e*100)/100,pIe=lt([ln],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${mm(n)}, ${mm(r)})`}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function gIe(){const{cursorCoordinatesString:e}=he(pIe),{t}=Ge();return v.jsx("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const mIe=lt([ln],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:d},stageScale:h,shouldShowCanvasDebugInfo:m,layer:y,boundingBoxScaleMethod:b,shouldPreserveMaskedArea:x}=e;let k="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(k="var(--status-working-color)"),{activeLayerColor:y==="mask"?"var(--status-working-color)":"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:k,boundingBoxCoordinatesString:`(${mm(u)}, ${mm(d)})`,boundingBoxDimensionsString:`${o}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${mm(r)}×${mm(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none",shouldPreserveMaskedArea:x}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),vIe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:d,shouldShowBoundingBox:h,shouldPreserveMaskedArea:m}=he(mIe),{t:y}=Ge();return v.jsxs("div",{className:"canvas-status-text",children:[v.jsx("div",{style:{color:e},children:`${y("unifiedcanvas:activeLayer")}: ${t}`}),v.jsx("div",{children:`${y("unifiedcanvas:canvasScale")}: ${u}%`}),m&&v.jsx("div",{style:{color:"var(--status-working-color)"},children:"Preserve Masked Area: On"}),h&&v.jsx("div",{style:{color:n},children:`${y("unifiedcanvas:boundingBox")}: ${i}`}),a&&v.jsx("div",{style:{color:n},children:`${y("unifiedcanvas:scaledBoundingBox")}: ${o}`}),d&&v.jsxs(v.Fragment,{children:[v.jsx("div",{children:`${y("unifiedcanvas:boundingBoxPosition")}: ${r}`}),v.jsx("div",{children:`${y("unifiedcanvas:canvasDimensions")}: ${l}`}),v.jsx("div",{children:`${y("unifiedcanvas:canvasPosition")}: ${s}`}),v.jsx(gIe,{})]})]})},yIe=lt(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),bIe=e=>{const{...t}=e,n=Oe(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:d,hitStrokeWidth:h}=he(yIe),m=w.useRef(null),y=w.useRef(null),[b,x]=w.useState(!1);w.useEffect(()=>{var te;!m.current||!y.current||(m.current.nodes([y.current]),(te=m.current.getLayer())==null||te.batchDraw())},[]);const k=64*l,E=w.useCallback(te=>{if(!u){n(CC({x:Math.floor(te.target.x()),y:Math.floor(te.target.y())}));return}const G=te.target.x(),F=te.target.y(),W=Yl(G,64),X=Yl(F,64);te.target.x(W),te.target.y(X),n(CC({x:W,y:X}))},[n,u]),_=w.useCallback(()=>{if(!y.current)return;const te=y.current,G=te.scaleX(),F=te.scaleY(),W=Math.round(te.width()*G),X=Math.round(te.height()*F),Z=Math.round(te.x()),U=Math.round(te.y());n(Av({width:W,height:X})),n(CC({x:u?Ld(Z,64):Z,y:u?Ld(U,64):U})),te.scaleX(1),te.scaleY(1)},[n,u]),P=w.useCallback((te,G,F)=>{const W=te.x%k,X=te.y%k;return{x:Ld(G.x,k)+W,y:Ld(G.y,k)+X}},[k]),A=()=>{n(kC(!0))},M=()=>{n(kC(!1)),n(_C(!1)),n(Pb(!1)),x(!1)},R=()=>{n(_C(!0))},D=()=>{n(kC(!1)),n(_C(!1)),n(Pb(!1)),x(!1)},j=()=>{x(!0)},z=()=>{!s&&!a&&x(!1)},H=()=>{n(Pb(!0))},K=()=>{n(Pb(!1))};return v.jsxs(uc,{...t,children:[v.jsx(cc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:H,onMouseOver:H,onMouseLeave:K,onMouseOut:K}),v.jsx(cc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:h,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onDragMove:E,onMouseDown:R,onMouseOut:z,onMouseOver:j,onMouseEnter:j,onMouseUp:D,onTransform:_,onTransformEnd:M,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),v.jsx(DMe,{anchorCornerRadius:3,anchorDragBoundFunc:P,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:d==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onMouseDown:A,onMouseUp:M,onTransformEnd:M,ref:m,rotateEnabled:!1})]})},SIe=lt(ln,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:d,stageScale:h,stageDimensions:m,boundingBoxCoordinates:y,boundingBoxDimensions:b,shouldRestrictStrokesToBox:x}=e,k=x?{clipX:y.x,clipY:y.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:HI/h,colorPickerInnerRadius:(HI-h8+1)/h,maskColorString:Uh({...i,a:.5}),brushColorString:Uh(o),colorPickerColorString:Uh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||d||!t)&&l,strokeWidth:1.5/h,dotRadius:1.5/h,clip:k}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),xIe=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:d,brushColorString:h,colorPickerColorString:m,colorPickerInnerRadius:y,colorPickerOuterRadius:b,clip:x}=he(SIe);return l?v.jsxs(uc,{listening:!1,...x,...t,children:[a==="colorPicker"?v.jsxs(v.Fragment,{children:[v.jsx(ch,{x:n,y:r,radius:b,stroke:h,strokeWidth:h8,strokeScaleEnabled:!1}),v.jsx(ch,{x:n,y:r,radius:y,stroke:m,strokeWidth:h8,strokeScaleEnabled:!1})]}):v.jsxs(v.Fragment,{children:[v.jsx(ch,{x:n,y:r,radius:i,fill:s==="mask"?o:h,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),v.jsx(ch,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:d*2,strokeEnabled:!0,listening:!1}),v.jsx(ch,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),v.jsx(ch,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),v.jsx(ch,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},wIe=lt([ln,Ir],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:d,isMovingStage:h,shouldShowIntermediates:m,shouldShowGrid:y,shouldRestrictStrokesToBox:b}=e;let x="none";return d==="move"||t?h?x="grabbing":x="grab":o?x=void 0:b&&!a&&(x="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:y,stageCoordinates:u,stageCursor:x,stageDimensions:l,stageScale:r,tool:d,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KY=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:d}=he(wIe);$Me();const h=w.useRef(null),m=w.useRef(null),y=w.useCallback(z=>{N8e(z),h.current=z},[]),b=w.useCallback(z=>{D8e(z),m.current=z},[]),x=w.useRef({x:0,y:0}),k=w.useRef(!1),E=KMe(h),_=HMe(h),P=qMe(h,k),A=WMe(h,k,x),M=UMe(),{handleDragStart:R,handleDragMove:D,handleDragEnd:j}=BMe();return v.jsx("div",{className:"inpainting-canvas-container",children:v.jsxs("div",{className:"inpainting-canvas-wrapper",children:[v.jsxs(NMe,{tabIndex:-1,ref:y,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:_,onTouchMove:A,onTouchEnd:P,onMouseDown:_,onMouseLeave:M,onMouseMove:A,onMouseUp:P,onDragStart:R,onDragMove:D,onDragEnd:j,onContextMenu:z=>z.evt.preventDefault(),onWheel:E,draggable:(l==="move"||u)&&!t,children:[v.jsx(vv,{id:"grid",visible:r,children:v.jsx(eIe,{})}),v.jsx(vv,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:v.jsx(uIe,{})}),v.jsxs(vv,{id:"mask",visible:e,listening:!1,children:[v.jsx(aIe,{visible:!0,listening:!1}),v.jsx(iIe,{listening:!1})]}),v.jsx(vv,{children:v.jsx(ZMe,{})}),v.jsxs(vv,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&v.jsx(xIe,{visible:l!=="move",listening:!1}),v.jsx(dIe,{visible:u}),d&&v.jsx(nIe,{}),v.jsx(bIe,{visible:n&&!u})]})]}),v.jsx(vIe,{}),v.jsx(hIe,{})]})})},CIe=lt(ln,Iq,Mr,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),XY=()=>{const e=Oe(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=he(CIe),o=w.useRef(null);return w.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(Hxe({width:a,height:s})),e(i?$xe():Bx()),e(vi(!1))},0)},[e,r,t,n,i]),v.jsx("div",{ref:o,className:"inpainting-canvas-area",children:v.jsx(ky,{thickness:"2px",speed:"1s",size:"xl"})})},_Ie=lt([ln,Mr,or],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function ZY(){const e=Oe(),{canRedo:t,activeTabName:n}=he(_Ie),{t:r}=Ge(),i=()=>{e(Bxe())};return et(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),v.jsx(Je,{"aria-label":`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,icon:v.jsx(DEe,{}),onClick:i,isDisabled:!t})}const kIe=lt([ln,Mr,or],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function QY(){const e=Oe(),{t}=Ge(),{canUndo:n,activeTabName:r}=he(kIe),i=()=>{e(Kxe())};return et(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:undo")} (Ctrl+Z)`,tooltip:`${t("unifiedcanvas:undo")} (Ctrl+Z)`,icon:v.jsx(FEe,{}),onClick:i,isDisabled:!n})}const EIe=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");o&&(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},PIe=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},TIe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:a,y:s,width:l,height:u},h=e.toDataURL(d);return e.scale(i),{dataURL:h,boundingBox:{x:o.x,y:o.y,width:l,height:u}}},LIe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Od=(e=LIe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(yCe("Exporting Image")),t(fm(!1));const u=n(),{stageScale:d,boundingBoxCoordinates:h,boundingBoxDimensions:m,stageCoordinates:y}=u.canvas,b=nl();if(!b){t(ns(!1)),t(fm(!0));return}const{dataURL:x,boundingBox:k}=TIe(b,d,y,i?{...h,...m}:void 0);if(!x){t(ns(!1)),t(fm(!0));return}const E=new FormData;E.append("data",JSON.stringify({dataURL:x,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const P=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:E})).json(),{url:A,width:M,height:R}=P,D={uuid:pm(),category:o?"result":"user",...P};a&&(PIe(A),t(Oh({title:zt.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(EIe(A,M,R),t(Oh({title:zt.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(dm({image:D,category:"result"})),t(Oh({title:zt.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(Uxe({kind:"image",layer:"base",...k,image:D})),t(Oh({title:zt.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(ns(!1)),t(B4(zt.t("common:statusConnected"))),t(fm(!0))};function AIe(){const e=he(Ir),t=nl(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Oe(),{t:o}=Ge();et(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Od({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return v.jsx(Je,{"aria-label":`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:v.jsx(u0,{}),onClick:a,isDisabled:e})}function OIe(){const e=Oe(),{t}=Ge(),n=nl(),r=he(Ir),i=he(s=>s.system.isProcessing),o=he(s=>s.canvas.shouldCropToBoundingBoxOnSave);et(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Od({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return v.jsx(Je,{"aria-label":`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:v.jsx(DP,{}),onClick:a,isDisabled:r})}function MIe(){const e=he(Ir),{openUploader:t}=TP(),{t:n}=Ge();return v.jsx(Je,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:v.jsx(tw,{}),onClick:t,isDisabled:e})}const IIe=lt([ln,Ir],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function RIe(){const e=Oe(),{t}=Ge(),{layer:n,isMaskEnabled:r,isStaging:i}=he(IIe),o=()=>{e(X5(n==="mask"?"base":"mask"))};et(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(X5(l)),l==="mask"&&!r&&e(Fy(!0))};return v.jsx(rl,{tooltip:`${t("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:qW,onChange:a,isDisabled:i})}function DIe(){const e=Oe(),{t}=Ge(),n=nl(),r=he(Ir),i=he(a=>a.system.isProcessing);et(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Od({cropVisible:!1,shouldSetAsInitialImage:!0}))};return v.jsx(Je,{"aria-label":`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:v.jsx(Oq,{}),onClick:o,isDisabled:r})}function NIe(){const e=he(o=>o.canvas.tool),t=he(Ir),n=Oe(),{t:r}=Ge();et(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(ru("move"));return v.jsx(Je,{"aria-label":`${r("unifiedcanvas:move")} (V)`,tooltip:`${r("unifiedcanvas:move")} (V)`,icon:v.jsx(kq,{}),"data-selected":e==="move"||t,onClick:i})}function jIe(){const e=he(i=>i.ui.shouldPinParametersPanel),t=Oe(),{t:n}=Ge(),r=()=>{t(Zu(!0)),e&&setTimeout(()=>t(vi(!0)),400)};return v.jsxs(je,{flexDirection:"column",gap:"0.5rem",children:[v.jsx(Je,{tooltip:`${n("parameters:showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters:showOptionsPanel"),onClick:r,children:v.jsx(jP,{})}),v.jsx(je,{children:v.jsx(rT,{iconButton:!0})}),v.jsx(je,{children:v.jsx(tT,{width:"100%",height:"40px"})})]})}function BIe(){const e=Oe(),{t}=Ge(),n=he(Ir),r=()=>{e(cP()),e(Bx())};return v.jsx(Je,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:v.jsx(xp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function JY(e,t,n=250){const[r,i]=w.useState(0);return w.useEffect(()=>{const o=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(o)},[r,e,t,n]),()=>i(o=>o+1)}function FIe(){const e=nl(),t=Oe(),{t:n}=Ge();et(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=JY(()=>i(!1),()=>i(!0)),i=(o=!1)=>{const a=nl();if(!a)return;const s=a.getClientRect({skipTransform:!0});t(JW({contentRect:s,shouldScaleTo1:o}))};return v.jsx(Je,{"aria-label":`${n("unifiedcanvas:resetView")} (R)`,tooltip:`${n("unifiedcanvas:resetView")} (R)`,icon:v.jsx(Pq,{}),onClick:r})}function $Ie(){const e=he(Ir),t=nl(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Oe(),{t:o}=Ge();et(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Od({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return v.jsx(Je,{"aria-label":`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:v.jsx(NP,{}),onClick:a,isDisabled:e})}const zIe=lt([ln,Ir,or],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HIe=()=>{const e=Oe(),{t}=Ge(),{tool:n,isStaging:r}=he(zIe);et(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),et(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),et(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),et(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),et(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(ru("brush")),o=()=>e(ru("eraser")),a=()=>e(ru("colorPicker")),s=()=>e(XW()),l=()=>e(KW());return v.jsxs(je,{flexDirection:"column",gap:"0.5rem",children:[v.jsxs(oo,{children:[v.jsx(Je,{"aria-label":`${t("unifiedcanvas:brush")} (B)`,tooltip:`${t("unifiedcanvas:brush")} (B)`,icon:v.jsx(Mq,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:eraser")} (E)`,tooltip:`${t("unifiedcanvas:eraser")} (B)`,icon:v.jsx(Tq,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),v.jsxs(oo,{children:[v.jsx(Je,{"aria-label":`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:v.jsx(Aq,{}),isDisabled:r,onClick:s}),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:v.jsx(Uy,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:colorPicker")} (C)`,tooltip:`${t("unifiedcanvas:colorPicker")} (C)`,icon:v.jsx(Lq,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},fw=Ae((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:d,onClose:h}=qh(),m=w.useRef(null),y=()=>{r(),h()},b=()=>{o&&o(),h()};return v.jsxs(v.Fragment,{children:[w.cloneElement(l,{onClick:d,ref:t}),v.jsx(zV,{isOpen:u,leastDestructiveRef:m,onClose:h,children:v.jsx(Qd,{children:v.jsxs(HV,{className:"modal",children:[v.jsx(k0,{fontSize:"lg",fontWeight:"bold",children:s}),v.jsx(a0,{children:a}),v.jsxs(wx,{children:[v.jsx(ls,{ref:m,onClick:b,className:"modal-close-btn",children:i}),v.jsx(ls,{colorScheme:"red",onClick:y,ml:3,children:n})]})]})})})]})}),eK=()=>{const e=he(Ir),t=Oe(),{t:n}=Ge(),r=()=>{t(i_e()),t(cP()),t(QW())};return v.jsxs(fw,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:v.jsx(nr,{leftIcon:v.jsx(xp,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[v.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),v.jsx("br",{}),v.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},tK=()=>{const e=he(Ir),t=Oe(),{t:n}=Ge();return v.jsxs(fw,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:()=>t(QW()),acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:v.jsx(nr,{size:"sm",leftIcon:v.jsx(xp,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[v.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),v.jsx("br",{}),v.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},VIe=lt([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WIe=()=>{const e=Oe(),{t}=Ge(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=he(VIe);return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:v.jsx(BP,{})}),children:v.jsxs(je,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:o,onChange:a=>e(lU(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:a=>e(nU(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:a=>e(rU(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:a=>e(aU(a.target.checked))}),v.jsx(tK,{}),v.jsx(eK,{})]})})},UIe=()=>{const e=he(t=>t.ui.shouldShowParametersPanel);return v.jsxs(je,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[v.jsx(RIe,{}),v.jsx(HIe,{}),v.jsxs(je,{gap:"0.5rem",children:[v.jsx(NIe,{}),v.jsx(FIe,{})]}),v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(DIe,{}),v.jsx($Ie,{})]}),v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(AIe,{}),v.jsx(OIe,{})]}),v.jsxs(je,{gap:"0.5rem",children:[v.jsx(QY,{}),v.jsx(ZY,{})]}),v.jsxs(je,{gap:"0.5rem",children:[v.jsx(MIe,{}),v.jsx(BIe,{})]}),v.jsx(WIe,{}),!e&&v.jsx(jIe,{})]})};function GIe(){const e=Oe(),t=he(i=>i.canvas.brushSize),{t:n}=Ge(),r=he(Ir);return et(["BracketLeft"],()=>{e(zm(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),et(["BracketRight"],()=>{e(zm(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),v.jsx(so,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:i=>e(zm(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function hw(){return(hw=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function n_(e){var t=w.useRef(e),n=w.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var f0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:k.buttons>0)&&i.current?o(gN(i.current,k,s.current)):x(!1)},b=function(){return x(!1)};function x(k){var E=l.current,_=r_(i.current),P=k?_.addEventListener:_.removeEventListener;P(E?"touchmove":"mousemove",y),P(E?"touchend":"mouseup",b)}return[function(k){var E=k.nativeEvent,_=i.current;if(_&&(mN(E),!function(A,M){return M&&!g2(A)}(E,l.current)&&_)){if(g2(E)){l.current=!0;var P=E.changedTouches||[];P.length&&(s.current=P[0].identifier)}_.focus(),o(gN(_,E,s.current)),x(!0)}},function(k){var E=k.which||k.keyCode;E<37||E>40||(k.preventDefault(),a({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},x]},[a,o]),d=u[0],h=u[1],m=u[2];return w.useEffect(function(){return m},[m]),N.createElement("div",hw({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),pw=function(e){return e.filter(Boolean).join(" ")},hT=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=pw(["react-colorful__pointer",e.className]);return N.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},N.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Po=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},rK=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Po(e.h),s:Po(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Po(i/2),a:Po(r,2)}},i_=function(e){var t=rK(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},YC=function(e){var t=rK(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},qIe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:Po(255*[r,s,a,a,l,r][u]),g:Po(255*[l,r,r,s,a,a][u]),b:Po(255*[a,a,l,r,r,s][u]),a:Po(i,2)}},YIe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Po(60*(s<0?s+6:s)),s:Po(o?a/o*100:0),v:Po(o/255*100),a:i}},KIe=N.memo(function(e){var t=e.hue,n=e.onChange,r=pw(["react-colorful__hue",e.className]);return N.createElement("div",{className:r},N.createElement(fT,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:f0(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Po(t),"aria-valuemax":"360","aria-valuemin":"0"},N.createElement(hT,{className:"react-colorful__hue-pointer",left:t/360,color:i_({h:t,s:100,v:100,a:1})})))}),XIe=N.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:i_({h:t.h,s:100,v:100,a:1})};return N.createElement("div",{className:"react-colorful__saturation",style:r},N.createElement(fT,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:f0(t.s+100*i.left,0,100),v:f0(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Po(t.s)+"%, Brightness "+Po(t.v)+"%"},N.createElement(hT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:i_(t)})))}),iK=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function ZIe(e,t,n){var r=n_(n),i=w.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=w.useRef({color:t,hsva:o});w.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),w.useEffect(function(){var u;iK(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=w.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var QIe=typeof window<"u"?w.useLayoutEffect:w.useEffect,JIe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},vN=new Map,eRe=function(e){QIe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!vN.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,vN.set(t,n);var r=JIe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},tRe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+YC(Object.assign({},n,{a:0}))+", "+YC(Object.assign({},n,{a:1}))+")"},o=pw(["react-colorful__alpha",t]),a=Po(100*n.a);return N.createElement("div",{className:o},N.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),N.createElement(fT,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:f0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},N.createElement(hT,{className:"react-colorful__alpha-pointer",left:n.a,color:YC(n)})))},nRe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=nK(e,["className","colorModel","color","onChange"]),s=w.useRef(null);eRe(s);var l=ZIe(n,i,o),u=l[0],d=l[1],h=pw(["react-colorful",t]);return N.createElement("div",hw({},a,{ref:s,className:h}),N.createElement(XIe,{hsva:u,onChange:d}),N.createElement(KIe,{hue:u.h,onChange:d}),N.createElement(tRe,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},rRe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:YIe,fromHsva:qIe,equal:iK},iRe=function(e){return N.createElement(nRe,hw({},e,{colorModel:rRe}))};const pS=e=>{const{styleClass:t,...n}=e;return v.jsx(iRe,{className:`invokeai__color-picker ${t}`,...n})},oRe=lt([ln,Ir],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function aRe(){const e=Oe(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=he(oRe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return et(["shift+BracketLeft"],()=>{e($m({...t,a:ke.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),et(["shift+BracketRight"],()=>{e($m({...t,a:ke.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Eo,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:v.jsxs(je,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&v.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e($m(a))}),r==="mask"&&v.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(tU(a))})]})})}function oK(){return v.jsxs(je,{columnGap:"1rem",alignItems:"center",children:[v.jsx(GIe,{}),v.jsx(aRe,{})]})}function sRe(){const e=Oe(),t=he(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ge();return v.jsx(er,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:r=>e(cU(r.target.checked))})}function lRe(){return v.jsxs(je,{gap:"1rem",alignItems:"center",children:[v.jsx(oK,{}),v.jsx(sRe,{})]})}function uRe(){const e=Oe(),{t}=Ge(),n=()=>e(uP());return v.jsx(nr,{size:"sm",leftIcon:v.jsx(xp,{}),onClick:n,tooltip:`${t("unifiedcanvas:clearMask")} (Shift+C)`,children:t("unifiedcanvas:betaClear")})}function cRe(){const e=he(i=>i.canvas.isMaskEnabled),t=Oe(),{t:n}=Ge(),r=()=>t(Fy(!e));return v.jsx(er,{label:`${n("unifiedcanvas:enableMask")} (H)`,isChecked:e,onChange:r})}function dRe(){const e=Oe(),{t}=Ge(),n=he(r=>r.canvas.shouldPreserveMaskedArea);return v.jsx(er,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:r=>e(oU(r.target.checked))})}function fRe(){return v.jsxs(je,{gap:"1rem",alignItems:"center",children:[v.jsx(oK,{}),v.jsx(cRe,{}),v.jsx(dRe,{}),v.jsx(uRe,{})]})}function hRe(){const e=he(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Oe(),{t:n}=Ge();return v.jsx(er,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:r=>t(iU(r.target.checked))})}function pRe(){const e=he(r=>r.canvas.shouldShowGrid),t=Oe(),{t:n}=Ge();return v.jsx(er,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:r=>t(sU(r.target.checked))})}function gRe(){const e=he(i=>i.canvas.shouldSnapToGrid),t=Oe(),{t:n}=Ge(),r=i=>t(Z5(i.target.checked));return v.jsx(er,{label:`${n("unifiedcanvas:snapToGrid")} (N)`,isChecked:e,onChange:r})}function mRe(){return v.jsxs(je,{alignItems:"center",gap:"1rem",children:[v.jsx(pRe,{}),v.jsx(gRe,{}),v.jsx(hRe,{})]})}const vRe=lt([ln],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function yRe(){const{tool:e,layer:t}=he(vRe);return v.jsxs(je,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&v.jsx(lRe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&v.jsx(fRe,{}),e=="move"&&v.jsx(mRe,{})]})}const bRe=lt([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),SRe=()=>{const e=Oe(),{doesCanvasNeedScaling:t}=he(bRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),v.jsx("div",{className:"workarea-single-view",children:v.jsxs(je,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[v.jsx(UIe,{}),v.jsxs(je,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[v.jsx(yRe,{}),t?v.jsx(XY,{}):v.jsx(KY,{})]})]})})},xRe=lt([ln,Ir],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:Uh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),wRe=()=>{const e=Oe(),{t}=Ge(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=he(xRe);et(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),et(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),et(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(X5(n==="mask"?"base":"mask"))},l=()=>e(uP()),u=()=>e(Fy(!i));return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(oo,{children:v.jsx(Je,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:v.jsx(LEe,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:v.jsxs(je,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:`${t("unifiedcanvas:enableMask")} (H)`,isChecked:i,onChange:u}),v.jsx(er,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:o,onChange:d=>e(oU(d.target.checked))}),v.jsx(pS,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:d=>e(tU(d))}),v.jsxs(nr,{size:"sm",leftIcon:v.jsx(xp,{}),onClick:l,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},CRe=lt([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),_Re=()=>{const e=Oe(),{t}=Ge(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=he(CRe);et(["n"],()=>{e(Z5(!l))},{enabled:!0,preventDefault:!0},[l]);const d=h=>e(Z5(h.target.checked));return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:v.jsx(BP,{})}),children:v.jsxs(je,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:s,onChange:h=>e(lU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showGrid"),isChecked:a,onChange:h=>e(sU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:snapToGrid"),isChecked:l,onChange:d}),v.jsx(er,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:h=>e(iU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:h=>e(nU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:h=>e(rU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:u,onChange:h=>e(cU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:o,onChange:h=>e(aU(h.target.checked))}),v.jsx(tK,{}),v.jsx(eK,{})]})})},kRe=lt([ln,Ir,or],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ERe=()=>{const e=Oe(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=he(kRe),{t:o}=Ge();et(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),et(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),et(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),et(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),et(["delete","backspace"],()=>{d()},{enabled:()=>!i,preventDefault:!0}),et(["BracketLeft"],()=>{e(zm(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),et(["BracketRight"],()=>{e(zm(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),et(["shift+BracketLeft"],()=>{e($m({...n,a:ke.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),et(["shift+BracketRight"],()=>{e($m({...n,a:ke.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(ru("brush")),s=()=>e(ru("eraser")),l=()=>e(ru("colorPicker")),u=()=>e(XW()),d=()=>e(KW());return v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${o("unifiedcanvas:brush")} (B)`,tooltip:`${o("unifiedcanvas:brush")} (B)`,icon:v.jsx(Mq,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:eraser")} (E)`,tooltip:`${o("unifiedcanvas:eraser")} (E)`,icon:v.jsx(Tq,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:v.jsx(Aq,{}),isDisabled:i,onClick:u}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:v.jsx(Uy,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:colorPicker")} (C)`,tooltip:`${o("unifiedcanvas:colorPicker")} (C)`,icon:v.jsx(Lq,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":o("unifiedcanvas:brushOptions"),tooltip:o("unifiedcanvas:brushOptions"),icon:v.jsx(jP,{})}),children:v.jsxs(je,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[v.jsx(je,{gap:"1rem",justifyContent:"space-between",children:v.jsx(so,{label:o("unifiedcanvas:brushSize"),value:r,withInput:!0,onChange:h=>e(zm(h)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),v.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:h=>e($m(h))})]})})]})},PRe=lt([or,ln,Ir],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),TRe=()=>{const e=Oe(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=he(PRe),s=nl(),{t:l}=Ge(),{openUploader:u}=TP();et(["v"],()=>{d()},{enabled:()=>!n,preventDefault:!0},[]),et(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[s]),et(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["shift+s"],()=>{x()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["meta+c","ctrl+c"],()=>{k()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["shift+d"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]);const d=()=>e(ru("move")),h=JY(()=>m(!1),()=>m(!0)),m=(P=!1)=>{const A=nl();if(!A)return;const M=A.getClientRect({skipTransform:!0});e(JW({contentRect:M,shouldScaleTo1:P}))},y=()=>{e(cP()),e(Bx())},b=()=>{e(Od({cropVisible:!1,shouldSetAsInitialImage:!0}))},x=()=>{e(Od({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},k=()=>{e(Od({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},E=()=>{e(Od({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},_=P=>{const A=P.target.value;e(X5(A)),A==="mask"&&!r&&e(Fy(!0))};return v.jsxs("div",{className:"inpainting-settings",children:[v.jsx(rl,{tooltip:`${l("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:qW,onChange:_,isDisabled:n}),v.jsx(wRe,{}),v.jsx(ERe,{}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${l("unifiedcanvas:move")} (V)`,tooltip:`${l("unifiedcanvas:move")} (V)`,icon:v.jsx(kq,{}),"data-selected":o==="move"||n,onClick:d}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:resetView")} (R)`,tooltip:`${l("unifiedcanvas:resetView")} (R)`,icon:v.jsx(Pq,{}),onClick:h})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:v.jsx(Oq,{}),onClick:b,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:v.jsx(NP,{}),onClick:x,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:v.jsx(u0,{}),onClick:k,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:v.jsx(DP,{}),onClick:E,isDisabled:n})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(QY,{}),v.jsx(ZY,{})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${l("common:upload")}`,tooltip:`${l("common:upload")}`,icon:v.jsx(tw,{}),onClick:u,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:clearCanvas")}`,tooltip:`${l("unifiedcanvas:clearCanvas")}`,icon:v.jsx(xp,{}),onClick:y,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),v.jsx(oo,{isAttached:!0,children:v.jsx(_Re,{})})]})},LRe=lt([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ARe=()=>{const e=Oe(),{doesCanvasNeedScaling:t}=he(LRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),v.jsx("div",{className:"workarea-single-view",children:v.jsx("div",{className:"workarea-split-view-left",children:v.jsxs("div",{className:"inpainting-main-area",children:[v.jsx(TRe,{}),v.jsx("div",{className:"inpainting-canvas-area",children:t?v.jsx(XY,{}):v.jsx(KY,{})})]})})})},ORe=lt(ln,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),MRe=()=>{const e=Oe(),{boundingBoxDimensions:t}=he(ORe),{t:n}=Ge(),r=s=>{e(Av({...t,width:Math.floor(s)}))},i=s=>{e(Av({...t,height:Math.floor(s)}))},o=()=>{e(Av({...t,width:Math.floor(512)}))},a=()=>{e(Av({...t,height:Math.floor(512)}))};return v.jsxs(je,{direction:"column",gap:"1rem",children:[v.jsx(so,{label:n("parameters:width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:o}),v.jsx(so,{label:n("parameters:height"),min:64,max:1024,step:64,value:t.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:a})]})},IRe=lt([nT,or,ln],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),RRe=()=>{const e=Oe(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=he(IRe),{t:s}=Ge(),l=y=>{e(Tb({...a,width:Math.floor(y)}))},u=y=>{e(Tb({...a,height:Math.floor(y)}))},d=()=>{e(Tb({...a,width:Math.floor(512)}))},h=()=>{e(Tb({...a,height:Math.floor(512)}))},m=y=>{e(zxe(y.target.value))};return v.jsxs(je,{direction:"column",gap:"1rem",children:[v.jsx(rl,{label:s("parameters:scaleBeforeProcessing"),validValues:_xe,value:i,onChange:m}),v.jsx(so,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:d}),v.jsx(so,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:h}),v.jsx(rl,{label:s("parameters:infillMethod"),value:n,validValues:r,onChange:y=>e(xU(y.target.value))}),v.jsx(so,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("parameters:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:y=>{e(XI(y))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(XI(32))}})]})};function DRe(){const e=Oe(),t=he(r=>r.generation.seamBlur),{t:n}=Ge();return v.jsx(so,{sliderMarkRightOffset:-4,label:n("parameters:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(GI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(GI(16))}})}function NRe(){const e=Oe(),{t}=Ge(),n=he(r=>r.generation.seamSize);return v.jsx(so,{sliderMarkRightOffset:-6,label:t("parameters:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(qI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(qI(96))})}function jRe(){const{t:e}=Ge(),t=he(r=>r.generation.seamSteps),n=Oe();return v.jsx(so,{sliderMarkRightOffset:-4,label:e("parameters:seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(YI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(YI(30))}})}function BRe(){const e=Oe(),{t}=Ge(),n=he(r=>r.generation.seamStrength);return v.jsx(so,{sliderMarkRightOffset:-7,label:t("parameters:seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(KI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(KI(.7))}})}const FRe=()=>v.jsxs(je,{direction:"column",gap:"1rem",children:[v.jsx(NRe,{}),v.jsx(DRe,{}),v.jsx(BRe,{}),v.jsx(jRe,{})]});function $Re(){const{t:e}=Ge(),t={boundingBox:{header:`${e("parameters:boundingBoxHeader")}`,feature:ao.BOUNDING_BOX,content:v.jsx(MRe,{})},seamCorrection:{header:`${e("parameters:seamCorrectionHeader")}`,feature:ao.SEAM_CORRECTION,content:v.jsx(FRe,{})},infillAndScaling:{header:`${e("parameters:infillScalingHeader")}`,feature:ao.INFILL_AND_SCALING,content:v.jsx(RRe,{})},seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:v.jsx(XP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:v.jsx(QP,{}),additionalHeaderComponents:v.jsx(ZP,{})}};return v.jsxs(sT,{children:[v.jsxs(je,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(aT,{}),v.jsx(oT,{})]}),v.jsx(iT,{}),v.jsx(JP,{}),v.jsx(jY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),v.jsx(eT,{accordionInfo:t})]})}function zRe(){const e=he(t=>t.ui.shouldUseCanvasBetaLayout);return v.jsx(KP,{optionsPanel:v.jsx($Re,{}),styleClass:"inpainting-workarea-overrides",children:e?v.jsx(SRe,{}):v.jsx(ARe,{})})}const ts={txt2img:{title:v.jsx(S_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(MOe,{}),tooltip:"Text To Image"},img2img:{title:v.jsx(v_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(kOe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:v.jsx(w_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(zRe,{}),tooltip:"Unified Canvas"},nodes:{title:v.jsx(y_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(h_e,{}),tooltip:"Nodes"},postprocess:{title:v.jsx(b_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(p_e,{}),tooltip:"Post Processing"},training:{title:v.jsx(x_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(g_e,{}),tooltip:"Training"}};function HRe(){ts.txt2img.tooltip=zt.t("common:text2img"),ts.img2img.tooltip=zt.t("common:img2img"),ts.unifiedCanvas.tooltip=zt.t("common:unifiedCanvas"),ts.nodes.tooltip=zt.t("common:nodes"),ts.postprocess.tooltip=zt.t("common:postProcessing"),ts.training.tooltip=zt.t("common:training")}function VRe(){const e=he(f_e),t=he(o=>o.lightbox.isLightboxOpen);m_e(HRe);const n=Oe();et("1",()=>{n(Yo(0))}),et("2",()=>{n(Yo(1))}),et("3",()=>{n(Yo(2))}),et("4",()=>{n(Yo(3))}),et("5",()=>{n(Yo(4))}),et("6",()=>{n(Yo(5))}),et("z",()=>{n(Hm(!t))},[t]);const r=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(v.jsx(uo,{hasArrow:!0,label:ts[a].tooltip,placement:"right",children:v.jsx(vW,{children:ts[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(v.jsx(gW,{className:"app-tabs-panel",children:ts[a].workarea},a))}),o};return v.jsxs(pW,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(Yo(o))},children:[v.jsx("div",{className:"app-tabs-list",children:r()}),v.jsx(mW,{className:"app-tabs-panels",children:t?v.jsx(zAe,{}):i()})]})}var WRe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Ky(e,t){var n=URe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function URe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=WRe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var GRe=[".DS_Store","Thumbs.db"];function qRe(e){return S0(this,void 0,void 0,function(){return x0(this,function(t){return gS(e)&&YRe(e.dataTransfer)?[2,QRe(e.dataTransfer,e.type)]:KRe(e)?[2,XRe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,ZRe(e)]:[2,[]]})})}function YRe(e){return gS(e)}function KRe(e){return gS(e)&&gS(e.target)}function gS(e){return typeof e=="object"&&e!==null}function XRe(e){return o_(e.target.files).map(function(t){return Ky(t)})}function ZRe(e){return S0(this,void 0,void 0,function(){var t;return x0(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Ky(r)})]}})})}function QRe(e,t){return S0(this,void 0,void 0,function(){var n,r;return x0(this,function(i){switch(i.label){case 0:return e.items?(n=o_(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(JRe))]):[3,2];case 1:return r=i.sent(),[2,yN(aK(r))];case 2:return[2,yN(o_(e.files).map(function(o){return Ky(o)}))]}})})}function yN(e){return e.filter(function(t){return GRe.indexOf(t.name)===-1})}function o_(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,CN(n)];if(e.sizen)return[!1,CN(n)]}return[!0,null]}function Ch(e){return e!=null}function gDe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=cK(l,n),d=cy(u,1),h=d[0],m=dK(l,r,i),y=cy(m,1),b=y[0],x=s?s(l):null;return h&&b&&!x})}function mS(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function e4(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function kN(e){e.preventDefault()}function mDe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function vDe(e){return e.indexOf("Edge/")!==-1}function yDe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return mDe(e)||vDe(e)}function Dl(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DDe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var hT=w.forwardRef(function(e,t){var n=e.children,r=vS(e,_De),i=mK(r),o=i.open,a=vS(i,kDe);return w.useImperativeHandle(t,function(){return{open:o}},[o]),N.createElement(w.Fragment,null,n(_r(_r({},a),{},{open:o})))});hT.displayName="Dropzone";var gK={disabled:!1,getFilesFromEvent:qRe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};hT.defaultProps=gK;hT.propTypes={children:jn.func,accept:jn.objectOf(jn.arrayOf(jn.string)),multiple:jn.bool,preventDropOnDocument:jn.bool,noClick:jn.bool,noKeyboard:jn.bool,noDrag:jn.bool,noDragEventsBubbling:jn.bool,minSize:jn.number,maxSize:jn.number,maxFiles:jn.number,disabled:jn.bool,getFilesFromEvent:jn.func,onFileDialogCancel:jn.func,onFileDialogOpen:jn.func,useFsAccessApi:jn.bool,autoFocus:jn.bool,onDragEnter:jn.func,onDragLeave:jn.func,onDragOver:jn.func,onDrop:jn.func,onDropAccepted:jn.func,onDropRejected:jn.func,onError:jn.func,validator:jn.func};var u_={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function mK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_r(_r({},gK),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,h=t.onDragOver,m=t.onDrop,v=t.onDropAccepted,b=t.onDropRejected,S=t.onFileDialogCancel,_=t.onFileDialogOpen,E=t.useFsAccessApi,k=t.autoFocus,T=t.preventDropOnDocument,A=t.noClick,M=t.noKeyboard,R=t.noDrag,D=t.noDragEventsBubbling,j=t.onError,z=t.validator,H=w.useMemo(function(){return xDe(n)},[n]),K=w.useMemo(function(){return SDe(n)},[n]),te=w.useMemo(function(){return typeof _=="function"?_:EN},[_]),G=w.useMemo(function(){return typeof S=="function"?S:EN},[S]),$=w.useRef(null),W=w.useRef(null),X=w.useReducer(NDe,u_),Z=KC(X,2),U=Z[0],Q=Z[1],re=U.isFocused,fe=U.isFileDialogActive,Ee=w.useRef(typeof window<"u"&&window.isSecureContext&&E&&bDe()),be=function(){!Ee.current&&fe&&setTimeout(function(){if(W.current){var Ne=W.current.files;Ne.length||(Q({type:"closeDialog"}),G())}},300)};w.useEffect(function(){return window.addEventListener("focus",be,!1),function(){window.removeEventListener("focus",be,!1)}},[W,fe,G,Ee]);var ye=w.useRef([]),Fe=function(Ne){$.current&&$.current.contains(Ne.target)||(Ne.preventDefault(),ye.current=[])};w.useEffect(function(){return T&&(document.addEventListener("dragover",_N,!1),document.addEventListener("drop",Fe,!1)),function(){T&&(document.removeEventListener("dragover",_N),document.removeEventListener("drop",Fe))}},[$,T]),w.useEffect(function(){return!r&&k&&$.current&&$.current.focus(),function(){}},[$,k,r]);var Me=w.useCallback(function(xe){j?j(xe):console.error(xe)},[j]),rt=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe),ye.current=[].concat(TDe(ye.current),[xe.target]),e4(xe)&&Promise.resolve(i(xe)).then(function(Ne){if(!(mS(xe)&&!D)){var Ct=Ne.length,Dt=Ct>0&&gDe({files:Ne,accept:H,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:z}),Te=Ct>0&&!Dt;Q({isDragAccept:Dt,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),u&&u(xe)}}).catch(function(Ne){return Me(Ne)})},[i,u,Me,D,H,a,o,s,l,z]),Ve=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe);var Ne=e4(xe);if(Ne&&xe.dataTransfer)try{xe.dataTransfer.dropEffect="copy"}catch{}return Ne&&h&&h(xe),!1},[h,D]),je=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe);var Ne=ye.current.filter(function(Dt){return $.current&&$.current.contains(Dt)}),Ct=Ne.indexOf(xe.target);Ct!==-1&&Ne.splice(Ct,1),ye.current=Ne,!(Ne.length>0)&&(Q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),e4(xe)&&d&&d(xe))},[$,d,D]),wt=w.useCallback(function(xe,Ne){var Ct=[],Dt=[];xe.forEach(function(Te){var At=cK(Te,H),ze=KC(At,2),vt=ze[0],nn=ze[1],Rn=dK(Te,a,o),Ze=KC(Rn,2),xt=Ze[0],ht=Ze[1],Ht=z?z(Te):null;if(vt&&xt&&!Ht)Ct.push(Te);else{var rn=[nn,ht];Ht&&(rn=rn.concat(Ht)),Dt.push({file:Te,errors:rn.filter(function(pr){return pr})})}}),(!s&&Ct.length>1||s&&l>=1&&Ct.length>l)&&(Ct.forEach(function(Te){Dt.push({file:Te,errors:[pDe]})}),Ct.splice(0)),Q({acceptedFiles:Ct,fileRejections:Dt,type:"setFiles"}),m&&m(Ct,Dt,Ne),Dt.length>0&&b&&b(Dt,Ne),Ct.length>0&&v&&v(Ct,Ne)},[Q,s,H,a,o,l,m,v,b,z]),Be=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe),ye.current=[],e4(xe)&&Promise.resolve(i(xe)).then(function(Ne){mS(xe)&&!D||wt(Ne,xe)}).catch(function(Ne){return Me(Ne)}),Q({type:"reset"})},[i,wt,Me,D]),at=w.useCallback(function(){if(Ee.current){Q({type:"openDialog"}),te();var xe={multiple:s,types:K};window.showOpenFilePicker(xe).then(function(Ne){return i(Ne)}).then(function(Ne){wt(Ne,null),Q({type:"closeDialog"})}).catch(function(Ne){wDe(Ne)?(G(Ne),Q({type:"closeDialog"})):CDe(Ne)?(Ee.current=!1,W.current?(W.current.value=null,W.current.click()):Me(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Me(Ne)});return}W.current&&(Q({type:"openDialog"}),te(),W.current.value=null,W.current.click())},[Q,te,G,E,wt,Me,K,s]),bt=w.useCallback(function(xe){!$.current||!$.current.isEqualNode(xe.target)||(xe.key===" "||xe.key==="Enter"||xe.keyCode===32||xe.keyCode===13)&&(xe.preventDefault(),at())},[$,at]),Le=w.useCallback(function(){Q({type:"focus"})},[]),ut=w.useCallback(function(){Q({type:"blur"})},[]),Mt=w.useCallback(function(){A||(yDe()?setTimeout(at,0):at())},[A,at]),ct=function(Ne){return r?null:Ne},_t=function(Ne){return M?null:ct(Ne)},un=function(Ne){return R?null:ct(Ne)},ae=function(Ne){D&&Ne.stopPropagation()},De=w.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=xe.refKey,Ct=Ne===void 0?"ref":Ne,Dt=xe.role,Te=xe.onKeyDown,At=xe.onFocus,ze=xe.onBlur,vt=xe.onClick,nn=xe.onDragEnter,Rn=xe.onDragOver,Ze=xe.onDragLeave,xt=xe.onDrop,ht=vS(xe,EDe);return _r(_r(l_({onKeyDown:_t(Dl(Te,bt)),onFocus:_t(Dl(At,Le)),onBlur:_t(Dl(ze,ut)),onClick:ct(Dl(vt,Mt)),onDragEnter:un(Dl(nn,rt)),onDragOver:un(Dl(Rn,Ve)),onDragLeave:un(Dl(Ze,je)),onDrop:un(Dl(xt,Be)),role:typeof Dt=="string"&&Dt!==""?Dt:"presentation"},Ct,$),!r&&!M?{tabIndex:0}:{}),ht)}},[$,bt,Le,ut,Mt,rt,Ve,je,Be,M,R,r]),Ke=w.useCallback(function(xe){xe.stopPropagation()},[]),Xe=w.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=xe.refKey,Ct=Ne===void 0?"ref":Ne,Dt=xe.onChange,Te=xe.onClick,At=vS(xe,PDe),ze=l_({accept:H,multiple:s,type:"file",style:{display:"none"},onChange:ct(Dl(Dt,Be)),onClick:ct(Dl(Te,Ke)),tabIndex:-1},Ct,W);return _r(_r({},ze),At)}},[W,n,s,Be,r]);return _r(_r({},U),{},{isFocused:re&&!r,getRootProps:De,getInputProps:Xe,rootRef:$,inputRef:W,open:ct(at)})}function NDe(e,t){switch(t.type){case"focus":return _r(_r({},e),{},{isFocused:!0});case"blur":return _r(_r({},e),{},{isFocused:!1});case"openDialog":return _r(_r({},u_),{},{isFileDialogActive:!0});case"closeDialog":return _r(_r({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _r(_r({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _r(_r({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return _r({},u_);default:return e}}function EN(){}const jDe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return et("esc",()=>{i(!1)}),y.jsxs("div",{className:"dropzone-container",children:[t&&y.jsx("div",{className:"dropzone-overlay is-drag-accept",children:y.jsxs(jh,{size:"lg",children:["Upload Image",r]})}),n&&y.jsxs("div",{className:"dropzone-overlay is-drag-reject",children:[y.jsx(jh,{size:"lg",children:"Invalid Upload"}),y.jsx(jh,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},BDe=e=>{const{children:t}=e,n=Oe(),r=he(Mr),i=By({}),{t:o}=Ue(),[a,s]=w.useState(!1),{setOpenUploader:l}=PP(),u=w.useCallback(T=>{s(!0);const A=T.errors.reduce((M,R)=>`${M} -${R.message}`,"");i({title:o("toast:uploadFailed"),description:A,status:"error",isClosable:!0})},[o,i]),d=w.useCallback(async T=>{n(bD({imageFile:T}))},[n]),h=w.useCallback((T,A)=>{A.forEach(M=>{u(M)}),T.forEach(M=>{d(M)})},[d,u]),{getRootProps:m,getInputProps:v,isDragAccept:b,isDragReject:S,isDragActive:_,open:E}=mK({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:()=>s(!0),maxFiles:1});l(E),w.useEffect(()=>{const T=A=>{var j;const M=(j=A.clipboardData)==null?void 0:j.items;if(!M)return;const R=[];for(const z of M)z.kind==="file"&&["image/png","image/jpg"].includes(z.type)&&R.push(z);if(!R.length)return;if(A.stopImmediatePropagation(),R.length>1){i({description:o("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=R[0].getAsFile();if(!D){i({description:o("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(bD({imageFile:D}))};return document.addEventListener("paste",T),()=>{document.removeEventListener("paste",T)}},[o,n,i,r]);const k=["img2img","unifiedCanvas"].includes(r)?` to ${ts[r].tooltip}`:"";return y.jsx(EP.Provider,{value:E,children:y.jsxs("div",{...m({style:{}}),onKeyDown:T=>{T.key},children:[y.jsx("input",{...v()}),t,_&&a&&y.jsx(jDe,{isDragAccept:b,isDragReject:S,overlaySecondaryText:k,setIsHandlingUpload:s})]})})},$De=lt(or,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),FDe=lt(or,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),zDe=()=>{const e=Oe(),t=he($De),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=he(FDe),[o,a]=w.useState(!0),s=w.useRef(null);w.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(ZU()),e(LC(!n))};et("`",()=>{e(LC(!n))},[n]),et("esc",()=>{e(LC(!1))});const u=()=>{s.current&&o&&s.current.scrollTop{const{timestamp:m,message:v,level:b}=d;return y.jsxs("div",{className:`console-entry console-${b}-color`,children:[y.jsxs("p",{className:"console-timestamp",children:[m,":"]}),y.jsx("p",{className:"console-message",children:v})]},h)})})}),n&&y.jsx(uo,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:y.jsx(us,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:y.jsx(gEe,{}),onClick:()=>a(!o)})}),y.jsx(uo,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:y.jsx(us,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?y.jsx(AEe,{}):y.jsx(Eq,{}),onClick:l})})]})},HDe=lt(or,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VDe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=he(HDe),i=t?Math.round(t*100/n):0;return y.jsx(YV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function WDe(e){const{title:t,hotkey:n,description:r}=e;return y.jsxs("div",{className:"hotkey-modal-item",children:[y.jsxs("div",{className:"hotkey-info",children:[y.jsx("p",{className:"hotkey-title",children:t}),r&&y.jsx("p",{className:"hotkey-description",children:r})]}),y.jsx("div",{className:"hotkey-key",children:n})]})}function UDe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Gh(),{t:i}=Ue(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=d=>{const h=[];return d.forEach((m,v)=>{h.push(y.jsx(WDe,{title:m.title,description:m.desc,hotkey:m.hotkey},v))}),y.jsx("div",{className:"hotkey-modal-category",children:h})};return y.jsxs(y.Fragment,{children:[w.cloneElement(e,{onClick:n}),y.jsxs(Xd,{isOpen:t,onClose:r,children:[y.jsx(Zd,{}),y.jsxs(Jh,{className:" modal hotkeys-modal",children:[y.jsx(Iy,{className:"modal-close-btn"}),y.jsx("h1",{children:"Keyboard Shorcuts"}),y.jsx("div",{className:"hotkeys-modal-items",children:y.jsxs(dk,{allowMultiple:!0,children:[y.jsxs(Kg,{children:[y.jsxs(qg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:appHotkeys")}),y.jsx(Yg,{})]}),y.jsx(Xg,{children:u(o)})]}),y.jsxs(Kg,{children:[y.jsxs(qg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:generalHotkeys")}),y.jsx(Yg,{})]}),y.jsx(Xg,{children:u(a)})]}),y.jsxs(Kg,{children:[y.jsxs(qg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:galleryHotkeys")}),y.jsx(Yg,{})]}),y.jsx(Xg,{children:u(s)})]}),y.jsxs(Kg,{children:[y.jsxs(qg,{className:"hotkeys-modal-button",children:[y.jsx("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),y.jsx(Yg,{})]}),y.jsx(Xg,{children:u(l)})]})]})})]})]})]})}var PN=Array.isArray,TN=Object.keys,GDe=Object.prototype.hasOwnProperty,qDe=typeof Element<"u";function c_(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=PN(e),r=PN(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!c_(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var h=TN(e);if(o=h.length,o!==TN(t).length)return!1;for(i=o;i--!==0;)if(!GDe.call(t,h[i]))return!1;if(qDe&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=h[i],!(a==="_owner"&&e.$$typeof)&&!c_(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var yd=function(t,n){try{return c_(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},YDe=function(t){return KDe(t)&&!XDe(t)};function KDe(e){return!!e&&typeof e=="object"}function XDe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||JDe(e)}var ZDe=typeof Symbol=="function"&&Symbol.for,QDe=ZDe?Symbol.for("react.element"):60103;function JDe(e){return e.$$typeof===QDe}function eNe(e){return Array.isArray(e)?[]:{}}function yS(e,t){return t.clone!==!1&&t.isMergeableObject(e)?dy(eNe(e),e,t):e}function tNe(e,t,n){return e.concat(t).map(function(r){return yS(r,n)})}function nNe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=yS(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=yS(t[i],n):r[i]=dy(e[i],t[i],n)}),r}function dy(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||tNe,n.isMergeableObject=n.isMergeableObject||YDe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):nNe(e,t,n):yS(t,n)}dy.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return dy(r,i,n)},{})};var d_=dy,rNe=typeof global=="object"&&global&&global.Object===Object&&global;const vK=rNe;var iNe=typeof self=="object"&&self&&self.Object===Object&&self,oNe=vK||iNe||Function("return this")();const yu=oNe;var aNe=yu.Symbol;const nf=aNe;var yK=Object.prototype,sNe=yK.hasOwnProperty,lNe=yK.toString,vv=nf?nf.toStringTag:void 0;function uNe(e){var t=sNe.call(e,vv),n=e[vv];try{e[vv]=void 0;var r=!0}catch{}var i=lNe.call(e);return r&&(t?e[vv]=n:delete e[vv]),i}var cNe=Object.prototype,dNe=cNe.toString;function fNe(e){return dNe.call(e)}var hNe="[object Null]",pNe="[object Undefined]",LN=nf?nf.toStringTag:void 0;function _p(e){return e==null?e===void 0?pNe:hNe:LN&&LN in Object(e)?uNe(e):fNe(e)}function bK(e,t){return function(n){return e(t(n))}}var gNe=bK(Object.getPrototypeOf,Object);const pT=gNe;function kp(e){return e!=null&&typeof e=="object"}var mNe="[object Object]",vNe=Function.prototype,yNe=Object.prototype,SK=vNe.toString,bNe=yNe.hasOwnProperty,SNe=SK.call(Object);function AN(e){if(!kp(e)||_p(e)!=mNe)return!1;var t=pT(e);if(t===null)return!0;var n=bNe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&SK.call(n)==SNe}function xNe(){this.__data__=[],this.size=0}function xK(e,t){return e===t||e!==e&&t!==t}function gw(e,t){for(var n=e.length;n--;)if(xK(e[n][0],t))return n;return-1}var wNe=Array.prototype,CNe=wNe.splice;function _Ne(e){var t=this.__data__,n=gw(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():CNe.call(t,n,1),--this.size,!0}function kNe(e){var t=this.__data__,n=gw(t,e);return n<0?void 0:t[n][1]}function ENe(e){return gw(this.__data__,e)>-1}function PNe(e,t){var n=this.__data__,r=gw(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function bc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=Rje}var Dje="[object Arguments]",Nje="[object Array]",jje="[object Boolean]",Bje="[object Date]",$je="[object Error]",Fje="[object Function]",zje="[object Map]",Hje="[object Number]",Vje="[object Object]",Wje="[object RegExp]",Uje="[object Set]",Gje="[object String]",qje="[object WeakMap]",Yje="[object ArrayBuffer]",Kje="[object DataView]",Xje="[object Float32Array]",Zje="[object Float64Array]",Qje="[object Int8Array]",Jje="[object Int16Array]",eBe="[object Int32Array]",tBe="[object Uint8Array]",nBe="[object Uint8ClampedArray]",rBe="[object Uint16Array]",iBe="[object Uint32Array]",lr={};lr[Xje]=lr[Zje]=lr[Qje]=lr[Jje]=lr[eBe]=lr[tBe]=lr[nBe]=lr[rBe]=lr[iBe]=!0;lr[Dje]=lr[Nje]=lr[Yje]=lr[jje]=lr[Kje]=lr[Bje]=lr[$je]=lr[Fje]=lr[zje]=lr[Hje]=lr[Vje]=lr[Wje]=lr[Uje]=lr[Gje]=lr[qje]=!1;function oBe(e){return kp(e)&&TK(e.length)&&!!lr[_p(e)]}function gT(e){return function(t){return e(t)}}var LK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,m2=LK&&typeof module=="object"&&module&&!module.nodeType&&module,aBe=m2&&m2.exports===LK,ZC=aBe&&vK.process,sBe=function(){try{var e=m2&&m2.require&&m2.require("util").types;return e||ZC&&ZC.binding&&ZC.binding("util")}catch{}}();const f0=sBe;var NN=f0&&f0.isTypedArray,lBe=NN?gT(NN):oBe;const uBe=lBe;var cBe=Object.prototype,dBe=cBe.hasOwnProperty;function AK(e,t){var n=Zy(e),r=!n&&kje(e),i=!n&&!r&&PK(e),o=!n&&!r&&!i&&uBe(e),a=n||r||i||o,s=a?Sje(e.length,String):[],l=s.length;for(var u in e)(t||dBe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ije(u,l)))&&s.push(u);return s}var fBe=Object.prototype;function mT(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||fBe;return e===n}var hBe=bK(Object.keys,Object);const pBe=hBe;var gBe=Object.prototype,mBe=gBe.hasOwnProperty;function vBe(e){if(!mT(e))return pBe(e);var t=[];for(var n in Object(e))mBe.call(e,n)&&n!="constructor"&&t.push(n);return t}function OK(e){return e!=null&&TK(e.length)&&!wK(e)}function vT(e){return OK(e)?AK(e):vBe(e)}function yBe(e,t){return e&&vw(t,vT(t),e)}function bBe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var SBe=Object.prototype,xBe=SBe.hasOwnProperty;function wBe(e){if(!Xy(e))return bBe(e);var t=mT(e),n=[];for(var r in e)r=="constructor"&&(t||!xBe.call(e,r))||n.push(r);return n}function yT(e){return OK(e)?AK(e,!0):wBe(e)}function CBe(e,t){return e&&vw(t,yT(t),e)}var MK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jN=MK&&typeof module=="object"&&module&&!module.nodeType&&module,_Be=jN&&jN.exports===MK,BN=_Be?yu.Buffer:void 0,$N=BN?BN.allocUnsafe:void 0;function kBe(e,t){if(t)return e.slice();var n=e.length,r=$N?$N(n):new e.constructor(n);return e.copy(r),r}function IK(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function tj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var nj=function(t){return Array.isArray(t)&&t.length===0},qo=function(t){return typeof t=="function"},yw=function(t){return t!==null&&typeof t=="object"},CFe=function(t){return String(Math.floor(Number(t)))===t},QC=function(t){return Object.prototype.toString.call(t)==="[object String]"},WK=function(t){return w.Children.count(t)===0},JC=function(t){return yw(t)&&qo(t.then)};function Wi(e,t,n,r){r===void 0&&(r=0);for(var i=VK(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function UK(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?De.map(function(Xe){return j(Xe,Wi(ae,Xe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ke).then(function(Xe){return Xe.reduce(function(xe,Ne,Ct){return Ne==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ne&&(xe=au(xe,De[Ct],Ne)),xe},{})})},[j]),H=w.useCallback(function(ae){return Promise.all([z(ae),m.validationSchema?D(ae):{},m.validate?R(ae):{}]).then(function(De){var Ke=De[0],Xe=De[1],xe=De[2],Ne=d_.all([Ke,Xe,xe],{arrayMerge:LFe});return Ne})},[m.validate,m.validationSchema,z,R,D]),K=Xa(function(ae){return ae===void 0&&(ae=A.values),M({type:"SET_ISVALIDATING",payload:!0}),H(ae).then(function(De){return E.current&&(M({type:"SET_ISVALIDATING",payload:!1}),M({type:"SET_ERRORS",payload:De})),De})});w.useEffect(function(){a&&E.current===!0&&yd(v.current,m.initialValues)&&K(v.current)},[a,K]);var te=w.useCallback(function(ae){var De=ae&&ae.values?ae.values:v.current,Ke=ae&&ae.errors?ae.errors:b.current?b.current:m.initialErrors||{},Xe=ae&&ae.touched?ae.touched:S.current?S.current:m.initialTouched||{},xe=ae&&ae.status?ae.status:_.current?_.current:m.initialStatus;v.current=De,b.current=Ke,S.current=Xe,_.current=xe;var Ne=function(){M({type:"RESET_FORM",payload:{isSubmitting:!!ae&&!!ae.isSubmitting,errors:Ke,touched:Xe,status:xe,values:De,isValidating:!!ae&&!!ae.isValidating,submitCount:ae&&ae.submitCount&&typeof ae.submitCount=="number"?ae.submitCount:0}})};if(m.onReset){var Ct=m.onReset(A.values,Be);JC(Ct)?Ct.then(Ne):Ne()}else Ne()},[m.initialErrors,m.initialStatus,m.initialTouched]);w.useEffect(function(){E.current===!0&&!yd(v.current,m.initialValues)&&(u&&(v.current=m.initialValues,te()),a&&K(v.current))},[u,m.initialValues,te,a,K]),w.useEffect(function(){u&&E.current===!0&&!yd(b.current,m.initialErrors)&&(b.current=m.initialErrors||dh,M({type:"SET_ERRORS",payload:m.initialErrors||dh}))},[u,m.initialErrors]),w.useEffect(function(){u&&E.current===!0&&!yd(S.current,m.initialTouched)&&(S.current=m.initialTouched||t4,M({type:"SET_TOUCHED",payload:m.initialTouched||t4}))},[u,m.initialTouched]),w.useEffect(function(){u&&E.current===!0&&!yd(_.current,m.initialStatus)&&(_.current=m.initialStatus,M({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var G=Xa(function(ae){if(k.current[ae]&&qo(k.current[ae].validate)){var De=Wi(A.values,ae),Ke=k.current[ae].validate(De);return JC(Ke)?(M({type:"SET_ISVALIDATING",payload:!0}),Ke.then(function(Xe){return Xe}).then(function(Xe){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Xe}}),M({type:"SET_ISVALIDATING",payload:!1})})):(M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Ke}}),Promise.resolve(Ke))}else if(m.validationSchema)return M({type:"SET_ISVALIDATING",payload:!0}),D(A.values,ae).then(function(Xe){return Xe}).then(function(Xe){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Xe[ae]}}),M({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),$=w.useCallback(function(ae,De){var Ke=De.validate;k.current[ae]={validate:Ke}},[]),W=w.useCallback(function(ae){delete k.current[ae]},[]),X=Xa(function(ae,De){M({type:"SET_TOUCHED",payload:ae});var Ke=De===void 0?i:De;return Ke?K(A.values):Promise.resolve()}),Z=w.useCallback(function(ae){M({type:"SET_ERRORS",payload:ae})},[]),U=Xa(function(ae,De){var Ke=qo(ae)?ae(A.values):ae;M({type:"SET_VALUES",payload:Ke});var Xe=De===void 0?n:De;return Xe?K(Ke):Promise.resolve()}),Q=w.useCallback(function(ae,De){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:De}})},[]),re=Xa(function(ae,De,Ke){M({type:"SET_FIELD_VALUE",payload:{field:ae,value:De}});var Xe=Ke===void 0?n:Ke;return Xe?K(au(A.values,ae,De)):Promise.resolve()}),fe=w.useCallback(function(ae,De){var Ke=De,Xe=ae,xe;if(!QC(ae)){ae.persist&&ae.persist();var Ne=ae.target?ae.target:ae.currentTarget,Ct=Ne.type,Dt=Ne.name,Te=Ne.id,At=Ne.value,ze=Ne.checked,vt=Ne.outerHTML,nn=Ne.options,Rn=Ne.multiple;Ke=De||Dt||Te,Xe=/number|range/.test(Ct)?(xe=parseFloat(At),isNaN(xe)?"":xe):/checkbox/.test(Ct)?OFe(Wi(A.values,Ke),ze,At):nn&&Rn?AFe(nn):At}Ke&&re(Ke,Xe)},[re,A.values]),Ee=Xa(function(ae){if(QC(ae))return function(De){return fe(De,ae)};fe(ae)}),be=Xa(function(ae,De,Ke){De===void 0&&(De=!0),M({type:"SET_FIELD_TOUCHED",payload:{field:ae,value:De}});var Xe=Ke===void 0?i:Ke;return Xe?K(A.values):Promise.resolve()}),ye=w.useCallback(function(ae,De){ae.persist&&ae.persist();var Ke=ae.target,Xe=Ke.name,xe=Ke.id,Ne=Ke.outerHTML,Ct=De||Xe||xe;be(Ct,!0)},[be]),Fe=Xa(function(ae){if(QC(ae))return function(De){return ye(De,ae)};ye(ae)}),Me=w.useCallback(function(ae){qo(ae)?M({type:"SET_FORMIK_STATE",payload:ae}):M({type:"SET_FORMIK_STATE",payload:function(){return ae}})},[]),rt=w.useCallback(function(ae){M({type:"SET_STATUS",payload:ae})},[]),Ve=w.useCallback(function(ae){M({type:"SET_ISSUBMITTING",payload:ae})},[]),je=Xa(function(){return M({type:"SUBMIT_ATTEMPT"}),K().then(function(ae){var De=ae instanceof Error,Ke=!De&&Object.keys(ae).length===0;if(Ke){var Xe;try{if(Xe=at(),Xe===void 0)return}catch(xe){throw xe}return Promise.resolve(Xe).then(function(xe){return E.current&&M({type:"SUBMIT_SUCCESS"}),xe}).catch(function(xe){if(E.current)throw M({type:"SUBMIT_FAILURE"}),xe})}else if(E.current&&(M({type:"SUBMIT_FAILURE"}),De))throw ae})}),wt=Xa(function(ae){ae&&ae.preventDefault&&qo(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&qo(ae.stopPropagation)&&ae.stopPropagation(),je().catch(function(De){console.warn("Warning: An unhandled error was caught from submitForm()",De)})}),Be={resetForm:te,validateForm:K,validateField:G,setErrors:Z,setFieldError:Q,setFieldTouched:be,setFieldValue:re,setStatus:rt,setSubmitting:Ve,setTouched:X,setValues:U,setFormikState:Me,submitForm:je},at=Xa(function(){return d(A.values,Be)}),bt=Xa(function(ae){ae&&ae.preventDefault&&qo(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&qo(ae.stopPropagation)&&ae.stopPropagation(),te()}),Le=w.useCallback(function(ae){return{value:Wi(A.values,ae),error:Wi(A.errors,ae),touched:!!Wi(A.touched,ae),initialValue:Wi(v.current,ae),initialTouched:!!Wi(S.current,ae),initialError:Wi(b.current,ae)}},[A.errors,A.touched,A.values]),ut=w.useCallback(function(ae){return{setValue:function(Ke,Xe){return re(ae,Ke,Xe)},setTouched:function(Ke,Xe){return be(ae,Ke,Xe)},setError:function(Ke){return Q(ae,Ke)}}},[re,be,Q]),Mt=w.useCallback(function(ae){var De=yw(ae),Ke=De?ae.name:ae,Xe=Wi(A.values,Ke),xe={name:Ke,value:Xe,onChange:Ee,onBlur:Fe};if(De){var Ne=ae.type,Ct=ae.value,Dt=ae.as,Te=ae.multiple;Ne==="checkbox"?Ct===void 0?xe.checked=!!Xe:(xe.checked=!!(Array.isArray(Xe)&&~Xe.indexOf(Ct)),xe.value=Ct):Ne==="radio"?(xe.checked=Xe===Ct,xe.value=Ct):Dt==="select"&&Te&&(xe.value=xe.value||[],xe.multiple=!0)}return xe},[Fe,Ee,A.values]),ct=w.useMemo(function(){return!yd(v.current,A.values)},[v.current,A.values]),_t=w.useMemo(function(){return typeof s<"u"?ct?A.errors&&Object.keys(A.errors).length===0:s!==!1&&qo(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,ct,A.errors,m]),un=qn({},A,{initialValues:v.current,initialErrors:b.current,initialTouched:S.current,initialStatus:_.current,handleBlur:Fe,handleChange:Ee,handleReset:bt,handleSubmit:wt,resetForm:te,setErrors:Z,setFormikState:Me,setFieldTouched:be,setFieldValue:re,setFieldError:Q,setStatus:rt,setSubmitting:Ve,setTouched:X,setValues:U,submitForm:je,validateForm:K,validateField:G,isValid:_t,dirty:ct,unregisterField:W,registerField:$,getFieldProps:Mt,getFieldMeta:Le,getFieldHelpers:ut,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return un}function Qy(e){var t=EFe(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return w.useImperativeHandle(o,function(){return t}),w.createElement(_Fe,{value:t},n?w.createElement(n,t):i?i(t):r?qo(r)?r(t):WK(r)?null:w.Children.only(r):null)}function PFe(e){var t={};if(e.inner){if(e.inner.length===0)return au(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Wi(t,a.path)||(t=au(t,a.path,a.message))}}return t}function TFe(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=m_(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function m_(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||AN(i)?m_(i):i!==""?i:void 0}):AN(e[r])?t[r]=m_(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function LFe(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?d_(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=d_(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function AFe(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function OFe(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var MFe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function Xa(e){var t=w.useRef(e);return MFe(function(){t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(qn({},t,{length:n+1}))}else return[]},jFe=function(e){wFe(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,d=l.formik.setFormikState;d(function(h){var m=typeof s=="function"?s:o,v=typeof a=="function"?a:o,b=au(h.values,u,o(Wi(h.values,u))),S=s?m(Wi(h.errors,u)):void 0,_=a?v(Wi(h.touched,u)):void 0;return nj(S)&&(S=void 0),nj(_)&&(_=void 0),qn({},h,{values:b,errors:s?au(h.errors,u,S):h.errors,touched:a?au(h.touched,u,_):h.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(h0(a),[xFe(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return DFe(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return RFe(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return e7(s,o,a)},function(s){return e7(s,o,null)},function(s){return e7(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return NFe(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(tj(i)),i.pop=i.pop.bind(tj(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!yd(Wi(i.formik.values,i.name),Wi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?h0(a):[];return o||(o=s[i]),qo(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,d=o.formik,h=Oh(d,["validate","validationSchema"]),m=qn({},i,{form:h,name:u});return a?w.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):WK(l)?null:w.Children.only(l):null},t}(w.Component);jFe.defaultProps={validateOnChange:!0};function BFe(e){const{model:t}=e,r=he(S=>S.system.model_list)[t],[i,o]=w.useState(""),[a,s]=w.useState("1"),l=Oe(),{t:u}=Ue(),d=he(S=>S.system.isProcessing),h=he(S=>S.system.isConnected),m=()=>{s("1"),o("")};w.useEffect(()=>{m()},[t]);const v=()=>{m()},b=()=>{const S={name:t,model_type:a,custom_config:a==="custom"&&i!==""?i:null};l(ns(!0)),l(n_e(S)),m()};return y.jsx(fw,{title:`${u("modelmanager:convert")} ${t}`,acceptCallback:b,cancelCallback:v,acceptButtonText:`${u("modelmanager:convert")}`,triggerComponent:y.jsxs(nr,{size:"sm","aria-label":u("modelmanager:convertToDiffusers"),isDisabled:r.status==="active"||d||!h,className:" modal-close-btn",marginRight:"2rem",children:["🧨 ",u("modelmanager:convertToDiffusers")]}),motionPreset:"slideInBottom",children:y.jsxs(Ge,{flexDirection:"column",rowGap:4,children:[y.jsx(Jt,{children:u("modelmanager:convertToDiffusersHelpText1")}),y.jsxs(xF,{children:[y.jsx(Sv,{children:u("modelmanager:convertToDiffusersHelpText2")}),y.jsx(Sv,{children:u("modelmanager:convertToDiffusersHelpText3")}),y.jsx(Sv,{children:u("modelmanager:convertToDiffusersHelpText4")}),y.jsx(Sv,{children:u("modelmanager:convertToDiffusersHelpText5")})]}),y.jsx(Jt,{children:u("modelmanager:convertToDiffusersHelpText6")}),y.jsx(XV,{value:a,onChange:S=>s(S),defaultValue:"1",name:"model_type",children:y.jsxs(Ge,{gap:4,children:[y.jsx(Ev,{value:"1",children:u("modelmanager:v1")}),y.jsx(Ev,{value:"2",children:u("modelmanager:v2")}),y.jsx(Ev,{value:"inpainting",children:u("modelmanager:inpainting")}),y.jsx(Ev,{value:"custom",children:u("modelmanager:custom")})]})}),a==="custom"&&y.jsxs(Ge,{flexDirection:"column",rowGap:2,children:[y.jsx(Jt,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:u("modelmanager:pathToCustomConfig")}),y.jsx(br,{value:i,onChange:S=>{S.target.value!==""&&o(S.target.value)},width:"25rem"})]})]})})}const $Fe=lt([or],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),rj=64,ij=2048;function FFe(){const{openModel:e,model_list:t}=he($Fe),n=he(l=>l.system.isProcessing),r=Oe(),{t:i}=Ue(),[o,a]=w.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});w.useEffect(()=>{var l,u,d,h,m,v,b;if(e){const S=ke.pickBy(t,(_,E)=>ke.isEqual(E,e));a({name:e,description:(l=S[e])==null?void 0:l.description,config:(u=S[e])==null?void 0:u.config,weights:(d=S[e])==null?void 0:d.weights,vae:(h=S[e])==null?void 0:h.vae,width:(m=S[e])==null?void 0:m.width,height:(v=S[e])==null?void 0:v.height,default:(b=S[e])==null?void 0:b.default,format:"ckpt"})}},[t,e]);const s=l=>{r(Vy({...l,width:Number(l.width),height:Number(l.height)}))};return e?y.jsxs(Ge,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[y.jsxs(Ge,{alignItems:"center",gap:4,justifyContent:"space-between",children:[y.jsx(Jt,{fontSize:"lg",fontWeight:"bold",children:e}),y.jsx(BFe,{model:e})]}),y.jsx(Ge,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:y.jsx(Qy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>y.jsx("form",{onSubmit:l,children:y.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[y.jsxs(fn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[y.jsx(En,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?y.jsx(cr,{children:u.description}):y.jsx(ur,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.config&&d.config,isRequired:!0,children:[y.jsx(En,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"config",name:"config",type:"text",width:"lg"}),u.config&&d.config?y.jsx(cr,{children:u.config}):y.jsx(ur,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.weights&&d.weights,isRequired:!0,children:[y.jsx(En,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"weights",name:"weights",type:"text",width:"lg"}),u.weights&&d.weights?y.jsx(cr,{children:u.weights}):y.jsx(ur,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.vae&&d.vae,children:[y.jsx(En,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae",name:"vae",type:"text",width:"lg"}),u.vae&&d.vae?y.jsx(cr,{children:u.vae}):y.jsx(ur,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(Ey,{width:"100%",children:[y.jsxs(fn,{isInvalid:!!u.width&&d.width,children:[y.jsx(En,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"width",name:"width",children:({field:h,form:m})=>y.jsx(ia,{id:"width",name:"width",min:rj,max:ij,step:64,value:m.values.width,onChange:v=>m.setFieldValue(h.name,Number(v))})}),u.width&&d.width?y.jsx(cr,{children:u.width}):y.jsx(ur,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.height&&d.height,children:[y.jsx(En,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"height",name:"height",children:({field:h,form:m})=>y.jsx(ia,{id:"height",name:"height",min:rj,max:ij,step:64,value:m.values.height,onChange:v=>m.setFieldValue(h.name,Number(v))})}),u.height&&d.height?y.jsx(cr,{children:u.height}):y.jsx(ur,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):y.jsx(Ge,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:y.jsx(Jt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const zFe=lt([or],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function HFe(){const{openModel:e,model_list:t}=he(zFe),n=he(l=>l.system.isProcessing),r=Oe(),{t:i}=Ue(),[o,a]=w.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});w.useEffect(()=>{var l,u,d,h,m,v,b,S,_,E,k,T,A,M,R,D;if(e){const j=ke.pickBy(t,(z,H)=>ke.isEqual(H,e));a({name:e,description:(l=j[e])==null?void 0:l.description,path:(u=j[e])!=null&&u.path&&((d=j[e])==null?void 0:d.path)!=="None"?(h=j[e])==null?void 0:h.path:"",repo_id:(m=j[e])!=null&&m.repo_id&&((v=j[e])==null?void 0:v.repo_id)!=="None"?(b=j[e])==null?void 0:b.repo_id:"",vae:{repo_id:(_=(S=j[e])==null?void 0:S.vae)!=null&&_.repo_id?(k=(E=j[e])==null?void 0:E.vae)==null?void 0:k.repo_id:"",path:(A=(T=j[e])==null?void 0:T.vae)!=null&&A.path?(R=(M=j[e])==null?void 0:M.vae)==null?void 0:R.path:""},default:(D=j[e])==null?void 0:D.default,format:"diffusers"})}},[t,e]);const s=l=>{const u=l;l.path===""&&delete u.path,l.repo_id===""&&delete u.repo_id,l.vae.path===""&&delete u.vae.path,l.vae.repo_id===""&&delete u.vae.repo_id,r(Vy(l))};return e?y.jsxs(Ge,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[y.jsx(Ge,{alignItems:"center",children:y.jsx(Jt,{fontSize:"lg",fontWeight:"bold",children:e})}),y.jsx(Ge,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:y.jsx(Qy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>{var h,m,v,b,S,_,E,k,T,A;return y.jsx("form",{onSubmit:l,children:y.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[y.jsxs(fn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[y.jsx(En,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?y.jsx(cr,{children:u.description}):y.jsx(ur,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.path&&d.path,isRequired:!0,children:[y.jsx(En,{htmlFor:"path",fontSize:"sm",children:i("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"path",name:"path",type:"text",width:"lg"}),u.path&&d.path?y.jsx(cr,{children:u.path}):y.jsx(ur,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!u.repo_id&&d.repo_id,children:[y.jsx(En,{htmlFor:"repo_id",fontSize:"sm",children:i("modelmanager:repo_id")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"repo_id",name:"repo_id",type:"text",width:"lg"}),u.repo_id&&d.repo_id?y.jsx(cr,{children:u.repo_id}):y.jsx(ur,{margin:0,children:i("modelmanager:repoIDValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!((h=u.vae)!=null&&h.path)&&((m=d.vae)==null?void 0:m.path),children:[y.jsx(En,{htmlFor:"vae.path",fontSize:"sm",children:i("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae.path",name:"vae.path",type:"text",width:"lg"}),(v=u.vae)!=null&&v.path&&((b=d.vae)!=null&&b.path)?y.jsx(cr,{children:(S=u.vae)==null?void 0:S.path}):y.jsx(ur,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!((_=u.vae)!=null&&_.repo_id)&&((E=d.vae)==null?void 0:E.repo_id),children:[y.jsx(En,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelmanager:vaeRepoID")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"lg"}),(k=u.vae)!=null&&k.repo_id&&((T=d.vae)!=null&&T.repo_id)?y.jsx(cr,{children:(A=u.vae)==null?void 0:A.repo_id}):y.jsx(ur,{margin:0,children:i("modelmanager:vaeRepoIDValidationMsg")})]})]}),y.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})}})})]}):y.jsx(Ge,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:y.jsx(Jt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const qK=lt([or],e=>{const{model_list:t}=e,n=[];return ke.forEach(t,r=>{n.push(r.weights)}),n});function VFe(){const{t:e}=Ue();return y.jsx(Eo,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function oj({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=he(qK),i=o=>{t.includes(o.target.value)?n(ke.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return y.jsxs(Eo,{position:"relative",children:[r.includes(e.location)?y.jsx(VFe,{}):null,y.jsx(er,{value:e.name,label:y.jsx(y.Fragment,{children:y.jsxs(yn,{alignItems:"start",children:[y.jsx("p",{style:{fontWeight:"bold"},children:e.name}),y.jsx("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function WFe(){const e=Oe(),{t}=Ue(),n=he(S=>S.system.searchFolder),r=he(S=>S.system.foundModels),i=he(qK),o=he(S=>S.ui.shouldShowExistingModelsInSearch),a=he(S=>S.system.isProcessing),[s,l]=N.useState([]),u=()=>{e(QU(null)),e(JU(null)),l([])},d=S=>{e(vD(S.checkpointFolder))},h=()=>{l([]),r&&r.forEach(S=>{i.includes(S.location)||l(_=>[..._,S.name])})},m=()=>{l([])},v=()=>{const S=r==null?void 0:r.filter(_=>s.includes(_.name));S==null||S.forEach(_=>{const E={name:_.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:_.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(Vy(E))}),l([])},b=()=>{const S=[],_=[];return r&&r.forEach((E,k)=>{i.includes(E.location)?_.push(y.jsx(oj,{model:E,modelsToAdd:s,setModelsToAdd:l},k)):S.push(y.jsx(oj,{model:E,modelsToAdd:s,setModelsToAdd:l},k))}),y.jsxs(y.Fragment,{children:[S,o&&_]})};return y.jsxs(y.Fragment,{children:[n?y.jsxs(Ge,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[y.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),y.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),y.jsx(Je,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:y.jsx(Yx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(vD(n))}),y.jsx(Je,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:y.jsx(Uy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:u})]}):y.jsx(Qy,{initialValues:{checkpointFolder:""},onSubmit:S=>{d(S)},children:({handleSubmit:S})=>y.jsx("form",{onSubmit:S,children:y.jsxs(Ey,{columnGap:"0.5rem",children:[y.jsx(fn,{isRequired:!0,width:"max-content",children:y.jsx(dr,{as:br,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),y.jsx(Je,{icon:y.jsx(iPe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&y.jsxs(Ge,{flexDirection:"column",rowGap:"1rem",children:[y.jsxs(Ge,{justifyContent:"space-between",alignItems:"center",children:[y.jsxs("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),y.jsxs("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),y.jsxs(Ge,{columnGap:"0.5rem",justifyContent:"space-between",children:[y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(nr,{isDisabled:s.length===r.length,onClick:h,children:t("modelmanager:selectAll")}),y.jsx(nr,{isDisabled:s.length===0,onClick:m,children:t("modelmanager:deselectAll")}),y.jsx(er,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(TCe(!o))})]}),y.jsx(nr,{isDisabled:s.length===0,onClick:v,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),y.jsxs(Ge,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&y.jsx(Jt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):y.jsx(Jt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),b()]})]})]})}const aj=64,sj=2048;function UFe(){const e=Oe(),{t}=Ue(),n=he(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(u){let d;return r(u)&&(d=t("modelmanager:cannotUseSpaces")),d}const o={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=u=>{e(Vy(u)),e(Vh(null))},[s,l]=N.useState(!1);return y.jsxs(y.Fragment,{children:[y.jsx(Je,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Vh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:y.jsx(lq,{})}),y.jsx(WFe,{}),y.jsx(er,{label:t("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&y.jsx(Qy,{initialValues:o,onSubmit:a,children:({handleSubmit:u,errors:d,touched:h})=>y.jsx("form",{onSubmit:u,children:y.jsxs(yn,{rowGap:"0.5rem",children:[y.jsx(Jt,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelmanager:manual")}),y.jsxs(fn,{isInvalid:!!d.name&&h.name,isRequired:!0,children:[y.jsx(En,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),d.name&&h.name?y.jsx(cr,{children:d.name}):y.jsx(ur,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!d.description&&h.description,isRequired:!0,children:[y.jsx(En,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"description",name:"description",type:"text",width:"2xl"}),d.description&&h.description?y.jsx(cr,{children:d.description}):y.jsx(ur,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!d.config&&h.config,isRequired:!0,children:[y.jsx(En,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:config")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"config",name:"config",type:"text",width:"2xl"}),d.config&&h.config?y.jsx(cr,{children:d.config}):y.jsx(ur,{margin:0,children:t("modelmanager:configValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!d.weights&&h.weights,isRequired:!0,children:[y.jsx(En,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"weights",name:"weights",type:"text",width:"2xl"}),d.weights&&h.weights?y.jsx(cr,{children:d.weights}):y.jsx(ur,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!d.vae&&h.vae,children:[y.jsx(En,{htmlFor:"vae",fontSize:"sm",children:t("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae",name:"vae",type:"text",width:"2xl"}),d.vae&&h.vae?y.jsx(cr,{children:d.vae}):y.jsx(ur,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(Ey,{width:"100%",children:[y.jsxs(fn,{isInvalid:!!d.width&&h.width,children:[y.jsx(En,{htmlFor:"width",fontSize:"sm",children:t("modelmanager:width")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"width",name:"width",children:({field:m,form:v})=>y.jsx(ia,{id:"width",name:"width",min:aj,max:sj,step:64,width:"90%",value:v.values.width,onChange:b=>v.setFieldValue(m.name,Number(b))})}),d.width&&h.width?y.jsx(cr,{children:d.width}):y.jsx(ur,{margin:0,children:t("modelmanager:widthValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!d.height&&h.height,children:[y.jsx(En,{htmlFor:"height",fontSize:"sm",children:t("modelmanager:height")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{id:"height",name:"height",children:({field:m,form:v})=>y.jsx(ia,{id:"height",name:"height",min:aj,max:sj,width:"90%",step:64,value:v.values.height,onChange:b=>v.setFieldValue(m.name,Number(b))})}),d.height&&h.height?y.jsx(cr,{children:d.height}):y.jsx(ur,{margin:0,children:t("modelmanager:heightValidationMsg")})]})]})]}),y.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})})]})}function n4({children:e}){return y.jsx(Ge,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:e})}function GFe(){const e=Oe(),{t}=Ue(),n=he(s=>s.system.isProcessing);function r(s){return/\s/.test(s)}function i(s){let l;return r(s)&&(l=t("modelmanager:cannotUseSpaces")),l}const o={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=s=>{const l=s;s.path===""&&delete l.path,s.repo_id===""&&delete l.repo_id,s.vae.path===""&&delete l.vae.path,s.vae.repo_id===""&&delete l.vae.repo_id,e(Vy(l)),e(Vh(null))};return y.jsxs(Ge,{children:[y.jsx(Je,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Vh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:y.jsx(lq,{})}),y.jsx(Qy,{initialValues:o,onSubmit:a,children:({handleSubmit:s,errors:l,touched:u})=>{var d,h,m,v,b,S,_,E,k,T;return y.jsx("form",{onSubmit:s,children:y.jsxs(yn,{rowGap:"0.5rem",children:[y.jsx(n4,{children:y.jsxs(fn,{isInvalid:!!l.name&&u.name,isRequired:!0,children:[y.jsx(En,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),l.name&&u.name?y.jsx(cr,{children:l.name}):y.jsx(ur,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]})}),y.jsx(n4,{children:y.jsxs(fn,{isInvalid:!!l.description&&u.description,isRequired:!0,children:[y.jsx(En,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),l.description&&u.description?y.jsx(cr,{children:l.description}):y.jsx(ur,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]})}),y.jsxs(n4,{children:[y.jsx(Jt,{fontWeight:"bold",fontSize:"sm",children:t("modelmanager:formMessageDiffusersModelLocation")}),y.jsx(Jt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersModelLocationDesc")}),y.jsxs(fn,{isInvalid:!!l.path&&u.path,children:[y.jsx(En,{htmlFor:"path",fontSize:"sm",children:t("modelmanager:modelLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"path",name:"path",type:"text",width:"2xl"}),l.path&&u.path?y.jsx(cr,{children:l.path}):y.jsx(ur,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!l.repo_id&&u.repo_id,children:[y.jsx(En,{htmlFor:"repo_id",fontSize:"sm",children:t("modelmanager:repo_id")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),l.repo_id&&u.repo_id?y.jsx(cr,{children:l.repo_id}):y.jsx(ur,{margin:0,children:t("modelmanager:repoIDValidationMsg")})]})]})]}),y.jsxs(n4,{children:[y.jsx(Jt,{fontWeight:"bold",children:t("modelmanager:formMessageDiffusersVAELocation")}),y.jsx(Jt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersVAELocationDesc")}),y.jsxs(fn,{isInvalid:!!((d=l.vae)!=null&&d.path)&&((h=u.vae)==null?void 0:h.path),children:[y.jsx(En,{htmlFor:"vae.path",fontSize:"sm",children:t("modelmanager:vaeLocation")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(m=l.vae)!=null&&m.path&&((v=u.vae)!=null&&v.path)?y.jsx(cr,{children:(b=l.vae)==null?void 0:b.path}):y.jsx(ur,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),y.jsxs(fn,{isInvalid:!!((S=l.vae)!=null&&S.repo_id)&&((_=u.vae)==null?void 0:_.repo_id),children:[y.jsx(En,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelmanager:vaeRepoID")}),y.jsxs(yn,{alignItems:"start",children:[y.jsx(dr,{as:br,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(E=l.vae)!=null&&E.repo_id&&((k=u.vae)!=null&&k.repo_id)?y.jsx(cr,{children:(T=l.vae)==null?void 0:T.repo_id}):y.jsx(ur,{margin:0,children:t("modelmanager:vaeRepoIDValidationMsg")})]})]})]}),y.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function lj({text:e,onClick:t}){return y.jsx(Ge,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:t,children:y.jsx(Jt,{fontWeight:"bold",children:e})})}function qFe(){const{isOpen:e,onOpen:t,onClose:n}=Gh(),r=he(s=>s.ui.addNewModelUIOption),i=Oe(),{t:o}=Ue(),a=()=>{n(),i(Vh(null))};return y.jsxs(y.Fragment,{children:[y.jsx(nr,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:y.jsxs(Ge,{columnGap:"0.5rem",alignItems:"center",children:[y.jsx(Uy,{}),o("modelmanager:addNew")]})}),y.jsxs(Xd,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[y.jsx(Zd,{}),y.jsxs(Jh,{className:"modal add-model-modal",fontFamily:"Inter",children:[y.jsx(_0,{children:o("modelmanager:addNewModel")}),y.jsx(Iy,{marginTop:"0.3rem"}),y.jsxs(o0,{className:"add-model-modal-body",children:[r==null&&y.jsxs(Ge,{columnGap:"1rem",children:[y.jsx(lj,{text:o("modelmanager:addCheckpointModel"),onClick:()=>i(Vh("ckpt"))}),y.jsx(lj,{text:o("modelmanager:addDiffuserModel"),onClick:()=>i(Vh("diffusers"))})]}),r=="ckpt"&&y.jsx(UFe,{}),r=="diffusers"&&y.jsx(GFe,{})]})]})]})]})}function r4(e){const{isProcessing:t,isConnected:n}=he(v=>v.system),r=he(v=>v.system.openModel),{t:i}=Ue(),o=Oe(),{name:a,status:s,description:l}=e,u=()=>{o(tq(a))},d=()=>{o(NR(a))},h=()=>{o(t_e(a)),o(NR(null))},m=()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}};return y.jsxs(Ge,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[y.jsx(Eo,{onClick:d,cursor:"pointer",children:y.jsx(uo,{label:l,hasArrow:!0,placement:"bottom",children:y.jsx(Jt,{fontWeight:"bold",children:a})})}),y.jsx(wF,{onClick:d,cursor:"pointer"}),y.jsxs(Ge,{gap:2,alignItems:"center",children:[y.jsx(Jt,{color:m(),children:s}),y.jsx(ls,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),y.jsx(Je,{icon:y.jsx(GEe,{}),size:"sm",onClick:d,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),y.jsx(fw,{title:i("modelmanager:deleteModel"),acceptCallback:h,acceptButtonText:i("modelmanager:delete"),triggerComponent:y.jsx(Je,{icon:y.jsx(UEe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:y.jsxs(Ge,{rowGap:"1rem",flexDirection:"column",children:[y.jsx("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),y.jsx("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const YFe=lt(or,e=>ke.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function t7({label:e,isActive:t,onClick:n}){return y.jsx(nr,{onClick:n,isActive:t,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:e})}const KFe=()=>{const e=he(YFe),[t,n]=w.useState(""),[r,i]=w.useState("all"),[o,a]=w.useTransition(),{t:s}=Ue(),l=d=>{a(()=>{n(d.target.value)})},u=w.useMemo(()=>{const d=[],h=[],m=[],v=[];return e.forEach((b,S)=>{b.name.toLowerCase().includes(t.toLowerCase())&&(m.push(y.jsx(r4,{name:b.name,status:b.status,description:b.description},S)),b.format===r&&v.push(y.jsx(r4,{name:b.name,status:b.status,description:b.description},S))),b.format!=="diffusers"?d.push(y.jsx(r4,{name:b.name,status:b.status,description:b.description},S)):h.push(y.jsx(r4,{name:b.name,status:b.status,description:b.description},S))}),t!==""?r==="all"?y.jsx(Eo,{marginTop:"1rem",children:m}):y.jsx(Eo,{marginTop:"1rem",children:v}):y.jsxs(Ge,{flexDirection:"column",rowGap:"1.5rem",children:[r==="all"&&y.jsxs(y.Fragment,{children:[y.jsxs(Eo,{children:[y.jsx(Jt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:s("modelmanager:checkpointModels")}),d]}),y.jsxs(Eo,{children:[y.jsx(Jt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:s("modelmanager:diffusersModels")}),h]})]}),r==="ckpt"&&y.jsx(Ge,{flexDirection:"column",marginTop:"1rem",children:d}),r==="diffusers"&&y.jsx(Ge,{flexDirection:"column",marginTop:"1rem",children:h})]})},[e,t,s,r]);return y.jsxs(Ge,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[y.jsxs(Ge,{justifyContent:"space-between",children:[y.jsx(Jt,{fontSize:"1.4rem",fontWeight:"bold",children:s("modelmanager:availableModels")}),y.jsx(qFe,{})]}),y.jsx(br,{onChange:l,label:s("modelmanager:search")}),y.jsxs(Ge,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[y.jsxs(Ge,{columnGap:"0.5rem",children:[y.jsx(t7,{label:s("modelmanager:allModels"),onClick:()=>i("all"),isActive:r==="all"}),y.jsx(t7,{label:s("modelmanager:checkpointModels"),onClick:()=>i("ckpt"),isActive:r==="ckpt"}),y.jsx(t7,{label:s("modelmanager:diffusersModels"),onClick:()=>i("diffusers"),isActive:r==="diffusers"})]}),u]})]})};function XFe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Gh(),i=he(s=>s.system.model_list),o=he(s=>s.system.openModel),{t:a}=Ue();return y.jsxs(y.Fragment,{children:[w.cloneElement(e,{onClick:n}),y.jsxs(Xd,{isOpen:t,onClose:r,size:"6xl",children:[y.jsx(Zd,{}),y.jsxs(Jh,{className:"modal",fontFamily:"Inter",children:[y.jsx(Iy,{className:"modal-close-btn"}),y.jsx(_0,{fontWeight:"bold",children:a("modelmanager:modelManager")}),y.jsxs(Ge,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[y.jsx(KFe,{}),o&&i[o].format==="diffusers"?y.jsx(HFe,{}):y.jsx(FFe,{})]})]})]})]})}const ZFe=lt([or],e=>{const{isProcessing:t,model_list:n}=e;return{models:ke.map(n,(i,o)=>o),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),QFe=()=>{const e=Oe(),{models:t,isProcessing:n}=he(ZFe),r=he(oq),i=o=>{e(tq(o.target.value))};return y.jsx(Ge,{style:{paddingLeft:"0.3rem"},children:y.jsx(rl,{style:{fontSize:"0.8rem"},tooltip:r.description,isDisabled:n,value:r.name,validValues:t,onChange:i})})},JFe=lt([or,bp],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:ke.map(o,(u,d)=>d),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),eze=({children:e})=>{const t=Oe(),{t:n}=Ue(),r=he(k=>k.generation.steps),{isOpen:i,onOpen:o,onClose:a}=Gh(),{isOpen:s,onOpen:l,onClose:u}=Gh(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:m,saveIntermediatesInterval:v,enableImageDebugging:b,shouldUseCanvasBetaLayout:S}=he(JFe),_=()=>{iq.purge().then(()=>{a(),l()})},E=k=>{k>r&&(k=r),k<1&&(k=1),t(pCe(k))};return y.jsxs(y.Fragment,{children:[w.cloneElement(e,{onClick:o}),y.jsxs(Xd,{isOpen:i,onClose:a,size:"lg",children:[y.jsx(Zd,{}),y.jsxs(Jh,{className:"modal settings-modal",children:[y.jsx(_0,{className:"settings-modal-header",children:n("common:settingsLabel")}),y.jsx(Iy,{className:"modal-close-btn"}),y.jsxs(o0,{className:"settings-modal-content",children:[y.jsxs("div",{className:"settings-modal-items",children:[y.jsxs("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[y.jsx(rl,{label:n("settings:displayInProgress"),validValues:C7e,value:d,onChange:k=>t(sCe(k.target.value))}),d==="full-res"&&y.jsx(ia,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:E,value:v,width:"auto",textAlign:"center"})]}),y.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:k=>t(XU(k.target.checked))}),y.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:k=>t(dCe(k.target.checked))}),y.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:S,onChange:k=>t(PCe(k.target.checked))})]}),y.jsxs("div",{className:"settings-modal-items",children:[y.jsx("h2",{style:{fontWeight:"bold"},children:"Developer"}),y.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:k=>t(gCe(k.target.checked))})]}),y.jsxs("div",{className:"settings-modal-reset",children:[y.jsx(jh,{size:"md",children:n("settings:resetWebUI")}),y.jsx(ls,{colorScheme:"red",onClick:_,children:n("settings:resetWebUI")}),y.jsx(Jt,{children:n("settings:resetWebUIDesc1")}),y.jsx(Jt,{children:n("settings:resetWebUIDesc2")})]})]}),y.jsx(wx,{children:y.jsx(ls,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),y.jsxs(Xd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[y.jsx(Zd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),y.jsx(Jh,{children:y.jsx(o0,{pb:6,pt:6,children:y.jsx(Ge,{justifyContent:"center",children:y.jsx(Jt,{fontSize:"lg",children:y.jsx(Jt,{children:n("settings:resetComplete")})})})})})]})]})},tze=lt(or,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),nze=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=he(tze),s=Oe(),{t:l}=Ue();let u;e&&!o?u="status-good":u="status-bad";let d=i;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(d)&&(u="status-working"),d&&t&&r>1&&(d=`${l(d)} (${n}/${r})`);const m=o&&!a?"Click to clear, check logs for details":void 0,v=o&&!a?"pointer":"initial",b=()=>{(o||!a)&&s(ZU())};return y.jsx(uo,{label:m,children:y.jsx(Jt,{cursor:v,onClick:b,className:`status ${u}`,children:l(d)})})};function rze(){const{t:e}=Ue(),{setColorMode:t,colorMode:n}=gy(),r=Oe(),i=he(l=>l.ui.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};w.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(wCe(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(y.jsx(nr,{style:{width:"6rem"},leftIcon:i===u?y.jsx(IP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y.jsx(OEe,{})}),children:y.jsx(yn,{align:"stretch",children:s()})})}function ize(){const{t:e,i18n:t}=Ue(),n={en:e("common:langEnglish"),nl:e("common:langDutch"),fr:e("common:langFrench"),de:e("common:langGerman"),it:e("common:langItalian"),ja:e("common:langJapanese"),pl:e("common:langPolish"),pt_br:e("common:langBrPortuguese"),ru:e("common:langRussian"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish"),ua:e("common:langUkranian")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(y.jsx(nr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return y.jsx(Js,{trigger:"hover",triggerComponent:y.jsx(Je,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:y.jsx(TEe,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:y.jsx(yn,{children:r()})})}const oze=()=>{const{t:e}=Ue(),t=he(n=>n.system.app_version);return y.jsxs("div",{className:"site-header",children:[y.jsxs("div",{className:"site-header-left-side",children:[y.jsx("img",{src:zY,alt:"invoke-ai-logo"}),y.jsxs(Ge,{alignItems:"center",columnGap:"0.6rem",children:[y.jsxs(Jt,{fontSize:"1.4rem",children:["invoke ",y.jsx("strong",{children:"ai"})]}),y.jsx(Jt,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),y.jsxs("div",{className:"site-header-right-side",children:[y.jsx(nze,{}),y.jsx(QFe,{}),y.jsx(XFe,{children:y.jsx(Je,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y.jsx(SEe,{})})}),y.jsx(UDe,{children:y.jsx(Je,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y.jsx(PEe,{})})}),y.jsx(rze,{}),y.jsx(ize,{}),y.jsx(Je,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y.jsx(Bh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:y.jsx(bEe,{})})}),y.jsx(Je,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y.jsx(Bh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:y.jsx(pEe,{})})}),y.jsx(Je,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y.jsx(Bh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:y.jsx(hEe,{})})}),y.jsx(eze,{children:y.jsx(Je,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:y.jsx(aPe,{})})})]})]})};function aze(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const sze=()=>{const e=Oe(),t=he(C_e),n=By();w.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(vCe())},[e,n,t])},YK=lt([xp,bp,Mr],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:o,shouldUseCanvasBetaLayout:a}=t,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=e,d=a&&n==="unifiedCanvas",h=!d&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!d&&(!r||!i),shouldShowParametersPanelButton:h,shouldShowParametersPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),lze=()=>{const e=Oe(),{shouldShowParametersPanel:t,shouldShowParametersPanelButton:n,shouldShowProcessButtons:r,shouldPinParametersPanel:i,shouldShowGallery:o,shouldPinGallery:a}=he(YK),s=()=>{e(Zu(!0)),i&&setTimeout(()=>e(vi(!0)),400)};return et("f",()=>{o||t?(e(Zu(!1)),e(Fd(!1))):(e(Zu(!0)),e(Fd(!0))),(a||i)&&setTimeout(()=>e(vi(!0)),400)},[o,t]),n?y.jsxs("div",{className:"show-hide-button-options",children:[y.jsx(Je,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:y.jsx(NP,{})}),r&&y.jsxs(y.Fragment,{children:[y.jsx(nT,{iconButton:!0}),y.jsx(eT,{})]})]}):null},uze=()=>{const e=Oe(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowParametersPanel:i,shouldPinParametersPanel:o}=he(YK),a=()=>{e(Fd(!0)),r&&e(vi(!0))};return et("f",()=>{t||i?(e(Zu(!1)),e(Fd(!1))):(e(Zu(!0)),e(Fd(!0))),(r||o)&&setTimeout(()=>e(vi(!0)),400)},[t,i]),n?y.jsx(Je,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:y.jsx(Fq,{})}):null};aze();const cze=()=>(sze(),y.jsxs("div",{className:"App",children:[y.jsxs(BDe,{children:[y.jsx(VDe,{}),y.jsxs("div",{className:"app-content",children:[y.jsx(oze,{}),y.jsx(VRe,{})]}),y.jsx("div",{className:"app-console",children:y.jsx(zDe,{})})]}),y.jsx(lze,{}),y.jsx(uze,{})]})),uj=()=>y.jsx(Ge,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:y.jsx(ky,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})});const dze=Bj({key:"invokeai-style-cache",prepend:!0});n8.createRoot(document.getElementById("root")).render(y.jsx(N.StrictMode,{children:y.jsx(W5e,{store:rq,children:y.jsx(TW,{loading:y.jsx(uj,{}),persistor:iq,children:y.jsx(ire,{value:dze,children:y.jsx(u5e,{children:y.jsx(N.Suspense,{fallback:y.jsx(uj,{}),children:y.jsx(cze,{})})})})})})})); +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pK(e,t){if(e){if(typeof e=="string")return s_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s_(e,t)}}function s_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DDe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var pT=w.forwardRef(function(e,t){var n=e.children,r=vS(e,_De),i=mK(r),o=i.open,a=vS(i,kDe);return w.useImperativeHandle(t,function(){return{open:o}},[o]),N.createElement(w.Fragment,null,n(_r(_r({},a),{},{open:o})))});pT.displayName="Dropzone";var gK={disabled:!1,getFilesFromEvent:qRe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};pT.defaultProps=gK;pT.propTypes={children:jn.func,accept:jn.objectOf(jn.arrayOf(jn.string)),multiple:jn.bool,preventDropOnDocument:jn.bool,noClick:jn.bool,noKeyboard:jn.bool,noDrag:jn.bool,noDragEventsBubbling:jn.bool,minSize:jn.number,maxSize:jn.number,maxFiles:jn.number,disabled:jn.bool,getFilesFromEvent:jn.func,onFileDialogCancel:jn.func,onFileDialogOpen:jn.func,useFsAccessApi:jn.bool,autoFocus:jn.bool,onDragEnter:jn.func,onDragLeave:jn.func,onDragOver:jn.func,onDrop:jn.func,onDropAccepted:jn.func,onDropRejected:jn.func,onError:jn.func,validator:jn.func};var u_={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function mK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_r(_r({},gK),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,h=t.onDragOver,m=t.onDrop,y=t.onDropAccepted,b=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,E=t.useFsAccessApi,_=t.autoFocus,P=t.preventDropOnDocument,A=t.noClick,M=t.noKeyboard,R=t.noDrag,D=t.noDragEventsBubbling,j=t.onError,z=t.validator,H=w.useMemo(function(){return xDe(n)},[n]),K=w.useMemo(function(){return SDe(n)},[n]),te=w.useMemo(function(){return typeof k=="function"?k:PN},[k]),G=w.useMemo(function(){return typeof x=="function"?x:PN},[x]),F=w.useRef(null),W=w.useRef(null),X=w.useReducer(NDe,u_),Z=KC(X,2),U=Z[0],Q=Z[1],re=U.isFocused,fe=U.isFileDialogActive,Ee=w.useRef(typeof window<"u"&&window.isSecureContext&&E&&bDe()),be=function(){!Ee.current&&fe&&setTimeout(function(){if(W.current){var Ne=W.current.files;Ne.length||(Q({type:"closeDialog"}),G())}},300)};w.useEffect(function(){return window.addEventListener("focus",be,!1),function(){window.removeEventListener("focus",be,!1)}},[W,fe,G,Ee]);var ye=w.useRef([]),ze=function(Ne){F.current&&F.current.contains(Ne.target)||(Ne.preventDefault(),ye.current=[])};w.useEffect(function(){return P&&(document.addEventListener("dragover",kN,!1),document.addEventListener("drop",ze,!1)),function(){P&&(document.removeEventListener("dragover",kN),document.removeEventListener("drop",ze))}},[F,P]),w.useEffect(function(){return!r&&_&&F.current&&F.current.focus(),function(){}},[F,_,r]);var Me=w.useCallback(function(xe){j?j(xe):console.error(xe)},[j]),rt=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe),ye.current=[].concat(TDe(ye.current),[xe.target]),e4(xe)&&Promise.resolve(i(xe)).then(function(Ne){if(!(mS(xe)&&!D)){var Ct=Ne.length,Dt=Ct>0&&gDe({files:Ne,accept:H,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:z}),Te=Ct>0&&!Dt;Q({isDragAccept:Dt,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),u&&u(xe)}}).catch(function(Ne){return Me(Ne)})},[i,u,Me,D,H,a,o,s,l,z]),We=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe);var Ne=e4(xe);if(Ne&&xe.dataTransfer)try{xe.dataTransfer.dropEffect="copy"}catch{}return Ne&&h&&h(xe),!1},[h,D]),Be=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe);var Ne=ye.current.filter(function(Dt){return F.current&&F.current.contains(Dt)}),Ct=Ne.indexOf(xe.target);Ct!==-1&&Ne.splice(Ct,1),ye.current=Ne,!(Ne.length>0)&&(Q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),e4(xe)&&d&&d(xe))},[F,d,D]),wt=w.useCallback(function(xe,Ne){var Ct=[],Dt=[];xe.forEach(function(Te){var At=cK(Te,H),He=KC(At,2),vt=He[0],nn=He[1],Rn=dK(Te,a,o),Ze=KC(Rn,2),xt=Ze[0],ht=Ze[1],Ht=z?z(Te):null;if(vt&&xt&&!Ht)Ct.push(Te);else{var rn=[nn,ht];Ht&&(rn=rn.concat(Ht)),Dt.push({file:Te,errors:rn.filter(function(gr){return gr})})}}),(!s&&Ct.length>1||s&&l>=1&&Ct.length>l)&&(Ct.forEach(function(Te){Dt.push({file:Te,errors:[pDe]})}),Ct.splice(0)),Q({acceptedFiles:Ct,fileRejections:Dt,type:"setFiles"}),m&&m(Ct,Dt,Ne),Dt.length>0&&b&&b(Dt,Ne),Ct.length>0&&y&&y(Ct,Ne)},[Q,s,H,a,o,l,m,y,b,z]),Fe=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe),ye.current=[],e4(xe)&&Promise.resolve(i(xe)).then(function(Ne){mS(xe)&&!D||wt(Ne,xe)}).catch(function(Ne){return Me(Ne)}),Q({type:"reset"})},[i,wt,Me,D]),at=w.useCallback(function(){if(Ee.current){Q({type:"openDialog"}),te();var xe={multiple:s,types:K};window.showOpenFilePicker(xe).then(function(Ne){return i(Ne)}).then(function(Ne){wt(Ne,null),Q({type:"closeDialog"})}).catch(function(Ne){wDe(Ne)?(G(Ne),Q({type:"closeDialog"})):CDe(Ne)?(Ee.current=!1,W.current?(W.current.value=null,W.current.click()):Me(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Me(Ne)});return}W.current&&(Q({type:"openDialog"}),te(),W.current.value=null,W.current.click())},[Q,te,G,E,wt,Me,K,s]),bt=w.useCallback(function(xe){!F.current||!F.current.isEqualNode(xe.target)||(xe.key===" "||xe.key==="Enter"||xe.keyCode===32||xe.keyCode===13)&&(xe.preventDefault(),at())},[F,at]),Le=w.useCallback(function(){Q({type:"focus"})},[]),ut=w.useCallback(function(){Q({type:"blur"})},[]),Mt=w.useCallback(function(){A||(yDe()?setTimeout(at,0):at())},[A,at]),ct=function(Ne){return r?null:Ne},_t=function(Ne){return M?null:ct(Ne)},un=function(Ne){return R?null:ct(Ne)},ae=function(Ne){D&&Ne.stopPropagation()},De=w.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=xe.refKey,Ct=Ne===void 0?"ref":Ne,Dt=xe.role,Te=xe.onKeyDown,At=xe.onFocus,He=xe.onBlur,vt=xe.onClick,nn=xe.onDragEnter,Rn=xe.onDragOver,Ze=xe.onDragLeave,xt=xe.onDrop,ht=vS(xe,EDe);return _r(_r(l_({onKeyDown:_t(Dl(Te,bt)),onFocus:_t(Dl(At,Le)),onBlur:_t(Dl(He,ut)),onClick:ct(Dl(vt,Mt)),onDragEnter:un(Dl(nn,rt)),onDragOver:un(Dl(Rn,We)),onDragLeave:un(Dl(Ze,Be)),onDrop:un(Dl(xt,Fe)),role:typeof Dt=="string"&&Dt!==""?Dt:"presentation"},Ct,F),!r&&!M?{tabIndex:0}:{}),ht)}},[F,bt,Le,ut,Mt,rt,We,Be,Fe,M,R,r]),Ke=w.useCallback(function(xe){xe.stopPropagation()},[]),Xe=w.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=xe.refKey,Ct=Ne===void 0?"ref":Ne,Dt=xe.onChange,Te=xe.onClick,At=vS(xe,PDe),He=l_({accept:H,multiple:s,type:"file",style:{display:"none"},onChange:ct(Dl(Dt,Fe)),onClick:ct(Dl(Te,Ke)),tabIndex:-1},Ct,W);return _r(_r({},He),At)}},[W,n,s,Fe,r]);return _r(_r({},U),{},{isFocused:re&&!r,getRootProps:De,getInputProps:Xe,rootRef:F,inputRef:W,open:ct(at)})}function NDe(e,t){switch(t.type){case"focus":return _r(_r({},e),{},{isFocused:!0});case"blur":return _r(_r({},e),{},{isFocused:!1});case"openDialog":return _r(_r({},u_),{},{isFileDialogActive:!0});case"closeDialog":return _r(_r({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _r(_r({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _r(_r({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return _r({},u_);default:return e}}function PN(){}const jDe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return et("esc",()=>{i(!1)}),v.jsxs("div",{className:"dropzone-container",children:[t&&v.jsx("div",{className:"dropzone-overlay is-drag-accept",children:v.jsxs(Bh,{size:"lg",children:["Upload Image",r]})}),n&&v.jsxs("div",{className:"dropzone-overlay is-drag-reject",children:[v.jsx(Bh,{size:"lg",children:"Invalid Upload"}),v.jsx(Bh,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},BDe=e=>{const{children:t}=e,n=Oe(),r=he(Mr),i=By({}),{t:o}=Ge(),[a,s]=w.useState(!1),{setOpenUploader:l}=TP(),u=w.useCallback(P=>{s(!0);const A=P.errors.reduce((M,R)=>`${M} +${R.message}`,"");i({title:o("toast:uploadFailed"),description:A,status:"error",isClosable:!0})},[o,i]),d=w.useCallback(async P=>{n(SD({imageFile:P}))},[n]),h=w.useCallback((P,A)=>{A.forEach(M=>{u(M)}),P.forEach(M=>{d(M)})},[d,u]),{getRootProps:m,getInputProps:y,isDragAccept:b,isDragReject:x,isDragActive:k,open:E}=mK({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:()=>s(!0),maxFiles:1});l(E),w.useEffect(()=>{const P=A=>{var j;const M=(j=A.clipboardData)==null?void 0:j.items;if(!M)return;const R=[];for(const z of M)z.kind==="file"&&["image/png","image/jpg"].includes(z.type)&&R.push(z);if(!R.length)return;if(A.stopImmediatePropagation(),R.length>1){i({description:o("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=R[0].getAsFile();if(!D){i({description:o("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(SD({imageFile:D}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[o,n,i,r]);const _=["img2img","unifiedCanvas"].includes(r)?` to ${ts[r].tooltip}`:"";return v.jsx(PP.Provider,{value:E,children:v.jsxs("div",{...m({style:{}}),onKeyDown:P=>{P.key},children:[v.jsx("input",{...y()}),t,k&&a&&v.jsx(jDe,{isDragAccept:b,isDragReject:x,overlaySecondaryText:_,setIsHandlingUpload:s})]})})},FDe=lt(or,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),$De=lt(or,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),zDe=()=>{const e=Oe(),t=he(FDe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=he($De),[o,a]=w.useState(!0),s=w.useRef(null);w.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(ZU()),e(LC(!n))};et("`",()=>{e(LC(!n))},[n]),et("esc",()=>{e(LC(!1))});const u=()=>{s.current&&o&&s.current.scrollTop{const{timestamp:m,message:y,level:b}=d;return v.jsxs("div",{className:`console-entry console-${b}-color`,children:[v.jsxs("p",{className:"console-timestamp",children:[m,":"]}),v.jsx("p",{className:"console-message",children:y})]},h)})})}),n&&v.jsx(uo,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:v.jsx(us,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:v.jsx(gEe,{}),onClick:()=>a(!o)})}),v.jsx(uo,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:v.jsx(us,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?v.jsx(AEe,{}):v.jsx(Eq,{}),onClick:l})})]})},HDe=lt(or,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VDe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=he(HDe),i=t?Math.round(t*100/n):0;return v.jsx(KV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function WDe(e){const{title:t,hotkey:n,description:r}=e;return v.jsxs("div",{className:"hotkey-modal-item",children:[v.jsxs("div",{className:"hotkey-info",children:[v.jsx("p",{className:"hotkey-title",children:t}),r&&v.jsx("p",{className:"hotkey-description",children:r})]}),v.jsx("div",{className:"hotkey-key",children:n})]})}function UDe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=qh(),{t:i}=Ge(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=d=>{const h=[];return d.forEach((m,y)=>{h.push(v.jsx(WDe,{title:m.title,description:m.desc,hotkey:m.hotkey},y))}),v.jsx("div",{className:"hotkey-modal-category",children:h})};return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:n}),v.jsxs(Zd,{isOpen:t,onClose:r,children:[v.jsx(Qd,{}),v.jsxs(ep,{className:" modal hotkeys-modal",children:[v.jsx(Iy,{className:"modal-close-btn"}),v.jsx("h1",{children:"Keyboard Shorcuts"}),v.jsx("div",{className:"hotkeys-modal-items",children:v.jsxs(dk,{allowMultiple:!0,children:[v.jsxs(Xg,{children:[v.jsxs(Yg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:appHotkeys")}),v.jsx(Kg,{})]}),v.jsx(Zg,{children:u(o)})]}),v.jsxs(Xg,{children:[v.jsxs(Yg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:generalHotkeys")}),v.jsx(Kg,{})]}),v.jsx(Zg,{children:u(a)})]}),v.jsxs(Xg,{children:[v.jsxs(Yg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:galleryHotkeys")}),v.jsx(Kg,{})]}),v.jsx(Zg,{children:u(s)})]}),v.jsxs(Xg,{children:[v.jsxs(Yg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),v.jsx(Kg,{})]}),v.jsx(Zg,{children:u(l)})]})]})})]})]})]})}var TN=Array.isArray,LN=Object.keys,GDe=Object.prototype.hasOwnProperty,qDe=typeof Element<"u";function c_(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=TN(e),r=TN(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!c_(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var h=LN(e);if(o=h.length,o!==LN(t).length)return!1;for(i=o;i--!==0;)if(!GDe.call(t,h[i]))return!1;if(qDe&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=h[i],!(a==="_owner"&&e.$$typeof)&&!c_(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var yd=function(t,n){try{return c_(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},YDe=function(t){return KDe(t)&&!XDe(t)};function KDe(e){return!!e&&typeof e=="object"}function XDe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||JDe(e)}var ZDe=typeof Symbol=="function"&&Symbol.for,QDe=ZDe?Symbol.for("react.element"):60103;function JDe(e){return e.$$typeof===QDe}function eNe(e){return Array.isArray(e)?[]:{}}function yS(e,t){return t.clone!==!1&&t.isMergeableObject(e)?dy(eNe(e),e,t):e}function tNe(e,t,n){return e.concat(t).map(function(r){return yS(r,n)})}function nNe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=yS(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=yS(t[i],n):r[i]=dy(e[i],t[i],n)}),r}function dy(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||tNe,n.isMergeableObject=n.isMergeableObject||YDe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):nNe(e,t,n):yS(t,n)}dy.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return dy(r,i,n)},{})};var d_=dy,rNe=typeof global=="object"&&global&&global.Object===Object&&global;const vK=rNe;var iNe=typeof self=="object"&&self&&self.Object===Object&&self,oNe=vK||iNe||Function("return this")();const yu=oNe;var aNe=yu.Symbol;const rf=aNe;var yK=Object.prototype,sNe=yK.hasOwnProperty,lNe=yK.toString,yv=rf?rf.toStringTag:void 0;function uNe(e){var t=sNe.call(e,yv),n=e[yv];try{e[yv]=void 0;var r=!0}catch{}var i=lNe.call(e);return r&&(t?e[yv]=n:delete e[yv]),i}var cNe=Object.prototype,dNe=cNe.toString;function fNe(e){return dNe.call(e)}var hNe="[object Null]",pNe="[object Undefined]",AN=rf?rf.toStringTag:void 0;function kp(e){return e==null?e===void 0?pNe:hNe:AN&&AN in Object(e)?uNe(e):fNe(e)}function bK(e,t){return function(n){return e(t(n))}}var gNe=bK(Object.getPrototypeOf,Object);const gT=gNe;function Ep(e){return e!=null&&typeof e=="object"}var mNe="[object Object]",vNe=Function.prototype,yNe=Object.prototype,SK=vNe.toString,bNe=yNe.hasOwnProperty,SNe=SK.call(Object);function ON(e){if(!Ep(e)||kp(e)!=mNe)return!1;var t=gT(e);if(t===null)return!0;var n=bNe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&SK.call(n)==SNe}function xNe(){this.__data__=[],this.size=0}function xK(e,t){return e===t||e!==e&&t!==t}function gw(e,t){for(var n=e.length;n--;)if(xK(e[n][0],t))return n;return-1}var wNe=Array.prototype,CNe=wNe.splice;function _Ne(e){var t=this.__data__,n=gw(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():CNe.call(t,n,1),--this.size,!0}function kNe(e){var t=this.__data__,n=gw(t,e);return n<0?void 0:t[n][1]}function ENe(e){return gw(this.__data__,e)>-1}function PNe(e,t){var n=this.__data__,r=gw(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function bc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=Rje}var Dje="[object Arguments]",Nje="[object Array]",jje="[object Boolean]",Bje="[object Date]",Fje="[object Error]",$je="[object Function]",zje="[object Map]",Hje="[object Number]",Vje="[object Object]",Wje="[object RegExp]",Uje="[object Set]",Gje="[object String]",qje="[object WeakMap]",Yje="[object ArrayBuffer]",Kje="[object DataView]",Xje="[object Float32Array]",Zje="[object Float64Array]",Qje="[object Int8Array]",Jje="[object Int16Array]",eBe="[object Int32Array]",tBe="[object Uint8Array]",nBe="[object Uint8ClampedArray]",rBe="[object Uint16Array]",iBe="[object Uint32Array]",lr={};lr[Xje]=lr[Zje]=lr[Qje]=lr[Jje]=lr[eBe]=lr[tBe]=lr[nBe]=lr[rBe]=lr[iBe]=!0;lr[Dje]=lr[Nje]=lr[Yje]=lr[jje]=lr[Kje]=lr[Bje]=lr[Fje]=lr[$je]=lr[zje]=lr[Hje]=lr[Vje]=lr[Wje]=lr[Uje]=lr[Gje]=lr[qje]=!1;function oBe(e){return Ep(e)&&TK(e.length)&&!!lr[kp(e)]}function mT(e){return function(t){return e(t)}}var LK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,m2=LK&&typeof module=="object"&&module&&!module.nodeType&&module,aBe=m2&&m2.exports===LK,ZC=aBe&&vK.process,sBe=function(){try{var e=m2&&m2.require&&m2.require("util").types;return e||ZC&&ZC.binding&&ZC.binding("util")}catch{}}();const h0=sBe;var jN=h0&&h0.isTypedArray,lBe=jN?mT(jN):oBe;const uBe=lBe;var cBe=Object.prototype,dBe=cBe.hasOwnProperty;function AK(e,t){var n=Zy(e),r=!n&&kje(e),i=!n&&!r&&PK(e),o=!n&&!r&&!i&&uBe(e),a=n||r||i||o,s=a?Sje(e.length,String):[],l=s.length;for(var u in e)(t||dBe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ije(u,l)))&&s.push(u);return s}var fBe=Object.prototype;function vT(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||fBe;return e===n}var hBe=bK(Object.keys,Object);const pBe=hBe;var gBe=Object.prototype,mBe=gBe.hasOwnProperty;function vBe(e){if(!vT(e))return pBe(e);var t=[];for(var n in Object(e))mBe.call(e,n)&&n!="constructor"&&t.push(n);return t}function OK(e){return e!=null&&TK(e.length)&&!wK(e)}function yT(e){return OK(e)?AK(e):vBe(e)}function yBe(e,t){return e&&vw(t,yT(t),e)}function bBe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var SBe=Object.prototype,xBe=SBe.hasOwnProperty;function wBe(e){if(!Xy(e))return bBe(e);var t=vT(e),n=[];for(var r in e)r=="constructor"&&(t||!xBe.call(e,r))||n.push(r);return n}function bT(e){return OK(e)?AK(e,!0):wBe(e)}function CBe(e,t){return e&&vw(t,bT(t),e)}var MK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,BN=MK&&typeof module=="object"&&module&&!module.nodeType&&module,_Be=BN&&BN.exports===MK,FN=_Be?yu.Buffer:void 0,$N=FN?FN.allocUnsafe:void 0;function kBe(e,t){if(t)return e.slice();var n=e.length,r=$N?$N(n):new e.constructor(n);return e.copy(r),r}function IK(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function nj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var rj=function(t){return Array.isArray(t)&&t.length===0},qo=function(t){return typeof t=="function"},yw=function(t){return t!==null&&typeof t=="object"},C$e=function(t){return String(Math.floor(Number(t)))===t},QC=function(t){return Object.prototype.toString.call(t)==="[object String]"},WK=function(t){return w.Children.count(t)===0},JC=function(t){return yw(t)&&qo(t.then)};function Wi(e,t,n,r){r===void 0&&(r=0);for(var i=VK(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function UK(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?De.map(function(Xe){return j(Xe,Wi(ae,Xe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ke).then(function(Xe){return Xe.reduce(function(xe,Ne,Ct){return Ne==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ne&&(xe=au(xe,De[Ct],Ne)),xe},{})})},[j]),H=w.useCallback(function(ae){return Promise.all([z(ae),m.validationSchema?D(ae):{},m.validate?R(ae):{}]).then(function(De){var Ke=De[0],Xe=De[1],xe=De[2],Ne=d_.all([Ke,Xe,xe],{arrayMerge:L$e});return Ne})},[m.validate,m.validationSchema,z,R,D]),K=Xa(function(ae){return ae===void 0&&(ae=A.values),M({type:"SET_ISVALIDATING",payload:!0}),H(ae).then(function(De){return E.current&&(M({type:"SET_ISVALIDATING",payload:!1}),M({type:"SET_ERRORS",payload:De})),De})});w.useEffect(function(){a&&E.current===!0&&yd(y.current,m.initialValues)&&K(y.current)},[a,K]);var te=w.useCallback(function(ae){var De=ae&&ae.values?ae.values:y.current,Ke=ae&&ae.errors?ae.errors:b.current?b.current:m.initialErrors||{},Xe=ae&&ae.touched?ae.touched:x.current?x.current:m.initialTouched||{},xe=ae&&ae.status?ae.status:k.current?k.current:m.initialStatus;y.current=De,b.current=Ke,x.current=Xe,k.current=xe;var Ne=function(){M({type:"RESET_FORM",payload:{isSubmitting:!!ae&&!!ae.isSubmitting,errors:Ke,touched:Xe,status:xe,values:De,isValidating:!!ae&&!!ae.isValidating,submitCount:ae&&ae.submitCount&&typeof ae.submitCount=="number"?ae.submitCount:0}})};if(m.onReset){var Ct=m.onReset(A.values,Fe);JC(Ct)?Ct.then(Ne):Ne()}else Ne()},[m.initialErrors,m.initialStatus,m.initialTouched]);w.useEffect(function(){E.current===!0&&!yd(y.current,m.initialValues)&&(u&&(y.current=m.initialValues,te()),a&&K(y.current))},[u,m.initialValues,te,a,K]),w.useEffect(function(){u&&E.current===!0&&!yd(b.current,m.initialErrors)&&(b.current=m.initialErrors||fh,M({type:"SET_ERRORS",payload:m.initialErrors||fh}))},[u,m.initialErrors]),w.useEffect(function(){u&&E.current===!0&&!yd(x.current,m.initialTouched)&&(x.current=m.initialTouched||t4,M({type:"SET_TOUCHED",payload:m.initialTouched||t4}))},[u,m.initialTouched]),w.useEffect(function(){u&&E.current===!0&&!yd(k.current,m.initialStatus)&&(k.current=m.initialStatus,M({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var G=Xa(function(ae){if(_.current[ae]&&qo(_.current[ae].validate)){var De=Wi(A.values,ae),Ke=_.current[ae].validate(De);return JC(Ke)?(M({type:"SET_ISVALIDATING",payload:!0}),Ke.then(function(Xe){return Xe}).then(function(Xe){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Xe}}),M({type:"SET_ISVALIDATING",payload:!1})})):(M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Ke}}),Promise.resolve(Ke))}else if(m.validationSchema)return M({type:"SET_ISVALIDATING",payload:!0}),D(A.values,ae).then(function(Xe){return Xe}).then(function(Xe){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Xe[ae]}}),M({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),F=w.useCallback(function(ae,De){var Ke=De.validate;_.current[ae]={validate:Ke}},[]),W=w.useCallback(function(ae){delete _.current[ae]},[]),X=Xa(function(ae,De){M({type:"SET_TOUCHED",payload:ae});var Ke=De===void 0?i:De;return Ke?K(A.values):Promise.resolve()}),Z=w.useCallback(function(ae){M({type:"SET_ERRORS",payload:ae})},[]),U=Xa(function(ae,De){var Ke=qo(ae)?ae(A.values):ae;M({type:"SET_VALUES",payload:Ke});var Xe=De===void 0?n:De;return Xe?K(Ke):Promise.resolve()}),Q=w.useCallback(function(ae,De){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:De}})},[]),re=Xa(function(ae,De,Ke){M({type:"SET_FIELD_VALUE",payload:{field:ae,value:De}});var Xe=Ke===void 0?n:Ke;return Xe?K(au(A.values,ae,De)):Promise.resolve()}),fe=w.useCallback(function(ae,De){var Ke=De,Xe=ae,xe;if(!QC(ae)){ae.persist&&ae.persist();var Ne=ae.target?ae.target:ae.currentTarget,Ct=Ne.type,Dt=Ne.name,Te=Ne.id,At=Ne.value,He=Ne.checked,vt=Ne.outerHTML,nn=Ne.options,Rn=Ne.multiple;Ke=De||Dt||Te,Xe=/number|range/.test(Ct)?(xe=parseFloat(At),isNaN(xe)?"":xe):/checkbox/.test(Ct)?O$e(Wi(A.values,Ke),He,At):nn&&Rn?A$e(nn):At}Ke&&re(Ke,Xe)},[re,A.values]),Ee=Xa(function(ae){if(QC(ae))return function(De){return fe(De,ae)};fe(ae)}),be=Xa(function(ae,De,Ke){De===void 0&&(De=!0),M({type:"SET_FIELD_TOUCHED",payload:{field:ae,value:De}});var Xe=Ke===void 0?i:Ke;return Xe?K(A.values):Promise.resolve()}),ye=w.useCallback(function(ae,De){ae.persist&&ae.persist();var Ke=ae.target,Xe=Ke.name,xe=Ke.id,Ne=Ke.outerHTML,Ct=De||Xe||xe;be(Ct,!0)},[be]),ze=Xa(function(ae){if(QC(ae))return function(De){return ye(De,ae)};ye(ae)}),Me=w.useCallback(function(ae){qo(ae)?M({type:"SET_FORMIK_STATE",payload:ae}):M({type:"SET_FORMIK_STATE",payload:function(){return ae}})},[]),rt=w.useCallback(function(ae){M({type:"SET_STATUS",payload:ae})},[]),We=w.useCallback(function(ae){M({type:"SET_ISSUBMITTING",payload:ae})},[]),Be=Xa(function(){return M({type:"SUBMIT_ATTEMPT"}),K().then(function(ae){var De=ae instanceof Error,Ke=!De&&Object.keys(ae).length===0;if(Ke){var Xe;try{if(Xe=at(),Xe===void 0)return}catch(xe){throw xe}return Promise.resolve(Xe).then(function(xe){return E.current&&M({type:"SUBMIT_SUCCESS"}),xe}).catch(function(xe){if(E.current)throw M({type:"SUBMIT_FAILURE"}),xe})}else if(E.current&&(M({type:"SUBMIT_FAILURE"}),De))throw ae})}),wt=Xa(function(ae){ae&&ae.preventDefault&&qo(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&qo(ae.stopPropagation)&&ae.stopPropagation(),Be().catch(function(De){console.warn("Warning: An unhandled error was caught from submitForm()",De)})}),Fe={resetForm:te,validateForm:K,validateField:G,setErrors:Z,setFieldError:Q,setFieldTouched:be,setFieldValue:re,setStatus:rt,setSubmitting:We,setTouched:X,setValues:U,setFormikState:Me,submitForm:Be},at=Xa(function(){return d(A.values,Fe)}),bt=Xa(function(ae){ae&&ae.preventDefault&&qo(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&qo(ae.stopPropagation)&&ae.stopPropagation(),te()}),Le=w.useCallback(function(ae){return{value:Wi(A.values,ae),error:Wi(A.errors,ae),touched:!!Wi(A.touched,ae),initialValue:Wi(y.current,ae),initialTouched:!!Wi(x.current,ae),initialError:Wi(b.current,ae)}},[A.errors,A.touched,A.values]),ut=w.useCallback(function(ae){return{setValue:function(Ke,Xe){return re(ae,Ke,Xe)},setTouched:function(Ke,Xe){return be(ae,Ke,Xe)},setError:function(Ke){return Q(ae,Ke)}}},[re,be,Q]),Mt=w.useCallback(function(ae){var De=yw(ae),Ke=De?ae.name:ae,Xe=Wi(A.values,Ke),xe={name:Ke,value:Xe,onChange:Ee,onBlur:ze};if(De){var Ne=ae.type,Ct=ae.value,Dt=ae.as,Te=ae.multiple;Ne==="checkbox"?Ct===void 0?xe.checked=!!Xe:(xe.checked=!!(Array.isArray(Xe)&&~Xe.indexOf(Ct)),xe.value=Ct):Ne==="radio"?(xe.checked=Xe===Ct,xe.value=Ct):Dt==="select"&&Te&&(xe.value=xe.value||[],xe.multiple=!0)}return xe},[ze,Ee,A.values]),ct=w.useMemo(function(){return!yd(y.current,A.values)},[y.current,A.values]),_t=w.useMemo(function(){return typeof s<"u"?ct?A.errors&&Object.keys(A.errors).length===0:s!==!1&&qo(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,ct,A.errors,m]),un=qn({},A,{initialValues:y.current,initialErrors:b.current,initialTouched:x.current,initialStatus:k.current,handleBlur:ze,handleChange:Ee,handleReset:bt,handleSubmit:wt,resetForm:te,setErrors:Z,setFormikState:Me,setFieldTouched:be,setFieldValue:re,setFieldError:Q,setStatus:rt,setSubmitting:We,setTouched:X,setValues:U,submitForm:Be,validateForm:K,validateField:G,isValid:_t,dirty:ct,unregisterField:W,registerField:F,getFieldProps:Mt,getFieldMeta:Le,getFieldHelpers:ut,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return un}function Qy(e){var t=E$e(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return w.useImperativeHandle(o,function(){return t}),w.createElement(_$e,{value:t},n?w.createElement(n,t):i?i(t):r?qo(r)?r(t):WK(r)?null:w.Children.only(r):null)}function P$e(e){var t={};if(e.inner){if(e.inner.length===0)return au(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Wi(t,a.path)||(t=au(t,a.path,a.message))}}return t}function T$e(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=m_(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function m_(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||ON(i)?m_(i):i!==""?i:void 0}):ON(e[r])?t[r]=m_(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function L$e(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?d_(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=d_(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function A$e(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function O$e(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var M$e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function Xa(e){var t=w.useRef(e);return M$e(function(){t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(qn({},t,{length:n+1}))}else return[]},j$e=function(e){w$e(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,d=l.formik.setFormikState;d(function(h){var m=typeof s=="function"?s:o,y=typeof a=="function"?a:o,b=au(h.values,u,o(Wi(h.values,u))),x=s?m(Wi(h.errors,u)):void 0,k=a?y(Wi(h.touched,u)):void 0;return rj(x)&&(x=void 0),rj(k)&&(k=void 0),qn({},h,{values:b,errors:s?au(h.errors,u,x):h.errors,touched:a?au(h.touched,u,k):h.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(p0(a),[x$e(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return D$e(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return R$e(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return e7(s,o,a)},function(s){return e7(s,o,null)},function(s){return e7(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return N$e(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(nj(i)),i.pop=i.pop.bind(nj(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!yd(Wi(i.formik.values,i.name),Wi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?p0(a):[];return o||(o=s[i]),qo(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,d=o.formik,h=Mh(d,["validate","validationSchema"]),m=qn({},i,{form:h,name:u});return a?w.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):WK(l)?null:w.Children.only(l):null},t}(w.Component);j$e.defaultProps={validateOnChange:!0};function B$e(e){const{model:t}=e,r=he(b=>b.system.model_list)[t],i=Oe(),{t:o}=Ge(),a=he(b=>b.system.isProcessing),s=he(b=>b.system.isConnected),[l,u]=w.useState("same"),[d,h]=w.useState("");w.useEffect(()=>{u("same")},[t]);const m=()=>{u("same")},y=()=>{const b={model_name:t,save_location:l,custom_location:l==="custom"&&d!==""?d:null};i(ns(!0)),i(n_e(b))};return v.jsxs(fw,{title:`${o("modelmanager:convert")} ${t}`,acceptCallback:y,cancelCallback:m,acceptButtonText:`${o("modelmanager:convert")}`,triggerComponent:v.jsxs(nr,{size:"sm","aria-label":o("modelmanager:convertToDiffusers"),isDisabled:r.status==="active"||a||!s,className:" modal-close-btn",marginRight:"2rem",children:["🧨 ",o("modelmanager:convertToDiffusers")]}),motionPreset:"slideInBottom",children:[v.jsxs(je,{flexDirection:"column",rowGap:4,children:[v.jsx(Yt,{children:o("modelmanager:convertToDiffusersHelpText1")}),v.jsxs(w$,{children:[v.jsx(xv,{children:o("modelmanager:convertToDiffusersHelpText2")}),v.jsx(xv,{children:o("modelmanager:convertToDiffusersHelpText3")}),v.jsx(xv,{children:o("modelmanager:convertToDiffusersHelpText4")}),v.jsx(xv,{children:o("modelmanager:convertToDiffusersHelpText5")})]}),v.jsx(Yt,{children:o("modelmanager:convertToDiffusersHelpText6")})]}),v.jsxs(je,{flexDir:"column",gap:4,children:[v.jsxs(je,{marginTop:"1rem",flexDir:"column",gap:2,children:[v.jsx(Yt,{fontWeight:"bold",children:"Save Location"}),v.jsx(HE,{value:l,onChange:b=>u(b),children:v.jsxs(je,{gap:4,children:[v.jsx(Td,{value:"same",children:o("modelmanager:sameFolder")}),v.jsx(Td,{value:"root",children:o("modelmanager:invokeRoot")}),v.jsx(Td,{value:"custom",children:o("modelmanager:custom")})]})})]}),l==="custom"&&v.jsxs(je,{flexDirection:"column",rowGap:2,children:[v.jsx(Yt,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:o("modelmanager:customSaveLocation")}),v.jsx(fr,{value:d,onChange:b=>{b.target.value!==""&&h(b.target.value)},width:"25rem"})]})]})]})}const F$e=lt([or],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ij=64,oj=2048;function $$e(){const{openModel:e,model_list:t}=he(F$e),n=he(l=>l.system.isProcessing),r=Oe(),{t:i}=Ge(),[o,a]=w.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});w.useEffect(()=>{var l,u,d,h,m,y,b;if(e){const x=ke.pickBy(t,(k,E)=>ke.isEqual(E,e));a({name:e,description:(l=x[e])==null?void 0:l.description,config:(u=x[e])==null?void 0:u.config,weights:(d=x[e])==null?void 0:d.weights,vae:(h=x[e])==null?void 0:h.vae,width:(m=x[e])==null?void 0:m.width,height:(y=x[e])==null?void 0:y.height,default:(b=x[e])==null?void 0:b.default,format:"ckpt"})}},[t,e]);const s=l=>{r(Vy({...l,width:Number(l.width),height:Number(l.height)}))};return e?v.jsxs(je,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[v.jsxs(je,{alignItems:"center",gap:4,justifyContent:"space-between",children:[v.jsx(Yt,{fontSize:"lg",fontWeight:"bold",children:e}),v.jsx(B$e,{model:e})]}),v.jsx(je,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:v.jsx(Qy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>v.jsx("form",{onSubmit:l,children:v.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[v.jsxs(fn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?v.jsx(cr,{children:u.description}):v.jsx(ur,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.config&&d.config,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"config",name:"config",type:"text",width:"lg"}),u.config&&d.config?v.jsx(cr,{children:u.config}):v.jsx(ur,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.weights&&d.weights,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"weights",name:"weights",type:"text",width:"lg"}),u.weights&&d.weights?v.jsx(cr,{children:u.weights}):v.jsx(ur,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.vae&&d.vae,children:[v.jsx(En,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae",name:"vae",type:"text",width:"lg"}),u.vae&&d.vae?v.jsx(cr,{children:u.vae}):v.jsx(ur,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(Ey,{width:"100%",children:[v.jsxs(fn,{isInvalid:!!u.width&&d.width,children:[v.jsx(En,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"width",name:"width",children:({field:h,form:m})=>v.jsx(ia,{id:"width",name:"width",min:ij,max:oj,step:64,value:m.values.width,onChange:y=>m.setFieldValue(h.name,Number(y))})}),u.width&&d.width?v.jsx(cr,{children:u.width}):v.jsx(ur,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.height&&d.height,children:[v.jsx(En,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"height",name:"height",children:({field:h,form:m})=>v.jsx(ia,{id:"height",name:"height",min:ij,max:oj,step:64,value:m.values.height,onChange:y=>m.setFieldValue(h.name,Number(y))})}),u.height&&d.height?v.jsx(cr,{children:u.height}):v.jsx(ur,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):v.jsx(je,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:v.jsx(Yt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const z$e=lt([or],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function H$e(){const{openModel:e,model_list:t}=he(z$e),n=he(l=>l.system.isProcessing),r=Oe(),{t:i}=Ge(),[o,a]=w.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});w.useEffect(()=>{var l,u,d,h,m,y,b,x,k,E,_,P,A,M,R,D;if(e){const j=ke.pickBy(t,(z,H)=>ke.isEqual(H,e));a({name:e,description:(l=j[e])==null?void 0:l.description,path:(u=j[e])!=null&&u.path&&((d=j[e])==null?void 0:d.path)!=="None"?(h=j[e])==null?void 0:h.path:"",repo_id:(m=j[e])!=null&&m.repo_id&&((y=j[e])==null?void 0:y.repo_id)!=="None"?(b=j[e])==null?void 0:b.repo_id:"",vae:{repo_id:(k=(x=j[e])==null?void 0:x.vae)!=null&&k.repo_id?(_=(E=j[e])==null?void 0:E.vae)==null?void 0:_.repo_id:"",path:(A=(P=j[e])==null?void 0:P.vae)!=null&&A.path?(R=(M=j[e])==null?void 0:M.vae)==null?void 0:R.path:""},default:(D=j[e])==null?void 0:D.default,format:"diffusers"})}},[t,e]);const s=l=>{const u=l;l.path===""&&delete u.path,l.repo_id===""&&delete u.repo_id,l.vae.path===""&&delete u.vae.path,l.vae.repo_id===""&&delete u.vae.repo_id,r(Vy(l))};return e?v.jsxs(je,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[v.jsx(je,{alignItems:"center",children:v.jsx(Yt,{fontSize:"lg",fontWeight:"bold",children:e})}),v.jsx(je,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:v.jsx(Qy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>{var h,m,y,b,x,k,E,_,P,A;return v.jsx("form",{onSubmit:l,children:v.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[v.jsxs(fn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?v.jsx(cr,{children:u.description}):v.jsx(ur,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.path&&d.path,isRequired:!0,children:[v.jsx(En,{htmlFor:"path",fontSize:"sm",children:i("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"path",name:"path",type:"text",width:"lg"}),u.path&&d.path?v.jsx(cr,{children:u.path}):v.jsx(ur,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.repo_id&&d.repo_id,children:[v.jsx(En,{htmlFor:"repo_id",fontSize:"sm",children:i("modelmanager:repo_id")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"repo_id",name:"repo_id",type:"text",width:"lg"}),u.repo_id&&d.repo_id?v.jsx(cr,{children:u.repo_id}):v.jsx(ur,{margin:0,children:i("modelmanager:repoIDValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!((h=u.vae)!=null&&h.path)&&((m=d.vae)==null?void 0:m.path),children:[v.jsx(En,{htmlFor:"vae.path",fontSize:"sm",children:i("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.path",name:"vae.path",type:"text",width:"lg"}),(y=u.vae)!=null&&y.path&&((b=d.vae)!=null&&b.path)?v.jsx(cr,{children:(x=u.vae)==null?void 0:x.path}):v.jsx(ur,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!((k=u.vae)!=null&&k.repo_id)&&((E=d.vae)==null?void 0:E.repo_id),children:[v.jsx(En,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelmanager:vaeRepoID")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"lg"}),(_=u.vae)!=null&&_.repo_id&&((P=d.vae)!=null&&P.repo_id)?v.jsx(cr,{children:(A=u.vae)==null?void 0:A.repo_id}):v.jsx(ur,{margin:0,children:i("modelmanager:vaeRepoIDValidationMsg")})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})}})})]}):v.jsx(je,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:v.jsx(Yt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const qK=lt([or],e=>{const{model_list:t}=e,n=[];return ke.forEach(t,r=>{n.push(r.weights)}),n});function V$e(){const{t:e}=Ge();return v.jsx(Eo,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function aj({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=he(qK),i=o=>{t.includes(o.target.value)?n(ke.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return v.jsxs(Eo,{position:"relative",children:[r.includes(e.location)?v.jsx(V$e,{}):null,v.jsx(er,{value:e.name,label:v.jsx(v.Fragment,{children:v.jsxs(yn,{alignItems:"start",children:[v.jsx("p",{style:{fontWeight:"bold"},children:e.name}),v.jsx("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function W$e(){const e=Oe(),{t}=Ge(),n=he(P=>P.system.searchFolder),r=he(P=>P.system.foundModels),i=he(qK),o=he(P=>P.ui.shouldShowExistingModelsInSearch),a=he(P=>P.system.isProcessing),[s,l]=N.useState([]),[u,d]=N.useState("v1"),[h,m]=N.useState(""),y=()=>{e(QU(null)),e(JU(null)),l([])},b=P=>{e(yD(P.checkpointFolder))},x=()=>{l([]),r&&r.forEach(P=>{i.includes(P.location)||l(A=>[...A,P.name])})},k=()=>{l([])},E=()=>{const P=r==null?void 0:r.filter(M=>s.includes(M.name)),A={v1:"configs/stable-diffusion/v1-inference.yaml",v2:"configs/stable-diffusion/v2-inference-v.yaml",inpainting:"configs/stable-diffusion/v1-inpainting-inference.yaml",custom:h};P==null||P.forEach(M=>{const R={name:M.name,description:"",config:A[u],weights:M.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(Vy(R))}),l([])},_=()=>{const P=[],A=[];return r&&r.forEach((M,R)=>{i.includes(M.location)?A.push(v.jsx(aj,{model:M,modelsToAdd:s,setModelsToAdd:l},R)):P.push(v.jsx(aj,{model:M,modelsToAdd:s,setModelsToAdd:l},R))}),v.jsxs(v.Fragment,{children:[P,o&&A]})};return v.jsxs(v.Fragment,{children:[n?v.jsxs(je,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[v.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),v.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),v.jsx(Je,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:v.jsx(Yx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(yD(n))}),v.jsx(Je,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:v.jsx(Uy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:y})]}):v.jsx(Qy,{initialValues:{checkpointFolder:""},onSubmit:P=>{b(P)},children:({handleSubmit:P})=>v.jsx("form",{onSubmit:P,children:v.jsxs(Ey,{columnGap:"0.5rem",children:[v.jsx(fn,{isRequired:!0,width:"max-content",children:v.jsx(dr,{as:fr,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),v.jsx(Je,{icon:v.jsx(iPe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&v.jsxs(je,{flexDirection:"column",rowGap:"1rem",children:[v.jsxs(je,{justifyContent:"space-between",alignItems:"center",children:[v.jsxs("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),v.jsxs("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),v.jsxs(je,{columnGap:"0.5rem",justifyContent:"space-between",children:[v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(nr,{isDisabled:s.length===r.length,onClick:x,children:t("modelmanager:selectAll")}),v.jsx(nr,{isDisabled:s.length===0,onClick:k,children:t("modelmanager:deselectAll")}),v.jsx(er,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(TCe(!o))})]}),v.jsx(nr,{isDisabled:s.length===0,onClick:E,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),v.jsxs(je,{gap:4,backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",flexDirection:"column",children:[v.jsxs(je,{gap:4,children:[v.jsx(Yt,{fontWeight:"bold",color:"var(--text-color-secondary)",children:"Pick Model Type:"}),v.jsx(HE,{value:u,onChange:P=>d(P),defaultValue:"v1",name:"model_type",children:v.jsxs(je,{gap:4,children:[v.jsx(Td,{value:"v1",children:t("modelmanager:v1")}),v.jsx(Td,{value:"v2",children:t("modelmanager:v2")}),v.jsx(Td,{value:"inpainting",children:t("modelmanager:inpainting")}),v.jsx(Td,{value:"custom",children:t("modelmanager:customConfig")})]})})]}),u==="custom"&&v.jsxs(je,{flexDirection:"column",rowGap:2,children:[v.jsx(Yt,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:t("modelmanager:pathToCustomConfig")}),v.jsx(fr,{value:h,onChange:P=>{P.target.value!==""&&m(P.target.value)},width:"42.5rem"})]})]}),v.jsxs(je,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&v.jsx(Yt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):v.jsx(Yt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),_()]})]})]})}const sj=64,lj=2048;function U$e(){const e=Oe(),{t}=Ge(),n=he(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(u){let d;return r(u)&&(d=t("modelmanager:cannotUseSpaces")),d}const o={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=u=>{e(Vy(u)),e(Wh(null))},[s,l]=N.useState(!1);return v.jsxs(v.Fragment,{children:[v.jsx(Je,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Wh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:v.jsx(lq,{})}),v.jsx(W$e,{}),v.jsx(er,{label:t("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&v.jsx(Qy,{initialValues:o,onSubmit:a,children:({handleSubmit:u,errors:d,touched:h})=>v.jsx("form",{onSubmit:u,children:v.jsxs(yn,{rowGap:"0.5rem",children:[v.jsx(Yt,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelmanager:manual")}),v.jsxs(fn,{isInvalid:!!d.name&&h.name,isRequired:!0,children:[v.jsx(En,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),d.name&&h.name?v.jsx(cr,{children:d.name}):v.jsx(ur,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.description&&h.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"2xl"}),d.description&&h.description?v.jsx(cr,{children:d.description}):v.jsx(ur,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.config&&h.config,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:config")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"config",name:"config",type:"text",width:"2xl"}),d.config&&h.config?v.jsx(cr,{children:d.config}):v.jsx(ur,{margin:0,children:t("modelmanager:configValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.weights&&h.weights,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"weights",name:"weights",type:"text",width:"2xl"}),d.weights&&h.weights?v.jsx(cr,{children:d.weights}):v.jsx(ur,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.vae&&h.vae,children:[v.jsx(En,{htmlFor:"vae",fontSize:"sm",children:t("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae",name:"vae",type:"text",width:"2xl"}),d.vae&&h.vae?v.jsx(cr,{children:d.vae}):v.jsx(ur,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(Ey,{width:"100%",children:[v.jsxs(fn,{isInvalid:!!d.width&&h.width,children:[v.jsx(En,{htmlFor:"width",fontSize:"sm",children:t("modelmanager:width")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"width",name:"width",children:({field:m,form:y})=>v.jsx(ia,{id:"width",name:"width",min:sj,max:lj,step:64,width:"90%",value:y.values.width,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.width&&h.width?v.jsx(cr,{children:d.width}):v.jsx(ur,{margin:0,children:t("modelmanager:widthValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.height&&h.height,children:[v.jsx(En,{htmlFor:"height",fontSize:"sm",children:t("modelmanager:height")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"height",name:"height",children:({field:m,form:y})=>v.jsx(ia,{id:"height",name:"height",min:sj,max:lj,width:"90%",step:64,value:y.values.height,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.height&&h.height?v.jsx(cr,{children:d.height}):v.jsx(ur,{margin:0,children:t("modelmanager:heightValidationMsg")})]})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})})]})}function n4({children:e}){return v.jsx(je,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:e})}function G$e(){const e=Oe(),{t}=Ge(),n=he(s=>s.system.isProcessing);function r(s){return/\s/.test(s)}function i(s){let l;return r(s)&&(l=t("modelmanager:cannotUseSpaces")),l}const o={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=s=>{const l=s;s.path===""&&delete l.path,s.repo_id===""&&delete l.repo_id,s.vae.path===""&&delete l.vae.path,s.vae.repo_id===""&&delete l.vae.repo_id,e(Vy(l)),e(Wh(null))};return v.jsxs(je,{children:[v.jsx(Je,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Wh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:v.jsx(lq,{})}),v.jsx(Qy,{initialValues:o,onSubmit:a,children:({handleSubmit:s,errors:l,touched:u})=>{var d,h,m,y,b,x,k,E,_,P;return v.jsx("form",{onSubmit:s,children:v.jsxs(yn,{rowGap:"0.5rem",children:[v.jsx(n4,{children:v.jsxs(fn,{isInvalid:!!l.name&&u.name,isRequired:!0,children:[v.jsx(En,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),l.name&&u.name?v.jsx(cr,{children:l.name}):v.jsx(ur,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]})}),v.jsx(n4,{children:v.jsxs(fn,{isInvalid:!!l.description&&u.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),l.description&&u.description?v.jsx(cr,{children:l.description}):v.jsx(ur,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]})}),v.jsxs(n4,{children:[v.jsx(Yt,{fontWeight:"bold",fontSize:"sm",children:t("modelmanager:formMessageDiffusersModelLocation")}),v.jsx(Yt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersModelLocationDesc")}),v.jsxs(fn,{isInvalid:!!l.path&&u.path,children:[v.jsx(En,{htmlFor:"path",fontSize:"sm",children:t("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"path",name:"path",type:"text",width:"2xl"}),l.path&&u.path?v.jsx(cr,{children:l.path}):v.jsx(ur,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!l.repo_id&&u.repo_id,children:[v.jsx(En,{htmlFor:"repo_id",fontSize:"sm",children:t("modelmanager:repo_id")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),l.repo_id&&u.repo_id?v.jsx(cr,{children:l.repo_id}):v.jsx(ur,{margin:0,children:t("modelmanager:repoIDValidationMsg")})]})]})]}),v.jsxs(n4,{children:[v.jsx(Yt,{fontWeight:"bold",children:t("modelmanager:formMessageDiffusersVAELocation")}),v.jsx(Yt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersVAELocationDesc")}),v.jsxs(fn,{isInvalid:!!((d=l.vae)!=null&&d.path)&&((h=u.vae)==null?void 0:h.path),children:[v.jsx(En,{htmlFor:"vae.path",fontSize:"sm",children:t("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(m=l.vae)!=null&&m.path&&((y=u.vae)!=null&&y.path)?v.jsx(cr,{children:(b=l.vae)==null?void 0:b.path}):v.jsx(ur,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!((x=l.vae)!=null&&x.repo_id)&&((k=u.vae)==null?void 0:k.repo_id),children:[v.jsx(En,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelmanager:vaeRepoID")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(E=l.vae)!=null&&E.repo_id&&((_=u.vae)!=null&&_.repo_id)?v.jsx(cr,{children:(P=l.vae)==null?void 0:P.repo_id}):v.jsx(ur,{margin:0,children:t("modelmanager:vaeRepoIDValidationMsg")})]})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function uj({text:e,onClick:t}){return v.jsx(je,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:t,children:v.jsx(Yt,{fontWeight:"bold",children:e})})}function q$e(){const{isOpen:e,onOpen:t,onClose:n}=qh(),r=he(s=>s.ui.addNewModelUIOption),i=Oe(),{t:o}=Ge(),a=()=>{n(),i(Wh(null))};return v.jsxs(v.Fragment,{children:[v.jsx(nr,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:v.jsxs(je,{columnGap:"0.5rem",alignItems:"center",children:[v.jsx(Uy,{}),o("modelmanager:addNew")]})}),v.jsxs(Zd,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[v.jsx(Qd,{}),v.jsxs(ep,{className:"modal add-model-modal",fontFamily:"Inter",children:[v.jsx(k0,{children:o("modelmanager:addNewModel")}),v.jsx(Iy,{marginTop:"0.3rem"}),v.jsxs(a0,{className:"add-model-modal-body",children:[r==null&&v.jsxs(je,{columnGap:"1rem",children:[v.jsx(uj,{text:o("modelmanager:addCheckpointModel"),onClick:()=>i(Wh("ckpt"))}),v.jsx(uj,{text:o("modelmanager:addDiffuserModel"),onClick:()=>i(Wh("diffusers"))})]}),r=="ckpt"&&v.jsx(U$e,{}),r=="diffusers"&&v.jsx(G$e,{})]})]})]})]})}function r4(e){const{isProcessing:t,isConnected:n}=he(y=>y.system),r=he(y=>y.system.openModel),{t:i}=Ge(),o=Oe(),{name:a,status:s,description:l}=e,u=()=>{o(tq(a))},d=()=>{o(jR(a))},h=()=>{o(t_e(a)),o(jR(null))},m=()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}};return v.jsxs(je,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[v.jsx(Eo,{onClick:d,cursor:"pointer",children:v.jsx(uo,{label:l,hasArrow:!0,placement:"bottom",children:v.jsx(Yt,{fontWeight:"bold",children:a})})}),v.jsx(C$,{onClick:d,cursor:"pointer"}),v.jsxs(je,{gap:2,alignItems:"center",children:[v.jsx(Yt,{color:m(),children:s}),v.jsx(ls,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),v.jsx(Je,{icon:v.jsx(GEe,{}),size:"sm",onClick:d,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),v.jsx(fw,{title:i("modelmanager:deleteModel"),acceptCallback:h,acceptButtonText:i("modelmanager:delete"),triggerComponent:v.jsx(Je,{icon:v.jsx(UEe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:v.jsxs(je,{rowGap:"1rem",flexDirection:"column",children:[v.jsx("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),v.jsx("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const Y$e=lt(or,e=>ke.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function t7({label:e,isActive:t,onClick:n}){return v.jsx(nr,{onClick:n,isActive:t,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:e})}const K$e=()=>{const e=he(Y$e),[t,n]=w.useState(""),[r,i]=w.useState("all"),[o,a]=w.useTransition(),{t:s}=Ge(),l=d=>{a(()=>{n(d.target.value)})},u=w.useMemo(()=>{const d=[],h=[],m=[],y=[];return e.forEach((b,x)=>{b.name.toLowerCase().includes(t.toLowerCase())&&(m.push(v.jsx(r4,{name:b.name,status:b.status,description:b.description},x)),b.format===r&&y.push(v.jsx(r4,{name:b.name,status:b.status,description:b.description},x))),b.format!=="diffusers"?d.push(v.jsx(r4,{name:b.name,status:b.status,description:b.description},x)):h.push(v.jsx(r4,{name:b.name,status:b.status,description:b.description},x))}),t!==""?r==="all"?v.jsx(Eo,{marginTop:"1rem",children:m}):v.jsx(Eo,{marginTop:"1rem",children:y}):v.jsxs(je,{flexDirection:"column",rowGap:"1.5rem",children:[r==="all"&&v.jsxs(v.Fragment,{children:[v.jsxs(Eo,{children:[v.jsx(Yt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:s("modelmanager:checkpointModels")}),d]}),v.jsxs(Eo,{children:[v.jsx(Yt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:s("modelmanager:diffusersModels")}),h]})]}),r==="ckpt"&&v.jsx(je,{flexDirection:"column",marginTop:"1rem",children:d}),r==="diffusers"&&v.jsx(je,{flexDirection:"column",marginTop:"1rem",children:h})]})},[e,t,s,r]);return v.jsxs(je,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[v.jsxs(je,{justifyContent:"space-between",children:[v.jsx(Yt,{fontSize:"1.4rem",fontWeight:"bold",children:s("modelmanager:availableModels")}),v.jsx(q$e,{})]}),v.jsx(fr,{onChange:l,label:s("modelmanager:search")}),v.jsxs(je,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(t7,{label:s("modelmanager:allModels"),onClick:()=>i("all"),isActive:r==="all"}),v.jsx(t7,{label:s("modelmanager:checkpointModels"),onClick:()=>i("ckpt"),isActive:r==="ckpt"}),v.jsx(t7,{label:s("modelmanager:diffusersModels"),onClick:()=>i("diffusers"),isActive:r==="diffusers"})]}),u]})]})};function X$e({children:e}){const{isOpen:t,onOpen:n,onClose:r}=qh(),i=he(s=>s.system.model_list),o=he(s=>s.system.openModel),{t:a}=Ge();return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:n}),v.jsxs(Zd,{isOpen:t,onClose:r,size:"6xl",children:[v.jsx(Qd,{}),v.jsxs(ep,{className:"modal",fontFamily:"Inter",children:[v.jsx(Iy,{className:"modal-close-btn"}),v.jsx(k0,{fontWeight:"bold",children:a("modelmanager:modelManager")}),v.jsxs(je,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[v.jsx(K$e,{}),o&&i[o].format==="diffusers"?v.jsx(H$e,{}):v.jsx($$e,{})]})]})]})]})}const Z$e=lt([or],e=>{const{isProcessing:t,model_list:n}=e;return{models:ke.map(n,(i,o)=>o),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),Q$e=()=>{const e=Oe(),{models:t,isProcessing:n}=he(Z$e),r=he(oq),i=o=>{e(tq(o.target.value))};return v.jsx(je,{style:{paddingLeft:"0.3rem"},children:v.jsx(rl,{style:{fontSize:"0.8rem"},tooltip:r.description,isDisabled:n,value:r.name,validValues:t,onChange:i})})},J$e=lt([or,Sp],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:ke.map(o,(u,d)=>d),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),eze=({children:e})=>{const t=Oe(),{t:n}=Ge(),r=he(_=>_.generation.steps),{isOpen:i,onOpen:o,onClose:a}=qh(),{isOpen:s,onOpen:l,onClose:u}=qh(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:m,saveIntermediatesInterval:y,enableImageDebugging:b,shouldUseCanvasBetaLayout:x}=he(J$e),k=()=>{iq.purge().then(()=>{a(),l()})},E=_=>{_>r&&(_=r),_<1&&(_=1),t(pCe(_))};return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:o}),v.jsxs(Zd,{isOpen:i,onClose:a,size:"lg",children:[v.jsx(Qd,{}),v.jsxs(ep,{className:"modal settings-modal",children:[v.jsx(k0,{className:"settings-modal-header",children:n("common:settingsLabel")}),v.jsx(Iy,{className:"modal-close-btn"}),v.jsxs(a0,{className:"settings-modal-content",children:[v.jsxs("div",{className:"settings-modal-items",children:[v.jsxs("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[v.jsx(rl,{label:n("settings:displayInProgress"),validValues:C7e,value:d,onChange:_=>t(sCe(_.target.value))}),d==="full-res"&&v.jsx(ia,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:E,value:y,width:"auto",textAlign:"center"})]}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:_=>t(XU(_.target.checked))}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:_=>t(dCe(_.target.checked))}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:x,onChange:_=>t(PCe(_.target.checked))})]}),v.jsxs("div",{className:"settings-modal-items",children:[v.jsx("h2",{style:{fontWeight:"bold"},children:"Developer"}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:_=>t(gCe(_.target.checked))})]}),v.jsxs("div",{className:"settings-modal-reset",children:[v.jsx(Bh,{size:"md",children:n("settings:resetWebUI")}),v.jsx(ls,{colorScheme:"red",onClick:k,children:n("settings:resetWebUI")}),v.jsx(Yt,{children:n("settings:resetWebUIDesc1")}),v.jsx(Yt,{children:n("settings:resetWebUIDesc2")})]})]}),v.jsx(wx,{children:v.jsx(ls,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),v.jsxs(Zd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[v.jsx(Qd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),v.jsx(ep,{children:v.jsx(a0,{pb:6,pt:6,children:v.jsx(je,{justifyContent:"center",children:v.jsx(Yt,{fontSize:"lg",children:v.jsx(Yt,{children:n("settings:resetComplete")})})})})})]})]})},tze=lt(or,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),nze=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=he(tze),s=Oe(),{t:l}=Ge();let u;e&&!o?u="status-good":u="status-bad";let d=i;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(d)&&(u="status-working"),d&&t&&r>1&&(d=`${l(d)} (${n}/${r})`);const m=o&&!a?"Click to clear, check logs for details":void 0,y=o&&!a?"pointer":"initial",b=()=>{(o||!a)&&s(ZU())};return v.jsx(uo,{label:m,children:v.jsx(Yt,{cursor:y,onClick:b,className:`status ${u}`,children:l(d)})})};function rze(){const{t:e}=Ge(),{setColorMode:t,colorMode:n}=gy(),r=Oe(),i=he(l=>l.ui.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};w.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(wCe(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(v.jsx(nr,{style:{width:"6rem"},leftIcon:i===u?v.jsx(RP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(OEe,{})}),children:v.jsx(yn,{align:"stretch",children:s()})})}function ize(){const{t:e,i18n:t}=Ge(),n={en:e("common:langEnglish"),nl:e("common:langDutch"),fr:e("common:langFrench"),de:e("common:langGerman"),it:e("common:langItalian"),ja:e("common:langJapanese"),pl:e("common:langPolish"),pt_br:e("common:langBrPortuguese"),ru:e("common:langRussian"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish"),ua:e("common:langUkranian")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(v.jsx(nr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:v.jsx(TEe,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:v.jsx(yn,{children:r()})})}const oze=()=>{const{t:e}=Ge(),t=he(n=>n.system.app_version);return v.jsxs("div",{className:"site-header",children:[v.jsxs("div",{className:"site-header-left-side",children:[v.jsx("img",{src:zY,alt:"invoke-ai-logo"}),v.jsxs(je,{alignItems:"center",columnGap:"0.6rem",children:[v.jsxs(Yt,{fontSize:"1.4rem",children:["invoke ",v.jsx("strong",{children:"ai"})]}),v.jsx(Yt,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),v.jsxs("div",{className:"site-header-right-side",children:[v.jsx(nze,{}),v.jsx(Q$e,{}),v.jsx(X$e,{children:v.jsx(Je,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(SEe,{})})}),v.jsx(UDe,{children:v.jsx(Je,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(PEe,{})})}),v.jsx(rze,{}),v.jsx(ize,{}),v.jsx(Je,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Fh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:v.jsx(bEe,{})})}),v.jsx(Je,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Fh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:v.jsx(pEe,{})})}),v.jsx(Je,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Fh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:v.jsx(hEe,{})})}),v.jsx(eze,{children:v.jsx(Je,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:v.jsx(aPe,{})})})]})]})};function aze(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const sze=()=>{const e=Oe(),t=he(C_e),n=By();w.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(vCe())},[e,n,t])},YK=lt([wp,Sp,Mr],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:o,shouldUseCanvasBetaLayout:a}=t,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=e,d=a&&n==="unifiedCanvas",h=!d&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!d&&(!r||!i),shouldShowParametersPanelButton:h,shouldShowParametersPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),lze=()=>{const e=Oe(),{shouldShowParametersPanel:t,shouldShowParametersPanelButton:n,shouldShowProcessButtons:r,shouldPinParametersPanel:i,shouldShowGallery:o,shouldPinGallery:a}=he(YK),s=()=>{e(Zu(!0)),i&&setTimeout(()=>e(vi(!0)),400)};return et("f",()=>{o||t?(e(Zu(!1)),e(zd(!1))):(e(Zu(!0)),e(zd(!0))),(a||i)&&setTimeout(()=>e(vi(!0)),400)},[o,t]),n?v.jsxs("div",{className:"show-hide-button-options",children:[v.jsx(Je,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:v.jsx(jP,{})}),r&&v.jsxs(v.Fragment,{children:[v.jsx(rT,{iconButton:!0}),v.jsx(tT,{})]})]}):null},uze=()=>{const e=Oe(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowParametersPanel:i,shouldPinParametersPanel:o}=he(YK),a=()=>{e(zd(!0)),r&&e(vi(!0))};return et("f",()=>{t||i?(e(Zu(!1)),e(zd(!1))):(e(Zu(!0)),e(zd(!0))),(r||o)&&setTimeout(()=>e(vi(!0)),400)},[t,i]),n?v.jsx(Je,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:v.jsx($q,{})}):null};aze();const cze=()=>(sze(),v.jsxs("div",{className:"App",children:[v.jsxs(BDe,{children:[v.jsx(VDe,{}),v.jsxs("div",{className:"app-content",children:[v.jsx(oze,{}),v.jsx(VRe,{})]}),v.jsx("div",{className:"app-console",children:v.jsx(zDe,{})})]}),v.jsx(lze,{}),v.jsx(uze,{})]})),cj=()=>v.jsx(je,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:v.jsx(ky,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})});const dze=Fj({key:"invokeai-style-cache",prepend:!0});n8.createRoot(document.getElementById("root")).render(v.jsx(N.StrictMode,{children:v.jsx(W5e,{store:rq,children:v.jsx(TW,{loading:v.jsx(cj,{}),persistor:iq,children:v.jsx(ire,{value:dze,children:v.jsx(u5e,{children:v.jsx(N.Suspense,{fallback:v.jsx(cj,{}),children:v.jsx(cze,{})})})})})})})); diff --git a/invokeai/frontend/dist/index.html b/invokeai/frontend/dist/index.html index cc74516ac2..8fc02c019c 100644 --- a/invokeai/frontend/dist/index.html +++ b/invokeai/frontend/dist/index.html @@ -5,7 +5,7 @@ InvokeAI - A Stable Diffusion Toolkit - + diff --git a/invokeai/frontend/dist/locales/modelmanager/en-US.json b/invokeai/frontend/dist/locales/modelmanager/en-US.json index c5c5eda054..f90fe59ca5 100644 --- a/invokeai/frontend/dist/locales/modelmanager/en-US.json +++ b/invokeai/frontend/dist/locales/modelmanager/en-US.json @@ -63,5 +63,23 @@ "formMessageDiffusersModelLocation": "Diffusers Model Location", "formMessageDiffusersModelLocationDesc": "Please enter at least one.", "formMessageDiffusersVAELocation": "VAE Location", - "formMessageDiffusersVAELocationDesc": "If not provided, InvokeAI will look for the VAE file inside the model location given above." + "formMessageDiffusersVAELocationDesc": "If not provided, InvokeAI will look for the VAE file inside the model location given above.", + "convert": "Convert", + "convertToDiffusers": "Convert To Diffusers", + "convertToDiffusersHelpText1": "This model will be converted to the 🧨 Diffusers format.", + "convertToDiffusersHelpText2": "This process will replace your Model Manager entry with the Diffusers version of the same model.", + "convertToDiffusersHelpText3": "Your checkpoint file on the disk will NOT be deleted or modified in anyway. You can add your checkpoint to the Model Manager again if you want to.", + "convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.", + "convertToDiffusersHelpText5": "This process will create a Diffusers version of this model in the same directory as your checkpoint. Please make sure you have enough disk space.", + "convertToDiffusersHelpText6": "Do you wish to convert this model?", + "v1": "v1", + "v2": "v2", + "inpainting": "v1 Inpainting", + "customConfig": "Custom Config", + "pathToCustomConfig": "Path To Custom Config", + "statusConverting": "Converting", + "sameFolder": "Same Folder", + "invokeRoot": "Invoke Models", + "custom": "Custom", + "customSaveLocation": "Custom Save Location" } diff --git a/invokeai/frontend/dist/locales/modelmanager/en.json b/invokeai/frontend/dist/locales/modelmanager/en.json index 967e11f061..6d6481085c 100644 --- a/invokeai/frontend/dist/locales/modelmanager/en.json +++ b/invokeai/frontend/dist/locales/modelmanager/en.json @@ -75,7 +75,11 @@ "v1": "v1", "v2": "v2", "inpainting": "v1 Inpainting", - "custom": "Custom", + "customConfig": "Custom Config", "pathToCustomConfig": "Path To Custom Config", - "statusConverting": "Converting" + "statusConverting": "Converting", + "sameFolder": "Same Folder", + "invokeRoot": "Invoke Models", + "custom": "Custom", + "customSaveLocation": "Custom Save Location" } diff --git a/invokeai/frontend/stats.html b/invokeai/frontend/stats.html index 3212c2f33c..466f841ddb 100644 --- a/invokeai/frontend/stats.html +++ b/invokeai/frontend/stats.html @@ -1,33140 +1,6177 @@ + - - - - - Rollup Visualizer - - - -
- - + - + window.addEventListener('resize', run); + + document.addEventListener('DOMContentLoaded', run); + /*-->*/ + + + From b87f7b1129f3a32cac50d5aff5ed7f9028db94ea Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Mon, 13 Feb 2023 00:30:50 +1300 Subject: [PATCH 18/39] Update Model Conversion Help Text --- invokeai/frontend/public/locales/modelmanager/en-US.json | 2 +- invokeai/frontend/public/locales/modelmanager/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/public/locales/modelmanager/en-US.json b/invokeai/frontend/public/locales/modelmanager/en-US.json index f90fe59ca5..a58592bd2f 100644 --- a/invokeai/frontend/public/locales/modelmanager/en-US.json +++ b/invokeai/frontend/public/locales/modelmanager/en-US.json @@ -70,7 +70,7 @@ "convertToDiffusersHelpText2": "This process will replace your Model Manager entry with the Diffusers version of the same model.", "convertToDiffusersHelpText3": "Your checkpoint file on the disk will NOT be deleted or modified in anyway. You can add your checkpoint to the Model Manager again if you want to.", "convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.", - "convertToDiffusersHelpText5": "This process will create a Diffusers version of this model in the same directory as your checkpoint. Please make sure you have enough disk space.", + "convertToDiffusersHelpText5": "Please make sure you have enough disk space. Models generally vary between 4GB-7GB in size.", "convertToDiffusersHelpText6": "Do you wish to convert this model?", "v1": "v1", "v2": "v2", diff --git a/invokeai/frontend/public/locales/modelmanager/en.json b/invokeai/frontend/public/locales/modelmanager/en.json index 6d6481085c..f3e2d72cc6 100644 --- a/invokeai/frontend/public/locales/modelmanager/en.json +++ b/invokeai/frontend/public/locales/modelmanager/en.json @@ -70,7 +70,7 @@ "convertToDiffusersHelpText2": "This process will replace your Model Manager entry with the Diffusers version of the same model.", "convertToDiffusersHelpText3": "Your checkpoint file on the disk will NOT be deleted or modified in anyway. You can add your checkpoint to the Model Manager again if you want to.", "convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.", - "convertToDiffusersHelpText5": "This process will create a Diffusers version of this model in the same directory as your checkpoint. Please make sure you have enough disk space.", + "convertToDiffusersHelpText5": "Please make sure you have enough disk space. Models generally vary between 4GB-7GB in size.", "convertToDiffusersHelpText6": "Do you wish to convert this model?", "v1": "v1", "v2": "v2", From e561d19206875e6bfd24cbd859871b7cc571dcb9 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sun, 12 Feb 2023 17:20:13 -0500 Subject: [PATCH 19/39] a few adjustments - fix unused variables and f-strings found by pyflakes - use global_converted_ckpts_dir() to find location of diffusers - fixed bug in model_manager that was causing the description of converted models to read "Optimized version of {model_name}' --- invokeai/backend/invoke_ai_web_server.py | 16 ++++++---------- ldm/invoke/globals.py | 5 ++++- ldm/invoke/model_manager.py | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/invokeai/backend/invoke_ai_web_server.py b/invokeai/backend/invoke_ai_web_server.py index dbe2714ade..292206ee61 100644 --- a/invokeai/backend/invoke_ai_web_server.py +++ b/invokeai/backend/invoke_ai_web_server.py @@ -28,7 +28,7 @@ from ldm.invoke.args import Args, APP_ID, APP_VERSION, calculate_init_img_hash from ldm.invoke.conditioning import get_tokens_for_prompt, get_prompt_structure from ldm.invoke.generator.diffusers_pipeline import PipelineIntermediateState from ldm.invoke.generator.inpaint import infill_methods -from ldm.invoke.globals import Globals +from ldm.invoke.globals import Globals, global_converted_ckpts_dir from ldm.invoke.pngwriter import PngWriter, retrieve_metadata from ldm.invoke.prompt_parser import split_weighted_subprompts, Blend @@ -294,7 +294,7 @@ class InvokeAIWebServer: def load_socketio_listeners(self, socketio): @socketio.on("requestSystemConfig") def handle_request_capabilities(): - print(f">> System config requested") + print(">> System config requested") config = self.get_system_config() config["model_list"] = self.generate.model_manager.list_models() config["infill_methods"] = infill_methods() @@ -428,7 +428,7 @@ class InvokeAIWebServer: ) if model_to_convert['save_location'] == 'root': - diffusers_path = Path(Globals.root, 'models', 'converted_ckpts', f'{model_name}_diffusers') + diffusers_path = Path(global_converted_ckpts_dir(), f'{model_name}_diffusers') if model_to_convert['save_location'] == 'custom' and model_to_convert['custom_location'] is not None: diffusers_path = Path(model_to_convert['custom_location'], f'{model_name}_diffusers') @@ -737,7 +737,7 @@ class InvokeAIWebServer: try: seed = original_image["metadata"]["image"]["seed"] - except (KeyError) as e: + except KeyError: seed = "unknown_seed" pass @@ -837,7 +837,7 @@ class InvokeAIWebServer: @socketio.on("cancel") def handle_cancel(): - print(f">> Cancel processing requested") + print(">> Cancel processing requested") self.canceled.set() # TODO: I think this needs a safety mechanism. @@ -919,9 +919,6 @@ class InvokeAIWebServer: So we need to convert each into a PIL Image. """ - truncated_outpaint_image_b64 = generation_parameters["init_img"][:64] - truncated_outpaint_mask_b64 = generation_parameters["init_mask"][:64] - init_img_url = generation_parameters["init_img"] original_bounding_box = generation_parameters["bounding_box"].copy( @@ -1096,7 +1093,6 @@ class InvokeAIWebServer: nonlocal facetool_parameters nonlocal progress - step_index = 1 nonlocal prior_variations """ @@ -1518,7 +1514,7 @@ class InvokeAIWebServer: if step_index: filename += f".{step_index}" if postprocessing: - filename += f".postprocessed" + filename += ".postprocessed" filename += ".png" diff --git a/ldm/invoke/globals.py b/ldm/invoke/globals.py index 6bfa0ecd9d..7016e8b902 100644 --- a/ldm/invoke/globals.py +++ b/ldm/invoke/globals.py @@ -33,7 +33,7 @@ Globals.models_file = 'models.yaml' Globals.models_dir = 'models' Globals.config_dir = 'configs' Globals.autoscan_dir = 'weights' -Globals.converted_ckpts_dir = 'converted-ckpts' +Globals.converted_ckpts_dir = 'converted_ckpts' # Try loading patchmatch Globals.try_patchmatch = True @@ -66,6 +66,9 @@ def global_models_dir()->Path: def global_autoscan_dir()->Path: return Path(Globals.root, Globals.autoscan_dir) +def global_converted_ckpts_dir()->Path: + return Path(global_models_dir(), Globals.converted_ckpts_dir) + def global_set_root(root_dir:Union[str,Path]): Globals.root = root_dir diff --git a/ldm/invoke/model_manager.py b/ldm/invoke/model_manager.py index 0e7a0747ab..99e2bdfd86 100644 --- a/ldm/invoke/model_manager.py +++ b/ldm/invoke/model_manager.py @@ -759,7 +759,7 @@ class ModelManager(object): return model_name = model_name or diffusers_path.name - model_description = model_description or "Optimized version of {model_name}" + model_description = model_description or f"Optimized version of {model_name}" print(f">> Optimizing {model_name} (30-60s)") try: # By passing the specified VAE too the conversion function, the autoencoder From 0bc55a0d5584453645d59c6b1d4f8e40989ccb0a Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Mon, 13 Feb 2023 13:37:41 -0500 Subject: [PATCH 20/39] Fix link to the installation documentation Broken link in the README. Now pointing to correct mkdocs file. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d39c1004e6..5ae87d8678 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ InvokeAI is a leading creative engine built to empower professionals and enthusiasts alike. Generate and create stunning visual media using the latest AI-driven technologies. InvokeAI offers an industry leading Web Interface, interactive Command Line Interface, and also serves as the foundation for multiple commercial products. -**Quick links**: [[How to Install](#installation)] [Discord Server] [Documentation and Tutorials] [Code and Downloads] [Bug Reports] [Discussion, Ideas & Q&A] +**Quick links**: [[How to Install](https://invoke-ai.github.io/InvokeAI/#installation)] [Discord Server] [Documentation and Tutorials] [Code and Downloads] [Bug Reports] [Discussion, Ideas & Q&A] _Note: InvokeAI is rapidly evolving. Please use the [Issues](https://github.com/invoke-ai/InvokeAI/issues) tab to report bugs and make feature From 093174942b127a3ffa99f27255989c47dd15abbe Mon Sep 17 00:00:00 2001 From: Jonathan <34005131+JPPhoto@users.noreply.github.com> Date: Tue, 14 Feb 2023 18:00:34 -0600 Subject: [PATCH 21/39] Add thresholding for all diffusers types (#2479) `generator` now asks `InvokeAIDiffuserComponent` to do postprocessing work on latents after every step. Thresholding - now implemented as replacing latents outside of the threshold with random noise - is called at this point. This postprocessing step is also where we can hook up symmetry and other image latent manipulations in the future. Note: code at this layer doesn't need to worry about MPS as relevant torch functions are wrapped and made MPS-safe by `generator.py`. --- ldm/invoke/generator/diffusers_pipeline.py | 18 ++++- ldm/invoke/generator/img2img.py | 4 +- ldm/invoke/generator/txt2img.py | 4 +- ldm/invoke/generator/txt2img2img.py | 5 +- .../diffusion/shared_invokeai_diffusion.py | 79 +++++++++++++------ 5 files changed, 73 insertions(+), 37 deletions(-) diff --git a/ldm/invoke/generator/diffusers_pipeline.py b/ldm/invoke/generator/diffusers_pipeline.py index 24626247cf..686fb40d3a 100644 --- a/ldm/invoke/generator/diffusers_pipeline.py +++ b/ldm/invoke/generator/diffusers_pipeline.py @@ -34,7 +34,7 @@ from torchvision.transforms.functional import resize as tv_resize from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer from ldm.invoke.globals import Globals -from ldm.models.diffusion.shared_invokeai_diffusion import InvokeAIDiffuserComponent, ThresholdSettings +from ldm.models.diffusion.shared_invokeai_diffusion import InvokeAIDiffuserComponent, PostprocessingSettings from ldm.modules.textual_inversion_manager import TextualInversionManager @@ -199,8 +199,10 @@ class ConditioningData: """ extra: Optional[InvokeAIDiffuserComponent.ExtraConditioningInfo] = None scheduler_args: dict[str, Any] = field(default_factory=dict) - """Additional arguments to pass to scheduler.step.""" - threshold: Optional[ThresholdSettings] = None + """ + Additional arguments to pass to invokeai_diffuser.do_latent_postprocessing(). + """ + postprocessing_settings: Optional[PostprocessingSettings] = None @property def dtype(self): @@ -419,6 +421,15 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline): total_step_count=len(timesteps), additional_guidance=additional_guidance) latents = step_output.prev_sample + + latents = self.invokeai_diffuser.do_latent_postprocessing( + postprocessing_settings=conditioning_data.postprocessing_settings, + latents=latents, + sigma=batched_t, + step_index=i, + total_step_count=len(timesteps) + ) + predicted_original = getattr(step_output, 'pred_original_sample', None) # TODO resuscitate attention map saving @@ -455,7 +466,6 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline): conditioning_data.guidance_scale, step_index=step_index, total_step_count=total_step_count, - threshold=conditioning_data.threshold ) # compute the previous noisy sample x_t -> x_t-1 diff --git a/ldm/invoke/generator/img2img.py b/ldm/invoke/generator/img2img.py index bfa50617ef..0b762f7c98 100644 --- a/ldm/invoke/generator/img2img.py +++ b/ldm/invoke/generator/img2img.py @@ -7,7 +7,7 @@ from diffusers import logging from ldm.invoke.generator.base import Generator from ldm.invoke.generator.diffusers_pipeline import StableDiffusionGeneratorPipeline, ConditioningData -from ldm.models.diffusion.shared_invokeai_diffusion import ThresholdSettings +from ldm.models.diffusion.shared_invokeai_diffusion import PostprocessingSettings class Img2Img(Generator): @@ -33,7 +33,7 @@ class Img2Img(Generator): conditioning_data = ( ConditioningData( uc, c, cfg_scale, extra_conditioning_info, - threshold = ThresholdSettings(threshold, warmup=0.2) if threshold else None) + postprocessing_settings = PostprocessingSettings(threshold, warmup=0.2) if threshold else None) .add_scheduler_args_if_applicable(pipeline.scheduler, eta=ddim_eta)) diff --git a/ldm/invoke/generator/txt2img.py b/ldm/invoke/generator/txt2img.py index 6578794fa7..76da3e4904 100644 --- a/ldm/invoke/generator/txt2img.py +++ b/ldm/invoke/generator/txt2img.py @@ -6,7 +6,7 @@ import torch from .base import Generator from .diffusers_pipeline import StableDiffusionGeneratorPipeline, ConditioningData -from ...models.diffusion.shared_invokeai_diffusion import ThresholdSettings +from ...models.diffusion.shared_invokeai_diffusion import PostprocessingSettings class Txt2Img(Generator): @@ -33,7 +33,7 @@ class Txt2Img(Generator): conditioning_data = ( ConditioningData( uc, c, cfg_scale, extra_conditioning_info, - threshold = ThresholdSettings(threshold, warmup=0.2) if threshold else None) + postprocessing_settings = PostprocessingSettings(threshold, warmup=0.2) if threshold else None) .add_scheduler_args_if_applicable(pipeline.scheduler, eta=ddim_eta)) def make_image(x_T) -> PIL.Image.Image: diff --git a/ldm/invoke/generator/txt2img2img.py b/ldm/invoke/generator/txt2img2img.py index 9632a8d4b0..ff5d3a4d26 100644 --- a/ldm/invoke/generator/txt2img2img.py +++ b/ldm/invoke/generator/txt2img2img.py @@ -11,7 +11,7 @@ from diffusers.utils.logging import get_verbosity, set_verbosity, set_verbosity_ from ldm.invoke.generator.base import Generator from ldm.invoke.generator.diffusers_pipeline import trim_to_multiple_of, StableDiffusionGeneratorPipeline, \ ConditioningData -from ldm.models.diffusion.shared_invokeai_diffusion import ThresholdSettings +from ldm.models.diffusion.shared_invokeai_diffusion import PostprocessingSettings class Txt2Img2Img(Generator): @@ -36,7 +36,7 @@ class Txt2Img2Img(Generator): conditioning_data = ( ConditioningData( uc, c, cfg_scale, extra_conditioning_info, - threshold = ThresholdSettings(threshold, warmup=0.2) if threshold else None) + postprocessing_settings = PostprocessingSettings(threshold=threshold, warmup=0.2) if threshold else None) .add_scheduler_args_if_applicable(pipeline.scheduler, eta=ddim_eta)) def make_image(x_T): @@ -47,7 +47,6 @@ class Txt2Img2Img(Generator): conditioning_data=conditioning_data, noise=x_T, callback=step_callback, - # TODO: threshold = threshold, ) # Get our initial generation width and height directly from the latent output so diff --git a/ldm/models/diffusion/shared_invokeai_diffusion.py b/ldm/models/diffusion/shared_invokeai_diffusion.py index f37bec789e..ca3e608fc0 100644 --- a/ldm/models/diffusion/shared_invokeai_diffusion.py +++ b/ldm/models/diffusion/shared_invokeai_diffusion.py @@ -15,7 +15,7 @@ from ldm.models.diffusion.cross_attention_map_saving import AttentionMapSaver @dataclass(frozen=True) -class ThresholdSettings: +class PostprocessingSettings: threshold: float warmup: float @@ -121,7 +121,6 @@ class InvokeAIDiffuserComponent: unconditional_guidance_scale: float, step_index: Optional[int]=None, total_step_count: Optional[int]=None, - threshold: Optional[ThresholdSettings]=None, ): """ :param x: current latents @@ -130,7 +129,6 @@ class InvokeAIDiffuserComponent: :param conditioning: embeddings for conditioned output. for hybrid conditioning this is a dict of tensors [B x 77 x 768], otherwise a single tensor [B x 77 x 768] :param unconditional_guidance_scale: aka CFG scale, controls how much effect the conditioning tensor has :param step_index: counts upwards from 0 to (step_count-1) (as passed to setup_cross_attention_control, if using). May be called multiple times for a single step, therefore do not assume that its value will monotically increase. If None, will be estimated by comparing sigma against self.model.sigmas . - :param threshold: threshold to apply after each step :return: the new latents after applying the model to x using unscaled unconditioning and CFG-scaled conditioning. """ @@ -138,15 +136,7 @@ class InvokeAIDiffuserComponent: cross_attention_control_types_to_do = [] context: Context = self.cross_attention_control_context if self.cross_attention_control_context is not None: - if step_index is not None and total_step_count is not None: - # 🧨diffusers codepath - percent_through = step_index / total_step_count # will never reach 1.0 - this is deliberate - else: - # legacy compvis codepath - # TODO remove when compvis codepath support is dropped - if step_index is None and sigma is None: - raise ValueError(f"Either step_index or sigma is required when doing cross attention control, but both are None.") - percent_through = self.estimate_percent_through(step_index, sigma) + percent_through = self.calculate_percent_through(sigma, step_index, total_step_count) cross_attention_control_types_to_do = context.get_active_cross_attention_control_types_for_step(percent_through) wants_cross_attention_control = (len(cross_attention_control_types_to_do) > 0) @@ -161,11 +151,34 @@ class InvokeAIDiffuserComponent: combined_next_x = self._combine(unconditioned_next_x, conditioned_next_x, unconditional_guidance_scale) - if threshold: - combined_next_x = self._threshold(threshold.threshold, threshold.warmup, combined_next_x, sigma) - return combined_next_x + def do_latent_postprocessing( + self, + postprocessing_settings: PostprocessingSettings, + latents: torch.Tensor, + sigma, + step_index, + total_step_count + ) -> torch.Tensor: + if postprocessing_settings is not None: + percent_through = self.calculate_percent_through(sigma, step_index, total_step_count) + latents = self.apply_threshold(postprocessing_settings, latents, percent_through) + return latents + + def calculate_percent_through(self, sigma, step_index, total_step_count): + if step_index is not None and total_step_count is not None: + # 🧨diffusers codepath + percent_through = step_index / total_step_count # will never reach 1.0 - this is deliberate + else: + # legacy compvis codepath + # TODO remove when compvis codepath support is dropped + if step_index is None and sigma is None: + raise ValueError( + f"Either step_index or sigma is required when doing cross attention control, but both are None.") + percent_through = self.estimate_percent_through(step_index, sigma) + return percent_through + # methods below are called from do_diffusion_step and should be considered private to this class. def apply_standard_conditioning(self, x, sigma, unconditioning, conditioning): @@ -275,17 +288,23 @@ class InvokeAIDiffuserComponent: combined_next_x = unconditioned_next_x + scaled_delta return combined_next_x - def _threshold(self, threshold, warmup, latents: torch.Tensor, sigma) -> torch.Tensor: - warmup_scale = (1 - sigma.item() / 1000) / warmup if warmup else math.inf - if warmup_scale < 1: - # This arithmetic based on https://github.com/invoke-ai/InvokeAI/pull/395 - warming_threshold = 1 + (threshold - 1) * warmup_scale - current_threshold = np.clip(warming_threshold, 1, threshold) + def apply_threshold( + self, + postprocessing_settings: PostprocessingSettings, + latents: torch.Tensor, + percent_through + ) -> torch.Tensor: + threshold = postprocessing_settings.threshold + warmup = postprocessing_settings.warmup + + if percent_through < warmup: + current_threshold = threshold + threshold * 5 * (1 - (percent_through / warmup)) else: current_threshold = threshold if current_threshold <= 0: return latents + maxval = latents.max().item() minval = latents.min().item() @@ -294,25 +313,34 @@ class InvokeAIDiffuserComponent: if self.debug_thresholding: std, mean = [i.item() for i in torch.std_mean(latents)] outside = torch.count_nonzero((latents < -current_threshold) | (latents > current_threshold)) - print(f"\nThreshold: 𝜎={sigma.item()} threshold={current_threshold:.3f} (of {threshold:.3f})\n" + print(f"\nThreshold: %={percent_through} threshold={current_threshold:.3f} (of {threshold:.3f})\n" f" | min, mean, max = {minval:.3f}, {mean:.3f}, {maxval:.3f}\tstd={std}\n" f" | {outside / latents.numel() * 100:.2f}% values outside threshold") if maxval < current_threshold and minval > -current_threshold: return latents + num_altered = 0 + + # MPS torch.rand_like is fine because torch.rand_like is wrapped in generate.py! + if maxval > current_threshold: + latents = torch.clone(latents) maxval = np.clip(maxval * scale, 1, current_threshold) + num_altered += torch.count_nonzero(latents > maxval) + latents[latents > maxval] = torch.rand_like(latents[latents > maxval]) * maxval if minval < -current_threshold: + latents = torch.clone(latents) minval = np.clip(minval * scale, -current_threshold, -1) + num_altered += torch.count_nonzero(latents < minval) + latents[latents < minval] = torch.rand_like(latents[latents < minval]) * minval if self.debug_thresholding: - outside = torch.count_nonzero((latents < minval) | (latents > maxval)) print(f" | min, , max = {minval:.3f}, , {maxval:.3f}\t(scaled by {scale})\n" - f" | {outside / latents.numel() * 100:.2f}% values will be clamped") + f" | {num_altered / latents.numel() * 100:.2f}% values altered") - return latents.clamp(minval, maxval) + return latents def estimate_percent_through(self, step_index, sigma): if step_index is not None and self.cross_attention_control_context is not None: @@ -376,4 +404,3 @@ class InvokeAIDiffuserComponent: # assert(0 == len(torch.nonzero(old_return_value - (uncond_latents + deltas_merged * cond_scale)))) return uncond_latents + deltas_merged * global_guidance_scale - From 7aa6c827f7578df0765db82613a3a163a6cf5348 Mon Sep 17 00:00:00 2001 From: fattire Date: Tue, 14 Feb 2023 17:38:21 -0800 Subject: [PATCH 22/39] fix minor typos --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a3619d15ab..230c7e584e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,7 +12,7 @@ LABEL org.opencontainers.image.authors="mauwii@outlook.de" RUN rm -f /etc/apt/apt.conf.d/docker-clean \ && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache -# Install necesarry packages +# Install necessary packages RUN \ --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ @@ -78,7 +78,7 @@ RUN python3 -c "from patchmatch import patch_match" ##################### FROM python-base AS runtime -# Create a new User +# Create a new user ARG UNAME=appuser RUN useradd \ --no-log-init \ From b08a51459421bcb4f901845d2b9b82298cd21a21 Mon Sep 17 00:00:00 2001 From: fattire Date: Tue, 14 Feb 2023 17:49:01 -0800 Subject: [PATCH 23/39] missed one. --- docker/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/build.sh b/docker/build.sh index 7dc98ec208..21108d2d21 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -36,7 +36,7 @@ echo -e "Container Image:\t${CONTAINER_IMAGE}\n" if [[ -n "$(docker volume ls -f name="${VOLUMENAME}" -q)" ]]; then echo -e "Volume already exists\n" else - echo -n "createing docker volume " + echo -n "creating docker volume " docker volume create "${VOLUMENAME}" fi From bcb1fbe031574efb99726889c8c0c4f417c5ed8d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 15 Feb 2023 22:28:36 +1100 Subject: [PATCH 24/39] add tooltips & status messages to model conversion --- invokeai/backend/invoke_ai_web_server.py | 2 +- .../frontend/public/locales/common/en.json | 4 ++- .../public/locales/modelmanager/en.json | 8 +++--- invokeai/frontend/src/app/invokeai.d.ts | 5 ++++ .../frontend/src/app/socketio/emitters.ts | 2 ++ .../frontend/src/app/socketio/listeners.ts | 25 +++++++++++++++++ .../frontend/src/app/socketio/middleware.ts | 5 ++++ .../components/ModelManager/ModelConvert.tsx | 27 ++++++++++++++----- .../src/features/system/store/systemSlice.ts | 7 +++++ 9 files changed, 74 insertions(+), 11 deletions(-) diff --git a/invokeai/backend/invoke_ai_web_server.py b/invokeai/backend/invoke_ai_web_server.py index 292206ee61..7ea100db20 100644 --- a/invokeai/backend/invoke_ai_web_server.py +++ b/invokeai/backend/invoke_ai_web_server.py @@ -448,7 +448,7 @@ class InvokeAIWebServer: new_model_list = self.generate.model_manager.list_models() socketio.emit( - "newModelAdded", + "modelConverted", {"new_model_name": model_name, "model_list": new_model_list, 'update': True}, ) diff --git a/invokeai/frontend/public/locales/common/en.json b/invokeai/frontend/public/locales/common/en.json index 7d38074520..dae6032dba 100644 --- a/invokeai/frontend/public/locales/common/en.json +++ b/invokeai/frontend/public/locales/common/en.json @@ -58,5 +58,7 @@ "statusUpscaling": "Upscaling", "statusUpscalingESRGAN": "Upscaling (ESRGAN)", "statusLoadingModel": "Loading Model", - "statusModelChanged": "Model Changed" + "statusModelChanged": "Model Changed", + "statusConvertingModel": "Converting Model", + "statusModelConverted": "Model Converted" } diff --git a/invokeai/frontend/public/locales/modelmanager/en.json b/invokeai/frontend/public/locales/modelmanager/en.json index f3e2d72cc6..be4830799f 100644 --- a/invokeai/frontend/public/locales/modelmanager/en.json +++ b/invokeai/frontend/public/locales/modelmanager/en.json @@ -72,14 +72,16 @@ "convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.", "convertToDiffusersHelpText5": "Please make sure you have enough disk space. Models generally vary between 4GB-7GB in size.", "convertToDiffusersHelpText6": "Do you wish to convert this model?", + "convertToDiffusersSaveLocation": "Save Location", "v1": "v1", "v2": "v2", "inpainting": "v1 Inpainting", - "customConfig": "Custom Config", + "customConfig": "Custom Config", "pathToCustomConfig": "Path To Custom Config", "statusConverting": "Converting", - "sameFolder": "Same Folder", - "invokeRoot": "Invoke Models", + "modelConverted": "Model Converted", + "sameFolder": "Same folder", + "invokeRoot": "InvokeAI folder", "custom": "Custom", "customSaveLocation": "Custom Save Location" } diff --git a/invokeai/frontend/src/app/invokeai.d.ts b/invokeai/frontend/src/app/invokeai.d.ts index 9578c71f93..4043df9ddc 100644 --- a/invokeai/frontend/src/app/invokeai.d.ts +++ b/invokeai/frontend/src/app/invokeai.d.ts @@ -234,6 +234,11 @@ export declare type ModelChangeResponse = { model_list: ModelList; }; +export declare type ModelConvertedResponse = { + converted_model_name: string; + model_list: ModelList; +}; + export declare type ModelAddedResponse = { new_model_name: string; model_list: ModelList; diff --git a/invokeai/frontend/src/app/socketio/emitters.ts b/invokeai/frontend/src/app/socketio/emitters.ts index 5070d572d4..a01a7ecc6b 100644 --- a/invokeai/frontend/src/app/socketio/emitters.ts +++ b/invokeai/frontend/src/app/socketio/emitters.ts @@ -15,6 +15,7 @@ import { addLogEntry, generationRequested, modelChangeRequested, + modelConvertRequested, setIsProcessing, } from 'features/system/store/systemSlice'; import { InvokeTabName } from 'features/ui/store/tabMap'; @@ -181,6 +182,7 @@ const makeSocketIOEmitters = ( emitConvertToDiffusers: ( modelToConvert: InvokeAI.InvokeModelConversionProps ) => { + dispatch(modelConvertRequested()); socketio.emit('convertToDiffusers', modelToConvert); }, emitRequestModelChange: (modelName: string) => { diff --git a/invokeai/frontend/src/app/socketio/listeners.ts b/invokeai/frontend/src/app/socketio/listeners.ts index c83b468069..bd40b6f5eb 100644 --- a/invokeai/frontend/src/app/socketio/listeners.ts +++ b/invokeai/frontend/src/app/socketio/listeners.ts @@ -365,6 +365,7 @@ const makeSocketIOListeners = ( const { new_model_name, model_list, update } = data; dispatch(setModelList(model_list)); dispatch(setIsProcessing(false)); + dispatch(setCurrentStatus(i18n.t('modelmanager:modelAdded'))); dispatch( addLogEntry({ timestamp: dateFormat(new Date(), 'isoDateTime'), @@ -407,6 +408,30 @@ const makeSocketIOListeners = ( }) ); }, + onModelConverted: (data: InvokeAI.ModelConvertedResponse) => { + const { converted_model_name, model_list } = data; + dispatch(setModelList(model_list)); + dispatch(setCurrentStatus(i18n.t('common:statusModelConverted'))); + dispatch(setIsProcessing(false)); + dispatch(setIsCancelable(true)); + dispatch( + addLogEntry({ + timestamp: dateFormat(new Date(), 'isoDateTime'), + message: `Model converted: ${converted_model_name}`, + level: 'info', + }) + ); + dispatch( + addToast({ + title: `${i18n.t( + 'modelmanager:modelConverted' + )}: ${converted_model_name}`, + status: 'success', + duration: 2500, + isClosable: true, + }) + ); + }, onModelChanged: (data: InvokeAI.ModelChangeResponse) => { const { model_name, model_list } = data; dispatch(setModelList(model_list)); diff --git a/invokeai/frontend/src/app/socketio/middleware.ts b/invokeai/frontend/src/app/socketio/middleware.ts index 4d3549da4e..e08725adbc 100644 --- a/invokeai/frontend/src/app/socketio/middleware.ts +++ b/invokeai/frontend/src/app/socketio/middleware.ts @@ -48,6 +48,7 @@ export const socketioMiddleware = () => { onFoundModels, onNewModelAdded, onModelDeleted, + onModelConverted, onModelChangeFailed, onTempFolderEmptied, } = makeSocketIOListeners(store); @@ -126,6 +127,10 @@ export const socketioMiddleware = () => { onModelDeleted(data); }); + socketio.on('modelConverted', (data: InvokeAI.ModelConvertedResponse) => { + onModelConverted(data); + }); + socketio.on('modelChanged', (data: InvokeAI.ModelChangeResponse) => { onModelChanged(data); }); diff --git a/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx b/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx index 6f34dbf43a..aacbfd44aa 100644 --- a/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx +++ b/invokeai/frontend/src/features/system/components/ModelManager/ModelConvert.tsx @@ -5,6 +5,7 @@ import { RadioGroup, Text, UnorderedList, + Tooltip, } from '@chakra-ui/react'; import { convertToDiffusers } from 'app/socketio/actions'; import { RootState } from 'app/store'; @@ -12,7 +13,6 @@ import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIAlertDialog from 'common/components/IAIAlertDialog'; import IAIButton from 'common/components/IAIButton'; import IAIInput from 'common/components/IAIInput'; -import { setIsProcessing } from 'features/system/store/systemSlice'; import { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -60,7 +60,6 @@ export default function ModelConvert(props: ModelConvertProps) { ? customSaveLocation : null, }; - dispatch(setIsProcessing(true)); dispatch(convertToDiffusers(modelToConvert)); }; @@ -98,12 +97,28 @@ export default function ModelConvert(props: ModelConvertProps) { - Save Location + + {t('modelmanager:convertToDiffusersSaveLocation')} + setSaveLocation(v)}> - {t('modelmanager:sameFolder')} - {t('modelmanager:invokeRoot')} - {t('modelmanager:custom')} + + + {t('modelmanager:sameFolder')} + + + + + + {t('modelmanager:invokeRoot')} + + + + + + {t('modelmanager:custom')} + + diff --git a/invokeai/frontend/src/features/system/store/systemSlice.ts b/invokeai/frontend/src/features/system/store/systemSlice.ts index 7cb253f6ee..e2f3355b31 100644 --- a/invokeai/frontend/src/features/system/store/systemSlice.ts +++ b/invokeai/frontend/src/features/system/store/systemSlice.ts @@ -214,6 +214,12 @@ export const systemSlice = createSlice({ state.isProcessing = true; state.currentStatusHasSteps = false; }, + modelConvertRequested: (state) => { + state.currentStatus = i18n.t('common:statusConvertingModel'); + state.isCancelable = false; + state.isProcessing = true; + state.currentStatusHasSteps = false; + }, setSaveIntermediatesInterval: (state, action: PayloadAction) => { state.saveIntermediatesInterval = action.payload; }, @@ -265,6 +271,7 @@ export const { setModelList, setIsCancelable, modelChangeRequested, + modelConvertRequested, setSaveIntermediatesInterval, setEnableImageDebugging, generationRequested, From 9591c8d4e038613a5e34f35cfad6bedfac06edc7 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 15 Feb 2023 22:30:47 +1100 Subject: [PATCH 25/39] builds frontend --- .../{index-337fc9d4.js => index-3af8749b.js} | 106 +++++++++--------- invokeai/frontend/dist/index.html | 2 +- invokeai/frontend/dist/locales/common/en.json | 4 +- .../dist/locales/modelmanager/en-US.json | 2 +- .../dist/locales/modelmanager/en.json | 10 +- invokeai/frontend/stats.html | 2 +- 6 files changed, 65 insertions(+), 61 deletions(-) rename invokeai/frontend/dist/assets/{index-337fc9d4.js => index-3af8749b.js} (55%) diff --git a/invokeai/frontend/dist/assets/index-337fc9d4.js b/invokeai/frontend/dist/assets/index-3af8749b.js similarity index 55% rename from invokeai/frontend/dist/assets/index-337fc9d4.js rename to invokeai/frontend/dist/assets/index-3af8749b.js index f8d6ff6b91..b1bf44a2c1 100644 --- a/invokeai/frontend/dist/assets/index-337fc9d4.js +++ b/invokeai/frontend/dist/assets/index-3af8749b.js @@ -6,7 +6,7 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var py=Symbol.for("react.element"),Eee=Symbol.for("react.portal"),Pee=Symbol.for("react.fragment"),Tee=Symbol.for("react.strict_mode"),Lee=Symbol.for("react.profiler"),Aee=Symbol.for("react.provider"),Oee=Symbol.for("react.context"),Mee=Symbol.for("react.forward_ref"),Iee=Symbol.for("react.suspense"),Ree=Symbol.for("react.memo"),Dee=Symbol.for("react.lazy"),mL=Symbol.iterator;function Nee(e){return e===null||typeof e!="object"?null:(e=mL&&e[mL]||e["@@iterator"],typeof e=="function"?e:null)}var fj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hj=Object.assign,pj={};function g0(e,t,n){this.props=e,this.context=t,this.refs=pj,this.updater=n||fj}g0.prototype.isReactComponent={};g0.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};g0.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gj(){}gj.prototype=g0.prototype;function y_(e,t,n){this.props=e,this.context=t,this.refs=pj,this.updater=n||fj}var b_=y_.prototype=new gj;b_.constructor=y_;hj(b_,g0.prototype);b_.isPureReactComponent=!0;var vL=Array.isArray,mj=Object.prototype.hasOwnProperty,S_={current:null},vj={key:!0,ref:!0,__self:!0,__source:!0};function yj(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)mj.call(t,r)&&!vj.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1t in e?wee(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var zee=w,Hee=Symbol.for("react.element"),Vee=Symbol.for("react.fragment"),Wee=Object.prototype.hasOwnProperty,Uee=zee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Gee={key:!0,ref:!0,__self:!0,__source:!0};function bj(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Wee.call(t,r)&&!Gee.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Hee,type:e,key:o,ref:a,props:i,_owner:Uee.current}}bS.Fragment=Vee;bS.jsx=bj;bS.jsxs=bj;(function(e){e.exports=bS})(_ee);var Gs=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:w.useEffect,w_=w.createContext({});w_.displayName="ColorModeContext";function gy(){const e=w.useContext(w_);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var z3={light:"chakra-ui-light",dark:"chakra-ui-dark"};function qee(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?z3.dark:z3.light),document.body.classList.remove(r?z3.light:z3.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){return n.query().matches??r==="dark"?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var Yee="chakra-ui-color-mode";function Kee(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var Xee=Kee(Yee),bL=()=>{};function SL(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function Sj(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=Xee}=e,s=i==="dark"?"dark":"light",[l,u]=w.useState(()=>SL(a,s)),[d,h]=w.useState(()=>SL(a)),{getSystemTheme:m,setClassName:y,setDataset:b,addListener:x}=w.useMemo(()=>qee({preventTransition:o}),[o]),k=i==="system"&&!l?d:l,E=w.useCallback(A=>{const M=A==="system"?m():A;u(M),y(M==="dark"),b(M),a.set(M)},[a,m,y,b]);Gs(()=>{i==="system"&&h(m())},[]),w.useEffect(()=>{const A=a.get();if(A){E(A);return}if(i==="system"){E("system");return}E(s)},[a,s,i,E]);const _=w.useCallback(()=>{E(k==="dark"?"light":"dark")},[k,E]);w.useEffect(()=>{if(r)return x(E)},[r,x,E]);const P=w.useMemo(()=>({colorMode:t??k,toggleColorMode:t?bL:_,setColorMode:t?bL:E,forced:t!==void 0}),[k,_,E,t]);return N.createElement(w_.Provider,{value:P},n)}Sj.displayName="ColorModeProvider";var U4={},Zee={get exports(){return U4},set exports(e){U4=e}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",m="[object Error]",y="[object Function]",b="[object GeneratorFunction]",x="[object Map]",k="[object Number]",E="[object Null]",_="[object Object]",P="[object Proxy]",A="[object RegExp]",M="[object Set]",R="[object String]",D="[object Undefined]",j="[object WeakMap]",z="[object ArrayBuffer]",H="[object DataView]",K="[object Float32Array]",te="[object Float64Array]",G="[object Int8Array]",F="[object Int16Array]",W="[object Int32Array]",X="[object Uint8Array]",Z="[object Uint8ClampedArray]",U="[object Uint16Array]",Q="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Ee=/^(?:0|[1-9]\d*)$/,be={};be[K]=be[te]=be[G]=be[F]=be[W]=be[X]=be[Z]=be[U]=be[Q]=!0,be[s]=be[l]=be[z]=be[d]=be[H]=be[h]=be[m]=be[y]=be[x]=be[k]=be[_]=be[A]=be[M]=be[R]=be[j]=!1;var ye=typeof _o=="object"&&_o&&_o.Object===Object&&_o,ze=typeof self=="object"&&self&&self.Object===Object&&self,Me=ye||ze||Function("return this")(),rt=t&&!t.nodeType&&t,We=rt&&!0&&e&&!e.nodeType&&e,Be=We&&We.exports===rt,wt=Be&&ye.process,Fe=function(){try{var Y=We&&We.require&&We.require("util").types;return Y||wt&&wt.binding&&wt.binding("util")}catch{}}(),at=Fe&&Fe.isTypedArray;function bt(Y,ie,ge){switch(ge.length){case 0:return Y.call(ie);case 1:return Y.call(ie,ge[0]);case 2:return Y.call(ie,ge[0],ge[1]);case 3:return Y.call(ie,ge[0],ge[1],ge[2])}return Y.apply(ie,ge)}function Le(Y,ie){for(var ge=-1,st=Array(Y);++ge-1}function F0(Y,ie){var ge=this.__data__,st=ys(ge,Y);return st<0?(++this.size,ge.push([Y,ie])):ge[st][1]=ie,this}oa.prototype.clear=Sf,oa.prototype.delete=B0,oa.prototype.get=xc,oa.prototype.has=xf,oa.prototype.set=F0;function al(Y){var ie=-1,ge=Y==null?0:Y.length;for(this.clear();++ie1?ge[Wt-1]:void 0,kt=Wt>2?ge[2]:void 0;for(xn=Y.length>3&&typeof xn=="function"?(Wt--,xn):void 0,kt&&Rp(ge[0],ge[1],kt)&&(xn=Wt<3?void 0:xn,Wt=1),ie=Object(ie);++st-1&&Y%1==0&&Y0){if(++ie>=i)return arguments[0]}else ie=0;return Y.apply(void 0,arguments)}}function Ec(Y){if(Y!=null){try{return Ke.call(Y)}catch{}try{return Y+""}catch{}}return""}function $a(Y,ie){return Y===ie||Y!==Y&&ie!==ie}var Ef=xu(function(){return arguments}())?xu:function(Y){return Kn(Y)&&Xe.call(Y,"callee")&&!Ze.call(Y,"callee")},_u=Array.isArray;function Kt(Y){return Y!=null&&Np(Y.length)&&!Tc(Y)}function Dp(Y){return Kn(Y)&&Kt(Y)}var Pc=rn||Q0;function Tc(Y){if(!ua(Y))return!1;var ie=ll(Y);return ie==y||ie==b||ie==u||ie==P}function Np(Y){return typeof Y=="number"&&Y>-1&&Y%1==0&&Y<=a}function ua(Y){var ie=typeof Y;return Y!=null&&(ie=="object"||ie=="function")}function Kn(Y){return Y!=null&&typeof Y=="object"}function Pf(Y){if(!Kn(Y)||ll(Y)!=_)return!1;var ie=nn(Y);if(ie===null)return!0;var ge=Xe.call(ie,"constructor")&&ie.constructor;return typeof ge=="function"&&ge instanceof ge&&Ke.call(ge)==Ct}var jp=at?ut(at):Cc;function Tf(Y){return ui(Y,Bp(Y))}function Bp(Y){return Kt(Y)?K0(Y,!0):ul(Y)}var gn=bs(function(Y,ie,ge,st){aa(Y,ie,ge,st)});function Xt(Y){return function(){return Y}}function Fp(Y){return Y}function Q0(){return!1}e.exports=gn})(Zee,U4);const Gl=U4;function qs(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function _h(e,...t){return Qee(e)?e(...t):e}var Qee=e=>typeof e=="function",Jee=e=>/!(important)?$/.test(e),xL=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,r7=(e,t)=>n=>{const r=String(t),i=Jee(r),o=xL(r),a=e?`${e}.${o}`:o;let s=qs(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=xL(s),i?`${s} !important`:s};function y2(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{const s=r7(t,o)(a);let l=(n==null?void 0:n(s,a))??s;return r&&(l=r(l,a)),l}}var H3=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Ms(e,t){return n=>{const r={property:n,scale:e};return r.transform=y2({scale:e,transform:t}),r}}var ete=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function tte(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:ete(t),transform:n?y2({scale:n,compose:r}):r}}var xj=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function nte(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...xj].join(" ")}function rte(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...xj].join(" ")}var ite={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},ote={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function ate(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var ste={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},wj="& > :not(style) ~ :not(style)",lte={[wj]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},ute={[wj]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},i7={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},cte=new Set(Object.values(i7)),Cj=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),dte=e=>e.trim();function fte(e,t){var n;if(e==null||Cj.has(e))return e;const r=/(?^[a-z-A-Z]+)\((?(.*))\)/g,{type:i,values:o}=((n=r.exec(e))==null?void 0:n.groups)??{};if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(dte).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in i7?i7[s]:s;l.unshift(u);const d=l.map(h=>{if(cte.has(h))return h;const m=h.indexOf(" "),[y,b]=m!==-1?[h.substr(0,m),h.substr(m+1)]:[h],x=_j(b)?b:b&&b.split(" "),k=`colors.${y}`,E=k in t.__cssMap?t.__cssMap[k].varRef:y;return x?[E,...Array.isArray(x)?x:[x]].join(" "):E});return`${a}(${d.join(", ")})`}var _j=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),hte=(e,t)=>fte(e,t??{});function pte(e){return/^var\(--.+\)$/.test(e)}var gte=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Al=e=>t=>`${e}(${t})`,hn={filter(e){return e!=="auto"?e:ite},backdropFilter(e){return e!=="auto"?e:ote},ring(e){return ate(hn.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?nte():e==="auto-gpu"?rte():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=gte(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(pte(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:hte,blur:Al("blur"),opacity:Al("opacity"),brightness:Al("brightness"),contrast:Al("contrast"),dropShadow:Al("drop-shadow"),grayscale:Al("grayscale"),hueRotate:Al("hue-rotate"),invert:Al("invert"),saturate:Al("saturate"),sepia:Al("sepia"),bgImage(e){return e==null||_j(e)||Cj.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=ste[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},se={borderWidths:Ms("borderWidths"),borderStyles:Ms("borderStyles"),colors:Ms("colors"),borders:Ms("borders"),radii:Ms("radii",hn.px),space:Ms("space",H3(hn.vh,hn.px)),spaceT:Ms("space",H3(hn.vh,hn.px)),degreeT(e){return{property:e,transform:hn.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:y2({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Ms("sizes",H3(hn.vh,hn.px)),sizesT:Ms("sizes",H3(hn.vh,hn.fraction)),shadows:Ms("shadows"),logical:tte,blur:Ms("blur",hn.blur)},a4={background:se.colors("background"),backgroundColor:se.colors("backgroundColor"),backgroundImage:se.propT("backgroundImage",hn.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:hn.bgClip},bgSize:se.prop("backgroundSize"),bgPosition:se.prop("backgroundPosition"),bg:se.colors("background"),bgColor:se.colors("backgroundColor"),bgPos:se.prop("backgroundPosition"),bgRepeat:se.prop("backgroundRepeat"),bgAttachment:se.prop("backgroundAttachment"),bgGradient:se.propT("backgroundImage",hn.gradient),bgClip:{transform:hn.bgClip}};Object.assign(a4,{bgImage:a4.backgroundImage,bgImg:a4.backgroundImage});var Cn={border:se.borders("border"),borderWidth:se.borderWidths("borderWidth"),borderStyle:se.borderStyles("borderStyle"),borderColor:se.colors("borderColor"),borderRadius:se.radii("borderRadius"),borderTop:se.borders("borderTop"),borderBlockStart:se.borders("borderBlockStart"),borderTopLeftRadius:se.radii("borderTopLeftRadius"),borderStartStartRadius:se.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:se.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:se.radii("borderTopRightRadius"),borderStartEndRadius:se.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:se.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:se.borders("borderRight"),borderInlineEnd:se.borders("borderInlineEnd"),borderBottom:se.borders("borderBottom"),borderBlockEnd:se.borders("borderBlockEnd"),borderBottomLeftRadius:se.radii("borderBottomLeftRadius"),borderBottomRightRadius:se.radii("borderBottomRightRadius"),borderLeft:se.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:se.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:se.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:se.borders(["borderLeft","borderRight"]),borderInline:se.borders("borderInline"),borderY:se.borders(["borderTop","borderBottom"]),borderBlock:se.borders("borderBlock"),borderTopWidth:se.borderWidths("borderTopWidth"),borderBlockStartWidth:se.borderWidths("borderBlockStartWidth"),borderTopColor:se.colors("borderTopColor"),borderBlockStartColor:se.colors("borderBlockStartColor"),borderTopStyle:se.borderStyles("borderTopStyle"),borderBlockStartStyle:se.borderStyles("borderBlockStartStyle"),borderBottomWidth:se.borderWidths("borderBottomWidth"),borderBlockEndWidth:se.borderWidths("borderBlockEndWidth"),borderBottomColor:se.colors("borderBottomColor"),borderBlockEndColor:se.colors("borderBlockEndColor"),borderBottomStyle:se.borderStyles("borderBottomStyle"),borderBlockEndStyle:se.borderStyles("borderBlockEndStyle"),borderLeftWidth:se.borderWidths("borderLeftWidth"),borderInlineStartWidth:se.borderWidths("borderInlineStartWidth"),borderLeftColor:se.colors("borderLeftColor"),borderInlineStartColor:se.colors("borderInlineStartColor"),borderLeftStyle:se.borderStyles("borderLeftStyle"),borderInlineStartStyle:se.borderStyles("borderInlineStartStyle"),borderRightWidth:se.borderWidths("borderRightWidth"),borderInlineEndWidth:se.borderWidths("borderInlineEndWidth"),borderRightColor:se.colors("borderRightColor"),borderInlineEndColor:se.colors("borderInlineEndColor"),borderRightStyle:se.borderStyles("borderRightStyle"),borderInlineEndStyle:se.borderStyles("borderInlineEndStyle"),borderTopRadius:se.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:se.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:se.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:se.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Cn,{rounded:Cn.borderRadius,roundedTop:Cn.borderTopRadius,roundedTopLeft:Cn.borderTopLeftRadius,roundedTopRight:Cn.borderTopRightRadius,roundedTopStart:Cn.borderStartStartRadius,roundedTopEnd:Cn.borderStartEndRadius,roundedBottom:Cn.borderBottomRadius,roundedBottomLeft:Cn.borderBottomLeftRadius,roundedBottomRight:Cn.borderBottomRightRadius,roundedBottomStart:Cn.borderEndStartRadius,roundedBottomEnd:Cn.borderEndEndRadius,roundedLeft:Cn.borderLeftRadius,roundedRight:Cn.borderRightRadius,roundedStart:Cn.borderInlineStartRadius,roundedEnd:Cn.borderInlineEndRadius,borderStart:Cn.borderInlineStart,borderEnd:Cn.borderInlineEnd,borderTopStartRadius:Cn.borderStartStartRadius,borderTopEndRadius:Cn.borderStartEndRadius,borderBottomStartRadius:Cn.borderEndStartRadius,borderBottomEndRadius:Cn.borderEndEndRadius,borderStartRadius:Cn.borderInlineStartRadius,borderEndRadius:Cn.borderInlineEndRadius,borderStartWidth:Cn.borderInlineStartWidth,borderEndWidth:Cn.borderInlineEndWidth,borderStartColor:Cn.borderInlineStartColor,borderEndColor:Cn.borderInlineEndColor,borderStartStyle:Cn.borderInlineStartStyle,borderEndStyle:Cn.borderInlineEndStyle});var mte={color:se.colors("color"),textColor:se.colors("color"),fill:se.colors("fill"),stroke:se.colors("stroke")},o7={boxShadow:se.shadows("boxShadow"),mixBlendMode:!0,blendMode:se.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:se.prop("backgroundBlendMode"),opacity:!0};Object.assign(o7,{shadow:o7.boxShadow});var vte={filter:{transform:hn.filter},blur:se.blur("--chakra-blur"),brightness:se.propT("--chakra-brightness",hn.brightness),contrast:se.propT("--chakra-contrast",hn.contrast),hueRotate:se.degreeT("--chakra-hue-rotate"),invert:se.propT("--chakra-invert",hn.invert),saturate:se.propT("--chakra-saturate",hn.saturate),dropShadow:se.propT("--chakra-drop-shadow",hn.dropShadow),backdropFilter:{transform:hn.backdropFilter},backdropBlur:se.blur("--chakra-backdrop-blur"),backdropBrightness:se.propT("--chakra-backdrop-brightness",hn.brightness),backdropContrast:se.propT("--chakra-backdrop-contrast",hn.contrast),backdropHueRotate:se.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:se.propT("--chakra-backdrop-invert",hn.invert),backdropSaturate:se.propT("--chakra-backdrop-saturate",hn.saturate)},G4={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:hn.flexDirection},experimental_spaceX:{static:lte,transform:y2({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:ute,transform:y2({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:se.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:se.space("gap"),rowGap:se.space("rowGap"),columnGap:se.space("columnGap")};Object.assign(G4,{flexDir:G4.flexDirection});var kj={gridGap:se.space("gridGap"),gridColumnGap:se.space("gridColumnGap"),gridRowGap:se.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},yte={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:hn.outline},outlineOffset:!0,outlineColor:se.colors("outlineColor")},Za={width:se.sizesT("width"),inlineSize:se.sizesT("inlineSize"),height:se.sizes("height"),blockSize:se.sizes("blockSize"),boxSize:se.sizes(["width","height"]),minWidth:se.sizes("minWidth"),minInlineSize:se.sizes("minInlineSize"),minHeight:se.sizes("minHeight"),minBlockSize:se.sizes("minBlockSize"),maxWidth:se.sizes("maxWidth"),maxInlineSize:se.sizes("maxInlineSize"),maxHeight:se.sizes("maxHeight"),maxBlockSize:se.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:se.propT("float",hn.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Za,{w:Za.width,h:Za.height,minW:Za.minWidth,maxW:Za.maxWidth,minH:Za.minHeight,maxH:Za.maxHeight,overscroll:Za.overscrollBehavior,overscrollX:Za.overscrollBehaviorX,overscrollY:Za.overscrollBehaviorY});var bte={listStyleType:!0,listStylePosition:!0,listStylePos:se.prop("listStylePosition"),listStyleImage:!0,listStyleImg:se.prop("listStyleImage")};function Ste(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},wte=xte(Ste),Cte={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},_te={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Xw=(e,t,n)=>{const r={},i=wte(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},kte={srOnly:{transform(e){return e===!0?Cte:e==="focusable"?_te:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Xw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Xw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Xw(t,e,n)}},Bv={position:!0,pos:se.prop("position"),zIndex:se.prop("zIndex","zIndices"),inset:se.spaceT("inset"),insetX:se.spaceT(["left","right"]),insetInline:se.spaceT("insetInline"),insetY:se.spaceT(["top","bottom"]),insetBlock:se.spaceT("insetBlock"),top:se.spaceT("top"),insetBlockStart:se.spaceT("insetBlockStart"),bottom:se.spaceT("bottom"),insetBlockEnd:se.spaceT("insetBlockEnd"),left:se.spaceT("left"),insetInlineStart:se.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:se.spaceT("right"),insetInlineEnd:se.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Bv,{insetStart:Bv.insetInlineStart,insetEnd:Bv.insetInlineEnd});var Ete={ring:{transform:hn.ring},ringColor:se.colors("--chakra-ring-color"),ringOffset:se.prop("--chakra-ring-offset-width"),ringOffsetColor:se.colors("--chakra-ring-offset-color"),ringInset:se.prop("--chakra-ring-inset")},sr={margin:se.spaceT("margin"),marginTop:se.spaceT("marginTop"),marginBlockStart:se.spaceT("marginBlockStart"),marginRight:se.spaceT("marginRight"),marginInlineEnd:se.spaceT("marginInlineEnd"),marginBottom:se.spaceT("marginBottom"),marginBlockEnd:se.spaceT("marginBlockEnd"),marginLeft:se.spaceT("marginLeft"),marginInlineStart:se.spaceT("marginInlineStart"),marginX:se.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:se.spaceT("marginInline"),marginY:se.spaceT(["marginTop","marginBottom"]),marginBlock:se.spaceT("marginBlock"),padding:se.space("padding"),paddingTop:se.space("paddingTop"),paddingBlockStart:se.space("paddingBlockStart"),paddingRight:se.space("paddingRight"),paddingBottom:se.space("paddingBottom"),paddingBlockEnd:se.space("paddingBlockEnd"),paddingLeft:se.space("paddingLeft"),paddingInlineStart:se.space("paddingInlineStart"),paddingInlineEnd:se.space("paddingInlineEnd"),paddingX:se.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:se.space("paddingInline"),paddingY:se.space(["paddingTop","paddingBottom"]),paddingBlock:se.space("paddingBlock")};Object.assign(sr,{m:sr.margin,mt:sr.marginTop,mr:sr.marginRight,me:sr.marginInlineEnd,marginEnd:sr.marginInlineEnd,mb:sr.marginBottom,ml:sr.marginLeft,ms:sr.marginInlineStart,marginStart:sr.marginInlineStart,mx:sr.marginX,my:sr.marginY,p:sr.padding,pt:sr.paddingTop,py:sr.paddingY,px:sr.paddingX,pb:sr.paddingBottom,pl:sr.paddingLeft,ps:sr.paddingInlineStart,paddingStart:sr.paddingInlineStart,pr:sr.paddingRight,pe:sr.paddingInlineEnd,paddingEnd:sr.paddingInlineEnd});var Pte={textDecorationColor:se.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:se.shadows("textShadow")},Tte={clipPath:!0,transform:se.propT("transform",hn.transform),transformOrigin:!0,translateX:se.spaceT("--chakra-translate-x"),translateY:se.spaceT("--chakra-translate-y"),skewX:se.degreeT("--chakra-skew-x"),skewY:se.degreeT("--chakra-skew-y"),scaleX:se.prop("--chakra-scale-x"),scaleY:se.prop("--chakra-scale-y"),scale:se.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:se.degreeT("--chakra-rotate")},Lte={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:se.prop("transitionDuration","transition.duration"),transitionProperty:se.prop("transitionProperty","transition.property"),transitionTimingFunction:se.prop("transitionTimingFunction","transition.easing")},Ate={fontFamily:se.prop("fontFamily","fonts"),fontSize:se.prop("fontSize","fontSizes",hn.px),fontWeight:se.prop("fontWeight","fontWeights"),lineHeight:se.prop("lineHeight","lineHeights"),letterSpacing:se.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},Ote={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:se.spaceT("scrollMargin"),scrollMarginTop:se.spaceT("scrollMarginTop"),scrollMarginBottom:se.spaceT("scrollMarginBottom"),scrollMarginLeft:se.spaceT("scrollMarginLeft"),scrollMarginRight:se.spaceT("scrollMarginRight"),scrollMarginX:se.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:se.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:se.spaceT("scrollPadding"),scrollPaddingTop:se.spaceT("scrollPaddingTop"),scrollPaddingBottom:se.spaceT("scrollPaddingBottom"),scrollPaddingLeft:se.spaceT("scrollPaddingLeft"),scrollPaddingRight:se.spaceT("scrollPaddingRight"),scrollPaddingX:se.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:se.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function Ej(e){return qs(e)&&e.reference?e.reference:String(e)}var SS=(e,...t)=>t.map(Ej).join(` ${e} `).replace(/calc/g,""),wL=(...e)=>`calc(${SS("+",...e)})`,CL=(...e)=>`calc(${SS("-",...e)})`,a7=(...e)=>`calc(${SS("*",...e)})`,_L=(...e)=>`calc(${SS("/",...e)})`,kL=e=>{const t=Ej(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:a7(t,-1)},xh=Object.assign(e=>({add:(...t)=>xh(wL(e,...t)),subtract:(...t)=>xh(CL(e,...t)),multiply:(...t)=>xh(a7(e,...t)),divide:(...t)=>xh(_L(e,...t)),negate:()=>xh(kL(e)),toString:()=>e.toString()}),{add:wL,subtract:CL,multiply:a7,divide:_L,negate:kL});function Mte(e,t="-"){return e.replace(/\s+/g,t)}function Ite(e){const t=Mte(e.toString());return Dte(Rte(t))}function Rte(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function Dte(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function Nte(e,t=""){return[t,e].filter(Boolean).join("-")}function jte(e,t){return`var(${e}${t?`, ${t}`:""})`}function Bte(e,t=""){return Ite(`--${Nte(e,t)}`)}function Vn(e,t,n){const r=Bte(e,n);return{variable:r,reference:jte(r,t)}}function Fte(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function $te(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function s7(e){if(e==null)return e;const{unitless:t}=$te(e);return t||typeof e=="number"?`${e}px`:e}var Pj=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,C_=e=>Object.fromEntries(Object.entries(e).sort(Pj));function EL(e){const t=C_(e);return Object.assign(Object.values(t),t)}function zte(e){const t=Object.keys(C_(e));return new Set(t)}function PL(e){if(!e)return e;e=s7(e)??e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function bv(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${s7(e)})`),t&&n.push("and",`(max-width: ${s7(t)})`),n.join(" ")}function Hte(e){if(!e)return null;e.base=e.base??"0px";const t=EL(e),n=Object.entries(e).sort(Pj).map(([o,a],s,l)=>{let[,u]=l[s+1]??[];return u=parseFloat(u)>0?PL(u):void 0,{_minW:PL(a),breakpoint:o,minW:a,maxW:u,maxWQuery:bv(null,u),minWQuery:bv(a),minMaxQuery:bv(a,u)}}),r=zte(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(o){const a=Object.keys(o);return a.length>0&&a.every(s=>r.has(s))},asObject:C_(e),asArray:EL(e),details:n,media:[null,...t.map(o=>bv(o)).slice(1)],toArrayValue(o){if(!qs(o))throw new Error("toArrayValue: value must be an object");const a=i.map(s=>o[s]??null);for(;Fte(a)===null;)a.pop();return a},toObjectValue(o){if(!Array.isArray(o))throw new Error("toObjectValue: value must be an array");return o.reduce((a,s,l)=>{const u=i[l];return u!=null&&s!=null&&(a[u]=s),a},{})}}}var zi={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},ad=e=>Tj(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Bu=e=>Tj(t=>e(t,"~ &"),"[data-peer]",".peer"),Tj=(e,...t)=>t.map(e).join(", "),xS={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:ad(zi.hover),_peerHover:Bu(zi.hover),_groupFocus:ad(zi.focus),_peerFocus:Bu(zi.focus),_groupFocusVisible:ad(zi.focusVisible),_peerFocusVisible:Bu(zi.focusVisible),_groupActive:ad(zi.active),_peerActive:Bu(zi.active),_groupDisabled:ad(zi.disabled),_peerDisabled:Bu(zi.disabled),_groupInvalid:ad(zi.invalid),_peerInvalid:Bu(zi.invalid),_groupChecked:ad(zi.checked),_peerChecked:Bu(zi.checked),_groupFocusWithin:ad(zi.focusWithin),_peerFocusWithin:Bu(zi.focusWithin),_peerPlaceholderShown:Bu(zi.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},Vte=Object.keys(xS);function TL(e,t){return Vn(String(e).replace(/\./g,"-"),void 0,t)}function Wte(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=TL(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[y,...b]=m,x=`${y}.-${b.join(".")}`,k=xh.negate(s),E=xh.negate(u);r[x]={value:k,var:l,varRef:E}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const d=m=>{const b=[String(i).split(".")[0],m].join(".");if(!e[b])return m;const{reference:k}=TL(b,t==null?void 0:t.cssVarPrefix);return k},h=qs(s)?s:{default:s};n=Gl(n,Object.entries(h).reduce((m,[y,b])=>{var x;const k=d(b);if(y==="default")return m[l]=k,m;const E=((x=xS)==null?void 0:x[y])??y;return m[E]={[l]:k},m},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function Ute(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Gte(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var qte=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function Yte(e){return Gte(e,qte)}function Kte(e){return e.semanticTokens}function Xte(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function Zte({tokens:e,semanticTokens:t}){const n=Object.entries(l7(e)??{}).map(([i,o])=>[i,{isSemantic:!1,value:o}]),r=Object.entries(l7(t,1)??{}).map(([i,o])=>[i,{isSemantic:!0,value:o}]);return Object.fromEntries([...n,...r])}function l7(e,t=1/0){return!qs(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(qs(i)||Array.isArray(i)?Object.entries(l7(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function Qte(e){var t;const n=Xte(e),r=Yte(n),i=Kte(n),o=Zte({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=Wte(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:Hte(n.breakpoints)}),n}var __=Gl({},a4,Cn,mte,G4,Za,vte,Ete,yte,kj,kte,Bv,o7,sr,Ote,Ate,Pte,Tte,bte,Lte),Jte=Object.assign({},sr,Za,G4,kj,Bv),Lj=Object.keys(Jte),ene=[...Object.keys(__),...Vte],tne={...__,...xS},nne=e=>e in tne,rne=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=_h(e[a],t);if(s==null)continue;if(s=qs(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!one(t),sne=(e,t)=>{if(t==null)return t;const n=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.varRef},r=a=>n(a)??a,[i,o]=ine(t);return t=n(i)??r(o)??r(t),t};function lne(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s;const l=_h(o,r),u=rne(l)(r);let d={};for(let h in u){const m=u[h];let y=_h(m,r);h in n&&(h=n[h]),ane(h,y)&&(y=sne(r,y));let b=t[h];if(b===!0&&(b={property:h}),qs(y)){d[h]=d[h]??{},d[h]=Gl({},d[h],i(y,!0));continue}let x=((s=b==null?void 0:b.transform)==null?void 0:s.call(b,y,r,l))??y;x=b!=null&&b.processResult?i(x,!0):x;const k=_h(b==null?void 0:b.property,r);if(!a&&(b!=null&&b.static)){const E=_h(b.static,r);d=Gl({},d,E)}if(k&&Array.isArray(k)){for(const E of k)d[E]=x;continue}if(k){k==="&"&&qs(x)?d=Gl({},d,x):d[k]=x;continue}if(qs(x)){d=Gl({},d,x);continue}d[h]=x}return d};return i}var Aj=e=>t=>lne({theme:t,pseudos:xS,configs:__})(e);function pr(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function une(e,t){if(Array.isArray(e))return e;if(qs(e))return t(e);if(e!=null)return[e]}function cne(e,t){for(let n=t+1;n{Gl(u,{[P]:m?_[P]:{[E]:_[P]}})});continue}if(!y){m?Gl(u,_):u[E]=_;continue}u[E]=_}}return u}}function fne(e){return t=>{const{variant:n,size:r,theme:i}=t,o=dne(i);return Gl({},_h(e.baseStyle??{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function hne(e,t,n){var r,i;return((i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)??n}function Sn(e){return Ute(e,["styleConfig","size","variant","colorScheme"])}function pne(e){if(e.sheet)return e.sheet;for(var t=0;t0?Ui(m0,--ra):0,Um--,ii===10&&(Um=1,CS--),ii}function Ta(){return ii=ra2||S2(ii)>3?"":" "}function Ene(e,t){for(;--t&&Ta()&&!(ii<48||ii>102||ii>57&&ii<65||ii>70&&ii<97););return my(e,s4()+(t<6&&Xl()==32&&Ta()==32))}function c7(e){for(;Ta();)switch(ii){case e:return ra;case 34:case 39:e!==34&&e!==39&&c7(ii);break;case 40:e===41&&c7(e);break;case 92:Ta();break}return ra}function Pne(e,t){for(;Ta()&&e+ii!==47+10;)if(e+ii===42+42&&Xl()===47)break;return"/*"+my(t,ra-1)+"*"+wS(e===47?e:Ta())}function Tne(e){for(;!S2(Xl());)Ta();return my(e,ra)}function Lne(e){return Nj(u4("",null,null,null,[""],e=Dj(e),0,[0],e))}function u4(e,t,n,r,i,o,a,s,l){for(var u=0,d=0,h=a,m=0,y=0,b=0,x=1,k=1,E=1,_=0,P="",A=i,M=o,R=r,D=P;k;)switch(b=_,_=Ta()){case 40:if(b!=108&&Ui(D,h-1)==58){u7(D+=On(l4(_),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:D+=l4(_);break;case 9:case 10:case 13:case 32:D+=kne(b);break;case 92:D+=Ene(s4()-1,7);continue;case 47:switch(Xl()){case 42:case 47:V3(Ane(Pne(Ta(),s4()),t,n),l);break;default:D+="/"}break;case 123*x:s[u++]=$l(D)*E;case 125*x:case 59:case 0:switch(_){case 0:case 125:k=0;case 59+d:y>0&&$l(D)-h&&V3(y>32?AL(D+";",r,n,h-1):AL(On(D," ","")+";",r,n,h-2),l);break;case 59:D+=";";default:if(V3(R=LL(D,t,n,u,d,i,s,P,A=[],M=[],h),o),_===123)if(d===0)u4(D,t,R,R,A,o,h,s,M);else switch(m===99&&Ui(D,3)===110?100:m){case 100:case 109:case 115:u4(e,R,R,r&&V3(LL(e,R,R,0,0,i,s,P,i,A=[],h),M),i,M,h,s,r?A:M);break;default:u4(D,R,R,R,[""],M,0,s,M)}}u=d=y=0,x=E=1,P=D="",h=a;break;case 58:h=1+$l(D),y=b;default:if(x<1){if(_==123)--x;else if(_==125&&x++==0&&_ne()==125)continue}switch(D+=wS(_),_*x){case 38:E=d>0?1:(D+="\f",-1);break;case 44:s[u++]=($l(D)-1)*E,E=1;break;case 64:Xl()===45&&(D+=l4(Ta())),m=Xl(),d=h=$l(P=D+=Tne(s4())),_++;break;case 45:b===45&&$l(D)==2&&(x=0)}}return o}function LL(e,t,n,r,i,o,a,s,l,u,d){for(var h=i-1,m=i===0?o:[""],y=P_(m),b=0,x=0,k=0;b0?m[E]+" "+_:On(_,/&\f/g,m[E])))&&(l[k++]=P);return _S(e,t,n,i===0?k_:s,l,u,d)}function Ane(e,t,n){return _S(e,t,n,Oj,wS(Cne()),b2(e,2,-2),0)}function AL(e,t,n,r){return _S(e,t,n,E_,b2(e,0,r),b2(e,r+1,-1),r)}function vm(e,t){for(var n="",r=P_(e),i=0;i6)switch(Ui(e,t+1)){case 109:if(Ui(e,t+4)!==45)break;case 102:return On(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+q4+(Ui(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~u7(e,"stretch")?Bj(On(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ui(e,t+1)!==115)break;case 6444:switch(Ui(e,$l(e)-3-(~u7(e,"!important")&&10))){case 107:return On(e,":",":"+_n)+e;case 101:return On(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Ui(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+eo+"$2box$3")+e}break;case 5936:switch(Ui(e,t+11)){case 114:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+eo+On(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+eo+e+e}return e}var Fne=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case E_:t.return=Bj(t.value,t.length);break;case Mj:return vm([V1(t,{value:On(t.value,"@","@"+_n)})],i);case k_:if(t.length)return wne(t.props,function(o){switch(xne(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return vm([V1(t,{props:[On(o,/:(read-\w+)/,":"+q4+"$1")]})],i);case"::placeholder":return vm([V1(t,{props:[On(o,/:(plac\w+)/,":"+_n+"input-$1")]}),V1(t,{props:[On(o,/:(plac\w+)/,":"+q4+"$1")]}),V1(t,{props:[On(o,/:(plac\w+)/,eo+"input-$1")]})],i)}return""})}},$ne=[Fne],Fj=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(x){var k=x.getAttribute("data-emotion");k.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var i=t.stylisPlugins||$ne,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var k=x.getAttribute("data-emotion").split(" "),E=1;E{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?V3.dark:V3.light),document.body.classList.remove(r?V3.light:V3.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){return n.query().matches??r==="dark"?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var Yee="chakra-ui-color-mode";function Kee(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var Xee=Kee(Yee),bL=()=>{};function SL(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function Sj(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=Xee}=e,s=i==="dark"?"dark":"light",[l,u]=w.useState(()=>SL(a,s)),[d,h]=w.useState(()=>SL(a)),{getSystemTheme:m,setClassName:y,setDataset:b,addListener:x}=w.useMemo(()=>qee({preventTransition:o}),[o]),k=i==="system"&&!l?d:l,E=w.useCallback(A=>{const M=A==="system"?m():A;u(M),y(M==="dark"),b(M),a.set(M)},[a,m,y,b]);Gs(()=>{i==="system"&&h(m())},[]),w.useEffect(()=>{const A=a.get();if(A){E(A);return}if(i==="system"){E("system");return}E(s)},[a,s,i,E]);const _=w.useCallback(()=>{E(k==="dark"?"light":"dark")},[k,E]);w.useEffect(()=>{if(r)return x(E)},[r,x,E]);const P=w.useMemo(()=>({colorMode:t??k,toggleColorMode:t?bL:_,setColorMode:t?bL:E,forced:t!==void 0}),[k,_,E,t]);return N.createElement(w_.Provider,{value:P},n)}Sj.displayName="ColorModeProvider";var U4={},Zee={get exports(){return U4},set exports(e){U4=e}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",m="[object Error]",y="[object Function]",b="[object GeneratorFunction]",x="[object Map]",k="[object Number]",E="[object Null]",_="[object Object]",P="[object Proxy]",A="[object RegExp]",M="[object Set]",R="[object String]",D="[object Undefined]",j="[object WeakMap]",z="[object ArrayBuffer]",H="[object DataView]",K="[object Float32Array]",te="[object Float64Array]",G="[object Int8Array]",$="[object Int16Array]",W="[object Int32Array]",X="[object Uint8Array]",Z="[object Uint8ClampedArray]",U="[object Uint16Array]",Q="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,he=/^\[object .+?Constructor\]$/,Ee=/^(?:0|[1-9]\d*)$/,Ce={};Ce[K]=Ce[te]=Ce[G]=Ce[$]=Ce[W]=Ce[X]=Ce[Z]=Ce[U]=Ce[Q]=!0,Ce[s]=Ce[l]=Ce[z]=Ce[d]=Ce[H]=Ce[h]=Ce[m]=Ce[y]=Ce[x]=Ce[k]=Ce[_]=Ce[A]=Ce[M]=Ce[R]=Ce[j]=!1;var de=typeof _o=="object"&&_o&&_o.Object===Object&&_o,ze=typeof self=="object"&&self&&self.Object===Object&&self,Me=de||ze||Function("return this")(),rt=t&&!t.nodeType&&t,We=rt&&!0&&e&&!e.nodeType&&e,Be=We&&We.exports===rt,wt=Be&&de.process,$e=function(){try{var Y=We&&We.require&&We.require("util").types;return Y||wt&&wt.binding&&wt.binding("util")}catch{}}(),at=$e&&$e.isTypedArray;function bt(Y,ie,me){switch(me.length){case 0:return Y.call(ie);case 1:return Y.call(ie,me[0]);case 2:return Y.call(ie,me[0],me[1]);case 3:return Y.call(ie,me[0],me[1],me[2])}return Y.apply(ie,me)}function Le(Y,ie){for(var me=-1,st=Array(Y);++me-1}function F0(Y,ie){var me=this.__data__,st=ys(me,Y);return st<0?(++this.size,me.push([Y,ie])):me[st][1]=ie,this}oa.prototype.clear=xf,oa.prototype.delete=$0,oa.prototype.get=xc,oa.prototype.has=wf,oa.prototype.set=F0;function al(Y){var ie=-1,me=Y==null?0:Y.length;for(this.clear();++ie1?me[Wt-1]:void 0,kt=Wt>2?me[2]:void 0;for(xn=Y.length>3&&typeof xn=="function"?(Wt--,xn):void 0,kt&&Dp(me[0],me[1],kt)&&(xn=Wt<3?void 0:xn,Wt=1),ie=Object(ie);++st-1&&Y%1==0&&Y0){if(++ie>=i)return arguments[0]}else ie=0;return Y.apply(void 0,arguments)}}function Ec(Y){if(Y!=null){try{return Ke.call(Y)}catch{}try{return Y+""}catch{}}return""}function Fa(Y,ie){return Y===ie||Y!==Y&&ie!==ie}var Pf=xu(function(){return arguments}())?xu:function(Y){return Kn(Y)&&Xe.call(Y,"callee")&&!Ze.call(Y,"callee")},_u=Array.isArray;function Kt(Y){return Y!=null&&jp(Y.length)&&!Tc(Y)}function Np(Y){return Kn(Y)&&Kt(Y)}var Pc=rn||J0;function Tc(Y){if(!ua(Y))return!1;var ie=ll(Y);return ie==y||ie==b||ie==u||ie==P}function jp(Y){return typeof Y=="number"&&Y>-1&&Y%1==0&&Y<=a}function ua(Y){var ie=typeof Y;return Y!=null&&(ie=="object"||ie=="function")}function Kn(Y){return Y!=null&&typeof Y=="object"}function Tf(Y){if(!Kn(Y)||ll(Y)!=_)return!1;var ie=nn(Y);if(ie===null)return!0;var me=Xe.call(ie,"constructor")&&ie.constructor;return typeof me=="function"&&me instanceof me&&Ke.call(me)==Ct}var Bp=at?ut(at):Cc;function Lf(Y){return ui(Y,$p(Y))}function $p(Y){return Kt(Y)?X0(Y,!0):ul(Y)}var gn=bs(function(Y,ie,me,st){aa(Y,ie,me,st)});function Xt(Y){return function(){return Y}}function Fp(Y){return Y}function J0(){return!1}e.exports=gn})(Zee,U4);const Gl=U4;function qs(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function kh(e,...t){return Qee(e)?e(...t):e}var Qee=e=>typeof e=="function",Jee=e=>/!(important)?$/.test(e),xL=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,r7=(e,t)=>n=>{const r=String(t),i=Jee(r),o=xL(r),a=e?`${e}.${o}`:o;let s=qs(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=xL(s),i?`${s} !important`:s};function S2(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{const s=r7(t,o)(a);let l=(n==null?void 0:n(s,a))??s;return r&&(l=r(l,a)),l}}var W3=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Ms(e,t){return n=>{const r={property:n,scale:e};return r.transform=S2({scale:e,transform:t}),r}}var ete=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function tte(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:ete(t),transform:n?S2({scale:n,compose:r}):r}}var xj=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function nte(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...xj].join(" ")}function rte(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...xj].join(" ")}var ite={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},ote={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function ate(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var ste={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},wj="& > :not(style) ~ :not(style)",lte={[wj]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},ute={[wj]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},i7={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},cte=new Set(Object.values(i7)),Cj=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),dte=e=>e.trim();function fte(e,t){var n;if(e==null||Cj.has(e))return e;const r=/(?^[a-z-A-Z]+)\((?(.*))\)/g,{type:i,values:o}=((n=r.exec(e))==null?void 0:n.groups)??{};if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(dte).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in i7?i7[s]:s;l.unshift(u);const d=l.map(h=>{if(cte.has(h))return h;const m=h.indexOf(" "),[y,b]=m!==-1?[h.substr(0,m),h.substr(m+1)]:[h],x=_j(b)?b:b&&b.split(" "),k=`colors.${y}`,E=k in t.__cssMap?t.__cssMap[k].varRef:y;return x?[E,...Array.isArray(x)?x:[x]].join(" "):E});return`${a}(${d.join(", ")})`}var _j=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),hte=(e,t)=>fte(e,t??{});function pte(e){return/^var\(--.+\)$/.test(e)}var gte=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Al=e=>t=>`${e}(${t})`,hn={filter(e){return e!=="auto"?e:ite},backdropFilter(e){return e!=="auto"?e:ote},ring(e){return ate(hn.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?nte():e==="auto-gpu"?rte():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=gte(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(pte(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:hte,blur:Al("blur"),opacity:Al("opacity"),brightness:Al("brightness"),contrast:Al("contrast"),dropShadow:Al("drop-shadow"),grayscale:Al("grayscale"),hueRotate:Al("hue-rotate"),invert:Al("invert"),saturate:Al("saturate"),sepia:Al("sepia"),bgImage(e){return e==null||_j(e)||Cj.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=ste[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},se={borderWidths:Ms("borderWidths"),borderStyles:Ms("borderStyles"),colors:Ms("colors"),borders:Ms("borders"),radii:Ms("radii",hn.px),space:Ms("space",W3(hn.vh,hn.px)),spaceT:Ms("space",W3(hn.vh,hn.px)),degreeT(e){return{property:e,transform:hn.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:S2({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Ms("sizes",W3(hn.vh,hn.px)),sizesT:Ms("sizes",W3(hn.vh,hn.fraction)),shadows:Ms("shadows"),logical:tte,blur:Ms("blur",hn.blur)},s4={background:se.colors("background"),backgroundColor:se.colors("backgroundColor"),backgroundImage:se.propT("backgroundImage",hn.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:hn.bgClip},bgSize:se.prop("backgroundSize"),bgPosition:se.prop("backgroundPosition"),bg:se.colors("background"),bgColor:se.colors("backgroundColor"),bgPos:se.prop("backgroundPosition"),bgRepeat:se.prop("backgroundRepeat"),bgAttachment:se.prop("backgroundAttachment"),bgGradient:se.propT("backgroundImage",hn.gradient),bgClip:{transform:hn.bgClip}};Object.assign(s4,{bgImage:s4.backgroundImage,bgImg:s4.backgroundImage});var Cn={border:se.borders("border"),borderWidth:se.borderWidths("borderWidth"),borderStyle:se.borderStyles("borderStyle"),borderColor:se.colors("borderColor"),borderRadius:se.radii("borderRadius"),borderTop:se.borders("borderTop"),borderBlockStart:se.borders("borderBlockStart"),borderTopLeftRadius:se.radii("borderTopLeftRadius"),borderStartStartRadius:se.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:se.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:se.radii("borderTopRightRadius"),borderStartEndRadius:se.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:se.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:se.borders("borderRight"),borderInlineEnd:se.borders("borderInlineEnd"),borderBottom:se.borders("borderBottom"),borderBlockEnd:se.borders("borderBlockEnd"),borderBottomLeftRadius:se.radii("borderBottomLeftRadius"),borderBottomRightRadius:se.radii("borderBottomRightRadius"),borderLeft:se.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:se.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:se.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:se.borders(["borderLeft","borderRight"]),borderInline:se.borders("borderInline"),borderY:se.borders(["borderTop","borderBottom"]),borderBlock:se.borders("borderBlock"),borderTopWidth:se.borderWidths("borderTopWidth"),borderBlockStartWidth:se.borderWidths("borderBlockStartWidth"),borderTopColor:se.colors("borderTopColor"),borderBlockStartColor:se.colors("borderBlockStartColor"),borderTopStyle:se.borderStyles("borderTopStyle"),borderBlockStartStyle:se.borderStyles("borderBlockStartStyle"),borderBottomWidth:se.borderWidths("borderBottomWidth"),borderBlockEndWidth:se.borderWidths("borderBlockEndWidth"),borderBottomColor:se.colors("borderBottomColor"),borderBlockEndColor:se.colors("borderBlockEndColor"),borderBottomStyle:se.borderStyles("borderBottomStyle"),borderBlockEndStyle:se.borderStyles("borderBlockEndStyle"),borderLeftWidth:se.borderWidths("borderLeftWidth"),borderInlineStartWidth:se.borderWidths("borderInlineStartWidth"),borderLeftColor:se.colors("borderLeftColor"),borderInlineStartColor:se.colors("borderInlineStartColor"),borderLeftStyle:se.borderStyles("borderLeftStyle"),borderInlineStartStyle:se.borderStyles("borderInlineStartStyle"),borderRightWidth:se.borderWidths("borderRightWidth"),borderInlineEndWidth:se.borderWidths("borderInlineEndWidth"),borderRightColor:se.colors("borderRightColor"),borderInlineEndColor:se.colors("borderInlineEndColor"),borderRightStyle:se.borderStyles("borderRightStyle"),borderInlineEndStyle:se.borderStyles("borderInlineEndStyle"),borderTopRadius:se.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:se.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:se.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:se.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Cn,{rounded:Cn.borderRadius,roundedTop:Cn.borderTopRadius,roundedTopLeft:Cn.borderTopLeftRadius,roundedTopRight:Cn.borderTopRightRadius,roundedTopStart:Cn.borderStartStartRadius,roundedTopEnd:Cn.borderStartEndRadius,roundedBottom:Cn.borderBottomRadius,roundedBottomLeft:Cn.borderBottomLeftRadius,roundedBottomRight:Cn.borderBottomRightRadius,roundedBottomStart:Cn.borderEndStartRadius,roundedBottomEnd:Cn.borderEndEndRadius,roundedLeft:Cn.borderLeftRadius,roundedRight:Cn.borderRightRadius,roundedStart:Cn.borderInlineStartRadius,roundedEnd:Cn.borderInlineEndRadius,borderStart:Cn.borderInlineStart,borderEnd:Cn.borderInlineEnd,borderTopStartRadius:Cn.borderStartStartRadius,borderTopEndRadius:Cn.borderStartEndRadius,borderBottomStartRadius:Cn.borderEndStartRadius,borderBottomEndRadius:Cn.borderEndEndRadius,borderStartRadius:Cn.borderInlineStartRadius,borderEndRadius:Cn.borderInlineEndRadius,borderStartWidth:Cn.borderInlineStartWidth,borderEndWidth:Cn.borderInlineEndWidth,borderStartColor:Cn.borderInlineStartColor,borderEndColor:Cn.borderInlineEndColor,borderStartStyle:Cn.borderInlineStartStyle,borderEndStyle:Cn.borderInlineEndStyle});var mte={color:se.colors("color"),textColor:se.colors("color"),fill:se.colors("fill"),stroke:se.colors("stroke")},o7={boxShadow:se.shadows("boxShadow"),mixBlendMode:!0,blendMode:se.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:se.prop("backgroundBlendMode"),opacity:!0};Object.assign(o7,{shadow:o7.boxShadow});var vte={filter:{transform:hn.filter},blur:se.blur("--chakra-blur"),brightness:se.propT("--chakra-brightness",hn.brightness),contrast:se.propT("--chakra-contrast",hn.contrast),hueRotate:se.degreeT("--chakra-hue-rotate"),invert:se.propT("--chakra-invert",hn.invert),saturate:se.propT("--chakra-saturate",hn.saturate),dropShadow:se.propT("--chakra-drop-shadow",hn.dropShadow),backdropFilter:{transform:hn.backdropFilter},backdropBlur:se.blur("--chakra-backdrop-blur"),backdropBrightness:se.propT("--chakra-backdrop-brightness",hn.brightness),backdropContrast:se.propT("--chakra-backdrop-contrast",hn.contrast),backdropHueRotate:se.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:se.propT("--chakra-backdrop-invert",hn.invert),backdropSaturate:se.propT("--chakra-backdrop-saturate",hn.saturate)},G4={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:hn.flexDirection},experimental_spaceX:{static:lte,transform:S2({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:ute,transform:S2({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:se.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:se.space("gap"),rowGap:se.space("rowGap"),columnGap:se.space("columnGap")};Object.assign(G4,{flexDir:G4.flexDirection});var kj={gridGap:se.space("gridGap"),gridColumnGap:se.space("gridColumnGap"),gridRowGap:se.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},yte={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:hn.outline},outlineOffset:!0,outlineColor:se.colors("outlineColor")},Za={width:se.sizesT("width"),inlineSize:se.sizesT("inlineSize"),height:se.sizes("height"),blockSize:se.sizes("blockSize"),boxSize:se.sizes(["width","height"]),minWidth:se.sizes("minWidth"),minInlineSize:se.sizes("minInlineSize"),minHeight:se.sizes("minHeight"),minBlockSize:se.sizes("minBlockSize"),maxWidth:se.sizes("maxWidth"),maxInlineSize:se.sizes("maxInlineSize"),maxHeight:se.sizes("maxHeight"),maxBlockSize:se.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:se.propT("float",hn.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Za,{w:Za.width,h:Za.height,minW:Za.minWidth,maxW:Za.maxWidth,minH:Za.minHeight,maxH:Za.maxHeight,overscroll:Za.overscrollBehavior,overscrollX:Za.overscrollBehaviorX,overscrollY:Za.overscrollBehaviorY});var bte={listStyleType:!0,listStylePosition:!0,listStylePos:se.prop("listStylePosition"),listStyleImage:!0,listStyleImg:se.prop("listStyleImage")};function Ste(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},wte=xte(Ste),Cte={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},_te={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Xw=(e,t,n)=>{const r={},i=wte(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},kte={srOnly:{transform(e){return e===!0?Cte:e==="focusable"?_te:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Xw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Xw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Xw(t,e,n)}},Fv={position:!0,pos:se.prop("position"),zIndex:se.prop("zIndex","zIndices"),inset:se.spaceT("inset"),insetX:se.spaceT(["left","right"]),insetInline:se.spaceT("insetInline"),insetY:se.spaceT(["top","bottom"]),insetBlock:se.spaceT("insetBlock"),top:se.spaceT("top"),insetBlockStart:se.spaceT("insetBlockStart"),bottom:se.spaceT("bottom"),insetBlockEnd:se.spaceT("insetBlockEnd"),left:se.spaceT("left"),insetInlineStart:se.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:se.spaceT("right"),insetInlineEnd:se.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Fv,{insetStart:Fv.insetInlineStart,insetEnd:Fv.insetInlineEnd});var Ete={ring:{transform:hn.ring},ringColor:se.colors("--chakra-ring-color"),ringOffset:se.prop("--chakra-ring-offset-width"),ringOffsetColor:se.colors("--chakra-ring-offset-color"),ringInset:se.prop("--chakra-ring-inset")},sr={margin:se.spaceT("margin"),marginTop:se.spaceT("marginTop"),marginBlockStart:se.spaceT("marginBlockStart"),marginRight:se.spaceT("marginRight"),marginInlineEnd:se.spaceT("marginInlineEnd"),marginBottom:se.spaceT("marginBottom"),marginBlockEnd:se.spaceT("marginBlockEnd"),marginLeft:se.spaceT("marginLeft"),marginInlineStart:se.spaceT("marginInlineStart"),marginX:se.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:se.spaceT("marginInline"),marginY:se.spaceT(["marginTop","marginBottom"]),marginBlock:se.spaceT("marginBlock"),padding:se.space("padding"),paddingTop:se.space("paddingTop"),paddingBlockStart:se.space("paddingBlockStart"),paddingRight:se.space("paddingRight"),paddingBottom:se.space("paddingBottom"),paddingBlockEnd:se.space("paddingBlockEnd"),paddingLeft:se.space("paddingLeft"),paddingInlineStart:se.space("paddingInlineStart"),paddingInlineEnd:se.space("paddingInlineEnd"),paddingX:se.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:se.space("paddingInline"),paddingY:se.space(["paddingTop","paddingBottom"]),paddingBlock:se.space("paddingBlock")};Object.assign(sr,{m:sr.margin,mt:sr.marginTop,mr:sr.marginRight,me:sr.marginInlineEnd,marginEnd:sr.marginInlineEnd,mb:sr.marginBottom,ml:sr.marginLeft,ms:sr.marginInlineStart,marginStart:sr.marginInlineStart,mx:sr.marginX,my:sr.marginY,p:sr.padding,pt:sr.paddingTop,py:sr.paddingY,px:sr.paddingX,pb:sr.paddingBottom,pl:sr.paddingLeft,ps:sr.paddingInlineStart,paddingStart:sr.paddingInlineStart,pr:sr.paddingRight,pe:sr.paddingInlineEnd,paddingEnd:sr.paddingInlineEnd});var Pte={textDecorationColor:se.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:se.shadows("textShadow")},Tte={clipPath:!0,transform:se.propT("transform",hn.transform),transformOrigin:!0,translateX:se.spaceT("--chakra-translate-x"),translateY:se.spaceT("--chakra-translate-y"),skewX:se.degreeT("--chakra-skew-x"),skewY:se.degreeT("--chakra-skew-y"),scaleX:se.prop("--chakra-scale-x"),scaleY:se.prop("--chakra-scale-y"),scale:se.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:se.degreeT("--chakra-rotate")},Lte={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:se.prop("transitionDuration","transition.duration"),transitionProperty:se.prop("transitionProperty","transition.property"),transitionTimingFunction:se.prop("transitionTimingFunction","transition.easing")},Ate={fontFamily:se.prop("fontFamily","fonts"),fontSize:se.prop("fontSize","fontSizes",hn.px),fontWeight:se.prop("fontWeight","fontWeights"),lineHeight:se.prop("lineHeight","lineHeights"),letterSpacing:se.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},Ote={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:se.spaceT("scrollMargin"),scrollMarginTop:se.spaceT("scrollMarginTop"),scrollMarginBottom:se.spaceT("scrollMarginBottom"),scrollMarginLeft:se.spaceT("scrollMarginLeft"),scrollMarginRight:se.spaceT("scrollMarginRight"),scrollMarginX:se.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:se.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:se.spaceT("scrollPadding"),scrollPaddingTop:se.spaceT("scrollPaddingTop"),scrollPaddingBottom:se.spaceT("scrollPaddingBottom"),scrollPaddingLeft:se.spaceT("scrollPaddingLeft"),scrollPaddingRight:se.spaceT("scrollPaddingRight"),scrollPaddingX:se.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:se.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function Ej(e){return qs(e)&&e.reference?e.reference:String(e)}var SS=(e,...t)=>t.map(Ej).join(` ${e} `).replace(/calc/g,""),wL=(...e)=>`calc(${SS("+",...e)})`,CL=(...e)=>`calc(${SS("-",...e)})`,a7=(...e)=>`calc(${SS("*",...e)})`,_L=(...e)=>`calc(${SS("/",...e)})`,kL=e=>{const t=Ej(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:a7(t,-1)},wh=Object.assign(e=>({add:(...t)=>wh(wL(e,...t)),subtract:(...t)=>wh(CL(e,...t)),multiply:(...t)=>wh(a7(e,...t)),divide:(...t)=>wh(_L(e,...t)),negate:()=>wh(kL(e)),toString:()=>e.toString()}),{add:wL,subtract:CL,multiply:a7,divide:_L,negate:kL});function Mte(e,t="-"){return e.replace(/\s+/g,t)}function Ite(e){const t=Mte(e.toString());return Dte(Rte(t))}function Rte(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function Dte(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function Nte(e,t=""){return[t,e].filter(Boolean).join("-")}function jte(e,t){return`var(${e}${t?`, ${t}`:""})`}function Bte(e,t=""){return Ite(`--${Nte(e,t)}`)}function Vn(e,t,n){const r=Bte(e,n);return{variable:r,reference:jte(r,t)}}function $te(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function Fte(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function s7(e){if(e==null)return e;const{unitless:t}=Fte(e);return t||typeof e=="number"?`${e}px`:e}var Pj=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,C_=e=>Object.fromEntries(Object.entries(e).sort(Pj));function EL(e){const t=C_(e);return Object.assign(Object.values(t),t)}function zte(e){const t=Object.keys(C_(e));return new Set(t)}function PL(e){if(!e)return e;e=s7(e)??e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function xv(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${s7(e)})`),t&&n.push("and",`(max-width: ${s7(t)})`),n.join(" ")}function Hte(e){if(!e)return null;e.base=e.base??"0px";const t=EL(e),n=Object.entries(e).sort(Pj).map(([o,a],s,l)=>{let[,u]=l[s+1]??[];return u=parseFloat(u)>0?PL(u):void 0,{_minW:PL(a),breakpoint:o,minW:a,maxW:u,maxWQuery:xv(null,u),minWQuery:xv(a),minMaxQuery:xv(a,u)}}),r=zte(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(o){const a=Object.keys(o);return a.length>0&&a.every(s=>r.has(s))},asObject:C_(e),asArray:EL(e),details:n,media:[null,...t.map(o=>xv(o)).slice(1)],toArrayValue(o){if(!qs(o))throw new Error("toArrayValue: value must be an object");const a=i.map(s=>o[s]??null);for(;$te(a)===null;)a.pop();return a},toObjectValue(o){if(!Array.isArray(o))throw new Error("toObjectValue: value must be an array");return o.reduce((a,s,l)=>{const u=i[l];return u!=null&&s!=null&&(a[u]=s),a},{})}}}var Hi={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},ad=e=>Tj(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Bu=e=>Tj(t=>e(t,"~ &"),"[data-peer]",".peer"),Tj=(e,...t)=>t.map(e).join(", "),xS={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:ad(Hi.hover),_peerHover:Bu(Hi.hover),_groupFocus:ad(Hi.focus),_peerFocus:Bu(Hi.focus),_groupFocusVisible:ad(Hi.focusVisible),_peerFocusVisible:Bu(Hi.focusVisible),_groupActive:ad(Hi.active),_peerActive:Bu(Hi.active),_groupDisabled:ad(Hi.disabled),_peerDisabled:Bu(Hi.disabled),_groupInvalid:ad(Hi.invalid),_peerInvalid:Bu(Hi.invalid),_groupChecked:ad(Hi.checked),_peerChecked:Bu(Hi.checked),_groupFocusWithin:ad(Hi.focusWithin),_peerFocusWithin:Bu(Hi.focusWithin),_peerPlaceholderShown:Bu(Hi.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},Vte=Object.keys(xS);function TL(e,t){return Vn(String(e).replace(/\./g,"-"),void 0,t)}function Wte(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=TL(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[y,...b]=m,x=`${y}.-${b.join(".")}`,k=wh.negate(s),E=wh.negate(u);r[x]={value:k,var:l,varRef:E}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const d=m=>{const b=[String(i).split(".")[0],m].join(".");if(!e[b])return m;const{reference:k}=TL(b,t==null?void 0:t.cssVarPrefix);return k},h=qs(s)?s:{default:s};n=Gl(n,Object.entries(h).reduce((m,[y,b])=>{var x;const k=d(b);if(y==="default")return m[l]=k,m;const E=((x=xS)==null?void 0:x[y])??y;return m[E]={[l]:k},m},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function Ute(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Gte(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var qte=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function Yte(e){return Gte(e,qte)}function Kte(e){return e.semanticTokens}function Xte(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function Zte({tokens:e,semanticTokens:t}){const n=Object.entries(l7(e)??{}).map(([i,o])=>[i,{isSemantic:!1,value:o}]),r=Object.entries(l7(t,1)??{}).map(([i,o])=>[i,{isSemantic:!0,value:o}]);return Object.fromEntries([...n,...r])}function l7(e,t=1/0){return!qs(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(qs(i)||Array.isArray(i)?Object.entries(l7(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function Qte(e){var t;const n=Xte(e),r=Yte(n),i=Kte(n),o=Zte({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=Wte(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:Hte(n.breakpoints)}),n}var __=Gl({},s4,Cn,mte,G4,Za,vte,Ete,yte,kj,kte,Fv,o7,sr,Ote,Ate,Pte,Tte,bte,Lte),Jte=Object.assign({},sr,Za,G4,kj,Fv),Lj=Object.keys(Jte),ene=[...Object.keys(__),...Vte],tne={...__,...xS},nne=e=>e in tne,rne=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=kh(e[a],t);if(s==null)continue;if(s=qs(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!one(t),sne=(e,t)=>{if(t==null)return t;const n=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.varRef},r=a=>n(a)??a,[i,o]=ine(t);return t=n(i)??r(o)??r(t),t};function lne(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s;const l=kh(o,r),u=rne(l)(r);let d={};for(let h in u){const m=u[h];let y=kh(m,r);h in n&&(h=n[h]),ane(h,y)&&(y=sne(r,y));let b=t[h];if(b===!0&&(b={property:h}),qs(y)){d[h]=d[h]??{},d[h]=Gl({},d[h],i(y,!0));continue}let x=((s=b==null?void 0:b.transform)==null?void 0:s.call(b,y,r,l))??y;x=b!=null&&b.processResult?i(x,!0):x;const k=kh(b==null?void 0:b.property,r);if(!a&&(b!=null&&b.static)){const E=kh(b.static,r);d=Gl({},d,E)}if(k&&Array.isArray(k)){for(const E of k)d[E]=x;continue}if(k){k==="&"&&qs(x)?d=Gl({},d,x):d[k]=x;continue}if(qs(x)){d=Gl({},d,x);continue}d[h]=x}return d};return i}var Aj=e=>t=>lne({theme:t,pseudos:xS,configs:__})(e);function pr(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function une(e,t){if(Array.isArray(e))return e;if(qs(e))return t(e);if(e!=null)return[e]}function cne(e,t){for(let n=t+1;n{Gl(u,{[P]:m?_[P]:{[E]:_[P]}})});continue}if(!y){m?Gl(u,_):u[E]=_;continue}u[E]=_}}return u}}function fne(e){return t=>{const{variant:n,size:r,theme:i}=t,o=dne(i);return Gl({},kh(e.baseStyle??{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function hne(e,t,n){var r,i;return((i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)??n}function Sn(e){return Ute(e,["styleConfig","size","variant","colorScheme"])}function pne(e){if(e.sheet)return e.sheet;for(var t=0;t0?Yi(v0,--ra):0,Gm--,ii===10&&(Gm=1,CS--),ii}function Ta(){return ii=ra2||w2(ii)>3?"":" "}function Ene(e,t){for(;--t&&Ta()&&!(ii<48||ii>102||ii>57&&ii<65||ii>70&&ii<97););return yy(e,l4()+(t<6&&Xl()==32&&Ta()==32))}function c7(e){for(;Ta();)switch(ii){case e:return ra;case 34:case 39:e!==34&&e!==39&&c7(ii);break;case 40:e===41&&c7(e);break;case 92:Ta();break}return ra}function Pne(e,t){for(;Ta()&&e+ii!==47+10;)if(e+ii===42+42&&Xl()===47)break;return"/*"+yy(t,ra-1)+"*"+wS(e===47?e:Ta())}function Tne(e){for(;!w2(Xl());)Ta();return yy(e,ra)}function Lne(e){return Nj(c4("",null,null,null,[""],e=Dj(e),0,[0],e))}function c4(e,t,n,r,i,o,a,s,l){for(var u=0,d=0,h=a,m=0,y=0,b=0,x=1,k=1,E=1,_=0,P="",A=i,M=o,R=r,D=P;k;)switch(b=_,_=Ta()){case 40:if(b!=108&&Yi(D,h-1)==58){u7(D+=On(u4(_),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:D+=u4(_);break;case 9:case 10:case 13:case 32:D+=kne(b);break;case 92:D+=Ene(l4()-1,7);continue;case 47:switch(Xl()){case 42:case 47:U3(Ane(Pne(Ta(),l4()),t,n),l);break;default:D+="/"}break;case 123*x:s[u++]=Fl(D)*E;case 125*x:case 59:case 0:switch(_){case 0:case 125:k=0;case 59+d:y>0&&Fl(D)-h&&U3(y>32?AL(D+";",r,n,h-1):AL(On(D," ","")+";",r,n,h-2),l);break;case 59:D+=";";default:if(U3(R=LL(D,t,n,u,d,i,s,P,A=[],M=[],h),o),_===123)if(d===0)c4(D,t,R,R,A,o,h,s,M);else switch(m===99&&Yi(D,3)===110?100:m){case 100:case 109:case 115:c4(e,R,R,r&&U3(LL(e,R,R,0,0,i,s,P,i,A=[],h),M),i,M,h,s,r?A:M);break;default:c4(D,R,R,R,[""],M,0,s,M)}}u=d=y=0,x=E=1,P=D="",h=a;break;case 58:h=1+Fl(D),y=b;default:if(x<1){if(_==123)--x;else if(_==125&&x++==0&&_ne()==125)continue}switch(D+=wS(_),_*x){case 38:E=d>0?1:(D+="\f",-1);break;case 44:s[u++]=(Fl(D)-1)*E,E=1;break;case 64:Xl()===45&&(D+=u4(Ta())),m=Xl(),d=h=Fl(P=D+=Tne(l4())),_++;break;case 45:b===45&&Fl(D)==2&&(x=0)}}return o}function LL(e,t,n,r,i,o,a,s,l,u,d){for(var h=i-1,m=i===0?o:[""],y=P_(m),b=0,x=0,k=0;b0?m[E]+" "+_:On(_,/&\f/g,m[E])))&&(l[k++]=P);return _S(e,t,n,i===0?k_:s,l,u,d)}function Ane(e,t,n){return _S(e,t,n,Oj,wS(Cne()),x2(e,2,-2),0)}function AL(e,t,n,r){return _S(e,t,n,E_,x2(e,0,r),x2(e,r+1,-1),r)}function ym(e,t){for(var n="",r=P_(e),i=0;i6)switch(Yi(e,t+1)){case 109:if(Yi(e,t+4)!==45)break;case 102:return On(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+q4+(Yi(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~u7(e,"stretch")?Bj(On(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Yi(e,t+1)!==115)break;case 6444:switch(Yi(e,Fl(e)-3-(~u7(e,"!important")&&10))){case 107:return On(e,":",":"+_n)+e;case 101:return On(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Yi(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+ro+"$2box$3")+e}break;case 5936:switch(Yi(e,t+11)){case 114:return _n+e+ro+On(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+ro+On(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+ro+On(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+ro+e+e}return e}var $ne=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case E_:t.return=Bj(t.value,t.length);break;case Mj:return ym([W1(t,{value:On(t.value,"@","@"+_n)})],i);case k_:if(t.length)return wne(t.props,function(o){switch(xne(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ym([W1(t,{props:[On(o,/:(read-\w+)/,":"+q4+"$1")]})],i);case"::placeholder":return ym([W1(t,{props:[On(o,/:(plac\w+)/,":"+_n+"input-$1")]}),W1(t,{props:[On(o,/:(plac\w+)/,":"+q4+"$1")]}),W1(t,{props:[On(o,/:(plac\w+)/,ro+"input-$1")]})],i)}return""})}},Fne=[$ne],$j=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(x){var k=x.getAttribute("data-emotion");k.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var i=t.stylisPlugins||Fne,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var k=x.getAttribute("data-emotion").split(" "),E=1;E=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Qne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Jne=/[A-Z]|^ms/g,ere=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Uj=function(t){return t.charCodeAt(1)===45},IL=function(t){return t!=null&&typeof t!="boolean"},Zw=jj(function(e){return Uj(e)?e:e.replace(Jne,"-$&").toLowerCase()}),RL=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(ere,function(r,i,o){return zl={name:i,styles:o,next:zl},i})}return Qne[t]!==1&&!Uj(t)&&typeof n=="number"&&n!==0?n+"px":n};function x2(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return zl={name:n.name,styles:n.styles,next:zl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)zl={name:r.name,styles:r.styles,next:zl},r=r.next;var i=n.styles+";";return i}return tre(e,t,n)}case"function":{if(e!==void 0){var o=zl,a=n(e);return zl=o,x2(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function tre(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{t.includes(r)||(n[r]=e[r])}),n}function yre(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},Qj=bre(yre);function Jj(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var eB=e=>Jj(e,t=>t!=null);function Sre(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var xre=Sre();function tB(e,...t){return mre(e)?e(...t):e}function wre(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Cre(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=w.createContext(void 0);i.displayName=r;function o(){var a;const s=w.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}var _re=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,kre=jj(function(e){return _re.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Ere=kre,Pre=function(t){return t!=="theme"},BL=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Ere:Pre},FL=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},Tre=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Vj(n,r,i),rre(function(){return Wj(n,r,i)}),null},Lre=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=FL(t,n,r),l=s||BL(i),u=!l("as");return function(){var d=arguments,h=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)h.push.apply(h,d);else{h.push(d[0][0]);for(var m=d.length,y=1;y[h,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([h,m])=>[h,m.className]))}function l(d){const y=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:y,selector:`.${y}`,toString:()=>d}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var Ore=Mn("accordion").parts("root","container","button","panel").extend("icon"),Mre=Mn("alert").parts("title","description","container").extend("icon","spinner"),Ire=Mn("avatar").parts("label","badge","container").extend("excessLabel","group"),Rre=Mn("breadcrumb").parts("link","item","container").extend("separator");Mn("button").parts();var Dre=Mn("checkbox").parts("control","icon","container").extend("label");Mn("progress").parts("track","filledTrack").extend("label");var Nre=Mn("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),jre=Mn("editable").parts("preview","input","textarea"),Bre=Mn("form").parts("container","requiredIndicator","helperText"),Fre=Mn("formError").parts("text","icon"),$re=Mn("input").parts("addon","field","element"),zre=Mn("list").parts("container","item","icon"),Hre=Mn("menu").parts("button","list","item").extend("groupTitle","command","divider"),Vre=Mn("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Wre=Mn("numberinput").parts("root","field","stepperGroup","stepper");Mn("pininput").parts("field");var Ure=Mn("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Gre=Mn("progress").parts("label","filledTrack","track"),qre=Mn("radio").parts("container","control","label"),Yre=Mn("select").parts("field","icon"),Kre=Mn("slider").parts("container","track","thumb","filledTrack","mark"),Xre=Mn("stat").parts("container","label","helpText","number","icon"),Zre=Mn("switch").parts("container","track","thumb"),Qre=Mn("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),Jre=Mn("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),eie=Mn("tag").parts("container","label","closeButton"),tie=Mn("card").parts("container","header","body","footer");function Gi(e,t){nie(e)&&(e="100%");var n=rie(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function W3(e){return Math.min(1,Math.max(0,e))}function nie(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function rie(e){return typeof e=="string"&&e.indexOf("%")!==-1}function nB(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function U3(e){return e<=1?"".concat(Number(e)*100,"%"):e}function kh(e){return e.length===1?"0"+e:String(e)}function iie(e,t,n){return{r:Gi(e,255)*255,g:Gi(t,255)*255,b:Gi(n,255)*255}}function $L(e,t,n){e=Gi(e,255),t=Gi(t,255),n=Gi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=0,s=(r+i)/2;if(r===i)a=0,o=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function oie(e,t,n){var r,i,o;if(e=Gi(e,360),t=Gi(t,100),n=Gi(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Qw(s,a,e+1/3),i=Qw(s,a,e),o=Qw(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function zL(e,t,n){e=Gi(e,255),t=Gi(t,255),n=Gi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var g7={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function cie(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=hie(e)),typeof e=="object"&&(Fu(e.r)&&Fu(e.g)&&Fu(e.b)?(t=iie(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Fu(e.h)&&Fu(e.s)&&Fu(e.v)?(r=U3(e.s),i=U3(e.v),t=aie(e.h,r,i),a=!0,s="hsv"):Fu(e.h)&&Fu(e.s)&&Fu(e.l)&&(r=U3(e.s),o=U3(e.l),t=oie(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=nB(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var die="[-\\+]?\\d+%?",fie="[-\\+]?\\d*\\.\\d+%?",Cd="(?:".concat(fie,")|(?:").concat(die,")"),Jw="[\\s|\\(]+(".concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")\\s*\\)?"),e6="[\\s|\\(]+(".concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")\\s*\\)?"),Bs={CSS_UNIT:new RegExp(Cd),rgb:new RegExp("rgb"+Jw),rgba:new RegExp("rgba"+e6),hsl:new RegExp("hsl"+Jw),hsla:new RegExp("hsla"+e6),hsv:new RegExp("hsv"+Jw),hsva:new RegExp("hsva"+e6),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function hie(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(g7[e])e=g7[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Bs.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Bs.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Bs.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Bs.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Bs.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Bs.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Bs.hex8.exec(e),n?{r:_a(n[1]),g:_a(n[2]),b:_a(n[3]),a:VL(n[4]),format:t?"name":"hex8"}:(n=Bs.hex6.exec(e),n?{r:_a(n[1]),g:_a(n[2]),b:_a(n[3]),format:t?"name":"hex"}:(n=Bs.hex4.exec(e),n?{r:_a(n[1]+n[1]),g:_a(n[2]+n[2]),b:_a(n[3]+n[3]),a:VL(n[4]+n[4]),format:t?"name":"hex8"}:(n=Bs.hex3.exec(e),n?{r:_a(n[1]+n[1]),g:_a(n[2]+n[2]),b:_a(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function Fu(e){return Boolean(Bs.CSS_UNIT.exec(String(e)))}var vy=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=uie(t)),this.originalInput=t;var i=cie(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,a=t.g/255,s=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=nB(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=zL(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=zL(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=$L(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=$L(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),HL(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),sie(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(Gi(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(Gi(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+HL(this.r,this.g,this.b,!1),n=0,r=Object.entries(g7);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=W3(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=W3(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=W3(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=W3(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:i,v:o})),o=(o+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(rB(e));return e.count=t,n}var r=pie(e.hue,e.seed),i=gie(r,e),o=mie(r,i,e),a={h:r,s:i,v:o};return e.alpha!==void 0&&(a.a=e.alpha),new vy(a)}function pie(e,t){var n=yie(e),r=Y4(n,t);return r<0&&(r=360+r),r}function gie(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return Y4([0,100],t.seed);var n=iB(e).saturationRange,r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55;break}return Y4([r,i],t.seed)}function mie(e,t,n){var r=vie(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100;break}return Y4([r,i],n.seed)}function vie(e,t){for(var n=iB(e).lowerBounds,r=0;r=i&&t<=a){var l=(s-o)/(a-i),u=o-l*i;return l*t+u}}return 0}function yie(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=aB.find(function(a){return a.name===e});if(n){var r=oB(n);if(r.hueRange)return r.hueRange}var i=new vy(e);if(i.isValid){var o=i.toHsv().h;return[o,o]}}return[0,360]}function iB(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=aB;t=i.hueRange[0]&&e<=i.hueRange[1])return i}throw Error("Color not found")}function Y4(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var i=t/233280;return Math.floor(r+i*(n-r))}function oB(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],i=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,i]}}var aB=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function bie(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,ko=(e,t,n)=>{const r=bie(e,`colors.${t}`,t),{isValid:i}=new vy(r);return i?r:n},xie=e=>t=>{const n=ko(t,e);return new vy(n).isDark()?"dark":"light"},wie=e=>t=>xie(e)(t)==="dark",Gm=(e,t)=>n=>{const r=ko(n,e);return new vy(r).setAlpha(t).toRgbString()};function WL(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + */var Oi=typeof Symbol=="function"&&Symbol.for,T_=Oi?Symbol.for("react.element"):60103,L_=Oi?Symbol.for("react.portal"):60106,kS=Oi?Symbol.for("react.fragment"):60107,ES=Oi?Symbol.for("react.strict_mode"):60108,PS=Oi?Symbol.for("react.profiler"):60114,TS=Oi?Symbol.for("react.provider"):60109,LS=Oi?Symbol.for("react.context"):60110,A_=Oi?Symbol.for("react.async_mode"):60111,AS=Oi?Symbol.for("react.concurrent_mode"):60111,OS=Oi?Symbol.for("react.forward_ref"):60112,MS=Oi?Symbol.for("react.suspense"):60113,Hne=Oi?Symbol.for("react.suspense_list"):60120,IS=Oi?Symbol.for("react.memo"):60115,RS=Oi?Symbol.for("react.lazy"):60116,Vne=Oi?Symbol.for("react.block"):60121,Wne=Oi?Symbol.for("react.fundamental"):60117,Une=Oi?Symbol.for("react.responder"):60118,Gne=Oi?Symbol.for("react.scope"):60119;function Da(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case T_:switch(e=e.type,e){case A_:case AS:case kS:case PS:case ES:case MS:return e;default:switch(e=e&&e.$$typeof,e){case LS:case OS:case RS:case IS:case TS:return e;default:return t}}case L_:return t}}}function Fj(e){return Da(e)===AS}$n.AsyncMode=A_;$n.ConcurrentMode=AS;$n.ContextConsumer=LS;$n.ContextProvider=TS;$n.Element=T_;$n.ForwardRef=OS;$n.Fragment=kS;$n.Lazy=RS;$n.Memo=IS;$n.Portal=L_;$n.Profiler=PS;$n.StrictMode=ES;$n.Suspense=MS;$n.isAsyncMode=function(e){return Fj(e)||Da(e)===A_};$n.isConcurrentMode=Fj;$n.isContextConsumer=function(e){return Da(e)===LS};$n.isContextProvider=function(e){return Da(e)===TS};$n.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===T_};$n.isForwardRef=function(e){return Da(e)===OS};$n.isFragment=function(e){return Da(e)===kS};$n.isLazy=function(e){return Da(e)===RS};$n.isMemo=function(e){return Da(e)===IS};$n.isPortal=function(e){return Da(e)===L_};$n.isProfiler=function(e){return Da(e)===PS};$n.isStrictMode=function(e){return Da(e)===ES};$n.isSuspense=function(e){return Da(e)===MS};$n.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kS||e===AS||e===PS||e===ES||e===MS||e===Hne||typeof e=="object"&&e!==null&&(e.$$typeof===RS||e.$$typeof===IS||e.$$typeof===TS||e.$$typeof===LS||e.$$typeof===OS||e.$$typeof===Wne||e.$$typeof===Une||e.$$typeof===Gne||e.$$typeof===Vne)};$n.typeOf=Da;(function(e){e.exports=$n})(zne);var zj=d7,qne={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Yne={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Hj={};Hj[zj.ForwardRef]=qne;Hj[zj.Memo]=Yne;var Kne=!0;function Xne(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var Vj=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||Kne===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},Wj=function(t,n,r){Vj(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+i:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function Zne(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Qne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Jne=/[A-Z]|^ms/g,ere=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Uj=function(t){return t.charCodeAt(1)===45},IL=function(t){return t!=null&&typeof t!="boolean"},Zw=jj(function(e){return Uj(e)?e:e.replace(Jne,"-$&").toLowerCase()}),RL=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(ere,function(r,i,o){return zl={name:i,styles:o,next:zl},i})}return Qne[t]!==1&&!Uj(t)&&typeof n=="number"&&n!==0?n+"px":n};function C2(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return zl={name:n.name,styles:n.styles,next:zl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)zl={name:r.name,styles:r.styles,next:zl},r=r.next;var i=n.styles+";";return i}return tre(e,t,n)}case"function":{if(e!==void 0){var o=zl,a=n(e);return zl=o,C2(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function tre(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{t.includes(r)||(n[r]=e[r])}),n}function yre(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},Qj=bre(yre);function Jj(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var eB=e=>Jj(e,t=>t!=null);function Sre(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var xre=Sre();function tB(e,...t){return mre(e)?e(...t):e}function wre(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Cre(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=w.createContext(void 0);i.displayName=r;function o(){var a;const s=w.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}var _re=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,kre=jj(function(e){return _re.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Ere=kre,Pre=function(t){return t!=="theme"},BL=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Ere:Pre},$L=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},Tre=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Vj(n,r,i),rre(function(){return Wj(n,r,i)}),null},Lre=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=$L(t,n,r),l=s||BL(i),u=!l("as");return function(){var d=arguments,h=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)h.push.apply(h,d);else{h.push(d[0][0]);for(var m=d.length,y=1;y[h,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([h,m])=>[h,m.className]))}function l(d){const y=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:y,selector:`.${y}`,toString:()=>d}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var Ore=Mn("accordion").parts("root","container","button","panel").extend("icon"),Mre=Mn("alert").parts("title","description","container").extend("icon","spinner"),Ire=Mn("avatar").parts("label","badge","container").extend("excessLabel","group"),Rre=Mn("breadcrumb").parts("link","item","container").extend("separator");Mn("button").parts();var Dre=Mn("checkbox").parts("control","icon","container").extend("label");Mn("progress").parts("track","filledTrack").extend("label");var Nre=Mn("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),jre=Mn("editable").parts("preview","input","textarea"),Bre=Mn("form").parts("container","requiredIndicator","helperText"),$re=Mn("formError").parts("text","icon"),Fre=Mn("input").parts("addon","field","element"),zre=Mn("list").parts("container","item","icon"),Hre=Mn("menu").parts("button","list","item").extend("groupTitle","command","divider"),Vre=Mn("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Wre=Mn("numberinput").parts("root","field","stepperGroup","stepper");Mn("pininput").parts("field");var Ure=Mn("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Gre=Mn("progress").parts("label","filledTrack","track"),qre=Mn("radio").parts("container","control","label"),Yre=Mn("select").parts("field","icon"),Kre=Mn("slider").parts("container","track","thumb","filledTrack","mark"),Xre=Mn("stat").parts("container","label","helpText","number","icon"),Zre=Mn("switch").parts("container","track","thumb"),Qre=Mn("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),Jre=Mn("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),eie=Mn("tag").parts("container","label","closeButton"),tie=Mn("card").parts("container","header","body","footer");function Ki(e,t){nie(e)&&(e="100%");var n=rie(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function G3(e){return Math.min(1,Math.max(0,e))}function nie(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function rie(e){return typeof e=="string"&&e.indexOf("%")!==-1}function nB(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function q3(e){return e<=1?"".concat(Number(e)*100,"%"):e}function Eh(e){return e.length===1?"0"+e:String(e)}function iie(e,t,n){return{r:Ki(e,255)*255,g:Ki(t,255)*255,b:Ki(n,255)*255}}function FL(e,t,n){e=Ki(e,255),t=Ki(t,255),n=Ki(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=0,s=(r+i)/2;if(r===i)a=0,o=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function oie(e,t,n){var r,i,o;if(e=Ki(e,360),t=Ki(t,100),n=Ki(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Qw(s,a,e+1/3),i=Qw(s,a,e),o=Qw(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function zL(e,t,n){e=Ki(e,255),t=Ki(t,255),n=Ki(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var g7={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function cie(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=hie(e)),typeof e=="object"&&($u(e.r)&&$u(e.g)&&$u(e.b)?(t=iie(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):$u(e.h)&&$u(e.s)&&$u(e.v)?(r=q3(e.s),i=q3(e.v),t=aie(e.h,r,i),a=!0,s="hsv"):$u(e.h)&&$u(e.s)&&$u(e.l)&&(r=q3(e.s),o=q3(e.l),t=oie(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=nB(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var die="[-\\+]?\\d+%?",fie="[-\\+]?\\d*\\.\\d+%?",Cd="(?:".concat(fie,")|(?:").concat(die,")"),Jw="[\\s|\\(]+(".concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")\\s*\\)?"),e6="[\\s|\\(]+(".concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")[,|\\s]+(").concat(Cd,")\\s*\\)?"),Bs={CSS_UNIT:new RegExp(Cd),rgb:new RegExp("rgb"+Jw),rgba:new RegExp("rgba"+e6),hsl:new RegExp("hsl"+Jw),hsla:new RegExp("hsla"+e6),hsv:new RegExp("hsv"+Jw),hsva:new RegExp("hsva"+e6),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function hie(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(g7[e])e=g7[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Bs.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Bs.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Bs.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Bs.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Bs.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Bs.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Bs.hex8.exec(e),n?{r:_a(n[1]),g:_a(n[2]),b:_a(n[3]),a:VL(n[4]),format:t?"name":"hex8"}:(n=Bs.hex6.exec(e),n?{r:_a(n[1]),g:_a(n[2]),b:_a(n[3]),format:t?"name":"hex"}:(n=Bs.hex4.exec(e),n?{r:_a(n[1]+n[1]),g:_a(n[2]+n[2]),b:_a(n[3]+n[3]),a:VL(n[4]+n[4]),format:t?"name":"hex8"}:(n=Bs.hex3.exec(e),n?{r:_a(n[1]+n[1]),g:_a(n[2]+n[2]),b:_a(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function $u(e){return Boolean(Bs.CSS_UNIT.exec(String(e)))}var by=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=uie(t)),this.originalInput=t;var i=cie(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,a=t.g/255,s=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=nB(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=zL(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=zL(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=FL(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=FL(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),HL(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),sie(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(Ki(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(Ki(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+HL(this.r,this.g,this.b,!1),n=0,r=Object.entries(g7);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=G3(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=G3(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=G3(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=G3(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:i,v:o})),o=(o+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(rB(e));return e.count=t,n}var r=pie(e.hue,e.seed),i=gie(r,e),o=mie(r,i,e),a={h:r,s:i,v:o};return e.alpha!==void 0&&(a.a=e.alpha),new by(a)}function pie(e,t){var n=yie(e),r=Y4(n,t);return r<0&&(r=360+r),r}function gie(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return Y4([0,100],t.seed);var n=iB(e).saturationRange,r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55;break}return Y4([r,i],t.seed)}function mie(e,t,n){var r=vie(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100;break}return Y4([r,i],n.seed)}function vie(e,t){for(var n=iB(e).lowerBounds,r=0;r=i&&t<=a){var l=(s-o)/(a-i),u=o-l*i;return l*t+u}}return 0}function yie(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=aB.find(function(a){return a.name===e});if(n){var r=oB(n);if(r.hueRange)return r.hueRange}var i=new by(e);if(i.isValid){var o=i.toHsv().h;return[o,o]}}return[0,360]}function iB(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=aB;t=i.hueRange[0]&&e<=i.hueRange[1])return i}throw Error("Color not found")}function Y4(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var i=t/233280;return Math.floor(r+i*(n-r))}function oB(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],i=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,i]}}var aB=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function bie(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,ko=(e,t,n)=>{const r=bie(e,`colors.${t}`,t),{isValid:i}=new by(r);return i?r:n},xie=e=>t=>{const n=ko(t,e);return new by(n).isDark()?"dark":"light"},wie=e=>t=>xie(e)(t)==="dark",qm=(e,t)=>n=>{const r=ko(n,e);return new by(r).setAlpha(t).toRgbString()};function WL(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( 45deg, ${t} 25%, transparent 25%, @@ -30,12 +30,12 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con ${t} 75%, transparent 75%, transparent - )`,backgroundSize:`${e} ${e}`}}function Cie(e){const t=rB().toHexString();return!e||Sie(e)?t:e.string&&e.colors?kie(e.string,e.colors):e.string&&!e.colors?_ie(e.string):e.colors&&!e.string?Eie(e.colors):t}function _ie(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function kie(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function I_(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function Pie(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function sB(e){return Pie(e)&&e.reference?e.reference:String(e)}var jS=(e,...t)=>t.map(sB).join(` ${e} `).replace(/calc/g,""),UL=(...e)=>`calc(${jS("+",...e)})`,GL=(...e)=>`calc(${jS("-",...e)})`,m7=(...e)=>`calc(${jS("*",...e)})`,qL=(...e)=>`calc(${jS("/",...e)})`,YL=e=>{const t=sB(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:m7(t,-1)},Uu=Object.assign(e=>({add:(...t)=>Uu(UL(e,...t)),subtract:(...t)=>Uu(GL(e,...t)),multiply:(...t)=>Uu(m7(e,...t)),divide:(...t)=>Uu(qL(e,...t)),negate:()=>Uu(YL(e)),toString:()=>e.toString()}),{add:UL,subtract:GL,multiply:m7,divide:qL,negate:YL});function Tie(e){return!Number.isInteger(parseFloat(e.toString()))}function Lie(e,t="-"){return e.replace(/\s+/g,t)}function lB(e){const t=Lie(e.toString());return t.includes("\\.")?e:Tie(e)?t.replace(".","\\."):e}function Aie(e,t=""){return[t,lB(e)].filter(Boolean).join("-")}function Oie(e,t){return`var(${lB(e)}${t?`, ${t}`:""})`}function Mie(e,t=""){return`--${Aie(e,t)}`}function yi(e,t){const n=Mie(e,t==null?void 0:t.prefix);return{variable:n,reference:Oie(n,Iie(t==null?void 0:t.fallback))}}function Iie(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{definePartsStyle:Rie,defineMultiStyleConfig:Die}=pr(Ore.keys),Nie={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},jie={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Bie={pt:"2",px:"4",pb:"5"},Fie={fontSize:"1.25em"},$ie=Rie({container:Nie,button:jie,panel:Bie,icon:Fie}),zie=Die({baseStyle:$ie}),{definePartsStyle:yy,defineMultiStyleConfig:Hie}=pr(Mre.keys),La=Vn("alert-fg"),ec=Vn("alert-bg"),Vie=yy({container:{bg:ec.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:La.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:La.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function R_(e){const{theme:t,colorScheme:n}=e,r=Gm(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Wie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark}}}}),Uie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:La.reference}}}),Gie=yy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:La.reference}}}),qie=yy(e=>{const{colorScheme:t}=e;return{container:{[La.variable]:"colors.white",[ec.variable]:`colors.${t}.500`,_dark:{[La.variable]:"colors.gray.900",[ec.variable]:`colors.${t}.200`},color:La.reference}}}),Yie={subtle:Wie,"left-accent":Uie,"top-accent":Gie,solid:qie},Kie=Hie({baseStyle:Vie,variants:Yie,defaultProps:{variant:"subtle",colorScheme:"blue"}}),uB={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Xie={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},Zie={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},Qie={...uB,...Xie,container:Zie},cB=Qie,Jie=e=>typeof e=="function";function To(e,...t){return Jie(e)?e(...t):e}var{definePartsStyle:dB,defineMultiStyleConfig:eoe}=pr(Ire.keys),ym=Vn("avatar-border-color"),t6=Vn("avatar-bg"),toe={borderRadius:"full",border:"0.2em solid",[ym.variable]:"white",_dark:{[ym.variable]:"colors.gray.800"},borderColor:ym.reference},noe={[t6.variable]:"colors.gray.200",_dark:{[t6.variable]:"colors.whiteAlpha.400"},bgColor:t6.reference},KL=Vn("avatar-background"),roe=e=>{const{name:t,theme:n}=e,r=t?Cie({string:t}):"colors.gray.400",i=wie(r)(n);let o="white";return i||(o="gray.800"),{bg:KL.reference,"&:not([data-loaded])":{[KL.variable]:r},color:o,[ym.variable]:"colors.white",_dark:{[ym.variable]:"colors.gray.800"},borderColor:ym.reference,verticalAlign:"top"}},ioe=dB(e=>({badge:To(toe,e),excessLabel:To(noe,e),container:To(roe,e)}));function sd(e){const t=e!=="100%"?cB[e]:void 0;return dB({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var ooe={"2xs":sd(4),xs:sd(6),sm:sd(8),md:sd(12),lg:sd(16),xl:sd(24),"2xl":sd(32),full:sd("100%")},aoe=eoe({baseStyle:ioe,sizes:ooe,defaultProps:{size:"md"}}),soe={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},bm=Vn("badge-bg"),ql=Vn("badge-color"),loe=e=>{const{colorScheme:t,theme:n}=e,r=Gm(`${t}.500`,.6)(n);return{[bm.variable]:`colors.${t}.500`,[ql.variable]:"colors.white",_dark:{[bm.variable]:r,[ql.variable]:"colors.whiteAlpha.800"},bg:bm.reference,color:ql.reference}},uoe=e=>{const{colorScheme:t,theme:n}=e,r=Gm(`${t}.200`,.16)(n);return{[bm.variable]:`colors.${t}.100`,[ql.variable]:`colors.${t}.800`,_dark:{[bm.variable]:r,[ql.variable]:`colors.${t}.200`},bg:bm.reference,color:ql.reference}},coe=e=>{const{colorScheme:t,theme:n}=e,r=Gm(`${t}.200`,.8)(n);return{[ql.variable]:`colors.${t}.500`,_dark:{[ql.variable]:r},color:ql.reference,boxShadow:`inset 0 0 0px 1px ${ql.reference}`}},doe={solid:loe,subtle:uoe,outline:coe},$v={baseStyle:soe,variants:doe,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:foe,definePartsStyle:hoe}=pr(Rre.keys),poe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},goe=hoe({link:poe}),moe=foe({baseStyle:goe}),voe={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},fB=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Et("inherit","whiteAlpha.900")(e),_hover:{bg:Et("gray.100","whiteAlpha.200")(e)},_active:{bg:Et("gray.200","whiteAlpha.300")(e)}};const r=Gm(`${t}.200`,.12)(n),i=Gm(`${t}.200`,.24)(n);return{color:Et(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Et(`${t}.50`,r)(e)},_active:{bg:Et(`${t}.100`,i)(e)}}},yoe=e=>{const{colorScheme:t}=e,n=Et("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...To(fB,e)}},boe={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Soe=e=>{const{colorScheme:t}=e;if(t==="gray"){const s=Et("gray.100","whiteAlpha.200")(e);return{bg:s,_hover:{bg:Et("gray.200","whiteAlpha.300")(e),_disabled:{bg:s}},_active:{bg:Et("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=boe[t]??{},a=Et(n,`${t}.200`)(e);return{bg:a,color:Et(r,"gray.800")(e),_hover:{bg:Et(i,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:Et(o,`${t}.400`)(e)}}},xoe=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Et(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Et(`${t}.700`,`${t}.500`)(e)}}},woe={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},Coe={ghost:fB,outline:yoe,solid:Soe,link:xoe,unstyled:woe},_oe={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},koe={baseStyle:voe,variants:Coe,sizes:_oe,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Ih,defineMultiStyleConfig:Eoe}=pr(tie.keys),K4=Vn("card-bg"),Sm=Vn("card-padding"),Poe=Ih({container:{[K4.variable]:"chakra-body-bg",backgroundColor:K4.reference,color:"chakra-body-text"},body:{padding:Sm.reference,flex:"1 1 0%"},header:{padding:Sm.reference},footer:{padding:Sm.reference}}),Toe={sm:Ih({container:{borderRadius:"base",[Sm.variable]:"space.3"}}),md:Ih({container:{borderRadius:"md",[Sm.variable]:"space.5"}}),lg:Ih({container:{borderRadius:"xl",[Sm.variable]:"space.7"}})},Loe={elevated:Ih({container:{boxShadow:"base",_dark:{[K4.variable]:"colors.gray.700"}}}),outline:Ih({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:Ih({container:{[K4.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},Aoe=Eoe({baseStyle:Poe,variants:Loe,sizes:Toe,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:c4,defineMultiStyleConfig:Ooe}=pr(Dre.keys),zv=Vn("checkbox-size"),Moe=e=>{const{colorScheme:t}=e;return{w:zv.reference,h:zv.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e),_hover:{bg:Et(`${t}.600`,`${t}.300`)(e),borderColor:Et(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Et("gray.200","transparent")(e),bg:Et("gray.200","whiteAlpha.300")(e),color:Et("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e)},_disabled:{bg:Et("gray.100","whiteAlpha.100")(e),borderColor:Et("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Et("red.500","red.300")(e)}}},Ioe={_disabled:{cursor:"not-allowed"}},Roe={userSelect:"none",_disabled:{opacity:.4}},Doe={transitionProperty:"transform",transitionDuration:"normal"},Noe=c4(e=>({icon:Doe,container:Ioe,control:To(Moe,e),label:Roe})),joe={sm:c4({control:{[zv.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:c4({control:{[zv.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:c4({control:{[zv.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},X4=Ooe({baseStyle:Noe,sizes:joe,defaultProps:{size:"md",colorScheme:"blue"}}),Hv=yi("close-button-size"),W1=yi("close-button-bg"),Boe={w:[Hv.reference],h:[Hv.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[W1.variable]:"colors.blackAlpha.100",_dark:{[W1.variable]:"colors.whiteAlpha.100"}},_active:{[W1.variable]:"colors.blackAlpha.200",_dark:{[W1.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:W1.reference},Foe={lg:{[Hv.variable]:"sizes.10",fontSize:"md"},md:{[Hv.variable]:"sizes.8",fontSize:"xs"},sm:{[Hv.variable]:"sizes.6",fontSize:"2xs"}},$oe={baseStyle:Boe,sizes:Foe,defaultProps:{size:"md"}},{variants:zoe,defaultProps:Hoe}=$v,Voe={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Woe={baseStyle:Voe,variants:zoe,defaultProps:Hoe},Uoe={w:"100%",mx:"auto",maxW:"prose",px:"4"},Goe={baseStyle:Uoe},qoe={opacity:.6,borderColor:"inherit"},Yoe={borderStyle:"solid"},Koe={borderStyle:"dashed"},Xoe={solid:Yoe,dashed:Koe},Zoe={baseStyle:qoe,variants:Xoe,defaultProps:{variant:"solid"}},{definePartsStyle:v7,defineMultiStyleConfig:Qoe}=pr(Nre.keys),n6=Vn("drawer-bg"),r6=Vn("drawer-box-shadow");function kg(e){return v7(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Joe={bg:"blackAlpha.600",zIndex:"overlay"},eae={display:"flex",zIndex:"modal",justifyContent:"center"},tae=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[n6.variable]:"colors.white",[r6.variable]:"shadows.lg",_dark:{[n6.variable]:"colors.gray.700",[r6.variable]:"shadows.dark-lg"},bg:n6.reference,boxShadow:r6.reference}},nae={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},rae={position:"absolute",top:"2",insetEnd:"3"},iae={px:"6",py:"2",flex:"1",overflow:"auto"},oae={px:"6",py:"4"},aae=v7(e=>({overlay:Joe,dialogContainer:eae,dialog:To(tae,e),header:nae,closeButton:rae,body:iae,footer:oae})),sae={xs:kg("xs"),sm:kg("md"),md:kg("lg"),lg:kg("2xl"),xl:kg("4xl"),full:kg("full")},lae=Qoe({baseStyle:aae,sizes:sae,defaultProps:{size:"xs"}}),{definePartsStyle:uae,defineMultiStyleConfig:cae}=pr(jre.keys),dae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},fae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},hae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},pae=uae({preview:dae,input:fae,textarea:hae}),gae=cae({baseStyle:pae}),{definePartsStyle:mae,defineMultiStyleConfig:vae}=pr(Bre.keys),xm=Vn("form-control-color"),yae={marginStart:"1",[xm.variable]:"colors.red.500",_dark:{[xm.variable]:"colors.red.300"},color:xm.reference},bae={mt:"2",[xm.variable]:"colors.gray.600",_dark:{[xm.variable]:"colors.whiteAlpha.600"},color:xm.reference,lineHeight:"normal",fontSize:"sm"},Sae=mae({container:{width:"100%",position:"relative"},requiredIndicator:yae,helperText:bae}),xae=vae({baseStyle:Sae}),{definePartsStyle:wae,defineMultiStyleConfig:Cae}=pr(Fre.keys),wm=Vn("form-error-color"),_ae={[wm.variable]:"colors.red.500",_dark:{[wm.variable]:"colors.red.300"},color:wm.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},kae={marginEnd:"0.5em",[wm.variable]:"colors.red.500",_dark:{[wm.variable]:"colors.red.300"},color:wm.reference},Eae=wae({text:_ae,icon:kae}),Pae=Cae({baseStyle:Eae}),Tae={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Lae={baseStyle:Tae},Aae={fontFamily:"heading",fontWeight:"bold"},Oae={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},Mae={baseStyle:Aae,sizes:Oae,defaultProps:{size:"xl"}},{definePartsStyle:Gu,defineMultiStyleConfig:Iae}=pr($re.keys),Rae=Gu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),ld={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},Dae={lg:Gu({field:ld.lg,addon:ld.lg}),md:Gu({field:ld.md,addon:ld.md}),sm:Gu({field:ld.sm,addon:ld.sm}),xs:Gu({field:ld.xs,addon:ld.xs})};function D_(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Et("blue.500","blue.300")(e),errorBorderColor:n||Et("red.500","red.300")(e)}}var Nae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Et("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r),boxShadow:`0 0 0 1px ${ko(t,r)}`},_focusVisible:{zIndex:1,borderColor:ko(t,n),boxShadow:`0 0 0 1px ${ko(t,n)}`}},addon:{border:"1px solid",borderColor:Et("inherit","whiteAlpha.50")(e),bg:Et("gray.100","whiteAlpha.300")(e)}}}),jae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e),_hover:{bg:Et("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r)},_focusVisible:{bg:"transparent",borderColor:ko(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e)}}}),Bae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r),boxShadow:`0px 1px 0px 0px ${ko(t,r)}`},_focusVisible:{borderColor:ko(t,n),boxShadow:`0px 1px 0px 0px ${ko(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),Fae=Gu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),$ae={outline:Nae,filled:jae,flushed:Bae,unstyled:Fae},kn=Iae({baseStyle:Rae,sizes:Dae,variants:$ae,defaultProps:{size:"md",variant:"outline"}}),i6=Vn("kbd-bg"),zae={[i6.variable]:"colors.gray.100",_dark:{[i6.variable]:"colors.whiteAlpha.100"},bg:i6.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Hae={baseStyle:zae},Vae={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Wae={baseStyle:Vae},{defineMultiStyleConfig:Uae,definePartsStyle:Gae}=pr(zre.keys),qae={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Yae=Gae({icon:qae}),Kae=Uae({baseStyle:Yae}),{defineMultiStyleConfig:Xae,definePartsStyle:Zae}=pr(Hre.keys),Fl=Vn("menu-bg"),o6=Vn("menu-shadow"),Qae={[Fl.variable]:"#fff",[o6.variable]:"shadows.sm",_dark:{[Fl.variable]:"colors.gray.700",[o6.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Fl.reference,boxShadow:o6.reference},Jae={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Fl.variable]:"colors.gray.100",_dark:{[Fl.variable]:"colors.whiteAlpha.100"}},_active:{[Fl.variable]:"colors.gray.200",_dark:{[Fl.variable]:"colors.whiteAlpha.200"}},_expanded:{[Fl.variable]:"colors.gray.100",_dark:{[Fl.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Fl.reference},ese={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},tse={opacity:.6},nse={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},rse={transitionProperty:"common",transitionDuration:"normal"},ise=Zae({button:rse,list:Qae,item:Jae,groupTitle:ese,command:tse,divider:nse}),ose=Xae({baseStyle:ise}),{defineMultiStyleConfig:ase,definePartsStyle:y7}=pr(Vre.keys),sse={bg:"blackAlpha.600",zIndex:"modal"},lse=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},use=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:Et("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:Et("lg","dark-lg")(e)}},cse={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},dse={position:"absolute",top:"2",insetEnd:"3"},fse=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},hse={px:"6",py:"4"},pse=y7(e=>({overlay:sse,dialogContainer:To(lse,e),dialog:To(use,e),header:cse,closeButton:dse,body:To(fse,e),footer:hse}));function Is(e){return y7(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var gse={xs:Is("xs"),sm:Is("sm"),md:Is("md"),lg:Is("lg"),xl:Is("xl"),"2xl":Is("2xl"),"3xl":Is("3xl"),"4xl":Is("4xl"),"5xl":Is("5xl"),"6xl":Is("6xl"),full:Is("full")},mse=ase({baseStyle:pse,sizes:gse,defaultProps:{size:"md"}}),vse={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},hB=vse,{defineMultiStyleConfig:yse,definePartsStyle:pB}=pr(Wre.keys),N_=yi("number-input-stepper-width"),gB=yi("number-input-input-padding"),bse=Uu(N_).add("0.5rem").toString(),a6=yi("number-input-bg"),s6=yi("number-input-color"),l6=yi("number-input-border-color"),Sse={[N_.variable]:"sizes.6",[gB.variable]:bse},xse=e=>{var t;return((t=To(kn.baseStyle,e))==null?void 0:t.field)??{}},wse={width:N_.reference},Cse={borderStart:"1px solid",borderStartColor:l6.reference,color:s6.reference,bg:a6.reference,[s6.variable]:"colors.chakra-body-text",[l6.variable]:"colors.chakra-border-color",_dark:{[s6.variable]:"colors.whiteAlpha.800",[l6.variable]:"colors.whiteAlpha.300"},_active:{[a6.variable]:"colors.gray.200",_dark:{[a6.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},_se=pB(e=>({root:Sse,field:To(xse,e)??{},stepperGroup:wse,stepper:Cse}));function G3(e){var t,n;const r=(t=kn.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},o=((n=r.field)==null?void 0:n.fontSize)??"md",a=hB.fontSizes[o];return pB({field:{...r.field,paddingInlineEnd:gB.reference,verticalAlign:"top"},stepper:{fontSize:Uu(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var kse={xs:G3("xs"),sm:G3("sm"),md:G3("md"),lg:G3("lg")},Ese=yse({baseStyle:_se,sizes:kse,variants:kn.variants,defaultProps:kn.defaultProps}),XL,Pse={...(XL=kn.baseStyle)==null?void 0:XL.field,textAlign:"center"},Tse={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},ZL,Lse={outline:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((ZL=kn.variants)==null?void 0:ZL.unstyled.field)??{}},Ase={baseStyle:Pse,sizes:Tse,variants:Lse,defaultProps:kn.defaultProps},{defineMultiStyleConfig:Ose,definePartsStyle:Mse}=pr(Ure.keys),q3=yi("popper-bg"),Ise=yi("popper-arrow-bg"),QL=yi("popper-arrow-shadow-color"),Rse={zIndex:10},Dse={[q3.variable]:"colors.white",bg:q3.reference,[Ise.variable]:q3.reference,[QL.variable]:"colors.gray.200",_dark:{[q3.variable]:"colors.gray.700",[QL.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},Nse={px:3,py:2,borderBottomWidth:"1px"},jse={px:3,py:2},Bse={px:3,py:2,borderTopWidth:"1px"},Fse={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},$se=Mse({popper:Rse,content:Dse,header:Nse,body:jse,footer:Bse,closeButton:Fse}),zse=Ose({baseStyle:$se}),{defineMultiStyleConfig:Hse,definePartsStyle:Sv}=pr(Gre.keys),Vse=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=Et(WL(),WL("1rem","rgba(0,0,0,0.1)"))(e),a=Et(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( + )`,backgroundSize:`${e} ${e}`}}function Cie(e){const t=rB().toHexString();return!e||Sie(e)?t:e.string&&e.colors?kie(e.string,e.colors):e.string&&!e.colors?_ie(e.string):e.colors&&!e.string?Eie(e.colors):t}function _ie(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function kie(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function I_(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function Pie(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function sB(e){return Pie(e)&&e.reference?e.reference:String(e)}var jS=(e,...t)=>t.map(sB).join(` ${e} `).replace(/calc/g,""),UL=(...e)=>`calc(${jS("+",...e)})`,GL=(...e)=>`calc(${jS("-",...e)})`,m7=(...e)=>`calc(${jS("*",...e)})`,qL=(...e)=>`calc(${jS("/",...e)})`,YL=e=>{const t=sB(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:m7(t,-1)},Uu=Object.assign(e=>({add:(...t)=>Uu(UL(e,...t)),subtract:(...t)=>Uu(GL(e,...t)),multiply:(...t)=>Uu(m7(e,...t)),divide:(...t)=>Uu(qL(e,...t)),negate:()=>Uu(YL(e)),toString:()=>e.toString()}),{add:UL,subtract:GL,multiply:m7,divide:qL,negate:YL});function Tie(e){return!Number.isInteger(parseFloat(e.toString()))}function Lie(e,t="-"){return e.replace(/\s+/g,t)}function lB(e){const t=Lie(e.toString());return t.includes("\\.")?e:Tie(e)?t.replace(".","\\."):e}function Aie(e,t=""){return[t,lB(e)].filter(Boolean).join("-")}function Oie(e,t){return`var(${lB(e)}${t?`, ${t}`:""})`}function Mie(e,t=""){return`--${Aie(e,t)}`}function bi(e,t){const n=Mie(e,t==null?void 0:t.prefix);return{variable:n,reference:Oie(n,Iie(t==null?void 0:t.fallback))}}function Iie(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{definePartsStyle:Rie,defineMultiStyleConfig:Die}=pr(Ore.keys),Nie={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},jie={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Bie={pt:"2",px:"4",pb:"5"},$ie={fontSize:"1.25em"},Fie=Rie({container:Nie,button:jie,panel:Bie,icon:$ie}),zie=Die({baseStyle:Fie}),{definePartsStyle:Sy,defineMultiStyleConfig:Hie}=pr(Mre.keys),La=Vn("alert-fg"),ec=Vn("alert-bg"),Vie=Sy({container:{bg:ec.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:La.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:La.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function R_(e){const{theme:t,colorScheme:n}=e,r=qm(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Wie=Sy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark}}}}),Uie=Sy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:La.reference}}}),Gie=Sy(e=>{const{colorScheme:t}=e,n=R_(e);return{container:{[La.variable]:`colors.${t}.500`,[ec.variable]:n.light,_dark:{[La.variable]:`colors.${t}.200`,[ec.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:La.reference}}}),qie=Sy(e=>{const{colorScheme:t}=e;return{container:{[La.variable]:"colors.white",[ec.variable]:`colors.${t}.500`,_dark:{[La.variable]:"colors.gray.900",[ec.variable]:`colors.${t}.200`},color:La.reference}}}),Yie={subtle:Wie,"left-accent":Uie,"top-accent":Gie,solid:qie},Kie=Hie({baseStyle:Vie,variants:Yie,defaultProps:{variant:"subtle",colorScheme:"blue"}}),uB={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Xie={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},Zie={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},Qie={...uB,...Xie,container:Zie},cB=Qie,Jie=e=>typeof e=="function";function To(e,...t){return Jie(e)?e(...t):e}var{definePartsStyle:dB,defineMultiStyleConfig:eoe}=pr(Ire.keys),bm=Vn("avatar-border-color"),t6=Vn("avatar-bg"),toe={borderRadius:"full",border:"0.2em solid",[bm.variable]:"white",_dark:{[bm.variable]:"colors.gray.800"},borderColor:bm.reference},noe={[t6.variable]:"colors.gray.200",_dark:{[t6.variable]:"colors.whiteAlpha.400"},bgColor:t6.reference},KL=Vn("avatar-background"),roe=e=>{const{name:t,theme:n}=e,r=t?Cie({string:t}):"colors.gray.400",i=wie(r)(n);let o="white";return i||(o="gray.800"),{bg:KL.reference,"&:not([data-loaded])":{[KL.variable]:r},color:o,[bm.variable]:"colors.white",_dark:{[bm.variable]:"colors.gray.800"},borderColor:bm.reference,verticalAlign:"top"}},ioe=dB(e=>({badge:To(toe,e),excessLabel:To(noe,e),container:To(roe,e)}));function sd(e){const t=e!=="100%"?cB[e]:void 0;return dB({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var ooe={"2xs":sd(4),xs:sd(6),sm:sd(8),md:sd(12),lg:sd(16),xl:sd(24),"2xl":sd(32),full:sd("100%")},aoe=eoe({baseStyle:ioe,sizes:ooe,defaultProps:{size:"md"}}),soe={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},Sm=Vn("badge-bg"),ql=Vn("badge-color"),loe=e=>{const{colorScheme:t,theme:n}=e,r=qm(`${t}.500`,.6)(n);return{[Sm.variable]:`colors.${t}.500`,[ql.variable]:"colors.white",_dark:{[Sm.variable]:r,[ql.variable]:"colors.whiteAlpha.800"},bg:Sm.reference,color:ql.reference}},uoe=e=>{const{colorScheme:t,theme:n}=e,r=qm(`${t}.200`,.16)(n);return{[Sm.variable]:`colors.${t}.100`,[ql.variable]:`colors.${t}.800`,_dark:{[Sm.variable]:r,[ql.variable]:`colors.${t}.200`},bg:Sm.reference,color:ql.reference}},coe=e=>{const{colorScheme:t,theme:n}=e,r=qm(`${t}.200`,.8)(n);return{[ql.variable]:`colors.${t}.500`,_dark:{[ql.variable]:r},color:ql.reference,boxShadow:`inset 0 0 0px 1px ${ql.reference}`}},doe={solid:loe,subtle:uoe,outline:coe},Hv={baseStyle:soe,variants:doe,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:foe,definePartsStyle:hoe}=pr(Rre.keys),poe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},goe=hoe({link:poe}),moe=foe({baseStyle:goe}),voe={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},fB=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Et("inherit","whiteAlpha.900")(e),_hover:{bg:Et("gray.100","whiteAlpha.200")(e)},_active:{bg:Et("gray.200","whiteAlpha.300")(e)}};const r=qm(`${t}.200`,.12)(n),i=qm(`${t}.200`,.24)(n);return{color:Et(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Et(`${t}.50`,r)(e)},_active:{bg:Et(`${t}.100`,i)(e)}}},yoe=e=>{const{colorScheme:t}=e,n=Et("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...To(fB,e)}},boe={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Soe=e=>{const{colorScheme:t}=e;if(t==="gray"){const s=Et("gray.100","whiteAlpha.200")(e);return{bg:s,_hover:{bg:Et("gray.200","whiteAlpha.300")(e),_disabled:{bg:s}},_active:{bg:Et("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=boe[t]??{},a=Et(n,`${t}.200`)(e);return{bg:a,color:Et(r,"gray.800")(e),_hover:{bg:Et(i,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:Et(o,`${t}.400`)(e)}}},xoe=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Et(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Et(`${t}.700`,`${t}.500`)(e)}}},woe={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},Coe={ghost:fB,outline:yoe,solid:Soe,link:xoe,unstyled:woe},_oe={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},koe={baseStyle:voe,variants:Coe,sizes:_oe,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Rh,defineMultiStyleConfig:Eoe}=pr(tie.keys),K4=Vn("card-bg"),xm=Vn("card-padding"),Poe=Rh({container:{[K4.variable]:"chakra-body-bg",backgroundColor:K4.reference,color:"chakra-body-text"},body:{padding:xm.reference,flex:"1 1 0%"},header:{padding:xm.reference},footer:{padding:xm.reference}}),Toe={sm:Rh({container:{borderRadius:"base",[xm.variable]:"space.3"}}),md:Rh({container:{borderRadius:"md",[xm.variable]:"space.5"}}),lg:Rh({container:{borderRadius:"xl",[xm.variable]:"space.7"}})},Loe={elevated:Rh({container:{boxShadow:"base",_dark:{[K4.variable]:"colors.gray.700"}}}),outline:Rh({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:Rh({container:{[K4.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},Aoe=Eoe({baseStyle:Poe,variants:Loe,sizes:Toe,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:d4,defineMultiStyleConfig:Ooe}=pr(Dre.keys),Vv=Vn("checkbox-size"),Moe=e=>{const{colorScheme:t}=e;return{w:Vv.reference,h:Vv.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e),_hover:{bg:Et(`${t}.600`,`${t}.300`)(e),borderColor:Et(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Et("gray.200","transparent")(e),bg:Et("gray.200","whiteAlpha.300")(e),color:Et("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e)},_disabled:{bg:Et("gray.100","whiteAlpha.100")(e),borderColor:Et("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Et("red.500","red.300")(e)}}},Ioe={_disabled:{cursor:"not-allowed"}},Roe={userSelect:"none",_disabled:{opacity:.4}},Doe={transitionProperty:"transform",transitionDuration:"normal"},Noe=d4(e=>({icon:Doe,container:Ioe,control:To(Moe,e),label:Roe})),joe={sm:d4({control:{[Vv.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:d4({control:{[Vv.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:d4({control:{[Vv.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},X4=Ooe({baseStyle:Noe,sizes:joe,defaultProps:{size:"md",colorScheme:"blue"}}),Wv=bi("close-button-size"),U1=bi("close-button-bg"),Boe={w:[Wv.reference],h:[Wv.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[U1.variable]:"colors.blackAlpha.100",_dark:{[U1.variable]:"colors.whiteAlpha.100"}},_active:{[U1.variable]:"colors.blackAlpha.200",_dark:{[U1.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:U1.reference},$oe={lg:{[Wv.variable]:"sizes.10",fontSize:"md"},md:{[Wv.variable]:"sizes.8",fontSize:"xs"},sm:{[Wv.variable]:"sizes.6",fontSize:"2xs"}},Foe={baseStyle:Boe,sizes:$oe,defaultProps:{size:"md"}},{variants:zoe,defaultProps:Hoe}=Hv,Voe={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Woe={baseStyle:Voe,variants:zoe,defaultProps:Hoe},Uoe={w:"100%",mx:"auto",maxW:"prose",px:"4"},Goe={baseStyle:Uoe},qoe={opacity:.6,borderColor:"inherit"},Yoe={borderStyle:"solid"},Koe={borderStyle:"dashed"},Xoe={solid:Yoe,dashed:Koe},Zoe={baseStyle:qoe,variants:Xoe,defaultProps:{variant:"solid"}},{definePartsStyle:v7,defineMultiStyleConfig:Qoe}=pr(Nre.keys),n6=Vn("drawer-bg"),r6=Vn("drawer-box-shadow");function Eg(e){return v7(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Joe={bg:"blackAlpha.600",zIndex:"overlay"},eae={display:"flex",zIndex:"modal",justifyContent:"center"},tae=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[n6.variable]:"colors.white",[r6.variable]:"shadows.lg",_dark:{[n6.variable]:"colors.gray.700",[r6.variable]:"shadows.dark-lg"},bg:n6.reference,boxShadow:r6.reference}},nae={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},rae={position:"absolute",top:"2",insetEnd:"3"},iae={px:"6",py:"2",flex:"1",overflow:"auto"},oae={px:"6",py:"4"},aae=v7(e=>({overlay:Joe,dialogContainer:eae,dialog:To(tae,e),header:nae,closeButton:rae,body:iae,footer:oae})),sae={xs:Eg("xs"),sm:Eg("md"),md:Eg("lg"),lg:Eg("2xl"),xl:Eg("4xl"),full:Eg("full")},lae=Qoe({baseStyle:aae,sizes:sae,defaultProps:{size:"xs"}}),{definePartsStyle:uae,defineMultiStyleConfig:cae}=pr(jre.keys),dae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},fae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},hae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},pae=uae({preview:dae,input:fae,textarea:hae}),gae=cae({baseStyle:pae}),{definePartsStyle:mae,defineMultiStyleConfig:vae}=pr(Bre.keys),wm=Vn("form-control-color"),yae={marginStart:"1",[wm.variable]:"colors.red.500",_dark:{[wm.variable]:"colors.red.300"},color:wm.reference},bae={mt:"2",[wm.variable]:"colors.gray.600",_dark:{[wm.variable]:"colors.whiteAlpha.600"},color:wm.reference,lineHeight:"normal",fontSize:"sm"},Sae=mae({container:{width:"100%",position:"relative"},requiredIndicator:yae,helperText:bae}),xae=vae({baseStyle:Sae}),{definePartsStyle:wae,defineMultiStyleConfig:Cae}=pr($re.keys),Cm=Vn("form-error-color"),_ae={[Cm.variable]:"colors.red.500",_dark:{[Cm.variable]:"colors.red.300"},color:Cm.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},kae={marginEnd:"0.5em",[Cm.variable]:"colors.red.500",_dark:{[Cm.variable]:"colors.red.300"},color:Cm.reference},Eae=wae({text:_ae,icon:kae}),Pae=Cae({baseStyle:Eae}),Tae={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Lae={baseStyle:Tae},Aae={fontFamily:"heading",fontWeight:"bold"},Oae={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},Mae={baseStyle:Aae,sizes:Oae,defaultProps:{size:"xl"}},{definePartsStyle:Gu,defineMultiStyleConfig:Iae}=pr(Fre.keys),Rae=Gu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),ld={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},Dae={lg:Gu({field:ld.lg,addon:ld.lg}),md:Gu({field:ld.md,addon:ld.md}),sm:Gu({field:ld.sm,addon:ld.sm}),xs:Gu({field:ld.xs,addon:ld.xs})};function D_(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Et("blue.500","blue.300")(e),errorBorderColor:n||Et("red.500","red.300")(e)}}var Nae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Et("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r),boxShadow:`0 0 0 1px ${ko(t,r)}`},_focusVisible:{zIndex:1,borderColor:ko(t,n),boxShadow:`0 0 0 1px ${ko(t,n)}`}},addon:{border:"1px solid",borderColor:Et("inherit","whiteAlpha.50")(e),bg:Et("gray.100","whiteAlpha.300")(e)}}}),jae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e),_hover:{bg:Et("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r)},_focusVisible:{bg:"transparent",borderColor:ko(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e)}}}),Bae=Gu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=D_(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ko(t,r),boxShadow:`0px 1px 0px 0px ${ko(t,r)}`},_focusVisible:{borderColor:ko(t,n),boxShadow:`0px 1px 0px 0px ${ko(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),$ae=Gu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),Fae={outline:Nae,filled:jae,flushed:Bae,unstyled:$ae},kn=Iae({baseStyle:Rae,sizes:Dae,variants:Fae,defaultProps:{size:"md",variant:"outline"}}),i6=Vn("kbd-bg"),zae={[i6.variable]:"colors.gray.100",_dark:{[i6.variable]:"colors.whiteAlpha.100"},bg:i6.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Hae={baseStyle:zae},Vae={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Wae={baseStyle:Vae},{defineMultiStyleConfig:Uae,definePartsStyle:Gae}=pr(zre.keys),qae={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Yae=Gae({icon:qae}),Kae=Uae({baseStyle:Yae}),{defineMultiStyleConfig:Xae,definePartsStyle:Zae}=pr(Hre.keys),$l=Vn("menu-bg"),o6=Vn("menu-shadow"),Qae={[$l.variable]:"#fff",[o6.variable]:"shadows.sm",_dark:{[$l.variable]:"colors.gray.700",[o6.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:$l.reference,boxShadow:o6.reference},Jae={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[$l.variable]:"colors.gray.100",_dark:{[$l.variable]:"colors.whiteAlpha.100"}},_active:{[$l.variable]:"colors.gray.200",_dark:{[$l.variable]:"colors.whiteAlpha.200"}},_expanded:{[$l.variable]:"colors.gray.100",_dark:{[$l.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:$l.reference},ese={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},tse={opacity:.6},nse={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},rse={transitionProperty:"common",transitionDuration:"normal"},ise=Zae({button:rse,list:Qae,item:Jae,groupTitle:ese,command:tse,divider:nse}),ose=Xae({baseStyle:ise}),{defineMultiStyleConfig:ase,definePartsStyle:y7}=pr(Vre.keys),sse={bg:"blackAlpha.600",zIndex:"modal"},lse=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},use=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:Et("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:Et("lg","dark-lg")(e)}},cse={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},dse={position:"absolute",top:"2",insetEnd:"3"},fse=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},hse={px:"6",py:"4"},pse=y7(e=>({overlay:sse,dialogContainer:To(lse,e),dialog:To(use,e),header:cse,closeButton:dse,body:To(fse,e),footer:hse}));function Is(e){return y7(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var gse={xs:Is("xs"),sm:Is("sm"),md:Is("md"),lg:Is("lg"),xl:Is("xl"),"2xl":Is("2xl"),"3xl":Is("3xl"),"4xl":Is("4xl"),"5xl":Is("5xl"),"6xl":Is("6xl"),full:Is("full")},mse=ase({baseStyle:pse,sizes:gse,defaultProps:{size:"md"}}),vse={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},hB=vse,{defineMultiStyleConfig:yse,definePartsStyle:pB}=pr(Wre.keys),N_=bi("number-input-stepper-width"),gB=bi("number-input-input-padding"),bse=Uu(N_).add("0.5rem").toString(),a6=bi("number-input-bg"),s6=bi("number-input-color"),l6=bi("number-input-border-color"),Sse={[N_.variable]:"sizes.6",[gB.variable]:bse},xse=e=>{var t;return((t=To(kn.baseStyle,e))==null?void 0:t.field)??{}},wse={width:N_.reference},Cse={borderStart:"1px solid",borderStartColor:l6.reference,color:s6.reference,bg:a6.reference,[s6.variable]:"colors.chakra-body-text",[l6.variable]:"colors.chakra-border-color",_dark:{[s6.variable]:"colors.whiteAlpha.800",[l6.variable]:"colors.whiteAlpha.300"},_active:{[a6.variable]:"colors.gray.200",_dark:{[a6.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},_se=pB(e=>({root:Sse,field:To(xse,e)??{},stepperGroup:wse,stepper:Cse}));function Y3(e){var t,n;const r=(t=kn.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},o=((n=r.field)==null?void 0:n.fontSize)??"md",a=hB.fontSizes[o];return pB({field:{...r.field,paddingInlineEnd:gB.reference,verticalAlign:"top"},stepper:{fontSize:Uu(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var kse={xs:Y3("xs"),sm:Y3("sm"),md:Y3("md"),lg:Y3("lg")},Ese=yse({baseStyle:_se,sizes:kse,variants:kn.variants,defaultProps:kn.defaultProps}),XL,Pse={...(XL=kn.baseStyle)==null?void 0:XL.field,textAlign:"center"},Tse={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},ZL,Lse={outline:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=To((t=kn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((ZL=kn.variants)==null?void 0:ZL.unstyled.field)??{}},Ase={baseStyle:Pse,sizes:Tse,variants:Lse,defaultProps:kn.defaultProps},{defineMultiStyleConfig:Ose,definePartsStyle:Mse}=pr(Ure.keys),K3=bi("popper-bg"),Ise=bi("popper-arrow-bg"),QL=bi("popper-arrow-shadow-color"),Rse={zIndex:10},Dse={[K3.variable]:"colors.white",bg:K3.reference,[Ise.variable]:K3.reference,[QL.variable]:"colors.gray.200",_dark:{[K3.variable]:"colors.gray.700",[QL.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},Nse={px:3,py:2,borderBottomWidth:"1px"},jse={px:3,py:2},Bse={px:3,py:2,borderTopWidth:"1px"},$se={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},Fse=Mse({popper:Rse,content:Dse,header:Nse,body:jse,footer:Bse,closeButton:$se}),zse=Ose({baseStyle:Fse}),{defineMultiStyleConfig:Hse,definePartsStyle:wv}=pr(Gre.keys),Vse=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=Et(WL(),WL("1rem","rgba(0,0,0,0.1)"))(e),a=Et(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( to right, transparent 0%, ${ko(n,a)} 50%, transparent 100% - )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},Wse={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Use=e=>({bg:Et("gray.100","whiteAlpha.300")(e)}),Gse=e=>({transitionProperty:"common",transitionDuration:"slow",...Vse(e)}),qse=Sv(e=>({label:Wse,filledTrack:Gse(e),track:Use(e)})),Yse={xs:Sv({track:{h:"1"}}),sm:Sv({track:{h:"2"}}),md:Sv({track:{h:"3"}}),lg:Sv({track:{h:"4"}})},Kse=Hse({sizes:Yse,baseStyle:qse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Xse,definePartsStyle:d4}=pr(qre.keys),Zse=e=>{var t;const n=(t=To(X4.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Qse=d4(e=>{var t,n,r,i;return{label:(n=(t=X4).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=X4).baseStyle)==null?void 0:i.call(r,e).container,control:Zse(e)}}),Jse={md:d4({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:d4({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:d4({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},ele=Xse({baseStyle:Qse,sizes:Jse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:tle,definePartsStyle:nle}=pr(Yre.keys),Y3=Vn("select-bg"),JL,rle={...(JL=kn.baseStyle)==null?void 0:JL.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Y3.reference,[Y3.variable]:"colors.white",_dark:{[Y3.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Y3.reference}},ile={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},ole=nle({field:rle,icon:ile}),K3={paddingInlineEnd:"8"},eA,tA,nA,rA,iA,oA,aA,sA,ale={lg:{...(eA=kn.sizes)==null?void 0:eA.lg,field:{...(tA=kn.sizes)==null?void 0:tA.lg.field,...K3}},md:{...(nA=kn.sizes)==null?void 0:nA.md,field:{...(rA=kn.sizes)==null?void 0:rA.md.field,...K3}},sm:{...(iA=kn.sizes)==null?void 0:iA.sm,field:{...(oA=kn.sizes)==null?void 0:oA.sm.field,...K3}},xs:{...(aA=kn.sizes)==null?void 0:aA.xs,field:{...(sA=kn.sizes)==null?void 0:sA.xs.field,...K3},icon:{insetEnd:"1"}}},sle=tle({baseStyle:ole,sizes:ale,variants:kn.variants,defaultProps:kn.defaultProps}),u6=Vn("skeleton-start-color"),c6=Vn("skeleton-end-color"),lle={[u6.variable]:"colors.gray.100",[c6.variable]:"colors.gray.400",_dark:{[u6.variable]:"colors.gray.800",[c6.variable]:"colors.gray.600"},background:u6.reference,borderColor:c6.reference,opacity:.7,borderRadius:"sm"},ule={baseStyle:lle},d6=Vn("skip-link-bg"),cle={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[d6.variable]:"colors.white",_dark:{[d6.variable]:"colors.gray.700"},bg:d6.reference}},dle={baseStyle:cle},{defineMultiStyleConfig:fle,definePartsStyle:BS}=pr(Kre.keys),_2=Vn("slider-thumb-size"),k2=Vn("slider-track-size"),bd=Vn("slider-bg"),hle=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...I_({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},ple=e=>({...I_({orientation:e.orientation,horizontal:{h:k2.reference},vertical:{w:k2.reference}}),overflow:"hidden",borderRadius:"sm",[bd.variable]:"colors.gray.200",_dark:{[bd.variable]:"colors.whiteAlpha.200"},_disabled:{[bd.variable]:"colors.gray.300",_dark:{[bd.variable]:"colors.whiteAlpha.300"}},bg:bd.reference}),gle=e=>{const{orientation:t}=e;return{...I_({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:_2.reference,h:_2.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},mle=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[bd.variable]:`colors.${t}.500`,_dark:{[bd.variable]:`colors.${t}.200`},bg:bd.reference}},vle=BS(e=>({container:hle(e),track:ple(e),thumb:gle(e),filledTrack:mle(e)})),yle=BS({container:{[_2.variable]:"sizes.4",[k2.variable]:"sizes.1"}}),ble=BS({container:{[_2.variable]:"sizes.3.5",[k2.variable]:"sizes.1"}}),Sle=BS({container:{[_2.variable]:"sizes.2.5",[k2.variable]:"sizes.0.5"}}),xle={lg:yle,md:ble,sm:Sle},wle=fle({baseStyle:vle,sizes:xle,defaultProps:{size:"md",colorScheme:"blue"}}),wh=yi("spinner-size"),Cle={width:[wh.reference],height:[wh.reference]},_le={xs:{[wh.variable]:"sizes.3"},sm:{[wh.variable]:"sizes.4"},md:{[wh.variable]:"sizes.6"},lg:{[wh.variable]:"sizes.8"},xl:{[wh.variable]:"sizes.12"}},kle={baseStyle:Cle,sizes:_le,defaultProps:{size:"md"}},{defineMultiStyleConfig:Ele,definePartsStyle:mB}=pr(Xre.keys),Ple={fontWeight:"medium"},Tle={opacity:.8,marginBottom:"2"},Lle={verticalAlign:"baseline",fontWeight:"semibold"},Ale={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},Ole=mB({container:{},label:Ple,helpText:Tle,number:Lle,icon:Ale}),Mle={md:mB({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},Ile=Ele({baseStyle:Ole,sizes:Mle,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Rle,definePartsStyle:f4}=pr(Zre.keys),Vv=yi("switch-track-width"),Rh=yi("switch-track-height"),f6=yi("switch-track-diff"),Dle=Uu.subtract(Vv,Rh),b7=yi("switch-thumb-x"),U1=yi("switch-bg"),Nle=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Vv.reference],height:[Rh.reference],transitionProperty:"common",transitionDuration:"fast",[U1.variable]:"colors.gray.300",_dark:{[U1.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[U1.variable]:`colors.${t}.500`,_dark:{[U1.variable]:`colors.${t}.200`}},bg:U1.reference}},jle={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Rh.reference],height:[Rh.reference],_checked:{transform:`translateX(${b7.reference})`}},Ble=f4(e=>({container:{[f6.variable]:Dle,[b7.variable]:f6.reference,_rtl:{[b7.variable]:Uu(f6).negate().toString()}},track:Nle(e),thumb:jle})),Fle={sm:f4({container:{[Vv.variable]:"1.375rem",[Rh.variable]:"sizes.3"}}),md:f4({container:{[Vv.variable]:"1.875rem",[Rh.variable]:"sizes.4"}}),lg:f4({container:{[Vv.variable]:"2.875rem",[Rh.variable]:"sizes.6"}})},$le=Rle({baseStyle:Ble,sizes:Fle,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:zle,definePartsStyle:Cm}=pr(Qre.keys),Hle=Cm({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Z4={"&[data-is-numeric=true]":{textAlign:"end"}},Vle=Cm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},caption:{color:Et("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Wle=Cm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},caption:{color:Et("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e)},td:{background:Et(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Ule={simple:Vle,striped:Wle,unstyled:{}},Gle={sm:Cm({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:Cm({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:Cm({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},qle=zle({baseStyle:Hle,variants:Ule,sizes:Gle,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Xo=Vn("tabs-color"),Vs=Vn("tabs-bg"),X3=Vn("tabs-border-color"),{defineMultiStyleConfig:Yle,definePartsStyle:Zl}=pr(Jre.keys),Kle=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},Xle=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Zle=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},Qle={p:4},Jle=Zl(e=>({root:Kle(e),tab:Xle(e),tablist:Zle(e),tabpanel:Qle})),eue={sm:Zl({tab:{py:1,px:4,fontSize:"sm"}}),md:Zl({tab:{fontSize:"md",py:2,px:4}}),lg:Zl({tab:{fontSize:"lg",py:3,px:4}})},tue=Zl(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Xo.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Vs.variable]:"colors.gray.200",_dark:{[Vs.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Xo.reference,bg:Vs.reference}}}),nue=Zl(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[X3.reference]:"transparent",_selected:{[Xo.variable]:`colors.${t}.600`,[X3.variable]:"colors.white",_dark:{[Xo.variable]:`colors.${t}.300`,[X3.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:X3.reference},color:Xo.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),rue=Zl(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Vs.variable]:"colors.gray.50",_dark:{[Vs.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Vs.variable]:"colors.white",[Xo.variable]:`colors.${t}.600`,_dark:{[Vs.variable]:"colors.gray.800",[Xo.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Xo.reference,bg:Vs.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),iue=Zl(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ko(n,`${t}.700`),bg:ko(n,`${t}.100`)}}}}),oue=Zl(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Xo.variable]:"colors.gray.600",_dark:{[Xo.variable]:"inherit"},_selected:{[Xo.variable]:"colors.white",[Vs.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:"colors.gray.800",[Vs.variable]:`colors.${t}.300`}},color:Xo.reference,bg:Vs.reference}}}),aue=Zl({}),sue={line:tue,enclosed:nue,"enclosed-colored":rue,"soft-rounded":iue,"solid-rounded":oue,unstyled:aue},lue=Yle({baseStyle:Jle,sizes:eue,variants:sue,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:uue,definePartsStyle:Dh}=pr(eie.keys),cue={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},due={lineHeight:1.2,overflow:"visible"},fue={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},hue=Dh({container:cue,label:due,closeButton:fue}),pue={sm:Dh({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Dh({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Dh({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},gue={subtle:Dh(e=>{var t;return{container:(t=$v.variants)==null?void 0:t.subtle(e)}}),solid:Dh(e=>{var t;return{container:(t=$v.variants)==null?void 0:t.solid(e)}}),outline:Dh(e=>{var t;return{container:(t=$v.variants)==null?void 0:t.outline(e)}})},mue=uue({variants:gue,baseStyle:hue,sizes:pue,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),lA,vue={...(lA=kn.baseStyle)==null?void 0:lA.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},uA,yue={outline:e=>{var t;return((t=kn.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=kn.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=kn.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((uA=kn.variants)==null?void 0:uA.unstyled.field)??{}},cA,dA,fA,hA,bue={xs:((cA=kn.sizes)==null?void 0:cA.xs.field)??{},sm:((dA=kn.sizes)==null?void 0:dA.sm.field)??{},md:((fA=kn.sizes)==null?void 0:fA.md.field)??{},lg:((hA=kn.sizes)==null?void 0:hA.lg.field)??{}},Sue={baseStyle:vue,sizes:bue,variants:yue,defaultProps:{size:"md",variant:"outline"}},Z3=yi("tooltip-bg"),h6=yi("tooltip-fg"),xue=yi("popper-arrow-bg"),wue={bg:Z3.reference,color:h6.reference,[Z3.variable]:"colors.gray.700",[h6.variable]:"colors.whiteAlpha.900",_dark:{[Z3.variable]:"colors.gray.300",[h6.variable]:"colors.gray.900"},[xue.variable]:Z3.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},Cue={baseStyle:wue},_ue={Accordion:zie,Alert:Kie,Avatar:aoe,Badge:$v,Breadcrumb:moe,Button:koe,Checkbox:X4,CloseButton:$oe,Code:Woe,Container:Goe,Divider:Zoe,Drawer:lae,Editable:gae,Form:xae,FormError:Pae,FormLabel:Lae,Heading:Mae,Input:kn,Kbd:Hae,Link:Wae,List:Kae,Menu:ose,Modal:mse,NumberInput:Ese,PinInput:Ase,Popover:zse,Progress:Kse,Radio:ele,Select:sle,Skeleton:ule,SkipLink:dle,Slider:wle,Spinner:kle,Stat:Ile,Switch:$le,Table:qle,Tabs:lue,Tag:mue,Textarea:Sue,Tooltip:Cue,Card:Aoe},kue={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Eue=kue,Pue={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Tue=Pue,Lue={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},Aue=Lue,Oue={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Mue=Oue,Iue={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},Rue=Iue,Due={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Nue={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},jue={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Bue={property:Due,easing:Nue,duration:jue},Fue=Bue,$ue={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},zue=$ue,Hue={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Vue=Hue,Wue={breakpoints:Tue,zIndices:zue,radii:Mue,blur:Vue,colors:Aue,...hB,sizes:cB,shadows:Rue,space:uB,borders:Eue,transition:Fue},Uue={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},Gue={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},que="ltr",Yue={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},Kue={semanticTokens:Uue,direction:que,...Wue,components:_ue,styles:Gue,config:Yue},Xue=typeof Element<"u",Zue=typeof Map=="function",Que=typeof Set=="function",Jue=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function h4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!h4(e[r],t[r]))return!1;return!0}var o;if(Zue&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!h4(r.value[1],t.get(r.value[0])))return!1;return!0}if(Que&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Jue&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(Xue&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!h4(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var ece=function(t,n){try{return h4(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function v0(){const e=w.useContext(w2);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function vB(){const e=gy(),t=v0();return{...e,theme:t}}function tce(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__breakpoints)==null?void 0:o.asArray)==null?void 0:a[i]};return r(t)??r(n)??n}function nce(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__cssMap)==null?void 0:o[i])==null?void 0:a.value};return r(t)??r(n)??n}function rce(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{if(e==="breakpoints")return tce(o,l,a[u]??l);const d=`${e}.${l}`;return nce(o,d,a[u]??l)});return Array.isArray(t)?s:s[0]}}function ice(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=w.useMemo(()=>Qte(n),[n]);return N.createElement(sre,{theme:i},N.createElement(oce,{root:t}),r)}function oce({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return N.createElement(DS,{styles:n=>({[t]:n.__cssVars})})}Cre({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function ace(){const{colorMode:e}=gy();return N.createElement(DS,{styles:t=>{const n=Qj(t,"styles.global"),r=tB(n,{theme:t,colorMode:e});return r?Aj(r)(t):void 0}})}var sce=new Set([...ene,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),lce=new Set(["htmlWidth","htmlHeight","htmlSize"]);function uce(e){return lce.has(e)||!sce.has(e)}var cce=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=Jj(a,(h,m)=>nne(m)),l=tB(e,t),u=Object.assign({},i,l,eB(s),o),d=Aj(u)(t.theme);return r?[d,r]:d};function p6(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=uce);const i=cce({baseStyle:n}),o=p7(e,r)(i);return N.forwardRef(function(l,u){const{colorMode:d,forced:h}=gy();return N.createElement(o,{ref:u,"data-theme":h?d:void 0,...l})})}function Ae(e){return w.forwardRef(e)}function yB(e,t={}){const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=vB(),a=e?Qj(i,`components.${e}`):void 0,s=n||a,l=Gl({theme:i,colorMode:o},(s==null?void 0:s.defaultProps)??{},eB(vre(r,["children"]))),u=w.useRef({});if(s){const h=fne(s)(l);ece(u.current,h)||(u.current=h)}return u.current}function Oo(e,t={}){return yB(e,t)}function Oi(e,t={}){return yB(e,t)}function dce(){const e=new Map;return new Proxy(p6,{apply(t,n,r){return p6(...r)},get(t,n){return e.has(n)||e.set(n,p6(n)),e.get(n)}})}var Ce=dce();function fce(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Pn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o}=e,a=w.createContext(void 0);a.displayName=t;function s(){var l;const u=w.useContext(a);if(!u&&n){const d=new Error(o??fce(r,i));throw d.name="ContextError",(l=Error.captureStackTrace)==null||l.call(Error,d,s),d}return u}return[a.Provider,s,a]}function hce(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Hn(...e){return t=>{e.forEach(n=>{hce(n,t)})}}function pce(...e){return w.useMemo(()=>Hn(...e),e)}function pA(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var gce=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function gA(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function mA(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var S7=typeof window<"u"?w.useLayoutEffect:w.useEffect,Q4=e=>e,mce=class{constructor(){sn(this,"descendants",new Map);sn(this,"register",e=>{if(e!=null)return gce(e)?this.registerNode(e):t=>{this.registerNode(t,e)}});sn(this,"unregister",e=>{this.descendants.delete(e);const t=pA(Array.from(this.descendants.keys()));this.assignIndex(t)});sn(this,"destroy",()=>{this.descendants.clear()});sn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})});sn(this,"count",()=>this.descendants.size);sn(this,"enabledCount",()=>this.enabledValues().length);sn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index));sn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled));sn(this,"item",e=>{if(this.count()!==0)return this.values()[e]});sn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]});sn(this,"first",()=>this.item(0));sn(this,"firstEnabled",()=>this.enabledItem(0));sn(this,"last",()=>this.item(this.descendants.size-1));sn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)});sn(this,"indexOf",e=>{var t;return e?((t=this.descendants.get(e))==null?void 0:t.index)??-1:-1});sn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e)));sn(this,"next",(e,t=!0)=>{const n=gA(e,this.count(),t);return this.item(n)});sn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=gA(r,this.enabledCount(),t);return this.enabledItem(i)});sn(this,"prev",(e,t=!0)=>{const n=mA(e,this.count()-1,t);return this.item(n)});sn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=mA(r,this.enabledCount()-1,t);return this.enabledItem(i)});sn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=pA(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function vce(){const e=w.useRef(new mce);return S7(()=>()=>e.current.destroy()),e.current}var[yce,bB]=Pn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function bce(e){const t=bB(),[n,r]=w.useState(-1),i=w.useRef(null);S7(()=>()=>{i.current&&t.unregister(i.current)},[]),S7(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=Q4(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:Hn(o,i)}}function SB(){return[Q4(yce),()=>Q4(bB()),()=>vce(),i=>bce(i)]}var Qr=(...e)=>e.filter(Boolean).join(" "),vA={path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})),viewBox:"0 0 24 24"},Na=Ae((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,d=Qr("chakra-icon",s),h={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},m={ref:t,focusable:o,className:d,__css:h},y=r??vA.viewBox;if(n&&typeof n!="string")return N.createElement(Ce.svg,{as:n,...m,...u});const b=a??vA.path;return N.createElement(Ce.svg,{verticalAlign:"middle",viewBox:y,...m,...u},b)});Na.displayName="Icon";function yt(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=w.Children.toArray(e.path),a=Ae((s,l)=>N.createElement(Na,{ref:l,viewBox:t,...i,...s},o.length?o:N.createElement("path",{fill:"currentColor",d:n})));return a.displayName=r,a}function Er(e,t=[]){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function FS(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,y)=>m!==y}=e,o=Er(r),a=Er(i),[s,l]=w.useState(n),u=t!==void 0,d=u?t:s,h=Er(m=>{const b=typeof m=="function"?m(d):m;a(d,b)&&(u||l(b),o(b))},[u,o,d,a]);return[d,h]}const j_=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),$S=w.createContext({});function Sce(){return w.useContext($S).visualElement}const y0=w.createContext(null),op=typeof document<"u",J4=op?w.useLayoutEffect:w.useEffect,xB=w.createContext({strict:!1});function xce(e,t,n,r){const i=Sce(),o=w.useContext(xB),a=w.useContext(y0),s=w.useContext(j_).reducedMotion,l=w.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return J4(()=>{u&&u.render()}),w.useEffect(()=>{u&&u.animationState&&u.animationState.animateChanges()}),J4(()=>()=>u&&u.notify("Unmount"),[]),u}function Gg(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wce(e,t,n){return w.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Gg(n)&&(n.current=r))},[t])}function E2(e){return typeof e=="string"||Array.isArray(e)}function zS(e){return typeof e=="object"&&typeof e.start=="function"}const Cce=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function HS(e){return zS(e.animate)||Cce.some(t=>E2(e[t]))}function wB(e){return Boolean(HS(e)||e.variants)}function _ce(e,t){if(HS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||E2(n)?n:void 0,animate:E2(r)?r:void 0}}return e.inherit!==!1?t:{}}function kce(e){const{initial:t,animate:n}=_ce(e,w.useContext($S));return w.useMemo(()=>({initial:t,animate:n}),[yA(t),yA(n)])}function yA(e){return Array.isArray(e)?e.join(" "):e}const $u=e=>({isEnabled:t=>e.some(n=>!!t[n])}),P2={measureLayout:$u(["layout","layoutId","drag"]),animation:$u(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:$u(["exit"]),drag:$u(["drag","dragControls"]),focus:$u(["whileFocus"]),hover:$u(["whileHover","onHoverStart","onHoverEnd"]),tap:$u(["whileTap","onTap","onTapStart","onTapCancel"]),pan:$u(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:$u(["whileInView","onViewportEnter","onViewportLeave"])};function Ece(e){for(const t in e)t==="projectionNodeConstructor"?P2.projectionNodeConstructor=e[t]:P2[t].Component=e[t]}function VS(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Wv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Pce=1;function Tce(){return VS(()=>{if(Wv.hasEverUpdated)return Pce++})}const B_=w.createContext({});class Lce extends N.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const CB=w.createContext({}),Ace=Symbol.for("motionComponentSymbol");function Oce({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&Ece(e);function a(l,u){const d={...w.useContext(j_),...l,layoutId:Mce(l)},{isStatic:h}=d;let m=null;const y=kce(l),b=h?void 0:Tce(),x=i(l,h);if(!h&&op){y.visualElement=xce(o,x,d,t);const k=w.useContext(xB).strict,E=w.useContext(CB);y.visualElement&&(m=y.visualElement.loadFeatures(d,k,e,b,n||P2.projectionNodeConstructor,E))}return w.createElement(Lce,{visualElement:y.visualElement,props:d},m,w.createElement($S.Provider,{value:y},r(o,l,b,wce(x,y.visualElement,u),x,h,y.visualElement)))}const s=w.forwardRef(a);return s[Ace]=o,s}function Mce({layoutId:e}){const t=w.useContext(B_).id;return t&&e!==void 0?t+"-"+e:e}function Ice(e){function t(r,i={}){return Oce(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const Rce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function F_(e){return typeof e!="string"||e.includes("-")?!1:!!(Rce.indexOf(e)>-1||/[A-Z]/.test(e))}const e5={};function Dce(e){Object.assign(e5,e)}const t5=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],b0=new Set(t5);function _B(e,{layout:t,layoutId:n}){return b0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!e5[e]||e==="opacity")}const su=e=>!!(e!=null&&e.getVelocity),Nce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jce=(e,t)=>t5.indexOf(e)-t5.indexOf(t);function Bce({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";t.sort(jce);for(const s of t)a+=`${Nce[s]||s}(${e[s]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}function kB(e){return e.startsWith("--")}const Fce=(e,t)=>t&&typeof e=="number"?t.transform(e):e,EB=(e,t)=>n=>Math.max(Math.min(n,t),e),Uv=e=>e%1?Number(e.toFixed(5)):e,T2=/(-)?([\d]*\.?[\d])+/g,x7=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,$ce=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function by(e){return typeof e=="string"}const ap={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Gv=Object.assign(Object.assign({},ap),{transform:EB(0,1)}),Q3=Object.assign(Object.assign({},ap),{default:1}),Sy=e=>({test:t=>by(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),fd=Sy("deg"),Ql=Sy("%"),Lt=Sy("px"),zce=Sy("vh"),Hce=Sy("vw"),bA=Object.assign(Object.assign({},Ql),{parse:e=>Ql.parse(e)/100,transform:e=>Ql.transform(e*100)}),$_=(e,t)=>n=>Boolean(by(n)&&$ce.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),PB=(e,t,n)=>r=>{if(!by(r))return r;const[i,o,a,s]=r.match(T2);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},Eh={test:$_("hsl","hue"),parse:PB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ql.transform(Uv(t))+", "+Ql.transform(Uv(n))+", "+Uv(Gv.transform(r))+")"},Vce=EB(0,255),g6=Object.assign(Object.assign({},ap),{transform:e=>Math.round(Vce(e))}),_d={test:$_("rgb","red"),parse:PB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+g6.transform(e)+", "+g6.transform(t)+", "+g6.transform(n)+", "+Uv(Gv.transform(r))+")"};function Wce(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const w7={test:$_("#"),parse:Wce,transform:_d.transform},wo={test:e=>_d.test(e)||w7.test(e)||Eh.test(e),parse:e=>_d.test(e)?_d.parse(e):Eh.test(e)?Eh.parse(e):w7.parse(e),transform:e=>by(e)?e:e.hasOwnProperty("red")?_d.transform(e):Eh.transform(e)},TB="${c}",LB="${n}";function Uce(e){var t,n,r,i;return isNaN(e)&&by(e)&&((n=(t=e.match(T2))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((i=(r=e.match(x7))===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0}function AB(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(x7);r&&(n=r.length,e=e.replace(x7,TB),t.push(...r.map(wo.parse)));const i=e.match(T2);return i&&(e=e.replace(T2,LB),t.push(...i.map(ap.parse))),{values:t,numColors:n,tokenised:e}}function OB(e){return AB(e).values}function MB(e){const{values:t,numColors:n,tokenised:r}=AB(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function qce(e){const t=OB(e);return MB(e)(t.map(Gce))}const tc={test:Uce,parse:OB,createTransformer:MB,getAnimatableNone:qce},Yce=new Set(["brightness","contrast","saturate","opacity"]);function Kce(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(T2)||[];if(!r)return e;const i=n.replace(r,"");let o=Yce.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const Xce=/([a-z-]*)\(.*?\)/g,C7=Object.assign(Object.assign({},tc),{getAnimatableNone:e=>{const t=e.match(Xce);return t?t.map(Kce).join(" "):e}}),SA={...ap,transform:Math.round},IB={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,size:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,rotate:fd,rotateX:fd,rotateY:fd,rotateZ:fd,scale:Q3,scaleX:Q3,scaleY:Q3,scaleZ:Q3,skew:fd,skewX:fd,skewY:fd,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:Gv,originX:bA,originY:bA,originZ:Lt,zIndex:SA,fillOpacity:Gv,strokeOpacity:Gv,numOctaves:SA};function z_(e,t,n,r){const{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let u=!1,d=!1,h=!0;for(const m in t){const y=t[m];if(kB(m)){o[m]=y;continue}const b=IB[m],x=Fce(y,b);if(b0.has(m)){if(u=!0,a[m]=x,s.push(m),!h)continue;y!==(b.default||0)&&(h=!1)}else m.startsWith("origin")?(d=!0,l[m]=x):i[m]=x}if(t.transform||(u||r?i.transform=Bce(e,n,h,r):i.transform&&(i.transform="none")),d){const{originX:m="50%",originY:y="50%",originZ:b=0}=l;i.transformOrigin=`${m} ${y} ${b}`}}const H_=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function RB(e,t,n){for(const r in t)!su(t[r])&&!_B(r,n)&&(e[r]=t[r])}function Zce({transformTemplate:e},t,n){return w.useMemo(()=>{const r=H_();return z_(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function Qce(e,t,n){const r=e.style||{},i={};return RB(i,r,e),Object.assign(i,Zce(e,t,n)),e.transformValues?e.transformValues(i):i}function Jce(e,t,n){const r={},i=Qce(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),r.style=i,r}const ede=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],tde=["whileTap","onTap","onTapStart","onTapCancel"],nde=["onPan","onPanStart","onPanSessionStart","onPanEnd"],rde=["whileInView","onViewportEnter","onViewportLeave","viewport"],ide=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...rde,...tde,...ede,...nde]);function n5(e){return ide.has(e)}let DB=e=>!n5(e);function ode(e){e&&(DB=t=>t.startsWith("on")?!n5(t):e(t))}try{ode(require("@emotion/is-prop-valid").default)}catch{}function ade(e,t,n){const r={};for(const i in e)(DB(i)||n===!0&&n5(i)||!t&&!n5(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function xA(e,t,n){return typeof e=="string"?e:Lt.transform(t+n*e)}function sde(e,t,n){const r=xA(t,e.x,e.width),i=xA(n,e.y,e.height);return`${r} ${i}`}const lde={offset:"stroke-dashoffset",array:"stroke-dasharray"},ude={offset:"strokeDashoffset",array:"strokeDasharray"};function cde(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?lde:ude;e[o.offset]=Lt.transform(-r);const a=Lt.transform(t),s=Lt.transform(n);e[o.array]=`${a} ${s}`}function V_(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,d){z_(e,l,u,d),e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:y}=e;h.transform&&(y&&(m.transform=h.transform),delete h.transform),y&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=sde(y,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),o!==void 0&&cde(h,o,a,s,!1)}const NB=()=>({...H_(),attrs:{}});function dde(e,t){const n=w.useMemo(()=>{const r=NB();return V_(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};RB(r,e.style,e),n.style={...r,...n.style}}return n}function fde(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=(F_(n)?dde:Jce)(r,a,s),h={...ade(r,typeof n=="string",e),...u,ref:o};return i&&(h["data-projection-id"]=i),w.createElement(n,h)}}const jB=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function BB(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const FB=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function $B(e,t,n,r){BB(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(FB.has(i)?i:jB(i),t.attrs[i])}function W_(e){const{style:t}=e,n={};for(const r in t)(su(t[r])||_B(r,e))&&(n[r]=t[r]);return n}function zB(e){const t=W_(e);for(const n in e)if(su(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function U_(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const L2=e=>Array.isArray(e),hde=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),HB=e=>L2(e)?e[e.length-1]||0:e;function p4(e){const t=su(e)?e.get():e;return hde(t)?t.toValue():t}function pde({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:gde(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const VB=e=>(t,n)=>{const r=w.useContext($S),i=w.useContext(y0),o=()=>pde(e,t,r,i);return n?o():VS(o)};function gde(e,t,n,r){const i={},o=r(e);for(const m in o)i[m]=p4(o[m]);let{initial:a,animate:s}=e;const l=HS(e),u=wB(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?s:a;return h&&typeof h!="boolean"&&!zS(h)&&(Array.isArray(h)?h:[h]).forEach(y=>{const b=U_(e,y);if(!b)return;const{transitionEnd:x,transition:k,...E}=b;for(const _ in E){let P=E[_];if(Array.isArray(P)){const A=d?P.length-1:0;P=P[A]}P!==null&&(i[_]=P)}for(const _ in x)i[_]=x[_]}),i}const mde={useVisualState:VB({scrapeMotionValuesFromProps:zB,createRenderState:NB,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}V_(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),$B(t,n)}})},vde={useVisualState:VB({scrapeMotionValuesFromProps:W_,createRenderState:H_})};function yde(e,{forwardMotionProps:t=!1},n,r,i){return{...F_(e)?mde:vde,preloadedFeatures:n,useRender:fde(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}}var tr;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(tr||(tr={}));function WS(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function _7(e,t,n,r){w.useEffect(()=>{const i=e.current;if(n&&i)return WS(i,t,n,r)},[e,t,n,r])}function bde({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(tr.Focus,!0)},i=()=>{n&&n.setActive(tr.Focus,!1)};_7(t,"focus",e?r:void 0),_7(t,"blur",e?i:void 0)}function WB(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function UB(e){return!!e.touches}function Sde(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const xde={pageX:0,pageY:0};function wde(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||xde;return{x:r[t+"X"],y:r[t+"Y"]}}function Cde(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function G_(e,t="page"){return{point:UB(e)?wde(e,t):Cde(e,t)}}const GB=(e,t=!1)=>{const n=r=>e(r,G_(r));return t?Sde(n):n},_de=()=>op&&window.onpointerdown===null,kde=()=>op&&window.ontouchstart===null,Ede=()=>op&&window.onmousedown===null,Pde={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Tde={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function qB(e){return _de()?e:kde()?Tde[e]:Ede()?Pde[e]:e}function _m(e,t,n,r){return WS(e,qB(t),GB(n,t==="pointerdown"),r)}function r5(e,t,n,r){return _7(e,qB(t),n&&GB(n,t==="pointerdown"),r)}function YB(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const wA=YB("dragHorizontal"),CA=YB("dragVertical");function KB(e){let t=!1;if(e==="y")t=CA();else if(e==="x")t=wA();else{const n=wA(),r=CA();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function XB(){const e=KB(!0);return e?(e(),!1):!0}function _A(e,t,n){return(r,i)=>{!WB(r)||XB()||(e.animationState&&e.animationState.setActive(tr.Hover,t),n&&n(r,i))}}function Lde({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){r5(r,"pointerenter",e||n?_A(r,!0,e):void 0,{passive:!e}),r5(r,"pointerleave",t||n?_A(r,!1,t):void 0,{passive:!t})}const ZB=(e,t)=>t?e===t?!0:ZB(e,t.parentElement):!1;function q_(e){return w.useEffect(()=>()=>e(),[])}function QB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),m6=.001,Ode=.01,kA=10,Mde=.05,Ide=1;function Rde({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;Ade(e<=kA*1e3);let a=1-t;a=o5(Mde,Ide,a),e=o5(Ode,kA,e/1e3),a<1?(i=u=>{const d=u*a,h=d*e,m=d-n,y=k7(u,a),b=Math.exp(-h);return m6-m/y*b},o=u=>{const h=u*a*e,m=h*n+n,y=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-h),x=k7(Math.pow(u,2),a);return(-i(u)+m6>0?-1:1)*((m-y)*b)/x}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-m6+d*h},o=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const s=5/e,l=Nde(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const Dde=12;function Nde(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function Fde(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!EA(e,Bde)&&EA(e,jde)){const n=Rde(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function Y_(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=QB(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:s,damping:l,mass:u,velocity:d,duration:h,isResolvedFromDuration:m}=Fde(o),y=PA,b=PA;function x(){const k=d?-(d/1e3):0,E=n-t,_=l/(2*Math.sqrt(s*u)),P=Math.sqrt(s/u)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),_<1){const A=k7(P,_);y=M=>{const R=Math.exp(-_*P*M);return n-R*((k+_*P*E)/A*Math.sin(A*M)+E*Math.cos(A*M))},b=M=>{const R=Math.exp(-_*P*M);return _*P*R*(Math.sin(A*M)*(k+_*P*E)/A+E*Math.cos(A*M))-R*(Math.cos(A*M)*(k+_*P*E)-A*E*Math.sin(A*M))}}else if(_===1)y=A=>n-Math.exp(-P*A)*(E+(k+P*E)*A);else{const A=P*Math.sqrt(_*_-1);y=M=>{const R=Math.exp(-_*P*M),D=Math.min(A*M,300);return n-R*((k+_*P*E)*Math.sinh(D)+A*E*Math.cosh(D))/A}}}return x(),{next:k=>{const E=y(k);if(m)a.done=k>=h;else{const _=b(k)*1e3,P=Math.abs(_)<=r,A=Math.abs(n-E)<=i;a.done=P&&A}return a.value=a.done?n:E,a},flipTarget:()=>{d=-d,[t,n]=[n,t],x()}}}Y_.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const PA=e=>0,A2=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},zr=(e,t,n)=>-n*e+n*t+e;function v6(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function TA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=v6(l,s,e+1/3),o=v6(l,s,e),a=v6(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const $de=(e,t,n)=>{const r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},zde=[w7,_d,Eh],LA=e=>zde.find(t=>t.test(e)),JB=(e,t)=>{let n=LA(e),r=LA(t),i=n.parse(e),o=r.parse(t);n===Eh&&(i=TA(i),n=_d),r===Eh&&(o=TA(o),r=_d);const a=Object.assign({},i);return s=>{for(const l in a)l!=="alpha"&&(a[l]=$de(i[l],o[l],s));return a.alpha=zr(i.alpha,o.alpha,s),n.transform(a)}},E7=e=>typeof e=="number",Hde=(e,t)=>n=>t(e(n)),US=(...e)=>e.reduce(Hde);function eF(e,t){return E7(e)?n=>zr(e,t,n):wo.test(e)?JB(e,t):nF(e,t)}const tF=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>eF(o,t[a]));return o=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=eF(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}};function AA(e){const t=tc.parse(e),n=t.length;let r=0,i=0,o=0;for(let a=0;a{const n=tc.createTransformer(t),r=AA(e),i=AA(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?US(tF(r.parsed,i.parsed),n):a=>`${a>0?t:e}`},Wde=(e,t)=>n=>zr(e,t,n);function Ude(e){if(typeof e=="number")return Wde;if(typeof e=="string")return wo.test(e)?JB:nF;if(Array.isArray(e))return tF;if(typeof e=="object")return Vde}function Gde(e,t,n){const r=[],i=n||Ude(e[0]),o=e.length-1;for(let a=0;an(A2(e,t,r))}function Yde(e,t){const n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let l=1;for(;li||l===r);l++);o=l-1}const s=A2(e[o],e[o+1],i);return t[o](s)}}function rF(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;i5(o===t.length),i5(!r||!Array.isArray(r)||r.length===o-1),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=Gde(t,r,i),s=o===2?qde(e,a):Yde(e,a);return n?l=>s(o5(e[0],e[o-1],l)):s}const GS=e=>t=>1-e(1-t),K_=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Kde=e=>t=>Math.pow(t,e),iF=e=>t=>t*t*((e+1)*t-e),Xde=e=>{const t=iF(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},oF=1.525,Zde=4/11,Qde=8/11,Jde=9/10,X_=e=>e,Z_=Kde(2),efe=GS(Z_),aF=K_(Z_),sF=e=>1-Math.sin(Math.acos(e)),Q_=GS(sF),tfe=K_(Q_),J_=iF(oF),nfe=GS(J_),rfe=K_(J_),ife=Xde(oF),ofe=4356/361,afe=35442/1805,sfe=16061/1805,a5=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-a5(1-e*2)):.5*a5(e*2-1)+.5;function cfe(e,t){return e.map(()=>t||aF).splice(0,e.length-1)}function dfe(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function ffe(e,t){return e.map(n=>n*t)}function g4({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){const o={done:!1,value:e},a=Array.isArray(t)?t:[e,t],s=ffe(r&&r.length===a.length?r:dfe(a),i);function l(){return rF(s,a,{ease:Array.isArray(n)?n:cfe(a,n)})}let u=l();return{next:d=>(o.value=u(d),o.done=d>=i,o),flipTarget:()=>{a.reverse(),u=l()}}}function hfe({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a={done:!1,value:t};let s=n*e;const l=t+s,u=o===void 0?l:o(l);return u!==l&&(s=u-t),{next:d=>{const h=-s*Math.exp(-d/r);return a.done=!(h>i||h<-i),a.value=a.done?u:u+h,a},flipTarget:()=>{}}}const OA={keyframes:g4,spring:Y_,decay:hfe};function pfe(e){if(Array.isArray(e.to))return g4;if(OA[e.type])return OA[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?g4:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Y_:g4}const lF=1/60*1e3,gfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),uF=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(gfe()),lF);function mfe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=mfe(()=>O2=!0),e),{}),yfe=xy.reduce((e,t)=>{const n=qS[t];return e[t]=(r,i=!1,o=!1)=>(O2||xfe(),n.schedule(r,i,o)),e},{}),bfe=xy.reduce((e,t)=>(e[t]=qS[t].cancel,e),{});xy.reduce((e,t)=>(e[t]=()=>qS[t].process(km),e),{});const Sfe=e=>qS[e].process(km),cF=e=>{O2=!1,km.delta=P7?lF:Math.max(Math.min(e-km.timestamp,vfe),1),km.timestamp=e,T7=!0,xy.forEach(Sfe),T7=!1,O2&&(P7=!1,uF(cF))},xfe=()=>{O2=!0,P7=!0,T7||uF(cF)},wfe=()=>km;function dF(e,t,n=0){return e-t-n}function Cfe(e,t,n=0,r=!0){return r?dF(t+-e,t,n):t-(e-t)+n}function _fe(e,t,n,r){return r?e>=t+n:e<=-n}const kfe=e=>{const t=({delta:n})=>e(n);return{start:()=>yfe.update(t,!0),stop:()=>bfe.update(t)}};function fF(e){var t,n,{from:r,autoplay:i=!0,driver:o=kfe,elapsed:a=0,repeat:s=0,repeatType:l="loop",repeatDelay:u=0,onPlay:d,onStop:h,onComplete:m,onRepeat:y,onUpdate:b}=e,x=QB(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:k}=x,E,_=0,P=x.duration,A,M=!1,R=!0,D;const j=pfe(x);!((n=(t=j).needsInterpolation)===null||n===void 0)&&n.call(t,r,k)&&(D=rF([0,100],[r,k],{clamp:!1}),r=0,k=100);const z=j(Object.assign(Object.assign({},x),{from:r,to:k}));function H(){_++,l==="reverse"?(R=_%2===0,a=Cfe(a,P,u,R)):(a=dF(a,P,u),l==="mirror"&&z.flipTarget()),M=!1,y&&y()}function K(){E.stop(),m&&m()}function te(F){if(R||(F=-F),a+=F,!M){const W=z.next(Math.max(0,a));A=W.value,D&&(A=D(A)),M=R?W.done:a<=0}b==null||b(A),M&&(_===0&&(P??(P=a)),_{h==null||h(),E.stop()}}}function hF(e,t){return t?e*(1e3/t):0}function Efe({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:d,onUpdate:h,onComplete:m,onStop:y}){let b;function x(P){return n!==void 0&&Pr}function k(P){return n===void 0?r:r===void 0||Math.abs(n-P){var M;h==null||h(A),(M=P.onUpdate)===null||M===void 0||M.call(P,A)},onComplete:m,onStop:y}))}function _(P){E(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},P))}if(x(e))_({from:e,velocity:t,to:k(e)});else{let P=i*t+e;typeof u<"u"&&(P=u(P));const A=k(P),M=A===n?-1:1;let R,D;const j=z=>{R=D,D=z,t=hF(z-R,wfe().delta),(M===1&&z>A||M===-1&&zb==null?void 0:b.stop()}}const L7=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),MA=e=>L7(e)&&e.hasOwnProperty("z"),J3=(e,t)=>Math.abs(e-t);function ek(e,t){if(E7(e)&&E7(t))return J3(e,t);if(L7(e)&&L7(t)){const n=J3(e.x,t.x),r=J3(e.y,t.y),i=MA(e)&&MA(t)?J3(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}const pF=(e,t)=>1-3*t+3*e,gF=(e,t)=>3*t-6*e,mF=e=>3*e,s5=(e,t,n)=>((pF(t,n)*e+gF(t,n))*e+mF(t))*e,vF=(e,t,n)=>3*pF(t,n)*e*e+2*gF(t,n)*e+mF(t),Pfe=1e-7,Tfe=10;function Lfe(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=s5(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>Pfe&&++s=Ofe?Mfe(a,h,e,n):m===0?h:Lfe(a,s,s+eb,e,n)}return a=>a===0||a===1?a:s5(o(a),t,r)}function Rfe({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(!1),s=w.useRef(null),l={passive:!(t||e||n||y)};function u(){s.current&&s.current(),s.current=null}function d(){return u(),a.current=!1,i.animationState&&i.animationState.setActive(tr.Tap,!1),!XB()}function h(b,x){d()&&(ZB(i.current,b.target)?e&&e(b,x):n&&n(b,x))}function m(b,x){d()&&n&&n(b,x)}function y(b,x){u(),!a.current&&(a.current=!0,s.current=US(_m(window,"pointerup",h,l),_m(window,"pointercancel",m,l)),i.animationState&&i.animationState.setActive(tr.Tap,!0),t&&t(b,x))}r5(i,"pointerdown",o?y:void 0,l),q_(u)}const Dfe="production",yF=typeof process>"u"||process.env===void 0?Dfe:"production",IA=new Set;function bF(e,t,n){e||IA.has(t)||(console.warn(t),n&&console.warn(n),IA.add(t))}const A7=new WeakMap,y6=new WeakMap,Nfe=e=>{const t=A7.get(e.target);t&&t(e)},jfe=e=>{e.forEach(Nfe)};function Bfe({root:e,...t}){const n=e||document;y6.has(n)||y6.set(n,{});const r=y6.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(jfe,{root:e,...t})),r[i]}function Ffe(e,t,n){const r=Bfe(t);return A7.set(e,n),r.observe(e),()=>{A7.delete(e),r.unobserve(e)}}function $fe({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){const o=w.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?Vfe:Hfe)(a,o.current,e,i)}const zfe={some:0,all:1};function Hfe(e,t,n,{root:r,margin:i,amount:o="some",once:a}){w.useEffect(()=>{if(!e||!n.current)return;const s={root:r==null?void 0:r.current,rootMargin:i,threshold:typeof o=="number"?o:zfe[o]},l=u=>{const{isIntersecting:d}=u;if(t.isInView===d||(t.isInView=d,a&&!d&&t.hasEnteredView))return;d&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(tr.InView,d);const h=n.getProps(),m=d?h.onViewportEnter:h.onViewportLeave;m&&m(u)};return Ffe(n.current,s,l)},[e,r,i,o])}function Vfe(e,t,n,{fallback:r=!0}){w.useEffect(()=>{!e||!r||(yF!=="production"&&bF(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:i}=n.getProps();i&&i(null),n.animationState&&n.animationState.setActive(tr.InView,!0)}))},[e])}const kd=e=>t=>(e(t),null),Wfe={inView:kd($fe),tap:kd(Rfe),focus:kd(bde),hover:kd(Lde)};function tk(){const e=w.useContext(y0);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=w.useId();return w.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function Ufe(){return Gfe(w.useContext(y0))}function Gfe(e){return e===null?!0:e.isPresent}function SF(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,qfe={linear:X_,easeIn:Z_,easeInOut:aF,easeOut:efe,circIn:sF,circInOut:tfe,circOut:Q_,backIn:J_,backInOut:rfe,backOut:nfe,anticipate:ife,bounceIn:lfe,bounceInOut:ufe,bounceOut:a5},RA=e=>{if(Array.isArray(e)){i5(e.length===4);const[t,n,r,i]=e;return Ife(t,n,r,i)}else if(typeof e=="string")return qfe[e];return e},Yfe=e=>Array.isArray(e)&&typeof e[0]!="number",DA=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&tc.test(t)&&!t.startsWith("url(")),ah=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),tb=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),b6=()=>({type:"keyframes",ease:"linear",duration:.3}),Kfe=e=>({type:"keyframes",duration:.8,values:e}),NA={x:ah,y:ah,z:ah,rotate:ah,rotateX:ah,rotateY:ah,rotateZ:ah,scaleX:tb,scaleY:tb,scale:tb,opacity:b6,backgroundColor:b6,color:b6,default:tb},Xfe=(e,t)=>{let n;return L2(t)?n=Kfe:n=NA[e]||NA.default,{to:t,...n(t)}},Zfe={...IB,color:wo,backgroundColor:wo,outlineColor:wo,fill:wo,stroke:wo,borderColor:wo,borderTopColor:wo,borderRightColor:wo,borderBottomColor:wo,borderLeftColor:wo,filter:C7,WebkitFilter:C7},nk=e=>Zfe[e];function rk(e,t){var n;let r=nk(e);return r!==C7&&(r=tc),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const Qfe={current:!1},xF=1/60*1e3,Jfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),wF=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Jfe()),xF);function ehe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=ehe(()=>M2=!0),e),{}),Ys=wy.reduce((e,t)=>{const n=YS[t];return e[t]=(r,i=!1,o=!1)=>(M2||rhe(),n.schedule(r,i,o)),e},{}),Gh=wy.reduce((e,t)=>(e[t]=YS[t].cancel,e),{}),S6=wy.reduce((e,t)=>(e[t]=()=>YS[t].process(Em),e),{}),nhe=e=>YS[e].process(Em),CF=e=>{M2=!1,Em.delta=O7?xF:Math.max(Math.min(e-Em.timestamp,the),1),Em.timestamp=e,M7=!0,wy.forEach(nhe),M7=!1,M2&&(O7=!1,wF(CF))},rhe=()=>{M2=!0,O7=!0,M7||wF(CF)},I7=()=>Em;function _F(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Gh.read(r),e(o-t))};return Ys.read(r,!0),()=>Gh.read(r)}function ihe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...u}){return!!Object.keys(u).length}function ohe({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){const a={...o};return t&&(a.offset=t),o.duration&&(a.duration=l5(o.duration)),o.repeatDelay&&(a.repeatDelay=l5(o.repeatDelay)),e&&(a.ease=Yfe(e)?e.map(RA):RA(e)),o.type==="tween"&&(a.type="keyframes"),(n||i||r)&&(n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),o.type!=="spring"&&(a.type="keyframes"),a}function ahe(e,t){var n,r;return(r=(n=(ik(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function she(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function lhe(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),she(t),ihe(e)||(e={...e,...Xfe(n,t.to)}),{...t,...ohe(e)}}function uhe(e,t,n,r,i){const o=ik(r,e)||{};let a=o.from!==void 0?o.from:t.get();const s=DA(e,n);a==="none"&&s&&typeof n=="string"?a=rk(e,n):jA(a)&&typeof n=="string"?a=BA(n):!Array.isArray(n)&&jA(n)&&typeof a=="string"&&(n=BA(a));const l=DA(e,a);function u(){const h={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:m=>t.set(m)};return o.type==="inertia"||o.type==="decay"?Efe({...h,...o}):fF({...lhe(o,h,e),onUpdate:m=>{h.onUpdate(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{h.onComplete(),o.onComplete&&o.onComplete()}})}function d(){const h=HB(n);return t.set(h),i(),o.onUpdate&&o.onUpdate(h),o.onComplete&&o.onComplete(),{stop:()=>{}}}return!l||!s||o.type===!1?d:u}function jA(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function BA(e){return typeof e=="number"?0:rk("",e)}function ik(e,t){return e[t]||e.default||e}function ok(e,t,n,r={}){return Qfe.current&&(r={type:!1}),t.start(i=>{let o;const a=uhe(e,t,n,r,i),s=ahe(r,e),l=()=>o=a();let u;return s?u=_F(l,l5(s)):l(),()=>{u&&u(),o&&o.stop()}})}const che=e=>/^\-?\d*\.?\d+$/.test(e),dhe=e=>/^0[^.\s]+$/.test(e);function ak(e,t){e.indexOf(t)===-1&&e.push(t)}function sk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class qv{constructor(){this.subscriptions=[]}add(t){return ak(this.subscriptions,t),()=>sk(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class hhe{constructor(t){this.version="7.6.9",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new qv,this.velocityUpdateSubscribers=new qv,this.renderSubscribers=new qv,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=I7();this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,Ys.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Ys.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=fhe(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?hF(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function qm(e){return new hhe(e)}const kF=e=>t=>t.test(e),phe={test:e=>e==="auto",parse:e=>e},EF=[ap,Lt,Ql,fd,Hce,zce,phe],G1=e=>EF.find(kF(e)),ghe=[...EF,wo,tc],mhe=e=>ghe.find(kF(e));function vhe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function yhe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function KS(e,t,n){const r=e.getProps();return U_(r,t,n!==void 0?n:r.custom,vhe(e),yhe(e))}function bhe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,qm(n))}function She(e,t){const n=KS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=HB(o[a]);bhe(e,a,s)}}function xhe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;sR7(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=R7(e,t,n);else{const i=typeof t=="function"?KS(e,t,n.custom):t;r=PF(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function R7(e,t,n={}){var r;const i=KS(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const a=i?()=>PF(e,i,n):()=>Promise.resolve(),s=!((r=e.variantChildren)===null||r===void 0)&&r.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=o;return khe(e,t,d+u,h,m,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[a,s]:[s,a];return u().then(d)}else return Promise.all([a(),s(n.delay)])}function PF(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const u=e.getValue("willChange");r&&(a=r);const d=[],h=i&&((o=e.animationState)===null||o===void 0?void 0:o.getState()[i]);for(const m in l){const y=e.getValue(m),b=l[m];if(!y||b===void 0||h&&Phe(h,m))continue;let x={delay:n,...a};e.shouldReduceMotion&&b0.has(m)&&(x={...x,type:!1,delay:0});let k=ok(m,y,b,x);u5(u)&&(u.add(m),k=k.then(()=>u.remove(m))),d.push(k)}return Promise.all(d).then(()=>{s&&She(e,s)})}function khe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(Ehe).forEach((u,d)=>{a.push(R7(u,t,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function Ehe(e,t){return e.sortNodePosition(t)}function Phe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const lk=[tr.Animate,tr.InView,tr.Focus,tr.Hover,tr.Tap,tr.Drag,tr.Exit],The=[...lk].reverse(),Lhe=lk.length;function Ahe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>_he(e,n,r)))}function Ohe(e){let t=Ahe(e);const n=Ihe();let r=!0;const i=(l,u)=>{const d=KS(e,u);if(d){const{transition:h,transitionEnd:m,...y}=d;l={...l,...y,...m}}return l};function o(l){t=l(e)}function a(l,u){var d;const h=e.getProps(),m=e.getVariantContext(!0)||{},y=[],b=new Set;let x={},k=1/0;for(let _=0;_k&&R;const K=Array.isArray(M)?M:[M];let te=K.reduce(i,{});D===!1&&(te={});const{prevResolvedValues:G={}}=A,F={...G,...te},W=X=>{H=!0,b.delete(X),A.needsAnimating[X]=!0};for(const X in F){const Z=te[X],U=G[X];x.hasOwnProperty(X)||(Z!==U?L2(Z)&&L2(U)?!SF(Z,U)||z?W(X):A.protectedKeys[X]=!0:Z!==void 0?W(X):b.add(X):Z!==void 0&&b.has(X)?W(X):A.protectedKeys[X]=!0)}A.prevProp=M,A.prevResolvedValues=te,A.isActive&&(x={...x,...te}),r&&e.blockInitialAnimation&&(H=!1),H&&!j&&y.push(...K.map(X=>({animation:X,options:{type:P,...l}})))}if(b.size){const _={};b.forEach(P=>{const A=e.getBaseTarget(P);A!==void 0&&(_[P]=A)}),y.push({animation:_})}let E=Boolean(y.length);return r&&h.initial===!1&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,E?t(y):Promise.resolve()}function s(l,u,d){var h;if(n[l].isActive===u)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(y=>{var b;return(b=y.animationState)===null||b===void 0?void 0:b.setActive(l,u)}),n[l].isActive=u;const m=a(d,l);for(const y in n)n[y].protectedKeys={};return m}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function Mhe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!SF(t,e):!1}function sh(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ihe(){return{[tr.Animate]:sh(!0),[tr.InView]:sh(),[tr.Hover]:sh(),[tr.Tap]:sh(),[tr.Drag]:sh(),[tr.Focus]:sh(),[tr.Exit]:sh()}}const Rhe={animation:kd(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=Ohe(e)),zS(t)&&w.useEffect(()=>t.subscribe(e),[t])}),exit:kd(e=>{const{custom:t,visualElement:n}=e,[r,i]=tk(),o=w.useContext(y0);w.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(tr.Exit,!r,{custom:o&&o.custom||t});a&&!r&&a.then(i)},[r])})};class TF{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=w6(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=ek(u.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:m}=u,{timestamp:y}=I7();this.history.push({...m,timestamp:y});const{onStart:b,onMove:x}=this.handlers;d||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{if(this.lastMoveEvent=u,this.lastMoveEventInfo=x6(d,this.transformPagePoint),WB(u)&&u.buttons===0){this.handlePointerUp(u,d);return}Ys.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{this.end();const{onEnd:h,onSessionEnd:m}=this.handlers,y=w6(x6(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),m&&m(u,y)},UB(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const i=G_(t),o=x6(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=I7();this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,w6(o,this.history)),this.removeListeners=US(_m(window,"pointermove",this.handlePointerMove),_m(window,"pointerup",this.handlePointerUp),_m(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Gh.update(this.updatePoint)}}function x6(e,t){return t?{point:t(e.point)}:e}function FA(e,t){return{x:e.x-t.x,y:e.y-t.y}}function w6({point:e},t){return{point:e,delta:FA(e,LF(t)),offset:FA(e,Dhe(t)),velocity:Nhe(t,.1)}}function Dhe(e){return e[0]}function LF(e){return e[e.length-1]}function Nhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=LF(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>l5(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Ma(e){return e.max-e.min}function $A(e,t=0,n=.01){return ek(e,t)n&&(e=r?zr(n,e,r.max):Math.min(e,n)),e}function WA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Fhe(e,{top:t,left:n,bottom:r,right:i}){return{x:WA(e.x,n,i),y:WA(e.y,t,r)}}function UA(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=A2(t.min,t.max-r,e.min):r>i&&(n=A2(e.min,e.max-i,t.min)),o5(0,1,n)}function Hhe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const D7=.35;function Vhe(e=D7){return e===!1?e=0:e===!0&&(e=D7),{x:GA(e,"left","right"),y:GA(e,"top","bottom")}}function GA(e,t,n){return{min:qA(e,t),max:qA(e,n)}}function qA(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const YA=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xv=()=>({x:YA(),y:YA()}),KA=()=>({min:0,max:0}),pi=()=>({x:KA(),y:KA()});function Nl(e){return[e("x"),e("y")]}function AF({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Whe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Uhe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function C6(e){return e===void 0||e===1}function N7({scale:e,scaleX:t,scaleY:n}){return!C6(e)||!C6(t)||!C6(n)}function hh(e){return N7(e)||OF(e)||e.z||e.rotate||e.rotateX||e.rotateY}function OF(e){return XA(e.x)||XA(e.y)}function XA(e){return e&&e!=="0%"}function c5(e,t,n){const r=e-n,i=t*r;return n+i}function ZA(e,t,n,r,i){return i!==void 0&&(e=c5(e,i,r)),c5(e,n,r)+t}function j7(e,t=0,n=1,r,i){e.min=ZA(e.min,t,n,r,i),e.max=ZA(e.max,t,n,r,i)}function MF(e,{x:t,y:n}){j7(e.x,t.translate,t.scale,t.originPoint),j7(e.y,n.translate,n.scale,n.originPoint)}function Ghe(e,t,n,r=!1){var i,o;const a=n.length;if(!a)return;t.x=t.y=1;let s,l;for(let u=0;u{this.stopAnimation(),n&&this.snapToCursor(G_(s,"page").point)},i=(s,l)=>{var u;const{drag:d,dragPropagation:h,onDragStart:m}=this.getProps();d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=KB(d),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nl(y=>{var b,x;let k=this.getAxisMotionValue(y).get()||0;if(Ql.test(k)){const E=(x=(b=this.visualElement.projection)===null||b===void 0?void 0:b.layout)===null||x===void 0?void 0:x.layoutBox[y];E&&(k=Ma(E)*(parseFloat(k)/100))}this.originPoint[y]=k}),m==null||m(s,l),(u=this.visualElement.animationState)===null||u===void 0||u.setActive(tr.Drag,!0))},o=(s,l)=>{const{dragPropagation:u,dragDirectionLock:d,onDirectionLock:h,onDrag:m}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:y}=l;if(d&&this.currentDirection===null){this.currentDirection=Qhe(y),this.currentDirection!==null&&(h==null||h(this.currentDirection));return}this.updateAxis("x",l.point,y),this.updateAxis("y",l.point,y),this.visualElement.render(),m==null||m(s,l)},a=(s,l)=>this.stop(s,l);this.panSession=new TF(t,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o==null||o(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(tr.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!nb(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Bhe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Gg(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Fhe(r.layoutBox,t):this.constraints=!1,this.elastic=Vhe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Nl(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Hhe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Gg(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Khe(r,i.root,this.visualElement.getTransformPagePoint());let a=$he(i.layout.layoutBox,o);if(n){const s=n(Whe(a));this.hasMutatedConstraints=!!s,s&&(a=AF(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Nl(d=>{var h;if(!nb(d,n,this.currentDirection))return;let m=(h=l==null?void 0:l[d])!==null&&h!==void 0?h:{};a&&(m={min:0,max:0});const y=i?200:1e6,b=i?40:1e7,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:y,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(d,x)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ok(t,r,0,n)}stopAnimation(){Nl(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){Nl(n=>{const{drag:r}=this.getProps();if(!nb(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-zr(a,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!Gg(r)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Nl(s=>{const l=this.getAxisMotionValue(s);if(l){const u=l.get();o[s]=zhe({min:u,max:u},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",(t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Nl(s=>{if(!nb(s,n,null))return;const l=this.getAxisMotionValue(s),{min:u,max:d}=this.constraints[s];l.set(zr(u,d,o[s]))})}addListeners(){var t;if(!this.visualElement.current)return;Xhe.set(this.visualElement,this);const n=this.visualElement.current,r=_m(n,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps();d&&h&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();Gg(u)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",i);o&&!o.layout&&((t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout()),i();const s=WS(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Nl(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=u[h].translate,m.set(m.get()+u[h].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),l==null||l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=D7,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function nb(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Qhe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function Jhe(e){const{dragControls:t,visualElement:n}=e,r=VS(()=>new Zhe(n));w.useEffect(()=>t&&t.subscribe(r),[r,t]),w.useEffect(()=>r.addListeners(),[r])}function epe({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(null),{transformPagePoint:s}=w.useContext(j_),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(d,h)=>{a.current=null,n&&n(d,h)}};w.useEffect(()=>{a.current!==null&&a.current.updateHandlers(l)});function u(d){a.current=new TF(d,l,{transformPagePoint:s})}r5(i,"pointerdown",o&&u),q_(()=>a.current&&a.current.end())}const tpe={pan:kd(epe),drag:kd(Jhe)};function B7(e){return typeof e=="string"&&e.startsWith("var(--")}const RF=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function npe(e){const t=RF.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function F7(e,t,n=1){const[r,i]=npe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():B7(i)?F7(i,t,n+1):i}function rpe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!B7(o))return;const a=F7(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!B7(o))continue;const a=F7(o,r);a&&(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const ipe=new Set(["width","height","top","left","right","bottom","x","y"]),DF=e=>ipe.has(e),ope=e=>Object.keys(e).some(DF),NF=(e,t)=>{e.set(t,!1),e.set(t)},JA=e=>e===ap||e===Lt;var eO;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(eO||(eO={}));const tO=(e,t)=>parseFloat(e.split(", ")[t]),nO=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return tO(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?tO(o[1],e):0}},ape=new Set(["x","y","z"]),spe=t5.filter(e=>!ape.has(e));function lpe(e){const t=[];return spe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const rO={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:nO(4,13),y:nO(5,14)},upe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=rO[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const d=t.getValue(u);NF(d,s[u]),e[u]=rO[u](l,o)}),e},cpe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(DF);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],h=G1(d);const m=t[l];let y;if(L2(m)){const b=m.length,x=m[0]===null?1:0;d=m[x],h=G1(d);for(let k=x;k=0?window.pageYOffset:null,u=upe(t,e,s);return o.length&&o.forEach(([d,h])=>{e.getValue(d).set(h)}),e.render(),op&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function dpe(e,t,n,r){return ope(t)?cpe(e,t,n,r):{target:t,transitionEnd:r}}const fpe=(e,t,n,r)=>{const i=rpe(e,t,r);return t=i.target,r=i.transitionEnd,dpe(e,t,n,r)},$7={current:null},jF={current:!1};function hpe(){if(jF.current=!0,!!op)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$7.current=e.matches;e.addListener(t),t()}else $7.current=!1}function ppe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(su(o))e.addValue(i,o),u5(r)&&r.add(i);else if(su(a))e.addValue(i,qm(o)),u5(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,qm(s!==void 0?s:o))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const BF=Object.keys(P2),gpe=BF.length,iO=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class mpe{constructor({parent:t,props:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Ys.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=s,this.parent=t,this.props=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=HS(n),this.isVariantNode=wB(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n);for(const d in u){const h=u[d];a[d]!==void 0&&su(h)&&(h.set(a[d],!1),u5(l)&&l.add(d))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var n;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(n=this.parent)===null||n===void 0?void 0:n.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),jF.current||hpe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:$7.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,n,r;(t=this.projection)===null||t===void 0||t.unmount(),Gh.update(this.notifyUpdate),Gh.render(this.render),this.valueSubscriptions.forEach(i=>i()),(n=this.removeFromVariantTree)===null||n===void 0||n.call(this),(r=this.parent)===null||r===void 0||r.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(t,n){const r=b0.has(t),i=n.onChange(a=>{this.latestValues[t]=a,this.props.onUpdate&&Ys.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isProjectionDirty=!0)}),o=n.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures(t,n,r,i,o,a){const s=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:m})}return s}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let n=0;nr.variantChildren.delete(t)}addValue(t,n){this.hasValue(t)&&this.removeValue(t),this.values.set(t,n),this.latestValues[t]=n.get(),this.bindToMotionValue(t,n)}removeValue(t){var n;this.values.delete(t),(n=this.valueSubscriptions.get(t))===null||n===void 0||n(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=qm(n),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=U_(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!su(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new qv),this.events[t].add(n)}notify(t,...n){var r;(r=this.events[t])===null||r===void 0||r.notify(...n)}}const FF=["initial",...lk],vpe=FF.length;class $F extends mpe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){var r;return(r=t.style)===null||r===void 0?void 0:r[n]}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=Che(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){xhe(this,r,a);const s=fpe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function ype(e){return window.getComputedStyle(e)}class bpe extends $F{readValueFromInstance(t,n){if(b0.has(n)){const r=nk(n);return r&&r.default||0}else{const r=ype(t),i=(kB(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return IF(t,n)}build(t,n,r,i){z_(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t){return W_(t)}renderInstance(t,n,r,i){BB(t,n,r,i)}}class Spe extends $F{getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){var r;return b0.has(n)?((r=nk(n))===null||r===void 0?void 0:r.default)||0:(n=FB.has(n)?n:jB(n),t.getAttribute(n))}measureInstanceViewportBox(){return pi()}scrapeMotionValuesFromProps(t){return zB(t)}build(t,n,r,i){V_(t,n,r,i.transformTemplate)}renderInstance(t,n,r,i){$B(t,n,r,i)}}const xpe=(e,t)=>F_(e)?new Spe(t,{enableHardwareAcceleration:!1}):new bpe(t,{enableHardwareAcceleration:!0});function oO(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const q1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Lt.test(e))e=parseFloat(e);else return e;const n=oO(e,t.target.x),r=oO(e,t.target.y);return`${n}% ${r}%`}},aO="_$css",wpe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(RF,y=>(o.push(y),aO)));const a=tc.parse(e);if(a.length>5)return r;const s=tc.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=d;const h=zr(u,d,.5);typeof a[2+l]=="number"&&(a[2+l]/=h),typeof a[3+l]=="number"&&(a[3+l]/=h);let m=s(a);if(i){let y=0;m=m.replace(aO,()=>{const b=o[y];return y++,b})}return m}};class Cpe extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;Dce(kpe),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Wv.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Ys.postRender(()=>{var s;!((s=a.getStack())===null||s===void 0)&&s.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(i),r!=null&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t==null||t()}render(){return null}}function _pe(e){const[t,n]=tk(),r=w.useContext(B_);return N.createElement(Cpe,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(CB),isPresent:t,safeToRemove:n})}const kpe={borderRadius:{...q1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:q1,borderTopRightRadius:q1,borderBottomLeftRadius:q1,borderBottomRightRadius:q1,boxShadow:wpe},Epe={measureLayout:_pe};function Ppe(e,t,n={}){const r=su(e)?e:qm(e);return ok("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const zF=["TopLeft","TopRight","BottomLeft","BottomRight"],Tpe=zF.length,sO=e=>typeof e=="string"?parseFloat(e):e,lO=e=>typeof e=="number"||Lt.test(e);function Lpe(e,t,n,r,i,o){var a,s,l,u;i?(e.opacity=zr(0,(a=n.opacity)!==null&&a!==void 0?a:1,Ape(r)),e.opacityExit=zr((s=t.opacity)!==null&&s!==void 0?s:1,0,Ope(r))):o&&(e.opacity=zr((l=t.opacity)!==null&&l!==void 0?l:1,(u=n.opacity)!==null&&u!==void 0?u:1,r));for(let d=0;drt?1:n(A2(e,t,r))}function cO(e,t){e.min=t.min,e.max=t.max}function Rs(e,t){cO(e.x,t.x),cO(e.y,t.y)}function dO(e,t,n,r,i){return e-=t,e=c5(e,1/n,r),i!==void 0&&(e=c5(e,1/i,r)),e}function Mpe(e,t=0,n=1,r=.5,i,o=e,a=e){if(Ql.test(t)&&(t=parseFloat(t),t=zr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=zr(o.min,o.max,r);e===o&&(s-=t),e.min=dO(e.min,t,n,s,i),e.max=dO(e.max,t,n,s,i)}function fO(e,t,[n,r,i],o,a){Mpe(e,t[n],t[r],t[i],t.scale,o,a)}const Ipe=["x","scaleX","originX"],Rpe=["y","scaleY","originY"];function hO(e,t,n,r){fO(e.x,t,Ipe,n==null?void 0:n.x,r==null?void 0:r.x),fO(e.y,t,Rpe,n==null?void 0:n.y,r==null?void 0:r.y)}function pO(e){return e.translate===0&&e.scale===1}function VF(e){return pO(e.x)&&pO(e.y)}function WF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function gO(e){return Ma(e.x)/Ma(e.y)}function Dpe(e,t,n=.1){return ek(e,t)<=n}class Npe{constructor(){this.members=[]}add(t){ak(this.members,t),t.scheduleRender()}remove(t){if(sk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){var r;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(i=t.resumingFrom)===null||i===void 0?void 0:(o=i.options).onExitComplete)===null||a===void 0||a.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function mO(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),d&&(r+=`rotateY(${d}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const jpe=(e,t)=>e.depth-t.depth;class Bpe{constructor(){this.children=[],this.isDirty=!1}add(t){ak(this.children,t),this.isDirty=!0}remove(t){sk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jpe),this.isDirty=!1,this.children.forEach(t)}}const vO=["","X","Y","Z"],yO=1e3;let Fpe=0;function UF({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=Fpe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Wpe),this.nodes.forEach(Upe)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=_F(y,250),Wv.hasAnimatedSinceResize&&(Wv.hasAnimatedSinceResize=!1,this.nodes.forEach(SO))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&h&&(u||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeTargetChanged:b,layout:x})=>{var k,E,_,P,A;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const M=(E=(k=this.options.transition)!==null&&k!==void 0?k:h.getDefaultTransition())!==null&&E!==void 0?E:Xpe,{onLayoutAnimationStart:R,onLayoutAnimationComplete:D}=h.getProps(),j=!this.targetLayout||!WF(this.targetLayout,x)||b,z=!y&&b;if(!((_=this.resumeFrom)===null||_===void 0)&&_.instance||z||y&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,z);const H={...ik(M,"layout"),onPlay:R,onComplete:D};h.shouldReduceMotion&&(H.delay=0,H.type=!1),this.startAnimation(H)}else!y&&this.animationProgress===0&&SO(this),this.isLead()&&((A=(P=this.options).onExitComplete)===null||A===void 0||A.call(P));this.targetLayout=x})}unmount(){var a,s;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(s=this.parent)===null||s===void 0||s.children.delete(this),this.instance=void 0,Gh.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(Gpe),this.animationId++)}willUpdate(a=!0){var s,l,u;if(this.root.isUpdateBlocked()){(l=(s=this.options).onExitComplete)===null||l===void 0||l.call(s);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var P;const A=_/1e3;xO(y.x,a.x,A),xO(y.y,a.y,A),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((P=this.relativeParent)===null||P===void 0)&&P.layout)&&(Kv(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ype(this.relativeTarget,this.relativeTargetOrigin,b,A)),x&&(this.animationValues=m,Lpe(m,h,this.latestValues,A,E,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(0)}startAnimation(a){var s,l;this.notifyListeners("animationStart"),(s=this.currentAnimation)===null||s===void 0||s.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(Gh.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ys.update(()=>{Wv.hasAnimatedSinceResize=!0,this.currentAnimation=Ppe(0,yO,{...a,onUpdate:u=>{var d;this.mixTargetDelta(u),(d=a.onUpdate)===null||d===void 0||d.call(a,u)},onComplete:()=>{var u;(u=a.onComplete)===null||u===void 0||u.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,yO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:d}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&GF(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||pi();const h=Ma(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+h;const m=Ma(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}Rs(s,l),qg(s,d),Yv(this.projectionDeltaWithTransform,this.layoutCorrected,s,d)}}registerSharedNode(a,s){var l,u,d;this.sharedNodes.has(a)||this.sharedNodes.set(a,new Npe),this.sharedNodes.get(a).add(s),s.promote({transition:(l=s.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(d=(u=s.options.initialPromotionConfig)===null||u===void 0?void 0:u.shouldPreserveFollowOpacity)===null||d===void 0?void 0:d.call(u,s)})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(bO),this.root.sharedNodes.clear()}}}function $pe(e){e.updateLayout()}function zpe(e){var t,n,r;const i=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:a}=e.layout,{animationType:s}=e.options,l=i.source!==e.layout.source;s==="size"?Nl(y=>{const b=l?i.measuredBox[y]:i.layoutBox[y],x=Ma(b);b.min=o[y].min,b.max=b.min+x}):GF(s,i.layoutBox,o)&&Nl(y=>{const b=l?i.measuredBox[y]:i.layoutBox[y],x=Ma(o[y]);b.max=b.min+x});const u=Xv();Yv(u,o,i.layoutBox);const d=Xv();l?Yv(d,e.applyTransform(a,!0),i.measuredBox):Yv(d,o,i.layoutBox);const h=!VF(u);let m=!1;if(!e.resumeFrom){const y=e.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:b,layout:x}=y;if(b&&x){const k=pi();Kv(k,i.layoutBox,b.layoutBox);const E=pi();Kv(E,o,x.layoutBox),WF(k,E)||(m=!0)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:d,layoutDelta:u,hasLayoutChanged:h,hasRelativeTargetChanged:m})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function Hpe(e){e.clearSnapshot()}function bO(e){e.clearMeasurements()}function Vpe(e){const{visualElement:t}=e.options;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function SO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Wpe(e){e.resolveTargetDelta()}function Upe(e){e.calcProjection()}function Gpe(e){e.resetRotation()}function qpe(e){e.removeLeadSnapshot()}function xO(e,t,n){e.translate=zr(t.translate,0,n),e.scale=zr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function wO(e,t,n,r){e.min=zr(t.min,n.min,r),e.max=zr(t.max,n.max,r)}function Ype(e,t,n,r){wO(e.x,t.x,n.x,r),wO(e.y,t.y,n.y,r)}function Kpe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Xpe={duration:.45,ease:[.4,0,.1,1]};function Zpe(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function CO(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function Qpe(e){CO(e.x),CO(e.y)}function GF(e,t,n){return e==="position"||e==="preserve-aspect"&&!Dpe(gO(t),gO(n),.2)}const Jpe=UF({attachResizeListener:(e,t)=>WS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_6={current:void 0},ege=UF({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_6.current){const e=new Jpe(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),_6.current=e}return _6.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),tge={...Rhe,...Wfe,...tpe,...Epe},hu=Ice((e,t)=>yde(e,t,tge,xpe,ege));function qF(){const e=w.useRef(!1);return J4(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function nge(){const e=qF(),[t,n]=w.useState(0),r=w.useCallback(()=>{e.current&&n(t+1)},[t]);return[w.useCallback(()=>Ys.postRender(r),[r]),t]}class rge extends w.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ige({children:e,isPresent:t}){const n=w.useId(),r=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0});return w.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` + )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},Wse={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Use=e=>({bg:Et("gray.100","whiteAlpha.300")(e)}),Gse=e=>({transitionProperty:"common",transitionDuration:"slow",...Vse(e)}),qse=wv(e=>({label:Wse,filledTrack:Gse(e),track:Use(e)})),Yse={xs:wv({track:{h:"1"}}),sm:wv({track:{h:"2"}}),md:wv({track:{h:"3"}}),lg:wv({track:{h:"4"}})},Kse=Hse({sizes:Yse,baseStyle:qse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Xse,definePartsStyle:f4}=pr(qre.keys),Zse=e=>{var t;const n=(t=To(X4.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Qse=f4(e=>{var t,n,r,i;return{label:(n=(t=X4).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=X4).baseStyle)==null?void 0:i.call(r,e).container,control:Zse(e)}}),Jse={md:f4({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:f4({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:f4({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},ele=Xse({baseStyle:Qse,sizes:Jse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:tle,definePartsStyle:nle}=pr(Yre.keys),X3=Vn("select-bg"),JL,rle={...(JL=kn.baseStyle)==null?void 0:JL.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:X3.reference,[X3.variable]:"colors.white",_dark:{[X3.variable]:"colors.gray.700"},"> option, > optgroup":{bg:X3.reference}},ile={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},ole=nle({field:rle,icon:ile}),Z3={paddingInlineEnd:"8"},eA,tA,nA,rA,iA,oA,aA,sA,ale={lg:{...(eA=kn.sizes)==null?void 0:eA.lg,field:{...(tA=kn.sizes)==null?void 0:tA.lg.field,...Z3}},md:{...(nA=kn.sizes)==null?void 0:nA.md,field:{...(rA=kn.sizes)==null?void 0:rA.md.field,...Z3}},sm:{...(iA=kn.sizes)==null?void 0:iA.sm,field:{...(oA=kn.sizes)==null?void 0:oA.sm.field,...Z3}},xs:{...(aA=kn.sizes)==null?void 0:aA.xs,field:{...(sA=kn.sizes)==null?void 0:sA.xs.field,...Z3},icon:{insetEnd:"1"}}},sle=tle({baseStyle:ole,sizes:ale,variants:kn.variants,defaultProps:kn.defaultProps}),u6=Vn("skeleton-start-color"),c6=Vn("skeleton-end-color"),lle={[u6.variable]:"colors.gray.100",[c6.variable]:"colors.gray.400",_dark:{[u6.variable]:"colors.gray.800",[c6.variable]:"colors.gray.600"},background:u6.reference,borderColor:c6.reference,opacity:.7,borderRadius:"sm"},ule={baseStyle:lle},d6=Vn("skip-link-bg"),cle={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[d6.variable]:"colors.white",_dark:{[d6.variable]:"colors.gray.700"},bg:d6.reference}},dle={baseStyle:cle},{defineMultiStyleConfig:fle,definePartsStyle:BS}=pr(Kre.keys),E2=Vn("slider-thumb-size"),P2=Vn("slider-track-size"),bd=Vn("slider-bg"),hle=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...I_({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},ple=e=>({...I_({orientation:e.orientation,horizontal:{h:P2.reference},vertical:{w:P2.reference}}),overflow:"hidden",borderRadius:"sm",[bd.variable]:"colors.gray.200",_dark:{[bd.variable]:"colors.whiteAlpha.200"},_disabled:{[bd.variable]:"colors.gray.300",_dark:{[bd.variable]:"colors.whiteAlpha.300"}},bg:bd.reference}),gle=e=>{const{orientation:t}=e;return{...I_({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:E2.reference,h:E2.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},mle=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[bd.variable]:`colors.${t}.500`,_dark:{[bd.variable]:`colors.${t}.200`},bg:bd.reference}},vle=BS(e=>({container:hle(e),track:ple(e),thumb:gle(e),filledTrack:mle(e)})),yle=BS({container:{[E2.variable]:"sizes.4",[P2.variable]:"sizes.1"}}),ble=BS({container:{[E2.variable]:"sizes.3.5",[P2.variable]:"sizes.1"}}),Sle=BS({container:{[E2.variable]:"sizes.2.5",[P2.variable]:"sizes.0.5"}}),xle={lg:yle,md:ble,sm:Sle},wle=fle({baseStyle:vle,sizes:xle,defaultProps:{size:"md",colorScheme:"blue"}}),Ch=bi("spinner-size"),Cle={width:[Ch.reference],height:[Ch.reference]},_le={xs:{[Ch.variable]:"sizes.3"},sm:{[Ch.variable]:"sizes.4"},md:{[Ch.variable]:"sizes.6"},lg:{[Ch.variable]:"sizes.8"},xl:{[Ch.variable]:"sizes.12"}},kle={baseStyle:Cle,sizes:_le,defaultProps:{size:"md"}},{defineMultiStyleConfig:Ele,definePartsStyle:mB}=pr(Xre.keys),Ple={fontWeight:"medium"},Tle={opacity:.8,marginBottom:"2"},Lle={verticalAlign:"baseline",fontWeight:"semibold"},Ale={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},Ole=mB({container:{},label:Ple,helpText:Tle,number:Lle,icon:Ale}),Mle={md:mB({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},Ile=Ele({baseStyle:Ole,sizes:Mle,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Rle,definePartsStyle:h4}=pr(Zre.keys),Uv=bi("switch-track-width"),Dh=bi("switch-track-height"),f6=bi("switch-track-diff"),Dle=Uu.subtract(Uv,Dh),b7=bi("switch-thumb-x"),G1=bi("switch-bg"),Nle=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Uv.reference],height:[Dh.reference],transitionProperty:"common",transitionDuration:"fast",[G1.variable]:"colors.gray.300",_dark:{[G1.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[G1.variable]:`colors.${t}.500`,_dark:{[G1.variable]:`colors.${t}.200`}},bg:G1.reference}},jle={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Dh.reference],height:[Dh.reference],_checked:{transform:`translateX(${b7.reference})`}},Ble=h4(e=>({container:{[f6.variable]:Dle,[b7.variable]:f6.reference,_rtl:{[b7.variable]:Uu(f6).negate().toString()}},track:Nle(e),thumb:jle})),$le={sm:h4({container:{[Uv.variable]:"1.375rem",[Dh.variable]:"sizes.3"}}),md:h4({container:{[Uv.variable]:"1.875rem",[Dh.variable]:"sizes.4"}}),lg:h4({container:{[Uv.variable]:"2.875rem",[Dh.variable]:"sizes.6"}})},Fle=Rle({baseStyle:Ble,sizes:$le,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:zle,definePartsStyle:_m}=pr(Qre.keys),Hle=_m({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Z4={"&[data-is-numeric=true]":{textAlign:"end"}},Vle=_m(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},caption:{color:Et("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Wle=_m(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Z4},caption:{color:Et("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e)},td:{background:Et(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Ule={simple:Vle,striped:Wle,unstyled:{}},Gle={sm:_m({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:_m({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:_m({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},qle=zle({baseStyle:Hle,variants:Ule,sizes:Gle,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Xo=Vn("tabs-color"),Vs=Vn("tabs-bg"),Q3=Vn("tabs-border-color"),{defineMultiStyleConfig:Yle,definePartsStyle:Zl}=pr(Jre.keys),Kle=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},Xle=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Zle=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},Qle={p:4},Jle=Zl(e=>({root:Kle(e),tab:Xle(e),tablist:Zle(e),tabpanel:Qle})),eue={sm:Zl({tab:{py:1,px:4,fontSize:"sm"}}),md:Zl({tab:{fontSize:"md",py:2,px:4}}),lg:Zl({tab:{fontSize:"lg",py:3,px:4}})},tue=Zl(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Xo.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Vs.variable]:"colors.gray.200",_dark:{[Vs.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Xo.reference,bg:Vs.reference}}}),nue=Zl(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Q3.reference]:"transparent",_selected:{[Xo.variable]:`colors.${t}.600`,[Q3.variable]:"colors.white",_dark:{[Xo.variable]:`colors.${t}.300`,[Q3.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Q3.reference},color:Xo.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),rue=Zl(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Vs.variable]:"colors.gray.50",_dark:{[Vs.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Vs.variable]:"colors.white",[Xo.variable]:`colors.${t}.600`,_dark:{[Vs.variable]:"colors.gray.800",[Xo.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Xo.reference,bg:Vs.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),iue=Zl(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ko(n,`${t}.700`),bg:ko(n,`${t}.100`)}}}}),oue=Zl(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Xo.variable]:"colors.gray.600",_dark:{[Xo.variable]:"inherit"},_selected:{[Xo.variable]:"colors.white",[Vs.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:"colors.gray.800",[Vs.variable]:`colors.${t}.300`}},color:Xo.reference,bg:Vs.reference}}}),aue=Zl({}),sue={line:tue,enclosed:nue,"enclosed-colored":rue,"soft-rounded":iue,"solid-rounded":oue,unstyled:aue},lue=Yle({baseStyle:Jle,sizes:eue,variants:sue,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:uue,definePartsStyle:Nh}=pr(eie.keys),cue={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},due={lineHeight:1.2,overflow:"visible"},fue={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},hue=Nh({container:cue,label:due,closeButton:fue}),pue={sm:Nh({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Nh({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Nh({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},gue={subtle:Nh(e=>{var t;return{container:(t=Hv.variants)==null?void 0:t.subtle(e)}}),solid:Nh(e=>{var t;return{container:(t=Hv.variants)==null?void 0:t.solid(e)}}),outline:Nh(e=>{var t;return{container:(t=Hv.variants)==null?void 0:t.outline(e)}})},mue=uue({variants:gue,baseStyle:hue,sizes:pue,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),lA,vue={...(lA=kn.baseStyle)==null?void 0:lA.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},uA,yue={outline:e=>{var t;return((t=kn.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=kn.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=kn.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((uA=kn.variants)==null?void 0:uA.unstyled.field)??{}},cA,dA,fA,hA,bue={xs:((cA=kn.sizes)==null?void 0:cA.xs.field)??{},sm:((dA=kn.sizes)==null?void 0:dA.sm.field)??{},md:((fA=kn.sizes)==null?void 0:fA.md.field)??{},lg:((hA=kn.sizes)==null?void 0:hA.lg.field)??{}},Sue={baseStyle:vue,sizes:bue,variants:yue,defaultProps:{size:"md",variant:"outline"}},J3=bi("tooltip-bg"),h6=bi("tooltip-fg"),xue=bi("popper-arrow-bg"),wue={bg:J3.reference,color:h6.reference,[J3.variable]:"colors.gray.700",[h6.variable]:"colors.whiteAlpha.900",_dark:{[J3.variable]:"colors.gray.300",[h6.variable]:"colors.gray.900"},[xue.variable]:J3.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},Cue={baseStyle:wue},_ue={Accordion:zie,Alert:Kie,Avatar:aoe,Badge:Hv,Breadcrumb:moe,Button:koe,Checkbox:X4,CloseButton:Foe,Code:Woe,Container:Goe,Divider:Zoe,Drawer:lae,Editable:gae,Form:xae,FormError:Pae,FormLabel:Lae,Heading:Mae,Input:kn,Kbd:Hae,Link:Wae,List:Kae,Menu:ose,Modal:mse,NumberInput:Ese,PinInput:Ase,Popover:zse,Progress:Kse,Radio:ele,Select:sle,Skeleton:ule,SkipLink:dle,Slider:wle,Spinner:kle,Stat:Ile,Switch:Fle,Table:qle,Tabs:lue,Tag:mue,Textarea:Sue,Tooltip:Cue,Card:Aoe},kue={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Eue=kue,Pue={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Tue=Pue,Lue={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},Aue=Lue,Oue={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Mue=Oue,Iue={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},Rue=Iue,Due={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Nue={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},jue={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Bue={property:Due,easing:Nue,duration:jue},$ue=Bue,Fue={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},zue=Fue,Hue={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Vue=Hue,Wue={breakpoints:Tue,zIndices:zue,radii:Mue,blur:Vue,colors:Aue,...hB,sizes:cB,shadows:Rue,space:uB,borders:Eue,transition:$ue},Uue={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},Gue={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},que="ltr",Yue={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},Kue={semanticTokens:Uue,direction:que,...Wue,components:_ue,styles:Gue,config:Yue},Xue=typeof Element<"u",Zue=typeof Map=="function",Que=typeof Set=="function",Jue=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function p4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!p4(e[r],t[r]))return!1;return!0}var o;if(Zue&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!p4(r.value[1],t.get(r.value[0])))return!1;return!0}if(Que&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Jue&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(Xue&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!p4(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var ece=function(t,n){try{return p4(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function y0(){const e=w.useContext(_2);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function vB(){const e=vy(),t=y0();return{...e,theme:t}}function tce(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__breakpoints)==null?void 0:o.asArray)==null?void 0:a[i]};return r(t)??r(n)??n}function nce(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__cssMap)==null?void 0:o[i])==null?void 0:a.value};return r(t)??r(n)??n}function rce(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{if(e==="breakpoints")return tce(o,l,a[u]??l);const d=`${e}.${l}`;return nce(o,d,a[u]??l)});return Array.isArray(t)?s:s[0]}}function ice(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=w.useMemo(()=>Qte(n),[n]);return N.createElement(sre,{theme:i},N.createElement(oce,{root:t}),r)}function oce({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return N.createElement(DS,{styles:n=>({[t]:n.__cssVars})})}Cre({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function ace(){const{colorMode:e}=vy();return N.createElement(DS,{styles:t=>{const n=Qj(t,"styles.global"),r=tB(n,{theme:t,colorMode:e});return r?Aj(r)(t):void 0}})}var sce=new Set([...ene,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),lce=new Set(["htmlWidth","htmlHeight","htmlSize"]);function uce(e){return lce.has(e)||!sce.has(e)}var cce=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=Jj(a,(h,m)=>nne(m)),l=tB(e,t),u=Object.assign({},i,l,eB(s),o),d=Aj(u)(t.theme);return r?[d,r]:d};function p6(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=uce);const i=cce({baseStyle:n}),o=p7(e,r)(i);return N.forwardRef(function(l,u){const{colorMode:d,forced:h}=vy();return N.createElement(o,{ref:u,"data-theme":h?d:void 0,...l})})}function Ae(e){return w.forwardRef(e)}function yB(e,t={}){const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=vB(),a=e?Qj(i,`components.${e}`):void 0,s=n||a,l=Gl({theme:i,colorMode:o},(s==null?void 0:s.defaultProps)??{},eB(vre(r,["children"]))),u=w.useRef({});if(s){const h=fne(s)(l);ece(u.current,h)||(u.current=h)}return u.current}function Oo(e,t={}){return yB(e,t)}function Mi(e,t={}){return yB(e,t)}function dce(){const e=new Map;return new Proxy(p6,{apply(t,n,r){return p6(...r)},get(t,n){return e.has(n)||e.set(n,p6(n)),e.get(n)}})}var we=dce();function fce(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Pn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o}=e,a=w.createContext(void 0);a.displayName=t;function s(){var l;const u=w.useContext(a);if(!u&&n){const d=new Error(o??fce(r,i));throw d.name="ContextError",(l=Error.captureStackTrace)==null||l.call(Error,d,s),d}return u}return[a.Provider,s,a]}function hce(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Hn(...e){return t=>{e.forEach(n=>{hce(n,t)})}}function pce(...e){return w.useMemo(()=>Hn(...e),e)}function pA(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var gce=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function gA(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function mA(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var S7=typeof window<"u"?w.useLayoutEffect:w.useEffect,Q4=e=>e,mce=class{constructor(){sn(this,"descendants",new Map);sn(this,"register",e=>{if(e!=null)return gce(e)?this.registerNode(e):t=>{this.registerNode(t,e)}});sn(this,"unregister",e=>{this.descendants.delete(e);const t=pA(Array.from(this.descendants.keys()));this.assignIndex(t)});sn(this,"destroy",()=>{this.descendants.clear()});sn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})});sn(this,"count",()=>this.descendants.size);sn(this,"enabledCount",()=>this.enabledValues().length);sn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index));sn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled));sn(this,"item",e=>{if(this.count()!==0)return this.values()[e]});sn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]});sn(this,"first",()=>this.item(0));sn(this,"firstEnabled",()=>this.enabledItem(0));sn(this,"last",()=>this.item(this.descendants.size-1));sn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)});sn(this,"indexOf",e=>{var t;return e?((t=this.descendants.get(e))==null?void 0:t.index)??-1:-1});sn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e)));sn(this,"next",(e,t=!0)=>{const n=gA(e,this.count(),t);return this.item(n)});sn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=gA(r,this.enabledCount(),t);return this.enabledItem(i)});sn(this,"prev",(e,t=!0)=>{const n=mA(e,this.count()-1,t);return this.item(n)});sn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=mA(r,this.enabledCount()-1,t);return this.enabledItem(i)});sn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=pA(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function vce(){const e=w.useRef(new mce);return S7(()=>()=>e.current.destroy()),e.current}var[yce,bB]=Pn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function bce(e){const t=bB(),[n,r]=w.useState(-1),i=w.useRef(null);S7(()=>()=>{i.current&&t.unregister(i.current)},[]),S7(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=Q4(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:Hn(o,i)}}function SB(){return[Q4(yce),()=>Q4(bB()),()=>vce(),i=>bce(i)]}var Qr=(...e)=>e.filter(Boolean).join(" "),vA={path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})),viewBox:"0 0 24 24"},Na=Ae((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,d=Qr("chakra-icon",s),h={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},m={ref:t,focusable:o,className:d,__css:h},y=r??vA.viewBox;if(n&&typeof n!="string")return N.createElement(we.svg,{as:n,...m,...u});const b=a??vA.path;return N.createElement(we.svg,{verticalAlign:"middle",viewBox:y,...m,...u},b)});Na.displayName="Icon";function yt(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=w.Children.toArray(e.path),a=Ae((s,l)=>N.createElement(Na,{ref:l,viewBox:t,...i,...s},o.length?o:N.createElement("path",{fill:"currentColor",d:n})));return a.displayName=r,a}function Er(e,t=[]){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function $S(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,y)=>m!==y}=e,o=Er(r),a=Er(i),[s,l]=w.useState(n),u=t!==void 0,d=u?t:s,h=Er(m=>{const b=typeof m=="function"?m(d):m;a(d,b)&&(u||l(b),o(b))},[u,o,d,a]);return[d,h]}const j_=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),FS=w.createContext({});function Sce(){return w.useContext(FS).visualElement}const b0=w.createContext(null),ap=typeof document<"u",J4=ap?w.useLayoutEffect:w.useEffect,xB=w.createContext({strict:!1});function xce(e,t,n,r){const i=Sce(),o=w.useContext(xB),a=w.useContext(b0),s=w.useContext(j_).reducedMotion,l=w.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return J4(()=>{u&&u.render()}),w.useEffect(()=>{u&&u.animationState&&u.animationState.animateChanges()}),J4(()=>()=>u&&u.notify("Unmount"),[]),u}function Yg(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wce(e,t,n){return w.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Yg(n)&&(n.current=r))},[t])}function T2(e){return typeof e=="string"||Array.isArray(e)}function zS(e){return typeof e=="object"&&typeof e.start=="function"}const Cce=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function HS(e){return zS(e.animate)||Cce.some(t=>T2(e[t]))}function wB(e){return Boolean(HS(e)||e.variants)}function _ce(e,t){if(HS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||T2(n)?n:void 0,animate:T2(r)?r:void 0}}return e.inherit!==!1?t:{}}function kce(e){const{initial:t,animate:n}=_ce(e,w.useContext(FS));return w.useMemo(()=>({initial:t,animate:n}),[yA(t),yA(n)])}function yA(e){return Array.isArray(e)?e.join(" "):e}const Fu=e=>({isEnabled:t=>e.some(n=>!!t[n])}),L2={measureLayout:Fu(["layout","layoutId","drag"]),animation:Fu(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:Fu(["exit"]),drag:Fu(["drag","dragControls"]),focus:Fu(["whileFocus"]),hover:Fu(["whileHover","onHoverStart","onHoverEnd"]),tap:Fu(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Fu(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:Fu(["whileInView","onViewportEnter","onViewportLeave"])};function Ece(e){for(const t in e)t==="projectionNodeConstructor"?L2.projectionNodeConstructor=e[t]:L2[t].Component=e[t]}function VS(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Gv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Pce=1;function Tce(){return VS(()=>{if(Gv.hasEverUpdated)return Pce++})}const B_=w.createContext({});class Lce extends N.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const CB=w.createContext({}),Ace=Symbol.for("motionComponentSymbol");function Oce({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&Ece(e);function a(l,u){const d={...w.useContext(j_),...l,layoutId:Mce(l)},{isStatic:h}=d;let m=null;const y=kce(l),b=h?void 0:Tce(),x=i(l,h);if(!h&&ap){y.visualElement=xce(o,x,d,t);const k=w.useContext(xB).strict,E=w.useContext(CB);y.visualElement&&(m=y.visualElement.loadFeatures(d,k,e,b,n||L2.projectionNodeConstructor,E))}return w.createElement(Lce,{visualElement:y.visualElement,props:d},m,w.createElement(FS.Provider,{value:y},r(o,l,b,wce(x,y.visualElement,u),x,h,y.visualElement)))}const s=w.forwardRef(a);return s[Ace]=o,s}function Mce({layoutId:e}){const t=w.useContext(B_).id;return t&&e!==void 0?t+"-"+e:e}function Ice(e){function t(r,i={}){return Oce(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const Rce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function $_(e){return typeof e!="string"||e.includes("-")?!1:!!(Rce.indexOf(e)>-1||/[A-Z]/.test(e))}const e5={};function Dce(e){Object.assign(e5,e)}const t5=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],S0=new Set(t5);function _B(e,{layout:t,layoutId:n}){return S0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!e5[e]||e==="opacity")}const su=e=>!!(e!=null&&e.getVelocity),Nce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jce=(e,t)=>t5.indexOf(e)-t5.indexOf(t);function Bce({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";t.sort(jce);for(const s of t)a+=`${Nce[s]||s}(${e[s]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}function kB(e){return e.startsWith("--")}const $ce=(e,t)=>t&&typeof e=="number"?t.transform(e):e,EB=(e,t)=>n=>Math.max(Math.min(n,t),e),qv=e=>e%1?Number(e.toFixed(5)):e,A2=/(-)?([\d]*\.?[\d])+/g,x7=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Fce=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function xy(e){return typeof e=="string"}const sp={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Yv=Object.assign(Object.assign({},sp),{transform:EB(0,1)}),eb=Object.assign(Object.assign({},sp),{default:1}),wy=e=>({test:t=>xy(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),fd=wy("deg"),Ql=wy("%"),Lt=wy("px"),zce=wy("vh"),Hce=wy("vw"),bA=Object.assign(Object.assign({},Ql),{parse:e=>Ql.parse(e)/100,transform:e=>Ql.transform(e*100)}),F_=(e,t)=>n=>Boolean(xy(n)&&Fce.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),PB=(e,t,n)=>r=>{if(!xy(r))return r;const[i,o,a,s]=r.match(A2);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},Ph={test:F_("hsl","hue"),parse:PB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ql.transform(qv(t))+", "+Ql.transform(qv(n))+", "+qv(Yv.transform(r))+")"},Vce=EB(0,255),g6=Object.assign(Object.assign({},sp),{transform:e=>Math.round(Vce(e))}),_d={test:F_("rgb","red"),parse:PB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+g6.transform(e)+", "+g6.transform(t)+", "+g6.transform(n)+", "+qv(Yv.transform(r))+")"};function Wce(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const w7={test:F_("#"),parse:Wce,transform:_d.transform},wo={test:e=>_d.test(e)||w7.test(e)||Ph.test(e),parse:e=>_d.test(e)?_d.parse(e):Ph.test(e)?Ph.parse(e):w7.parse(e),transform:e=>xy(e)?e:e.hasOwnProperty("red")?_d.transform(e):Ph.transform(e)},TB="${c}",LB="${n}";function Uce(e){var t,n,r,i;return isNaN(e)&&xy(e)&&((n=(t=e.match(A2))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((i=(r=e.match(x7))===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0}function AB(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(x7);r&&(n=r.length,e=e.replace(x7,TB),t.push(...r.map(wo.parse)));const i=e.match(A2);return i&&(e=e.replace(A2,LB),t.push(...i.map(sp.parse))),{values:t,numColors:n,tokenised:e}}function OB(e){return AB(e).values}function MB(e){const{values:t,numColors:n,tokenised:r}=AB(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function qce(e){const t=OB(e);return MB(e)(t.map(Gce))}const tc={test:Uce,parse:OB,createTransformer:MB,getAnimatableNone:qce},Yce=new Set(["brightness","contrast","saturate","opacity"]);function Kce(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(A2)||[];if(!r)return e;const i=n.replace(r,"");let o=Yce.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const Xce=/([a-z-]*)\(.*?\)/g,C7=Object.assign(Object.assign({},tc),{getAnimatableNone:e=>{const t=e.match(Xce);return t?t.map(Kce).join(" "):e}}),SA={...sp,transform:Math.round},IB={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,size:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,rotate:fd,rotateX:fd,rotateY:fd,rotateZ:fd,scale:eb,scaleX:eb,scaleY:eb,scaleZ:eb,skew:fd,skewX:fd,skewY:fd,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:Yv,originX:bA,originY:bA,originZ:Lt,zIndex:SA,fillOpacity:Yv,strokeOpacity:Yv,numOctaves:SA};function z_(e,t,n,r){const{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let u=!1,d=!1,h=!0;for(const m in t){const y=t[m];if(kB(m)){o[m]=y;continue}const b=IB[m],x=$ce(y,b);if(S0.has(m)){if(u=!0,a[m]=x,s.push(m),!h)continue;y!==(b.default||0)&&(h=!1)}else m.startsWith("origin")?(d=!0,l[m]=x):i[m]=x}if(t.transform||(u||r?i.transform=Bce(e,n,h,r):i.transform&&(i.transform="none")),d){const{originX:m="50%",originY:y="50%",originZ:b=0}=l;i.transformOrigin=`${m} ${y} ${b}`}}const H_=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function RB(e,t,n){for(const r in t)!su(t[r])&&!_B(r,n)&&(e[r]=t[r])}function Zce({transformTemplate:e},t,n){return w.useMemo(()=>{const r=H_();return z_(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function Qce(e,t,n){const r=e.style||{},i={};return RB(i,r,e),Object.assign(i,Zce(e,t,n)),e.transformValues?e.transformValues(i):i}function Jce(e,t,n){const r={},i=Qce(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),r.style=i,r}const ede=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],tde=["whileTap","onTap","onTapStart","onTapCancel"],nde=["onPan","onPanStart","onPanSessionStart","onPanEnd"],rde=["whileInView","onViewportEnter","onViewportLeave","viewport"],ide=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...rde,...tde,...ede,...nde]);function n5(e){return ide.has(e)}let DB=e=>!n5(e);function ode(e){e&&(DB=t=>t.startsWith("on")?!n5(t):e(t))}try{ode(require("@emotion/is-prop-valid").default)}catch{}function ade(e,t,n){const r={};for(const i in e)(DB(i)||n===!0&&n5(i)||!t&&!n5(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function xA(e,t,n){return typeof e=="string"?e:Lt.transform(t+n*e)}function sde(e,t,n){const r=xA(t,e.x,e.width),i=xA(n,e.y,e.height);return`${r} ${i}`}const lde={offset:"stroke-dashoffset",array:"stroke-dasharray"},ude={offset:"strokeDashoffset",array:"strokeDasharray"};function cde(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?lde:ude;e[o.offset]=Lt.transform(-r);const a=Lt.transform(t),s=Lt.transform(n);e[o.array]=`${a} ${s}`}function V_(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,d){z_(e,l,u,d),e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:y}=e;h.transform&&(y&&(m.transform=h.transform),delete h.transform),y&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=sde(y,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),o!==void 0&&cde(h,o,a,s,!1)}const NB=()=>({...H_(),attrs:{}});function dde(e,t){const n=w.useMemo(()=>{const r=NB();return V_(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};RB(r,e.style,e),n.style={...r,...n.style}}return n}function fde(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=($_(n)?dde:Jce)(r,a,s),h={...ade(r,typeof n=="string",e),...u,ref:o};return i&&(h["data-projection-id"]=i),w.createElement(n,h)}}const jB=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function BB(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const $B=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function FB(e,t,n,r){BB(e,t,void 0,r);for(const i in t.attrs)e.setAttribute($B.has(i)?i:jB(i),t.attrs[i])}function W_(e){const{style:t}=e,n={};for(const r in t)(su(t[r])||_B(r,e))&&(n[r]=t[r]);return n}function zB(e){const t=W_(e);for(const n in e)if(su(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function U_(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const O2=e=>Array.isArray(e),hde=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),HB=e=>O2(e)?e[e.length-1]||0:e;function g4(e){const t=su(e)?e.get():e;return hde(t)?t.toValue():t}function pde({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:gde(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const VB=e=>(t,n)=>{const r=w.useContext(FS),i=w.useContext(b0),o=()=>pde(e,t,r,i);return n?o():VS(o)};function gde(e,t,n,r){const i={},o=r(e);for(const m in o)i[m]=g4(o[m]);let{initial:a,animate:s}=e;const l=HS(e),u=wB(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?s:a;return h&&typeof h!="boolean"&&!zS(h)&&(Array.isArray(h)?h:[h]).forEach(y=>{const b=U_(e,y);if(!b)return;const{transitionEnd:x,transition:k,...E}=b;for(const _ in E){let P=E[_];if(Array.isArray(P)){const A=d?P.length-1:0;P=P[A]}P!==null&&(i[_]=P)}for(const _ in x)i[_]=x[_]}),i}const mde={useVisualState:VB({scrapeMotionValuesFromProps:zB,createRenderState:NB,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}V_(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),FB(t,n)}})},vde={useVisualState:VB({scrapeMotionValuesFromProps:W_,createRenderState:H_})};function yde(e,{forwardMotionProps:t=!1},n,r,i){return{...$_(e)?mde:vde,preloadedFeatures:n,useRender:fde(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}}var tr;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(tr||(tr={}));function WS(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function _7(e,t,n,r){w.useEffect(()=>{const i=e.current;if(n&&i)return WS(i,t,n,r)},[e,t,n,r])}function bde({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(tr.Focus,!0)},i=()=>{n&&n.setActive(tr.Focus,!1)};_7(t,"focus",e?r:void 0),_7(t,"blur",e?i:void 0)}function WB(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function UB(e){return!!e.touches}function Sde(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const xde={pageX:0,pageY:0};function wde(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||xde;return{x:r[t+"X"],y:r[t+"Y"]}}function Cde(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function G_(e,t="page"){return{point:UB(e)?wde(e,t):Cde(e,t)}}const GB=(e,t=!1)=>{const n=r=>e(r,G_(r));return t?Sde(n):n},_de=()=>ap&&window.onpointerdown===null,kde=()=>ap&&window.ontouchstart===null,Ede=()=>ap&&window.onmousedown===null,Pde={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Tde={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function qB(e){return _de()?e:kde()?Tde[e]:Ede()?Pde[e]:e}function km(e,t,n,r){return WS(e,qB(t),GB(n,t==="pointerdown"),r)}function r5(e,t,n,r){return _7(e,qB(t),n&&GB(n,t==="pointerdown"),r)}function YB(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const wA=YB("dragHorizontal"),CA=YB("dragVertical");function KB(e){let t=!1;if(e==="y")t=CA();else if(e==="x")t=wA();else{const n=wA(),r=CA();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function XB(){const e=KB(!0);return e?(e(),!1):!0}function _A(e,t,n){return(r,i)=>{!WB(r)||XB()||(e.animationState&&e.animationState.setActive(tr.Hover,t),n&&n(r,i))}}function Lde({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){r5(r,"pointerenter",e||n?_A(r,!0,e):void 0,{passive:!e}),r5(r,"pointerleave",t||n?_A(r,!1,t):void 0,{passive:!t})}const ZB=(e,t)=>t?e===t?!0:ZB(e,t.parentElement):!1;function q_(e){return w.useEffect(()=>()=>e(),[])}function QB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),m6=.001,Ode=.01,kA=10,Mde=.05,Ide=1;function Rde({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;Ade(e<=kA*1e3);let a=1-t;a=o5(Mde,Ide,a),e=o5(Ode,kA,e/1e3),a<1?(i=u=>{const d=u*a,h=d*e,m=d-n,y=k7(u,a),b=Math.exp(-h);return m6-m/y*b},o=u=>{const h=u*a*e,m=h*n+n,y=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-h),x=k7(Math.pow(u,2),a);return(-i(u)+m6>0?-1:1)*((m-y)*b)/x}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-m6+d*h},o=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const s=5/e,l=Nde(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const Dde=12;function Nde(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function $de(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!EA(e,Bde)&&EA(e,jde)){const n=Rde(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function Y_(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=QB(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:s,damping:l,mass:u,velocity:d,duration:h,isResolvedFromDuration:m}=$de(o),y=PA,b=PA;function x(){const k=d?-(d/1e3):0,E=n-t,_=l/(2*Math.sqrt(s*u)),P=Math.sqrt(s/u)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),_<1){const A=k7(P,_);y=M=>{const R=Math.exp(-_*P*M);return n-R*((k+_*P*E)/A*Math.sin(A*M)+E*Math.cos(A*M))},b=M=>{const R=Math.exp(-_*P*M);return _*P*R*(Math.sin(A*M)*(k+_*P*E)/A+E*Math.cos(A*M))-R*(Math.cos(A*M)*(k+_*P*E)-A*E*Math.sin(A*M))}}else if(_===1)y=A=>n-Math.exp(-P*A)*(E+(k+P*E)*A);else{const A=P*Math.sqrt(_*_-1);y=M=>{const R=Math.exp(-_*P*M),D=Math.min(A*M,300);return n-R*((k+_*P*E)*Math.sinh(D)+A*E*Math.cosh(D))/A}}}return x(),{next:k=>{const E=y(k);if(m)a.done=k>=h;else{const _=b(k)*1e3,P=Math.abs(_)<=r,A=Math.abs(n-E)<=i;a.done=P&&A}return a.value=a.done?n:E,a},flipTarget:()=>{d=-d,[t,n]=[n,t],x()}}}Y_.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const PA=e=>0,M2=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},zr=(e,t,n)=>-n*e+n*t+e;function v6(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function TA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=v6(l,s,e+1/3),o=v6(l,s,e),a=v6(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const Fde=(e,t,n)=>{const r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},zde=[w7,_d,Ph],LA=e=>zde.find(t=>t.test(e)),JB=(e,t)=>{let n=LA(e),r=LA(t),i=n.parse(e),o=r.parse(t);n===Ph&&(i=TA(i),n=_d),r===Ph&&(o=TA(o),r=_d);const a=Object.assign({},i);return s=>{for(const l in a)l!=="alpha"&&(a[l]=Fde(i[l],o[l],s));return a.alpha=zr(i.alpha,o.alpha,s),n.transform(a)}},E7=e=>typeof e=="number",Hde=(e,t)=>n=>t(e(n)),US=(...e)=>e.reduce(Hde);function e$(e,t){return E7(e)?n=>zr(e,t,n):wo.test(e)?JB(e,t):n$(e,t)}const t$=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>e$(o,t[a]));return o=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=e$(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}};function AA(e){const t=tc.parse(e),n=t.length;let r=0,i=0,o=0;for(let a=0;a{const n=tc.createTransformer(t),r=AA(e),i=AA(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?US(t$(r.parsed,i.parsed),n):a=>`${a>0?t:e}`},Wde=(e,t)=>n=>zr(e,t,n);function Ude(e){if(typeof e=="number")return Wde;if(typeof e=="string")return wo.test(e)?JB:n$;if(Array.isArray(e))return t$;if(typeof e=="object")return Vde}function Gde(e,t,n){const r=[],i=n||Ude(e[0]),o=e.length-1;for(let a=0;an(M2(e,t,r))}function Yde(e,t){const n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let l=1;for(;li||l===r);l++);o=l-1}const s=M2(e[o],e[o+1],i);return t[o](s)}}function r$(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;i5(o===t.length),i5(!r||!Array.isArray(r)||r.length===o-1),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=Gde(t,r,i),s=o===2?qde(e,a):Yde(e,a);return n?l=>s(o5(e[0],e[o-1],l)):s}const GS=e=>t=>1-e(1-t),K_=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Kde=e=>t=>Math.pow(t,e),i$=e=>t=>t*t*((e+1)*t-e),Xde=e=>{const t=i$(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},o$=1.525,Zde=4/11,Qde=8/11,Jde=9/10,X_=e=>e,Z_=Kde(2),efe=GS(Z_),a$=K_(Z_),s$=e=>1-Math.sin(Math.acos(e)),Q_=GS(s$),tfe=K_(Q_),J_=i$(o$),nfe=GS(J_),rfe=K_(J_),ife=Xde(o$),ofe=4356/361,afe=35442/1805,sfe=16061/1805,a5=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-a5(1-e*2)):.5*a5(e*2-1)+.5;function cfe(e,t){return e.map(()=>t||a$).splice(0,e.length-1)}function dfe(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function ffe(e,t){return e.map(n=>n*t)}function m4({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){const o={done:!1,value:e},a=Array.isArray(t)?t:[e,t],s=ffe(r&&r.length===a.length?r:dfe(a),i);function l(){return r$(s,a,{ease:Array.isArray(n)?n:cfe(a,n)})}let u=l();return{next:d=>(o.value=u(d),o.done=d>=i,o),flipTarget:()=>{a.reverse(),u=l()}}}function hfe({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a={done:!1,value:t};let s=n*e;const l=t+s,u=o===void 0?l:o(l);return u!==l&&(s=u-t),{next:d=>{const h=-s*Math.exp(-d/r);return a.done=!(h>i||h<-i),a.value=a.done?u:u+h,a},flipTarget:()=>{}}}const OA={keyframes:m4,spring:Y_,decay:hfe};function pfe(e){if(Array.isArray(e.to))return m4;if(OA[e.type])return OA[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?m4:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Y_:m4}const l$=1/60*1e3,gfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),u$=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(gfe()),l$);function mfe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=mfe(()=>I2=!0),e),{}),yfe=Cy.reduce((e,t)=>{const n=qS[t];return e[t]=(r,i=!1,o=!1)=>(I2||xfe(),n.schedule(r,i,o)),e},{}),bfe=Cy.reduce((e,t)=>(e[t]=qS[t].cancel,e),{});Cy.reduce((e,t)=>(e[t]=()=>qS[t].process(Em),e),{});const Sfe=e=>qS[e].process(Em),c$=e=>{I2=!1,Em.delta=P7?l$:Math.max(Math.min(e-Em.timestamp,vfe),1),Em.timestamp=e,T7=!0,Cy.forEach(Sfe),T7=!1,I2&&(P7=!1,u$(c$))},xfe=()=>{I2=!0,P7=!0,T7||u$(c$)},wfe=()=>Em;function d$(e,t,n=0){return e-t-n}function Cfe(e,t,n=0,r=!0){return r?d$(t+-e,t,n):t-(e-t)+n}function _fe(e,t,n,r){return r?e>=t+n:e<=-n}const kfe=e=>{const t=({delta:n})=>e(n);return{start:()=>yfe.update(t,!0),stop:()=>bfe.update(t)}};function f$(e){var t,n,{from:r,autoplay:i=!0,driver:o=kfe,elapsed:a=0,repeat:s=0,repeatType:l="loop",repeatDelay:u=0,onPlay:d,onStop:h,onComplete:m,onRepeat:y,onUpdate:b}=e,x=QB(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:k}=x,E,_=0,P=x.duration,A,M=!1,R=!0,D;const j=pfe(x);!((n=(t=j).needsInterpolation)===null||n===void 0)&&n.call(t,r,k)&&(D=r$([0,100],[r,k],{clamp:!1}),r=0,k=100);const z=j(Object.assign(Object.assign({},x),{from:r,to:k}));function H(){_++,l==="reverse"?(R=_%2===0,a=Cfe(a,P,u,R)):(a=d$(a,P,u),l==="mirror"&&z.flipTarget()),M=!1,y&&y()}function K(){E.stop(),m&&m()}function te($){if(R||($=-$),a+=$,!M){const W=z.next(Math.max(0,a));A=W.value,D&&(A=D(A)),M=R?W.done:a<=0}b==null||b(A),M&&(_===0&&(P??(P=a)),_{h==null||h(),E.stop()}}}function h$(e,t){return t?e*(1e3/t):0}function Efe({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:d,onUpdate:h,onComplete:m,onStop:y}){let b;function x(P){return n!==void 0&&Pr}function k(P){return n===void 0?r:r===void 0||Math.abs(n-P){var M;h==null||h(A),(M=P.onUpdate)===null||M===void 0||M.call(P,A)},onComplete:m,onStop:y}))}function _(P){E(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},P))}if(x(e))_({from:e,velocity:t,to:k(e)});else{let P=i*t+e;typeof u<"u"&&(P=u(P));const A=k(P),M=A===n?-1:1;let R,D;const j=z=>{R=D,D=z,t=h$(z-R,wfe().delta),(M===1&&z>A||M===-1&&zb==null?void 0:b.stop()}}const L7=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),MA=e=>L7(e)&&e.hasOwnProperty("z"),tb=(e,t)=>Math.abs(e-t);function ek(e,t){if(E7(e)&&E7(t))return tb(e,t);if(L7(e)&&L7(t)){const n=tb(e.x,t.x),r=tb(e.y,t.y),i=MA(e)&&MA(t)?tb(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}const p$=(e,t)=>1-3*t+3*e,g$=(e,t)=>3*t-6*e,m$=e=>3*e,s5=(e,t,n)=>((p$(t,n)*e+g$(t,n))*e+m$(t))*e,v$=(e,t,n)=>3*p$(t,n)*e*e+2*g$(t,n)*e+m$(t),Pfe=1e-7,Tfe=10;function Lfe(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=s5(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>Pfe&&++s=Ofe?Mfe(a,h,e,n):m===0?h:Lfe(a,s,s+nb,e,n)}return a=>a===0||a===1?a:s5(o(a),t,r)}function Rfe({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(!1),s=w.useRef(null),l={passive:!(t||e||n||y)};function u(){s.current&&s.current(),s.current=null}function d(){return u(),a.current=!1,i.animationState&&i.animationState.setActive(tr.Tap,!1),!XB()}function h(b,x){d()&&(ZB(i.current,b.target)?e&&e(b,x):n&&n(b,x))}function m(b,x){d()&&n&&n(b,x)}function y(b,x){u(),!a.current&&(a.current=!0,s.current=US(km(window,"pointerup",h,l),km(window,"pointercancel",m,l)),i.animationState&&i.animationState.setActive(tr.Tap,!0),t&&t(b,x))}r5(i,"pointerdown",o?y:void 0,l),q_(u)}const Dfe="production",y$=typeof process>"u"||process.env===void 0?Dfe:"production",IA=new Set;function b$(e,t,n){e||IA.has(t)||(console.warn(t),n&&console.warn(n),IA.add(t))}const A7=new WeakMap,y6=new WeakMap,Nfe=e=>{const t=A7.get(e.target);t&&t(e)},jfe=e=>{e.forEach(Nfe)};function Bfe({root:e,...t}){const n=e||document;y6.has(n)||y6.set(n,{});const r=y6.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(jfe,{root:e,...t})),r[i]}function $fe(e,t,n){const r=Bfe(t);return A7.set(e,n),r.observe(e),()=>{A7.delete(e),r.unobserve(e)}}function Ffe({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){const o=w.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?Vfe:Hfe)(a,o.current,e,i)}const zfe={some:0,all:1};function Hfe(e,t,n,{root:r,margin:i,amount:o="some",once:a}){w.useEffect(()=>{if(!e||!n.current)return;const s={root:r==null?void 0:r.current,rootMargin:i,threshold:typeof o=="number"?o:zfe[o]},l=u=>{const{isIntersecting:d}=u;if(t.isInView===d||(t.isInView=d,a&&!d&&t.hasEnteredView))return;d&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(tr.InView,d);const h=n.getProps(),m=d?h.onViewportEnter:h.onViewportLeave;m&&m(u)};return $fe(n.current,s,l)},[e,r,i,o])}function Vfe(e,t,n,{fallback:r=!0}){w.useEffect(()=>{!e||!r||(y$!=="production"&&b$(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:i}=n.getProps();i&&i(null),n.animationState&&n.animationState.setActive(tr.InView,!0)}))},[e])}const kd=e=>t=>(e(t),null),Wfe={inView:kd(Ffe),tap:kd(Rfe),focus:kd(bde),hover:kd(Lde)};function tk(){const e=w.useContext(b0);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=w.useId();return w.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function Ufe(){return Gfe(w.useContext(b0))}function Gfe(e){return e===null?!0:e.isPresent}function S$(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,qfe={linear:X_,easeIn:Z_,easeInOut:a$,easeOut:efe,circIn:s$,circInOut:tfe,circOut:Q_,backIn:J_,backInOut:rfe,backOut:nfe,anticipate:ife,bounceIn:lfe,bounceInOut:ufe,bounceOut:a5},RA=e=>{if(Array.isArray(e)){i5(e.length===4);const[t,n,r,i]=e;return Ife(t,n,r,i)}else if(typeof e=="string")return qfe[e];return e},Yfe=e=>Array.isArray(e)&&typeof e[0]!="number",DA=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&tc.test(t)&&!t.startsWith("url(")),sh=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),rb=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),b6=()=>({type:"keyframes",ease:"linear",duration:.3}),Kfe=e=>({type:"keyframes",duration:.8,values:e}),NA={x:sh,y:sh,z:sh,rotate:sh,rotateX:sh,rotateY:sh,rotateZ:sh,scaleX:rb,scaleY:rb,scale:rb,opacity:b6,backgroundColor:b6,color:b6,default:rb},Xfe=(e,t)=>{let n;return O2(t)?n=Kfe:n=NA[e]||NA.default,{to:t,...n(t)}},Zfe={...IB,color:wo,backgroundColor:wo,outlineColor:wo,fill:wo,stroke:wo,borderColor:wo,borderTopColor:wo,borderRightColor:wo,borderBottomColor:wo,borderLeftColor:wo,filter:C7,WebkitFilter:C7},nk=e=>Zfe[e];function rk(e,t){var n;let r=nk(e);return r!==C7&&(r=tc),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const Qfe={current:!1},x$=1/60*1e3,Jfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),w$=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Jfe()),x$);function ehe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=ehe(()=>R2=!0),e),{}),Ys=_y.reduce((e,t)=>{const n=YS[t];return e[t]=(r,i=!1,o=!1)=>(R2||rhe(),n.schedule(r,i,o)),e},{}),qh=_y.reduce((e,t)=>(e[t]=YS[t].cancel,e),{}),S6=_y.reduce((e,t)=>(e[t]=()=>YS[t].process(Pm),e),{}),nhe=e=>YS[e].process(Pm),C$=e=>{R2=!1,Pm.delta=O7?x$:Math.max(Math.min(e-Pm.timestamp,the),1),Pm.timestamp=e,M7=!0,_y.forEach(nhe),M7=!1,R2&&(O7=!1,w$(C$))},rhe=()=>{R2=!0,O7=!0,M7||w$(C$)},I7=()=>Pm;function _$(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(qh.read(r),e(o-t))};return Ys.read(r,!0),()=>qh.read(r)}function ihe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...u}){return!!Object.keys(u).length}function ohe({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){const a={...o};return t&&(a.offset=t),o.duration&&(a.duration=l5(o.duration)),o.repeatDelay&&(a.repeatDelay=l5(o.repeatDelay)),e&&(a.ease=Yfe(e)?e.map(RA):RA(e)),o.type==="tween"&&(a.type="keyframes"),(n||i||r)&&(n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),o.type!=="spring"&&(a.type="keyframes"),a}function ahe(e,t){var n,r;return(r=(n=(ik(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function she(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function lhe(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),she(t),ihe(e)||(e={...e,...Xfe(n,t.to)}),{...t,...ohe(e)}}function uhe(e,t,n,r,i){const o=ik(r,e)||{};let a=o.from!==void 0?o.from:t.get();const s=DA(e,n);a==="none"&&s&&typeof n=="string"?a=rk(e,n):jA(a)&&typeof n=="string"?a=BA(n):!Array.isArray(n)&&jA(n)&&typeof a=="string"&&(n=BA(a));const l=DA(e,a);function u(){const h={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:m=>t.set(m)};return o.type==="inertia"||o.type==="decay"?Efe({...h,...o}):f$({...lhe(o,h,e),onUpdate:m=>{h.onUpdate(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{h.onComplete(),o.onComplete&&o.onComplete()}})}function d(){const h=HB(n);return t.set(h),i(),o.onUpdate&&o.onUpdate(h),o.onComplete&&o.onComplete(),{stop:()=>{}}}return!l||!s||o.type===!1?d:u}function jA(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function BA(e){return typeof e=="number"?0:rk("",e)}function ik(e,t){return e[t]||e.default||e}function ok(e,t,n,r={}){return Qfe.current&&(r={type:!1}),t.start(i=>{let o;const a=uhe(e,t,n,r,i),s=ahe(r,e),l=()=>o=a();let u;return s?u=_$(l,l5(s)):l(),()=>{u&&u(),o&&o.stop()}})}const che=e=>/^\-?\d*\.?\d+$/.test(e),dhe=e=>/^0[^.\s]+$/.test(e);function ak(e,t){e.indexOf(t)===-1&&e.push(t)}function sk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Kv{constructor(){this.subscriptions=[]}add(t){return ak(this.subscriptions,t),()=>sk(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class hhe{constructor(t){this.version="7.6.9",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Kv,this.velocityUpdateSubscribers=new Kv,this.renderSubscribers=new Kv,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=I7();this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,Ys.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Ys.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=fhe(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?h$(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Ym(e){return new hhe(e)}const k$=e=>t=>t.test(e),phe={test:e=>e==="auto",parse:e=>e},E$=[sp,Lt,Ql,fd,Hce,zce,phe],q1=e=>E$.find(k$(e)),ghe=[...E$,wo,tc],mhe=e=>ghe.find(k$(e));function vhe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function yhe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function KS(e,t,n){const r=e.getProps();return U_(r,t,n!==void 0?n:r.custom,vhe(e),yhe(e))}function bhe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ym(n))}function She(e,t){const n=KS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=HB(o[a]);bhe(e,a,s)}}function xhe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;sR7(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=R7(e,t,n);else{const i=typeof t=="function"?KS(e,t,n.custom):t;r=P$(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function R7(e,t,n={}){var r;const i=KS(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const a=i?()=>P$(e,i,n):()=>Promise.resolve(),s=!((r=e.variantChildren)===null||r===void 0)&&r.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=o;return khe(e,t,d+u,h,m,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[a,s]:[s,a];return u().then(d)}else return Promise.all([a(),s(n.delay)])}function P$(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const u=e.getValue("willChange");r&&(a=r);const d=[],h=i&&((o=e.animationState)===null||o===void 0?void 0:o.getState()[i]);for(const m in l){const y=e.getValue(m),b=l[m];if(!y||b===void 0||h&&Phe(h,m))continue;let x={delay:n,...a};e.shouldReduceMotion&&S0.has(m)&&(x={...x,type:!1,delay:0});let k=ok(m,y,b,x);u5(u)&&(u.add(m),k=k.then(()=>u.remove(m))),d.push(k)}return Promise.all(d).then(()=>{s&&She(e,s)})}function khe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(Ehe).forEach((u,d)=>{a.push(R7(u,t,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function Ehe(e,t){return e.sortNodePosition(t)}function Phe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const lk=[tr.Animate,tr.InView,tr.Focus,tr.Hover,tr.Tap,tr.Drag,tr.Exit],The=[...lk].reverse(),Lhe=lk.length;function Ahe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>_he(e,n,r)))}function Ohe(e){let t=Ahe(e);const n=Ihe();let r=!0;const i=(l,u)=>{const d=KS(e,u);if(d){const{transition:h,transitionEnd:m,...y}=d;l={...l,...y,...m}}return l};function o(l){t=l(e)}function a(l,u){var d;const h=e.getProps(),m=e.getVariantContext(!0)||{},y=[],b=new Set;let x={},k=1/0;for(let _=0;_k&&R;const K=Array.isArray(M)?M:[M];let te=K.reduce(i,{});D===!1&&(te={});const{prevResolvedValues:G={}}=A,$={...G,...te},W=X=>{H=!0,b.delete(X),A.needsAnimating[X]=!0};for(const X in $){const Z=te[X],U=G[X];x.hasOwnProperty(X)||(Z!==U?O2(Z)&&O2(U)?!S$(Z,U)||z?W(X):A.protectedKeys[X]=!0:Z!==void 0?W(X):b.add(X):Z!==void 0&&b.has(X)?W(X):A.protectedKeys[X]=!0)}A.prevProp=M,A.prevResolvedValues=te,A.isActive&&(x={...x,...te}),r&&e.blockInitialAnimation&&(H=!1),H&&!j&&y.push(...K.map(X=>({animation:X,options:{type:P,...l}})))}if(b.size){const _={};b.forEach(P=>{const A=e.getBaseTarget(P);A!==void 0&&(_[P]=A)}),y.push({animation:_})}let E=Boolean(y.length);return r&&h.initial===!1&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,E?t(y):Promise.resolve()}function s(l,u,d){var h;if(n[l].isActive===u)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(y=>{var b;return(b=y.animationState)===null||b===void 0?void 0:b.setActive(l,u)}),n[l].isActive=u;const m=a(d,l);for(const y in n)n[y].protectedKeys={};return m}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function Mhe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!S$(t,e):!1}function lh(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ihe(){return{[tr.Animate]:lh(!0),[tr.InView]:lh(),[tr.Hover]:lh(),[tr.Tap]:lh(),[tr.Drag]:lh(),[tr.Focus]:lh(),[tr.Exit]:lh()}}const Rhe={animation:kd(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=Ohe(e)),zS(t)&&w.useEffect(()=>t.subscribe(e),[t])}),exit:kd(e=>{const{custom:t,visualElement:n}=e,[r,i]=tk(),o=w.useContext(b0);w.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(tr.Exit,!r,{custom:o&&o.custom||t});a&&!r&&a.then(i)},[r])})};class T${constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=w6(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=ek(u.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:m}=u,{timestamp:y}=I7();this.history.push({...m,timestamp:y});const{onStart:b,onMove:x}=this.handlers;d||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{if(this.lastMoveEvent=u,this.lastMoveEventInfo=x6(d,this.transformPagePoint),WB(u)&&u.buttons===0){this.handlePointerUp(u,d);return}Ys.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{this.end();const{onEnd:h,onSessionEnd:m}=this.handlers,y=w6(x6(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),m&&m(u,y)},UB(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const i=G_(t),o=x6(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=I7();this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,w6(o,this.history)),this.removeListeners=US(km(window,"pointermove",this.handlePointerMove),km(window,"pointerup",this.handlePointerUp),km(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qh.update(this.updatePoint)}}function x6(e,t){return t?{point:t(e.point)}:e}function $A(e,t){return{x:e.x-t.x,y:e.y-t.y}}function w6({point:e},t){return{point:e,delta:$A(e,L$(t)),offset:$A(e,Dhe(t)),velocity:Nhe(t,.1)}}function Dhe(e){return e[0]}function L$(e){return e[e.length-1]}function Nhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=L$(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>l5(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Ma(e){return e.max-e.min}function FA(e,t=0,n=.01){return ek(e,t)n&&(e=r?zr(n,e,r.max):Math.min(e,n)),e}function WA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function $he(e,{top:t,left:n,bottom:r,right:i}){return{x:WA(e.x,n,i),y:WA(e.y,t,r)}}function UA(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=M2(t.min,t.max-r,e.min):r>i&&(n=M2(e.min,e.max-i,t.min)),o5(0,1,n)}function Hhe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const D7=.35;function Vhe(e=D7){return e===!1?e=0:e===!0&&(e=D7),{x:GA(e,"left","right"),y:GA(e,"top","bottom")}}function GA(e,t,n){return{min:qA(e,t),max:qA(e,n)}}function qA(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const YA=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qv=()=>({x:YA(),y:YA()}),KA=()=>({min:0,max:0}),pi=()=>({x:KA(),y:KA()});function Nl(e){return[e("x"),e("y")]}function A$({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Whe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Uhe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function C6(e){return e===void 0||e===1}function N7({scale:e,scaleX:t,scaleY:n}){return!C6(e)||!C6(t)||!C6(n)}function ph(e){return N7(e)||O$(e)||e.z||e.rotate||e.rotateX||e.rotateY}function O$(e){return XA(e.x)||XA(e.y)}function XA(e){return e&&e!=="0%"}function c5(e,t,n){const r=e-n,i=t*r;return n+i}function ZA(e,t,n,r,i){return i!==void 0&&(e=c5(e,i,r)),c5(e,n,r)+t}function j7(e,t=0,n=1,r,i){e.min=ZA(e.min,t,n,r,i),e.max=ZA(e.max,t,n,r,i)}function M$(e,{x:t,y:n}){j7(e.x,t.translate,t.scale,t.originPoint),j7(e.y,n.translate,n.scale,n.originPoint)}function Ghe(e,t,n,r=!1){var i,o;const a=n.length;if(!a)return;t.x=t.y=1;let s,l;for(let u=0;u{this.stopAnimation(),n&&this.snapToCursor(G_(s,"page").point)},i=(s,l)=>{var u;const{drag:d,dragPropagation:h,onDragStart:m}=this.getProps();d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=KB(d),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nl(y=>{var b,x;let k=this.getAxisMotionValue(y).get()||0;if(Ql.test(k)){const E=(x=(b=this.visualElement.projection)===null||b===void 0?void 0:b.layout)===null||x===void 0?void 0:x.layoutBox[y];E&&(k=Ma(E)*(parseFloat(k)/100))}this.originPoint[y]=k}),m==null||m(s,l),(u=this.visualElement.animationState)===null||u===void 0||u.setActive(tr.Drag,!0))},o=(s,l)=>{const{dragPropagation:u,dragDirectionLock:d,onDirectionLock:h,onDrag:m}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:y}=l;if(d&&this.currentDirection===null){this.currentDirection=Qhe(y),this.currentDirection!==null&&(h==null||h(this.currentDirection));return}this.updateAxis("x",l.point,y),this.updateAxis("y",l.point,y),this.visualElement.render(),m==null||m(s,l)},a=(s,l)=>this.stop(s,l);this.panSession=new T$(t,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o==null||o(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(tr.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!ib(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Bhe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Yg(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=$he(r.layoutBox,t):this.constraints=!1,this.elastic=Vhe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Nl(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Hhe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Yg(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Khe(r,i.root,this.visualElement.getTransformPagePoint());let a=Fhe(i.layout.layoutBox,o);if(n){const s=n(Whe(a));this.hasMutatedConstraints=!!s,s&&(a=A$(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Nl(d=>{var h;if(!ib(d,n,this.currentDirection))return;let m=(h=l==null?void 0:l[d])!==null&&h!==void 0?h:{};a&&(m={min:0,max:0});const y=i?200:1e6,b=i?40:1e7,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:y,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(d,x)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ok(t,r,0,n)}stopAnimation(){Nl(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){Nl(n=>{const{drag:r}=this.getProps();if(!ib(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-zr(a,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!Yg(r)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Nl(s=>{const l=this.getAxisMotionValue(s);if(l){const u=l.get();o[s]=zhe({min:u,max:u},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",(t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Nl(s=>{if(!ib(s,n,null))return;const l=this.getAxisMotionValue(s),{min:u,max:d}=this.constraints[s];l.set(zr(u,d,o[s]))})}addListeners(){var t;if(!this.visualElement.current)return;Xhe.set(this.visualElement,this);const n=this.visualElement.current,r=km(n,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps();d&&h&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();Yg(u)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",i);o&&!o.layout&&((t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout()),i();const s=WS(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Nl(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=u[h].translate,m.set(m.get()+u[h].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),l==null||l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=D7,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function ib(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Qhe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function Jhe(e){const{dragControls:t,visualElement:n}=e,r=VS(()=>new Zhe(n));w.useEffect(()=>t&&t.subscribe(r),[r,t]),w.useEffect(()=>r.addListeners(),[r])}function epe({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(null),{transformPagePoint:s}=w.useContext(j_),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(d,h)=>{a.current=null,n&&n(d,h)}};w.useEffect(()=>{a.current!==null&&a.current.updateHandlers(l)});function u(d){a.current=new T$(d,l,{transformPagePoint:s})}r5(i,"pointerdown",o&&u),q_(()=>a.current&&a.current.end())}const tpe={pan:kd(epe),drag:kd(Jhe)};function B7(e){return typeof e=="string"&&e.startsWith("var(--")}const R$=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function npe(e){const t=R$.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function $7(e,t,n=1){const[r,i]=npe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():B7(i)?$7(i,t,n+1):i}function rpe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!B7(o))return;const a=$7(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!B7(o))continue;const a=$7(o,r);a&&(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const ipe=new Set(["width","height","top","left","right","bottom","x","y"]),D$=e=>ipe.has(e),ope=e=>Object.keys(e).some(D$),N$=(e,t)=>{e.set(t,!1),e.set(t)},JA=e=>e===sp||e===Lt;var eO;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(eO||(eO={}));const tO=(e,t)=>parseFloat(e.split(", ")[t]),nO=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return tO(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?tO(o[1],e):0}},ape=new Set(["x","y","z"]),spe=t5.filter(e=>!ape.has(e));function lpe(e){const t=[];return spe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const rO={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:nO(4,13),y:nO(5,14)},upe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=rO[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const d=t.getValue(u);N$(d,s[u]),e[u]=rO[u](l,o)}),e},cpe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(D$);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],h=q1(d);const m=t[l];let y;if(O2(m)){const b=m.length,x=m[0]===null?1:0;d=m[x],h=q1(d);for(let k=x;k=0?window.pageYOffset:null,u=upe(t,e,s);return o.length&&o.forEach(([d,h])=>{e.getValue(d).set(h)}),e.render(),ap&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function dpe(e,t,n,r){return ope(t)?cpe(e,t,n,r):{target:t,transitionEnd:r}}const fpe=(e,t,n,r)=>{const i=rpe(e,t,r);return t=i.target,r=i.transitionEnd,dpe(e,t,n,r)},F7={current:null},j$={current:!1};function hpe(){if(j$.current=!0,!!ap)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>F7.current=e.matches;e.addListener(t),t()}else F7.current=!1}function ppe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(su(o))e.addValue(i,o),u5(r)&&r.add(i);else if(su(a))e.addValue(i,Ym(o)),u5(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,Ym(s!==void 0?s:o))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const B$=Object.keys(L2),gpe=B$.length,iO=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class mpe{constructor({parent:t,props:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Ys.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=s,this.parent=t,this.props=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=HS(n),this.isVariantNode=wB(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n);for(const d in u){const h=u[d];a[d]!==void 0&&su(h)&&(h.set(a[d],!1),u5(l)&&l.add(d))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var n;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(n=this.parent)===null||n===void 0?void 0:n.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),j$.current||hpe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:F7.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,n,r;(t=this.projection)===null||t===void 0||t.unmount(),qh.update(this.notifyUpdate),qh.render(this.render),this.valueSubscriptions.forEach(i=>i()),(n=this.removeFromVariantTree)===null||n===void 0||n.call(this),(r=this.parent)===null||r===void 0||r.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(t,n){const r=S0.has(t),i=n.onChange(a=>{this.latestValues[t]=a,this.props.onUpdate&&Ys.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isProjectionDirty=!0)}),o=n.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures(t,n,r,i,o,a){const s=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:m})}return s}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let n=0;nr.variantChildren.delete(t)}addValue(t,n){this.hasValue(t)&&this.removeValue(t),this.values.set(t,n),this.latestValues[t]=n.get(),this.bindToMotionValue(t,n)}removeValue(t){var n;this.values.delete(t),(n=this.valueSubscriptions.get(t))===null||n===void 0||n(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ym(n),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=U_(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!su(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Kv),this.events[t].add(n)}notify(t,...n){var r;(r=this.events[t])===null||r===void 0||r.notify(...n)}}const $$=["initial",...lk],vpe=$$.length;class F$ extends mpe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){var r;return(r=t.style)===null||r===void 0?void 0:r[n]}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=Che(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){xhe(this,r,a);const s=fpe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function ype(e){return window.getComputedStyle(e)}class bpe extends F${readValueFromInstance(t,n){if(S0.has(n)){const r=nk(n);return r&&r.default||0}else{const r=ype(t),i=(kB(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return I$(t,n)}build(t,n,r,i){z_(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t){return W_(t)}renderInstance(t,n,r,i){BB(t,n,r,i)}}class Spe extends F${getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){var r;return S0.has(n)?((r=nk(n))===null||r===void 0?void 0:r.default)||0:(n=$B.has(n)?n:jB(n),t.getAttribute(n))}measureInstanceViewportBox(){return pi()}scrapeMotionValuesFromProps(t){return zB(t)}build(t,n,r,i){V_(t,n,r,i.transformTemplate)}renderInstance(t,n,r,i){FB(t,n,r,i)}}const xpe=(e,t)=>$_(e)?new Spe(t,{enableHardwareAcceleration:!1}):new bpe(t,{enableHardwareAcceleration:!0});function oO(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Y1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Lt.test(e))e=parseFloat(e);else return e;const n=oO(e,t.target.x),r=oO(e,t.target.y);return`${n}% ${r}%`}},aO="_$css",wpe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(R$,y=>(o.push(y),aO)));const a=tc.parse(e);if(a.length>5)return r;const s=tc.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=d;const h=zr(u,d,.5);typeof a[2+l]=="number"&&(a[2+l]/=h),typeof a[3+l]=="number"&&(a[3+l]/=h);let m=s(a);if(i){let y=0;m=m.replace(aO,()=>{const b=o[y];return y++,b})}return m}};class Cpe extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;Dce(kpe),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Gv.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Ys.postRender(()=>{var s;!((s=a.getStack())===null||s===void 0)&&s.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(i),r!=null&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t==null||t()}render(){return null}}function _pe(e){const[t,n]=tk(),r=w.useContext(B_);return N.createElement(Cpe,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(CB),isPresent:t,safeToRemove:n})}const kpe={borderRadius:{...Y1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Y1,borderTopRightRadius:Y1,borderBottomLeftRadius:Y1,borderBottomRightRadius:Y1,boxShadow:wpe},Epe={measureLayout:_pe};function Ppe(e,t,n={}){const r=su(e)?e:Ym(e);return ok("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const z$=["TopLeft","TopRight","BottomLeft","BottomRight"],Tpe=z$.length,sO=e=>typeof e=="string"?parseFloat(e):e,lO=e=>typeof e=="number"||Lt.test(e);function Lpe(e,t,n,r,i,o){var a,s,l,u;i?(e.opacity=zr(0,(a=n.opacity)!==null&&a!==void 0?a:1,Ape(r)),e.opacityExit=zr((s=t.opacity)!==null&&s!==void 0?s:1,0,Ope(r))):o&&(e.opacity=zr((l=t.opacity)!==null&&l!==void 0?l:1,(u=n.opacity)!==null&&u!==void 0?u:1,r));for(let d=0;drt?1:n(M2(e,t,r))}function cO(e,t){e.min=t.min,e.max=t.max}function Rs(e,t){cO(e.x,t.x),cO(e.y,t.y)}function dO(e,t,n,r,i){return e-=t,e=c5(e,1/n,r),i!==void 0&&(e=c5(e,1/i,r)),e}function Mpe(e,t=0,n=1,r=.5,i,o=e,a=e){if(Ql.test(t)&&(t=parseFloat(t),t=zr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=zr(o.min,o.max,r);e===o&&(s-=t),e.min=dO(e.min,t,n,s,i),e.max=dO(e.max,t,n,s,i)}function fO(e,t,[n,r,i],o,a){Mpe(e,t[n],t[r],t[i],t.scale,o,a)}const Ipe=["x","scaleX","originX"],Rpe=["y","scaleY","originY"];function hO(e,t,n,r){fO(e.x,t,Ipe,n==null?void 0:n.x,r==null?void 0:r.x),fO(e.y,t,Rpe,n==null?void 0:n.y,r==null?void 0:r.y)}function pO(e){return e.translate===0&&e.scale===1}function V$(e){return pO(e.x)&&pO(e.y)}function W$(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function gO(e){return Ma(e.x)/Ma(e.y)}function Dpe(e,t,n=.1){return ek(e,t)<=n}class Npe{constructor(){this.members=[]}add(t){ak(this.members,t),t.scheduleRender()}remove(t){if(sk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){var r;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(i=t.resumingFrom)===null||i===void 0?void 0:(o=i.options).onExitComplete)===null||a===void 0||a.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function mO(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),d&&(r+=`rotateY(${d}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const jpe=(e,t)=>e.depth-t.depth;class Bpe{constructor(){this.children=[],this.isDirty=!1}add(t){ak(this.children,t),this.isDirty=!0}remove(t){sk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jpe),this.isDirty=!1,this.children.forEach(t)}}const vO=["","X","Y","Z"],yO=1e3;let $pe=0;function U$({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=$pe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Wpe),this.nodes.forEach(Upe)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=_$(y,250),Gv.hasAnimatedSinceResize&&(Gv.hasAnimatedSinceResize=!1,this.nodes.forEach(SO))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&h&&(u||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeTargetChanged:b,layout:x})=>{var k,E,_,P,A;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const M=(E=(k=this.options.transition)!==null&&k!==void 0?k:h.getDefaultTransition())!==null&&E!==void 0?E:Xpe,{onLayoutAnimationStart:R,onLayoutAnimationComplete:D}=h.getProps(),j=!this.targetLayout||!W$(this.targetLayout,x)||b,z=!y&&b;if(!((_=this.resumeFrom)===null||_===void 0)&&_.instance||z||y&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,z);const H={...ik(M,"layout"),onPlay:R,onComplete:D};h.shouldReduceMotion&&(H.delay=0,H.type=!1),this.startAnimation(H)}else!y&&this.animationProgress===0&&SO(this),this.isLead()&&((A=(P=this.options).onExitComplete)===null||A===void 0||A.call(P));this.targetLayout=x})}unmount(){var a,s;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(s=this.parent)===null||s===void 0||s.children.delete(this),this.instance=void 0,qh.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(Gpe),this.animationId++)}willUpdate(a=!0){var s,l,u;if(this.root.isUpdateBlocked()){(l=(s=this.options).onExitComplete)===null||l===void 0||l.call(s);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var P;const A=_/1e3;xO(y.x,a.x,A),xO(y.y,a.y,A),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((P=this.relativeParent)===null||P===void 0)&&P.layout)&&(Zv(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ype(this.relativeTarget,this.relativeTargetOrigin,b,A)),x&&(this.animationValues=m,Lpe(m,h,this.latestValues,A,E,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(0)}startAnimation(a){var s,l;this.notifyListeners("animationStart"),(s=this.currentAnimation)===null||s===void 0||s.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(qh.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ys.update(()=>{Gv.hasAnimatedSinceResize=!0,this.currentAnimation=Ppe(0,yO,{...a,onUpdate:u=>{var d;this.mixTargetDelta(u),(d=a.onUpdate)===null||d===void 0||d.call(a,u)},onComplete:()=>{var u;(u=a.onComplete)===null||u===void 0||u.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,yO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:d}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&G$(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||pi();const h=Ma(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+h;const m=Ma(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}Rs(s,l),Kg(s,d),Xv(this.projectionDeltaWithTransform,this.layoutCorrected,s,d)}}registerSharedNode(a,s){var l,u,d;this.sharedNodes.has(a)||this.sharedNodes.set(a,new Npe),this.sharedNodes.get(a).add(s),s.promote({transition:(l=s.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(d=(u=s.options.initialPromotionConfig)===null||u===void 0?void 0:u.shouldPreserveFollowOpacity)===null||d===void 0?void 0:d.call(u,s)})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(bO),this.root.sharedNodes.clear()}}}function Fpe(e){e.updateLayout()}function zpe(e){var t,n,r;const i=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:a}=e.layout,{animationType:s}=e.options,l=i.source!==e.layout.source;s==="size"?Nl(y=>{const b=l?i.measuredBox[y]:i.layoutBox[y],x=Ma(b);b.min=o[y].min,b.max=b.min+x}):G$(s,i.layoutBox,o)&&Nl(y=>{const b=l?i.measuredBox[y]:i.layoutBox[y],x=Ma(o[y]);b.max=b.min+x});const u=Qv();Xv(u,o,i.layoutBox);const d=Qv();l?Xv(d,e.applyTransform(a,!0),i.measuredBox):Xv(d,o,i.layoutBox);const h=!V$(u);let m=!1;if(!e.resumeFrom){const y=e.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:b,layout:x}=y;if(b&&x){const k=pi();Zv(k,i.layoutBox,b.layoutBox);const E=pi();Zv(E,o,x.layoutBox),W$(k,E)||(m=!0)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:d,layoutDelta:u,hasLayoutChanged:h,hasRelativeTargetChanged:m})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function Hpe(e){e.clearSnapshot()}function bO(e){e.clearMeasurements()}function Vpe(e){const{visualElement:t}=e.options;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function SO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Wpe(e){e.resolveTargetDelta()}function Upe(e){e.calcProjection()}function Gpe(e){e.resetRotation()}function qpe(e){e.removeLeadSnapshot()}function xO(e,t,n){e.translate=zr(t.translate,0,n),e.scale=zr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function wO(e,t,n,r){e.min=zr(t.min,n.min,r),e.max=zr(t.max,n.max,r)}function Ype(e,t,n,r){wO(e.x,t.x,n.x,r),wO(e.y,t.y,n.y,r)}function Kpe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Xpe={duration:.45,ease:[.4,0,.1,1]};function Zpe(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function CO(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function Qpe(e){CO(e.x),CO(e.y)}function G$(e,t,n){return e==="position"||e==="preserve-aspect"&&!Dpe(gO(t),gO(n),.2)}const Jpe=U$({attachResizeListener:(e,t)=>WS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_6={current:void 0},ege=U$({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_6.current){const e=new Jpe(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),_6.current=e}return _6.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),tge={...Rhe,...Wfe,...tpe,...Epe},hu=Ice((e,t)=>yde(e,t,tge,xpe,ege));function q$(){const e=w.useRef(!1);return J4(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function nge(){const e=q$(),[t,n]=w.useState(0),r=w.useCallback(()=>{e.current&&n(t+1)},[t]);return[w.useCallback(()=>Ys.postRender(r),[r]),t]}class rge extends w.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ige({children:e,isPresent:t}){const n=w.useId(),r=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0});return w.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${o}px !important; @@ -43,8 +43,8 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con top: ${s}px !important; left: ${l}px !important; } - `),()=>{document.head.removeChild(u)}},[t]),w.createElement(rge,{isPresent:t,childRef:r,sizeRef:i},w.cloneElement(e,{ref:r}))}const k6=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=VS(oge),l=w.useId(),u=w.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:d=>{s.set(d,!0);for(const h of s.values())if(!h)return;r&&r()},register:d=>(s.set(d,!1),()=>s.delete(d))}),o?void 0:[n]);return w.useMemo(()=>{s.forEach((d,h)=>s.set(h,!1))},[n]),w.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=w.createElement(ige,{isPresent:n},e)),w.createElement(y0.Provider,{value:u},e)};function oge(){return new Map}const Hg=e=>e.key||"";function age(e,t){e.forEach(n=>{const r=Hg(n);t.set(r,n)})}function sge(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const af=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",bF(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=nge();const l=w.useContext(B_).forceRender;l&&(s=l);const u=qF(),d=sge(e);let h=d;const m=new Set,y=w.useRef(h),b=w.useRef(new Map).current,x=w.useRef(!0);if(J4(()=>{x.current=!1,age(d,b),y.current=h}),q_(()=>{x.current=!0,b.clear(),m.clear()}),x.current)return w.createElement(w.Fragment,null,h.map(P=>w.createElement(k6,{key:Hg(P),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},P)));h=[...h];const k=y.current.map(Hg),E=d.map(Hg),_=k.length;for(let P=0;P<_;P++){const A=k[P];E.indexOf(A)===-1&&m.add(A)}return a==="wait"&&m.size&&(h=[]),m.forEach(P=>{if(E.indexOf(P)!==-1)return;const A=b.get(P);if(!A)return;const M=k.indexOf(P),R=()=>{b.delete(P),m.delete(P);const D=y.current.findIndex(j=>j.key===P);if(y.current.splice(D,1),!m.size){if(y.current=d,u.current===!1)return;s(),r&&r()}};h.splice(M,0,w.createElement(k6,{key:Hg(A),isPresent:!1,onExitComplete:R,custom:t,presenceAffectsLayout:o,mode:a},A))}),h=h.map(P=>{const A=P.key;return m.has(A)?P:w.createElement(k6,{key:Hg(P),isPresent:!0,presenceAffectsLayout:o,mode:a},P)}),yF!=="production"&&a==="wait"&&h.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),w.createElement(w.Fragment,null,m.size?h:h.map(P=>w.cloneElement(P)))};var Hl=function(){return Hl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function z7(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function lge(){return!1}var uge=e=>{const{condition:t,message:n}=e;t&&lge()&&console.warn(n)},Ph={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Y1={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function H7(e){switch((e==null?void 0:e.direction)??"right"){case"right":return Y1.slideRight;case"left":return Y1.slideLeft;case"bottom":return Y1.slideDown;case"top":return Y1.slideUp;default:return Y1.slideRight}}var Nh={enter:{duration:.2,ease:Ph.easeOut},exit:{duration:.1,ease:Ph.easeIn}},Ks={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},cge=e=>e!=null&&parseInt(e.toString(),10)>0,kO={exit:{height:{duration:.2,ease:Ph.ease},opacity:{duration:.3,ease:Ph.ease}},enter:{height:{duration:.3,ease:Ph.ease},opacity:{duration:.4,ease:Ph.ease}}},dge={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:cge(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(n==null?void 0:n.exit)??Ks.exit(kO.exit,i)}),enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(n==null?void 0:n.enter)??Ks.enter(kO.enter,i)})},KF=w.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:d,...h}=e,[m,y]=w.useState(!1);w.useEffect(()=>{const _=setTimeout(()=>{y(!0)});return()=>clearTimeout(_)},[]),uge({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,x={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:d==null?void 0:d.enter,exit:r?d==null?void 0:d.exit:{...d==null?void 0:d.exit,display:b?"block":"none"}}},k=r?n:!0,E=n||r?"enter":"exit";return N.createElement(af,{initial:!1,custom:x},k&&N.createElement(hu.div,{ref:t,...h,className:Cy("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:x,variants:dge,initial:r?"exit":!1,animate:E,exit:"exit"}))});KF.displayName="Collapse";var fge={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??Ks.enter(Nh.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??Ks.exit(Nh.exit,n),transitionEnd:t==null?void 0:t.exit})},XF={initial:"exit",animate:"enter",exit:"exit",variants:fge},hge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,d=i||r?"enter":"exit",h=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return N.createElement(af,{custom:m},h&&N.createElement(hu.div,{ref:n,className:Cy("chakra-fade",o),custom:m,...XF,animate:d,...u}))});hge.displayName="Fade";var pge={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(n==null?void 0:n.exit)??Ks.exit(Nh.exit,i)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??Ks.enter(Nh.enter,n),transitionEnd:e==null?void 0:e.enter})},ZF={initial:"exit",animate:"enter",exit:"exit",variants:pge},gge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:d,...h}=t,m=r?i&&r:!0,y=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:d};return N.createElement(af,{custom:b},m&&N.createElement(hu.div,{ref:n,className:Cy("chakra-offset-slide",s),...ZF,animate:y,custom:b,...h}))});gge.displayName="ScaleFade";var EO={exit:{duration:.15,ease:Ph.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},mge={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{const{exit:i}=H7({direction:e});return{...i,transition:(t==null?void 0:t.exit)??Ks.exit(EO.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{const{enter:i}=H7({direction:e});return{...i,transition:(n==null?void 0:n.enter)??Ks.enter(EO.enter,r),transitionEnd:t==null?void 0:t.enter}}},QF=w.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:d,motionProps:h,...m}=t,y=H7({direction:r}),b=Object.assign({position:"fixed"},y.position,i),x=o?a&&o:!0,k=a||o?"enter":"exit",E={transitionEnd:u,transition:l,direction:r,delay:d};return N.createElement(af,{custom:E},x&&N.createElement(hu.div,{...m,ref:n,initial:"exit",className:Cy("chakra-slide",s),animate:k,exit:"exit",custom:E,variants:mge,style:b,...h}))});QF.displayName="Slide";var vge={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,x:e,y:t,transition:(n==null?void 0:n.exit)??Ks.exit(Nh.exit,i),transitionEnd:r==null?void 0:r.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??Ks.enter(Nh.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{const a={x:t,y:e};return{opacity:0,transition:(n==null?void 0:n.exit)??Ks.exit(Nh.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},V7={initial:"initial",animate:"enter",exit:"exit",variants:vge},yge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:d,delay:h,...m}=t,y=r?i&&r:!0,b=i||r?"enter":"exit",x={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:d,delay:h};return N.createElement(af,{custom:x},y&&N.createElement(hu.div,{ref:n,className:Cy("chakra-offset-slide",a),custom:x,...V7,animate:b,...m}))});yge.displayName="SlideFade";var _y=(...e)=>e.filter(Boolean).join(" ");function bge(){return!1}var XS=e=>{const{condition:t,message:n}=e;t&&bge()&&console.warn(n)};function E6(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Sge,ZS]=Pn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[xge,uk]=Pn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[wge,pze,Cge,_ge]=SB(),Yg=Ae(function(t,n){const{getButtonProps:r}=uk(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...ZS().button};return N.createElement(Ce.button,{...i,className:_y("chakra-accordion__button",t.className),__css:a})});Yg.displayName="AccordionButton";function kge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Tge(e),Lge(e);const s=Cge(),[l,u]=w.useState(-1);w.useEffect(()=>()=>{u(-1)},[]);const[d,h]=FS({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:d,setIndex:h,htmlProps:a,getAccordionItemProps:y=>{let b=!1;return y!==null&&(b=Array.isArray(d)?d.includes(y):d===y),{isOpen:b,onChange:k=>{if(y!==null)if(i&&Array.isArray(d)){const E=k?d.concat(y):d.filter(_=>_!==y);h(E)}else k?h(y):o&&h(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[Ege,ck]=Pn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Pge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=ck(),s=w.useRef(null),l=w.useId(),u=r??l,d=`accordion-button-${u}`,h=`accordion-panel-${u}`;Age(e);const{register:m,index:y,descendants:b}=_ge({disabled:t&&!n}),{isOpen:x,onChange:k}=o(y===-1?null:y);Oge({isOpen:x,isDisabled:t});const E=()=>{k==null||k(!0)},_=()=>{k==null||k(!1)},P=w.useCallback(()=>{k==null||k(!x),a(y)},[y,a,x,k]),A=w.useCallback(j=>{const H={ArrowDown:()=>{const K=b.nextEnabled(y);K==null||K.node.focus()},ArrowUp:()=>{const K=b.prevEnabled(y);K==null||K.node.focus()},Home:()=>{const K=b.firstEnabled();K==null||K.node.focus()},End:()=>{const K=b.lastEnabled();K==null||K.node.focus()}}[j.key];H&&(j.preventDefault(),H(j))},[b,y]),M=w.useCallback(()=>{a(y)},[a,y]),R=w.useCallback(function(z={},H=null){return{...z,type:"button",ref:Hn(m,s,H),id:d,disabled:!!t,"aria-expanded":!!x,"aria-controls":h,onClick:E6(z.onClick,P),onFocus:E6(z.onFocus,M),onKeyDown:E6(z.onKeyDown,A)}},[d,t,x,P,M,A,h,m]),D=w.useCallback(function(z={},H=null){return{...z,ref:H,role:"region",id:h,"aria-labelledby":d,hidden:!x}},[d,x,h]);return{isOpen:x,isDisabled:t,isFocusable:n,onOpen:E,onClose:_,getButtonProps:R,getPanelProps:D,htmlProps:i}}function Tge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;XS({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function Lge(e){XS({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function Age(e){XS({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. - `})}function Oge(e){XS({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Kg(e){const{isOpen:t,isDisabled:n}=uk(),{reduceMotion:r}=ck(),i=_y("chakra-accordion__icon",e.className),o=ZS(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return N.createElement(Na,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))}Kg.displayName="AccordionIcon";var Xg=Ae(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Pge(t),l={...ZS().container,overflowAnchor:"none"},u=w.useMemo(()=>a,[a]);return N.createElement(xge,{value:u},N.createElement(Ce.div,{ref:n,...o,className:_y("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});Xg.displayName="AccordionItem";var Zg=Ae(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=ck(),{getPanelProps:s,isOpen:l}=uk(),u=s(o,n),d=_y("chakra-accordion__panel",r),h=ZS();a||delete u.hidden;const m=N.createElement(Ce.div,{...u,__css:h.panel,className:d});return a?m:N.createElement(KF,{in:l,...i},m)});Zg.displayName="AccordionPanel";var dk=Ae(function({children:t,reduceMotion:n,...r},i){const o=Oi("Accordion",r),a=Sn(r),{htmlProps:s,descendants:l,...u}=kge(a),d=w.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return N.createElement(wge,{value:l},N.createElement(Ege,{value:d},N.createElement(Sge,{value:o},N.createElement(Ce.div,{ref:i,...s,className:_y("chakra-accordion",r.className),__css:o.root},t))))});dk.displayName="Accordion";var Mge=(...e)=>e.filter(Boolean).join(" "),Ige=of({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),ky=Ae((e,t)=>{const n=Oo("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=Sn(e),u=Mge("chakra-spinner",s),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${Ige} ${o} linear infinite`,...n};return N.createElement(Ce.div,{ref:t,__css:d,className:u,...l},r&&N.createElement(Ce.span,{srOnly:!0},r))});ky.displayName="Spinner";var QS=(...e)=>e.filter(Boolean).join(" ");function Rge(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}))}function Dge(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}))}function PO(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))}var[Nge,jge]=Pn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[Bge,fk]=Pn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),JF={info:{icon:Dge,colorScheme:"blue"},warning:{icon:PO,colorScheme:"orange"},success:{icon:Rge,colorScheme:"green"},error:{icon:PO,colorScheme:"red"},loading:{icon:ky,colorScheme:"blue"}};function Fge(e){return JF[e].colorScheme}function $ge(e){return JF[e].icon}var e$=Ae(function(t,n){const{status:r="info",addRole:i=!0,...o}=Sn(t),a=t.colorScheme??Fge(r),s=Oi("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return N.createElement(Nge,{value:{status:r}},N.createElement(Bge,{value:s},N.createElement(Ce.div,{role:i?"alert":void 0,ref:n,...o,className:QS("chakra-alert",t.className),__css:l})))});e$.displayName="Alert";var t$=Ae(function(t,n){const i={display:"inline",...fk().description};return N.createElement(Ce.div,{ref:n,...t,className:QS("chakra-alert__desc",t.className),__css:i})});t$.displayName="AlertDescription";function n$(e){const{status:t}=jge(),n=$ge(t),r=fk(),i=t==="loading"?r.spinner:r.icon;return N.createElement(Ce.span,{display:"inherit",...e,className:QS("chakra-alert__icon",e.className),__css:i},e.children||N.createElement(n,{h:"100%",w:"100%"}))}n$.displayName="AlertIcon";var r$=Ae(function(t,n){const r=fk();return N.createElement(Ce.div,{ref:n,...t,className:QS("chakra-alert__title",t.className),__css:r.title})});r$.displayName="AlertTitle";function zge(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Hge(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,d]=w.useState("pending");w.useEffect(()=>{d(n?"loading":"pending")},[n]);const h=w.useRef(),m=w.useCallback(()=>{if(!n)return;y();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=x=>{y(),d("loaded"),i==null||i(x)},b.onerror=x=>{y(),d("failed"),o==null||o(x)},h.current=b},[n,a,r,s,i,o,t]),y=()=>{h.current&&(h.current.onload=null,h.current.onerror=null,h.current=null)};return Gs(()=>{if(!l)return u==="loading"&&m(),()=>{y()}},[u,m,l]),l?"loaded":u}var Vge=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",d5=Ae(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return N.createElement("img",{width:r,height:i,ref:n,alt:o,...a})});d5.displayName="NativeImage";var JS=Ae(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:d,crossOrigin:h,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:y,...b}=t,x=r!==void 0||i!==void 0,k=u!=null||d||!x,E=Hge({...t,ignoreFallback:k}),_=Vge(E,m),P={ref:n,objectFit:l,objectPosition:s,...k?b:zge(b,["onError","onLoad"])};return _?i||N.createElement(Ce.img,{as:d5,className:"chakra-image__placeholder",src:r,...P}):N.createElement(Ce.img,{as:d5,src:o,srcSet:a,crossOrigin:h,loading:u,referrerPolicy:y,className:"chakra-image",...P})});JS.displayName="Image";Ae((e,t)=>N.createElement(Ce.img,{ref:t,as:d5,className:"chakra-image",...e}));function ex(e){return w.Children.toArray(e).filter(t=>w.isValidElement(t))}var tx=(...e)=>e.filter(Boolean).join(" "),TO=e=>e?"":void 0,[Wge,Uge]=Pn({strict:!1,name:"ButtonGroupContext"});function W7(e){const{children:t,className:n,...r}=e,i=w.isValidElement(t)?w.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=tx("chakra-button__icon",n);return N.createElement(Ce.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}W7.displayName="ButtonIcon";function U7(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=N.createElement(ky,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=tx("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",d=w.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return N.createElement(Ce.div,{className:l,...s,__css:d},i)}U7.displayName="ButtonSpinner";function Gge(e){const[t,n]=w.useState(!e);return{ref:w.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var ls=Ae((e,t)=>{const n=Uge(),r=Oo("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:d,iconSpacing:h="0.5rem",type:m,spinner:y,spinnerPlacement:b="start",className:x,as:k,...E}=Sn(e),_=w.useMemo(()=>{const R={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:R}}},[r,n]),{ref:P,type:A}=Gge(k),M={rightIcon:u,leftIcon:l,iconSpacing:h,children:s};return N.createElement(Ce.button,{disabled:i||o,ref:pce(t,P),as:k,type:m??A,"data-active":TO(a),"data-loading":TO(o),__css:_,className:tx("chakra-button",x),...E},o&&b==="start"&&N.createElement(U7,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:h},y),o?d||N.createElement(Ce.span,{opacity:0},N.createElement(LO,{...M})):N.createElement(LO,{...M}),o&&b==="end"&&N.createElement(U7,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:h},y))});ls.displayName="Button";function LO(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return N.createElement(N.Fragment,null,t&&N.createElement(W7,{marginEnd:i},t),r,n&&N.createElement(W7,{marginStart:i},n))}var oo=Ae(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...d}=t,h=tx("chakra-button__group",a),m=w.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let y={display:"inline-flex"};return l?y={...y,"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}}:y={...y,"& > *:not(style) ~ *:not(style)":{marginStart:s}},N.createElement(Wge,{value:m},N.createElement(Ce.div,{ref:n,role:"group",__css:y,className:h,"data-attached":l?"":void 0,...d}))});oo.displayName="ButtonGroup";var us=Ae((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=w.isValidElement(s)?w.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return N.createElement(ls,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a},l)});us.displayName="IconButton";var w0=(...e)=>e.filter(Boolean).join(" "),rb=e=>e?"":void 0,P6=e=>e?!0:void 0;function AO(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[qge,i$]=Pn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Yge,sp]=Pn({strict:!1,name:"FormControlContext"});function Kge(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=w.useId(),l=t||`field-${s}`,u=`${l}-label`,d=`${l}-feedback`,h=`${l}-helptext`,[m,y]=w.useState(!1),[b,x]=w.useState(!1),[k,E]=w.useState(!1),_=w.useCallback((D={},j=null)=>({id:h,...D,ref:Hn(j,z=>{z&&x(!0)})}),[h]),P=w.useCallback((D={},j=null)=>({...D,ref:j,"data-focus":rb(k),"data-disabled":rb(i),"data-invalid":rb(r),"data-readonly":rb(o),id:D.id??u,htmlFor:D.htmlFor??l}),[l,i,k,r,o,u]),A=w.useCallback((D={},j=null)=>({id:d,...D,ref:Hn(j,z=>{z&&y(!0)}),"aria-live":"polite"}),[d]),M=w.useCallback((D={},j=null)=>({...D,...a,ref:j,role:"group"}),[a]),R=w.useCallback((D={},j=null)=>({...D,ref:j,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!k,onFocus:()=>E(!0),onBlur:()=>E(!1),hasFeedbackText:m,setHasFeedbackText:y,hasHelpText:b,setHasHelpText:x,id:l,labelId:u,feedbackId:d,helpTextId:h,htmlProps:a,getHelpTextProps:_,getErrorMessageProps:A,getRootProps:M,getLabelProps:P,getRequiredIndicatorProps:R}}var fn=Ae(function(t,n){const r=Oi("Form",t),i=Sn(t),{getRootProps:o,htmlProps:a,...s}=Kge(i),l=w0("chakra-form-control",t.className);return N.createElement(Yge,{value:s},N.createElement(qge,{value:r},N.createElement(Ce.div,{...o({},n),className:l,__css:r.container})))});fn.displayName="FormControl";var ur=Ae(function(t,n){const r=sp(),i=i$(),o=w0("chakra-form__helper-text",t.className);return N.createElement(Ce.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});ur.displayName="FormHelperText";function hk(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=pk(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":P6(n),"aria-required":P6(i),"aria-readonly":P6(r)}}function pk(e){const t=sp(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:d,onBlur:h,...m}=e,y=e["aria-describedby"]?[e["aria-describedby"]]:[];return t!=null&&t.hasFeedbackText&&(t!=null&&t.isInvalid)&&y.push(t.feedbackId),t!=null&&t.hasHelpText&&y.push(t.helpTextId),{...m,"aria-describedby":y.join(" ")||void 0,id:n??(t==null?void 0:t.id),isDisabled:r??u??(t==null?void 0:t.isDisabled),isReadOnly:i??l??(t==null?void 0:t.isReadOnly),isRequired:o??a??(t==null?void 0:t.isRequired),isInvalid:s??(t==null?void 0:t.isInvalid),onFocus:AO(t==null?void 0:t.onFocus,d),onBlur:AO(t==null?void 0:t.onBlur,h)}}var[Xge,Zge]=Pn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),cr=Ae((e,t)=>{const n=Oi("FormError",e),r=Sn(e),i=sp();return i!=null&&i.isInvalid?N.createElement(Xge,{value:n},N.createElement(Ce.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:w0("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});cr.displayName="FormErrorMessage";var Qge=Ae((e,t)=>{const n=Zge(),r=sp();if(!(r!=null&&r.isInvalid))return null;const i=w0("chakra-form__error-icon",e.className);return N.createElement(Na,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))});Qge.displayName="FormErrorIcon";var En=Ae(function(t,n){const r=Oo("FormLabel",t),i=Sn(t),{className:o,children:a,requiredIndicator:s=N.createElement(o$,null),optionalIndicator:l=null,...u}=i,d=sp(),h=(d==null?void 0:d.getLabelProps(u,n))??{ref:n,...u};return N.createElement(Ce.label,{...h,className:w0("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,d!=null&&d.isRequired?s:l)});En.displayName="FormLabel";var o$=Ae(function(t,n){const r=sp(),i=i$();if(!(r!=null&&r.isRequired))return null;const o=w0("chakra-form__required-indicator",t.className);return N.createElement(Ce.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});o$.displayName="RequiredIndicator";function Gd(e,t){const n=w.useRef(!1),r=w.useRef(!1);w.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var gk={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},Jge=Ce("span",{baseStyle:gk});Jge.displayName="VisuallyHidden";var eme=Ce("input",{baseStyle:gk});eme.displayName="VisuallyHiddenInput";var OO=!1,nx=null,Ym=!1,G7=new Set,tme=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function nme(e){return!(e.metaKey||!tme&&e.altKey||e.ctrlKey)}function mk(e,t){G7.forEach(n=>n(e,t))}function MO(e){Ym=!0,nme(e)&&(nx="keyboard",mk("keyboard",e))}function Eg(e){nx="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ym=!0,mk("pointer",e))}function rme(e){e.target===window||e.target===document||(Ym||(nx="keyboard",mk("keyboard",e)),Ym=!1)}function ime(){Ym=!1}function IO(){return nx!=="pointer"}function ome(){if(typeof window>"u"||OO)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Ym=!0,e.apply(this,n)},document.addEventListener("keydown",MO,!0),document.addEventListener("keyup",MO,!0),window.addEventListener("focus",rme,!0),window.addEventListener("blur",ime,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Eg,!0),document.addEventListener("pointermove",Eg,!0),document.addEventListener("pointerup",Eg,!0)):(document.addEventListener("mousedown",Eg,!0),document.addEventListener("mousemove",Eg,!0),document.addEventListener("mouseup",Eg,!0)),OO=!0}function a$(e){ome(),e(IO());const t=()=>e(IO());return G7.add(t),()=>{G7.delete(t)}}var[gze,ame]=Pn({name:"CheckboxGroupContext",strict:!1}),sme=(...e)=>e.filter(Boolean).join(" "),bo=e=>e?"":void 0;function Ka(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function lme(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function ume(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},N.createElement("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function cme(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},N.createElement("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function dme(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?cme:ume;return n||t?N.createElement(Ce.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},N.createElement(i,{...r})):null}function fme(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function s$(e={}){const t=pk(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:d,isChecked:h,isFocusable:m,onChange:y,isIndeterminate:b,name:x,value:k,tabIndex:E=void 0,"aria-label":_,"aria-labelledby":P,"aria-invalid":A,...M}=e,R=fme(M,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=Er(y),j=Er(s),z=Er(l),[H,K]=w.useState(!1),[te,G]=w.useState(!1),[F,W]=w.useState(!1),[X,Z]=w.useState(!1);w.useEffect(()=>a$(K),[]);const U=w.useRef(null),[Q,re]=w.useState(!0),[fe,Ee]=w.useState(!!d),be=h!==void 0,ye=be?h:fe,ze=w.useCallback(Le=>{if(r||n){Le.preventDefault();return}be||Ee(ye?Le.target.checked:b?!0:Le.target.checked),D==null||D(Le)},[r,n,ye,be,b,D]);Gs(()=>{U.current&&(U.current.indeterminate=Boolean(b))},[b]),Gd(()=>{n&&G(!1)},[n,G]),Gs(()=>{const Le=U.current;Le!=null&&Le.form&&(Le.form.onreset=()=>{Ee(!!d)})},[]);const Me=n&&!m,rt=w.useCallback(Le=>{Le.key===" "&&Z(!0)},[Z]),We=w.useCallback(Le=>{Le.key===" "&&Z(!1)},[Z]);Gs(()=>{if(!U.current)return;U.current.checked!==ye&&Ee(U.current.checked)},[U.current]);const Be=w.useCallback((Le={},ut=null)=>{const Mt=ct=>{te&&ct.preventDefault(),Z(!0)};return{...Le,ref:ut,"data-active":bo(X),"data-hover":bo(F),"data-checked":bo(ye),"data-focus":bo(te),"data-focus-visible":bo(te&&H),"data-indeterminate":bo(b),"data-disabled":bo(n),"data-invalid":bo(o),"data-readonly":bo(r),"aria-hidden":!0,onMouseDown:Ka(Le.onMouseDown,Mt),onMouseUp:Ka(Le.onMouseUp,()=>Z(!1)),onMouseEnter:Ka(Le.onMouseEnter,()=>W(!0)),onMouseLeave:Ka(Le.onMouseLeave,()=>W(!1))}},[X,ye,n,te,H,F,b,o,r]),wt=w.useCallback((Le={},ut=null)=>({...R,...Le,ref:Hn(ut,Mt=>{Mt&&re(Mt.tagName==="LABEL")}),onClick:Ka(Le.onClick,()=>{var Mt;Q||((Mt=U.current)==null||Mt.click(),requestAnimationFrame(()=>{var ct;(ct=U.current)==null||ct.focus()}))}),"data-disabled":bo(n),"data-checked":bo(ye),"data-invalid":bo(o)}),[R,n,ye,o,Q]),Fe=w.useCallback((Le={},ut=null)=>({...Le,ref:Hn(U,ut),type:"checkbox",name:x,value:k,id:a,tabIndex:E,onChange:Ka(Le.onChange,ze),onBlur:Ka(Le.onBlur,j,()=>G(!1)),onFocus:Ka(Le.onFocus,z,()=>G(!0)),onKeyDown:Ka(Le.onKeyDown,rt),onKeyUp:Ka(Le.onKeyUp,We),required:i,checked:ye,disabled:Me,readOnly:r,"aria-label":_,"aria-labelledby":P,"aria-invalid":A?Boolean(A):o,"aria-describedby":u,"aria-disabled":n,style:gk}),[x,k,a,ze,j,z,rt,We,i,ye,Me,r,_,P,A,o,u,n,E]),at=w.useCallback((Le={},ut=null)=>({...Le,ref:ut,onMouseDown:Ka(Le.onMouseDown,RO),onTouchStart:Ka(Le.onTouchStart,RO),"data-disabled":bo(n),"data-checked":bo(ye),"data-invalid":bo(o)}),[ye,n,o]);return{state:{isInvalid:o,isFocused:te,isChecked:ye,isActive:X,isHovered:F,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:wt,getCheckboxProps:Be,getInputProps:Fe,getLabelProps:at,htmlProps:R}}function RO(e){e.preventDefault(),e.stopPropagation()}var hme={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},pme={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},gme=of({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),mme=of({from:{opacity:0},to:{opacity:1}}),vme=of({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),l$=Ae(function(t,n){const r=ame(),i={...r,...t},o=Oi("Checkbox",i),a=Sn(t),{spacing:s="0.5rem",className:l,children:u,iconColor:d,iconSize:h,icon:m=N.createElement(dme,null),isChecked:y,isDisabled:b=r==null?void 0:r.isDisabled,onChange:x,inputProps:k,...E}=a;let _=y;r!=null&&r.value&&a.value&&(_=r.value.includes(a.value));let P=x;r!=null&&r.onChange&&a.value&&(P=lme(r.onChange,x));const{state:A,getInputProps:M,getCheckboxProps:R,getLabelProps:D,getRootProps:j}=s$({...E,isDisabled:b,isChecked:_,onChange:P}),z=w.useMemo(()=>({animation:A.isIndeterminate?`${mme} 20ms linear, ${vme} 200ms linear`:`${gme} 200ms linear`,fontSize:h,color:d,...o.icon}),[d,h,,A.isIndeterminate,o.icon]),H=w.cloneElement(m,{__css:z,isIndeterminate:A.isIndeterminate,isChecked:A.isChecked});return N.createElement(Ce.label,{__css:{...pme,...o.container},className:sme("chakra-checkbox",l),...j()},N.createElement("input",{className:"chakra-checkbox__input",...M(k,n)}),N.createElement(Ce.span,{__css:{...hme,...o.control},className:"chakra-checkbox__control",...R()},H),u&&N.createElement(Ce.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:s,...o.label}},u))});l$.displayName="Checkbox";function yme(e){return N.createElement(Na,{focusable:"false","aria-hidden":!0,...e},N.createElement("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}))}var rx=Ae(function(t,n){const r=Oo("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=Sn(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return N.createElement(Ce.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||N.createElement(yme,{width:"1em",height:"1em"}))});rx.displayName="CloseButton";function bme(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function vk(e,t){let n=bme(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function q7(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function f5(e,t,n){return(e-t)*100/(n-t)}function u$(e,t,n){return(n-t)*e+t}function Y7(e,t,n){const r=Math.round((e-t)/n)*n+t,i=q7(n);return vk(r,i)}function Pm(e,t,n){return e==null?e:(nr==null?"":T6(r,o,n)??""),m=typeof i<"u",y=m?i:d,b=c$(hd(y),o),x=n??b,k=w.useCallback(H=>{H!==y&&(m||h(H.toString()),u==null||u(H.toString(),hd(H)))},[u,m,y]),E=w.useCallback(H=>{let K=H;return l&&(K=Pm(K,a,s)),vk(K,x)},[x,l,s,a]),_=w.useCallback((H=o)=>{let K;y===""?K=hd(H):K=hd(y)+H,K=E(K),k(K)},[E,o,k,y]),P=w.useCallback((H=o)=>{let K;y===""?K=hd(-H):K=hd(y)-H,K=E(K),k(K)},[E,o,k,y]),A=w.useCallback(()=>{let H;r==null?H="":H=T6(r,o,n)??a,k(H)},[r,n,o,k,a]),M=w.useCallback(H=>{const K=T6(H,o,x)??a;k(K)},[x,o,k,a]),R=hd(y);return{isOutOfRange:R>s||R{document.head.removeChild(u)}},[t]),w.createElement(rge,{isPresent:t,childRef:r,sizeRef:i},w.cloneElement(e,{ref:r}))}const k6=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=VS(oge),l=w.useId(),u=w.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:d=>{s.set(d,!0);for(const h of s.values())if(!h)return;r&&r()},register:d=>(s.set(d,!1),()=>s.delete(d))}),o?void 0:[n]);return w.useMemo(()=>{s.forEach((d,h)=>s.set(h,!1))},[n]),w.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=w.createElement(ige,{isPresent:n},e)),w.createElement(b0.Provider,{value:u},e)};function oge(){return new Map}const Vg=e=>e.key||"";function age(e,t){e.forEach(n=>{const r=Vg(n);t.set(r,n)})}function sge(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const sf=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",b$(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=nge();const l=w.useContext(B_).forceRender;l&&(s=l);const u=q$(),d=sge(e);let h=d;const m=new Set,y=w.useRef(h),b=w.useRef(new Map).current,x=w.useRef(!0);if(J4(()=>{x.current=!1,age(d,b),y.current=h}),q_(()=>{x.current=!0,b.clear(),m.clear()}),x.current)return w.createElement(w.Fragment,null,h.map(P=>w.createElement(k6,{key:Vg(P),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},P)));h=[...h];const k=y.current.map(Vg),E=d.map(Vg),_=k.length;for(let P=0;P<_;P++){const A=k[P];E.indexOf(A)===-1&&m.add(A)}return a==="wait"&&m.size&&(h=[]),m.forEach(P=>{if(E.indexOf(P)!==-1)return;const A=b.get(P);if(!A)return;const M=k.indexOf(P),R=()=>{b.delete(P),m.delete(P);const D=y.current.findIndex(j=>j.key===P);if(y.current.splice(D,1),!m.size){if(y.current=d,u.current===!1)return;s(),r&&r()}};h.splice(M,0,w.createElement(k6,{key:Vg(A),isPresent:!1,onExitComplete:R,custom:t,presenceAffectsLayout:o,mode:a},A))}),h=h.map(P=>{const A=P.key;return m.has(A)?P:w.createElement(k6,{key:Vg(P),isPresent:!0,presenceAffectsLayout:o,mode:a},P)}),y$!=="production"&&a==="wait"&&h.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),w.createElement(w.Fragment,null,m.size?h:h.map(P=>w.cloneElement(P)))};var Hl=function(){return Hl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function z7(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function lge(){return!1}var uge=e=>{const{condition:t,message:n}=e;t&&lge()&&console.warn(n)},Th={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},K1={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function H7(e){switch((e==null?void 0:e.direction)??"right"){case"right":return K1.slideRight;case"left":return K1.slideLeft;case"bottom":return K1.slideDown;case"top":return K1.slideUp;default:return K1.slideRight}}var jh={enter:{duration:.2,ease:Th.easeOut},exit:{duration:.1,ease:Th.easeIn}},Ks={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},cge=e=>e!=null&&parseInt(e.toString(),10)>0,kO={exit:{height:{duration:.2,ease:Th.ease},opacity:{duration:.3,ease:Th.ease}},enter:{height:{duration:.3,ease:Th.ease},opacity:{duration:.4,ease:Th.ease}}},dge={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:cge(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(n==null?void 0:n.exit)??Ks.exit(kO.exit,i)}),enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(n==null?void 0:n.enter)??Ks.enter(kO.enter,i)})},K$=w.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:d,...h}=e,[m,y]=w.useState(!1);w.useEffect(()=>{const _=setTimeout(()=>{y(!0)});return()=>clearTimeout(_)},[]),uge({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,x={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:d==null?void 0:d.enter,exit:r?d==null?void 0:d.exit:{...d==null?void 0:d.exit,display:b?"block":"none"}}},k=r?n:!0,E=n||r?"enter":"exit";return N.createElement(sf,{initial:!1,custom:x},k&&N.createElement(hu.div,{ref:t,...h,className:ky("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:x,variants:dge,initial:r?"exit":!1,animate:E,exit:"exit"}))});K$.displayName="Collapse";var fge={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??Ks.enter(jh.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??Ks.exit(jh.exit,n),transitionEnd:t==null?void 0:t.exit})},X$={initial:"exit",animate:"enter",exit:"exit",variants:fge},hge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,d=i||r?"enter":"exit",h=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return N.createElement(sf,{custom:m},h&&N.createElement(hu.div,{ref:n,className:ky("chakra-fade",o),custom:m,...X$,animate:d,...u}))});hge.displayName="Fade";var pge={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(n==null?void 0:n.exit)??Ks.exit(jh.exit,i)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??Ks.enter(jh.enter,n),transitionEnd:e==null?void 0:e.enter})},Z$={initial:"exit",animate:"enter",exit:"exit",variants:pge},gge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:d,...h}=t,m=r?i&&r:!0,y=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:d};return N.createElement(sf,{custom:b},m&&N.createElement(hu.div,{ref:n,className:ky("chakra-offset-slide",s),...Z$,animate:y,custom:b,...h}))});gge.displayName="ScaleFade";var EO={exit:{duration:.15,ease:Th.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},mge={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{const{exit:i}=H7({direction:e});return{...i,transition:(t==null?void 0:t.exit)??Ks.exit(EO.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{const{enter:i}=H7({direction:e});return{...i,transition:(n==null?void 0:n.enter)??Ks.enter(EO.enter,r),transitionEnd:t==null?void 0:t.enter}}},Q$=w.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:d,motionProps:h,...m}=t,y=H7({direction:r}),b=Object.assign({position:"fixed"},y.position,i),x=o?a&&o:!0,k=a||o?"enter":"exit",E={transitionEnd:u,transition:l,direction:r,delay:d};return N.createElement(sf,{custom:E},x&&N.createElement(hu.div,{...m,ref:n,initial:"exit",className:ky("chakra-slide",s),animate:k,exit:"exit",custom:E,variants:mge,style:b,...h}))});Q$.displayName="Slide";var vge={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,x:e,y:t,transition:(n==null?void 0:n.exit)??Ks.exit(jh.exit,i),transitionEnd:r==null?void 0:r.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??Ks.enter(jh.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{const a={x:t,y:e};return{opacity:0,transition:(n==null?void 0:n.exit)??Ks.exit(jh.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},V7={initial:"initial",animate:"enter",exit:"exit",variants:vge},yge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:d,delay:h,...m}=t,y=r?i&&r:!0,b=i||r?"enter":"exit",x={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:d,delay:h};return N.createElement(sf,{custom:x},y&&N.createElement(hu.div,{ref:n,className:ky("chakra-offset-slide",a),custom:x,...V7,animate:b,...m}))});yge.displayName="SlideFade";var Ey=(...e)=>e.filter(Boolean).join(" ");function bge(){return!1}var XS=e=>{const{condition:t,message:n}=e;t&&bge()&&console.warn(n)};function E6(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Sge,ZS]=Pn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[xge,uk]=Pn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[wge,gze,Cge,_ge]=SB(),Xg=Ae(function(t,n){const{getButtonProps:r}=uk(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...ZS().button};return N.createElement(we.button,{...i,className:Ey("chakra-accordion__button",t.className),__css:a})});Xg.displayName="AccordionButton";function kge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Tge(e),Lge(e);const s=Cge(),[l,u]=w.useState(-1);w.useEffect(()=>()=>{u(-1)},[]);const[d,h]=$S({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:d,setIndex:h,htmlProps:a,getAccordionItemProps:y=>{let b=!1;return y!==null&&(b=Array.isArray(d)?d.includes(y):d===y),{isOpen:b,onChange:k=>{if(y!==null)if(i&&Array.isArray(d)){const E=k?d.concat(y):d.filter(_=>_!==y);h(E)}else k?h(y):o&&h(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[Ege,ck]=Pn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Pge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=ck(),s=w.useRef(null),l=w.useId(),u=r??l,d=`accordion-button-${u}`,h=`accordion-panel-${u}`;Age(e);const{register:m,index:y,descendants:b}=_ge({disabled:t&&!n}),{isOpen:x,onChange:k}=o(y===-1?null:y);Oge({isOpen:x,isDisabled:t});const E=()=>{k==null||k(!0)},_=()=>{k==null||k(!1)},P=w.useCallback(()=>{k==null||k(!x),a(y)},[y,a,x,k]),A=w.useCallback(j=>{const H={ArrowDown:()=>{const K=b.nextEnabled(y);K==null||K.node.focus()},ArrowUp:()=>{const K=b.prevEnabled(y);K==null||K.node.focus()},Home:()=>{const K=b.firstEnabled();K==null||K.node.focus()},End:()=>{const K=b.lastEnabled();K==null||K.node.focus()}}[j.key];H&&(j.preventDefault(),H(j))},[b,y]),M=w.useCallback(()=>{a(y)},[a,y]),R=w.useCallback(function(z={},H=null){return{...z,type:"button",ref:Hn(m,s,H),id:d,disabled:!!t,"aria-expanded":!!x,"aria-controls":h,onClick:E6(z.onClick,P),onFocus:E6(z.onFocus,M),onKeyDown:E6(z.onKeyDown,A)}},[d,t,x,P,M,A,h,m]),D=w.useCallback(function(z={},H=null){return{...z,ref:H,role:"region",id:h,"aria-labelledby":d,hidden:!x}},[d,x,h]);return{isOpen:x,isDisabled:t,isFocusable:n,onOpen:E,onClose:_,getButtonProps:R,getPanelProps:D,htmlProps:i}}function Tge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;XS({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function Lge(e){XS({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function Age(e){XS({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. + `})}function Oge(e){XS({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Zg(e){const{isOpen:t,isDisabled:n}=uk(),{reduceMotion:r}=ck(),i=Ey("chakra-accordion__icon",e.className),o=ZS(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return N.createElement(Na,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))}Zg.displayName="AccordionIcon";var Qg=Ae(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Pge(t),l={...ZS().container,overflowAnchor:"none"},u=w.useMemo(()=>a,[a]);return N.createElement(xge,{value:u},N.createElement(we.div,{ref:n,...o,className:Ey("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});Qg.displayName="AccordionItem";var Jg=Ae(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=ck(),{getPanelProps:s,isOpen:l}=uk(),u=s(o,n),d=Ey("chakra-accordion__panel",r),h=ZS();a||delete u.hidden;const m=N.createElement(we.div,{...u,__css:h.panel,className:d});return a?m:N.createElement(K$,{in:l,...i},m)});Jg.displayName="AccordionPanel";var dk=Ae(function({children:t,reduceMotion:n,...r},i){const o=Mi("Accordion",r),a=Sn(r),{htmlProps:s,descendants:l,...u}=kge(a),d=w.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return N.createElement(wge,{value:l},N.createElement(Ege,{value:d},N.createElement(Sge,{value:o},N.createElement(we.div,{ref:i,...s,className:Ey("chakra-accordion",r.className),__css:o.root},t))))});dk.displayName="Accordion";var Mge=(...e)=>e.filter(Boolean).join(" "),Ige=af({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Py=Ae((e,t)=>{const n=Oo("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=Sn(e),u=Mge("chakra-spinner",s),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${Ige} ${o} linear infinite`,...n};return N.createElement(we.div,{ref:t,__css:d,className:u,...l},r&&N.createElement(we.span,{srOnly:!0},r))});Py.displayName="Spinner";var QS=(...e)=>e.filter(Boolean).join(" ");function Rge(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}))}function Dge(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}))}function PO(e){return N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))}var[Nge,jge]=Pn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[Bge,fk]=Pn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),J$={info:{icon:Dge,colorScheme:"blue"},warning:{icon:PO,colorScheme:"orange"},success:{icon:Rge,colorScheme:"green"},error:{icon:PO,colorScheme:"red"},loading:{icon:Py,colorScheme:"blue"}};function $ge(e){return J$[e].colorScheme}function Fge(e){return J$[e].icon}var eF=Ae(function(t,n){const{status:r="info",addRole:i=!0,...o}=Sn(t),a=t.colorScheme??$ge(r),s=Mi("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return N.createElement(Nge,{value:{status:r}},N.createElement(Bge,{value:s},N.createElement(we.div,{role:i?"alert":void 0,ref:n,...o,className:QS("chakra-alert",t.className),__css:l})))});eF.displayName="Alert";var tF=Ae(function(t,n){const i={display:"inline",...fk().description};return N.createElement(we.div,{ref:n,...t,className:QS("chakra-alert__desc",t.className),__css:i})});tF.displayName="AlertDescription";function nF(e){const{status:t}=jge(),n=Fge(t),r=fk(),i=t==="loading"?r.spinner:r.icon;return N.createElement(we.span,{display:"inherit",...e,className:QS("chakra-alert__icon",e.className),__css:i},e.children||N.createElement(n,{h:"100%",w:"100%"}))}nF.displayName="AlertIcon";var rF=Ae(function(t,n){const r=fk();return N.createElement(we.div,{ref:n,...t,className:QS("chakra-alert__title",t.className),__css:r.title})});rF.displayName="AlertTitle";function zge(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Hge(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,d]=w.useState("pending");w.useEffect(()=>{d(n?"loading":"pending")},[n]);const h=w.useRef(),m=w.useCallback(()=>{if(!n)return;y();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=x=>{y(),d("loaded"),i==null||i(x)},b.onerror=x=>{y(),d("failed"),o==null||o(x)},h.current=b},[n,a,r,s,i,o,t]),y=()=>{h.current&&(h.current.onload=null,h.current.onerror=null,h.current=null)};return Gs(()=>{if(!l)return u==="loading"&&m(),()=>{y()}},[u,m,l]),l?"loaded":u}var Vge=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",d5=Ae(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return N.createElement("img",{width:r,height:i,ref:n,alt:o,...a})});d5.displayName="NativeImage";var JS=Ae(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:d,crossOrigin:h,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:y,...b}=t,x=r!==void 0||i!==void 0,k=u!=null||d||!x,E=Hge({...t,ignoreFallback:k}),_=Vge(E,m),P={ref:n,objectFit:l,objectPosition:s,...k?b:zge(b,["onError","onLoad"])};return _?i||N.createElement(we.img,{as:d5,className:"chakra-image__placeholder",src:r,...P}):N.createElement(we.img,{as:d5,src:o,srcSet:a,crossOrigin:h,loading:u,referrerPolicy:y,className:"chakra-image",...P})});JS.displayName="Image";Ae((e,t)=>N.createElement(we.img,{ref:t,as:d5,className:"chakra-image",...e}));function ex(e){return w.Children.toArray(e).filter(t=>w.isValidElement(t))}var tx=(...e)=>e.filter(Boolean).join(" "),TO=e=>e?"":void 0,[Wge,Uge]=Pn({strict:!1,name:"ButtonGroupContext"});function W7(e){const{children:t,className:n,...r}=e,i=w.isValidElement(t)?w.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=tx("chakra-button__icon",n);return N.createElement(we.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}W7.displayName="ButtonIcon";function U7(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=N.createElement(Py,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=tx("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",d=w.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return N.createElement(we.div,{className:l,...s,__css:d},i)}U7.displayName="ButtonSpinner";function Gge(e){const[t,n]=w.useState(!e);return{ref:w.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var ls=Ae((e,t)=>{const n=Uge(),r=Oo("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:d,iconSpacing:h="0.5rem",type:m,spinner:y,spinnerPlacement:b="start",className:x,as:k,...E}=Sn(e),_=w.useMemo(()=>{const R={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:R}}},[r,n]),{ref:P,type:A}=Gge(k),M={rightIcon:u,leftIcon:l,iconSpacing:h,children:s};return N.createElement(we.button,{disabled:i||o,ref:pce(t,P),as:k,type:m??A,"data-active":TO(a),"data-loading":TO(o),__css:_,className:tx("chakra-button",x),...E},o&&b==="start"&&N.createElement(U7,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:h},y),o?d||N.createElement(we.span,{opacity:0},N.createElement(LO,{...M})):N.createElement(LO,{...M}),o&&b==="end"&&N.createElement(U7,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:h},y))});ls.displayName="Button";function LO(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return N.createElement(N.Fragment,null,t&&N.createElement(W7,{marginEnd:i},t),r,n&&N.createElement(W7,{marginStart:i},n))}var ao=Ae(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...d}=t,h=tx("chakra-button__group",a),m=w.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let y={display:"inline-flex"};return l?y={...y,"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}}:y={...y,"& > *:not(style) ~ *:not(style)":{marginStart:s}},N.createElement(Wge,{value:m},N.createElement(we.div,{ref:n,role:"group",__css:y,className:h,"data-attached":l?"":void 0,...d}))});ao.displayName="ButtonGroup";var us=Ae((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=w.isValidElement(s)?w.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return N.createElement(ls,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a},l)});us.displayName="IconButton";var C0=(...e)=>e.filter(Boolean).join(" "),ob=e=>e?"":void 0,P6=e=>e?!0:void 0;function AO(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[qge,iF]=Pn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Yge,lp]=Pn({strict:!1,name:"FormControlContext"});function Kge(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=w.useId(),l=t||`field-${s}`,u=`${l}-label`,d=`${l}-feedback`,h=`${l}-helptext`,[m,y]=w.useState(!1),[b,x]=w.useState(!1),[k,E]=w.useState(!1),_=w.useCallback((D={},j=null)=>({id:h,...D,ref:Hn(j,z=>{z&&x(!0)})}),[h]),P=w.useCallback((D={},j=null)=>({...D,ref:j,"data-focus":ob(k),"data-disabled":ob(i),"data-invalid":ob(r),"data-readonly":ob(o),id:D.id??u,htmlFor:D.htmlFor??l}),[l,i,k,r,o,u]),A=w.useCallback((D={},j=null)=>({id:d,...D,ref:Hn(j,z=>{z&&y(!0)}),"aria-live":"polite"}),[d]),M=w.useCallback((D={},j=null)=>({...D,...a,ref:j,role:"group"}),[a]),R=w.useCallback((D={},j=null)=>({...D,ref:j,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!k,onFocus:()=>E(!0),onBlur:()=>E(!1),hasFeedbackText:m,setHasFeedbackText:y,hasHelpText:b,setHasHelpText:x,id:l,labelId:u,feedbackId:d,helpTextId:h,htmlProps:a,getHelpTextProps:_,getErrorMessageProps:A,getRootProps:M,getLabelProps:P,getRequiredIndicatorProps:R}}var fn=Ae(function(t,n){const r=Mi("Form",t),i=Sn(t),{getRootProps:o,htmlProps:a,...s}=Kge(i),l=C0("chakra-form-control",t.className);return N.createElement(Yge,{value:s},N.createElement(qge,{value:r},N.createElement(we.div,{...o({},n),className:l,__css:r.container})))});fn.displayName="FormControl";var ur=Ae(function(t,n){const r=lp(),i=iF(),o=C0("chakra-form__helper-text",t.className);return N.createElement(we.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});ur.displayName="FormHelperText";function hk(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=pk(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":P6(n),"aria-required":P6(i),"aria-readonly":P6(r)}}function pk(e){const t=lp(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:d,onBlur:h,...m}=e,y=e["aria-describedby"]?[e["aria-describedby"]]:[];return t!=null&&t.hasFeedbackText&&(t!=null&&t.isInvalid)&&y.push(t.feedbackId),t!=null&&t.hasHelpText&&y.push(t.helpTextId),{...m,"aria-describedby":y.join(" ")||void 0,id:n??(t==null?void 0:t.id),isDisabled:r??u??(t==null?void 0:t.isDisabled),isReadOnly:i??l??(t==null?void 0:t.isReadOnly),isRequired:o??a??(t==null?void 0:t.isRequired),isInvalid:s??(t==null?void 0:t.isInvalid),onFocus:AO(t==null?void 0:t.onFocus,d),onBlur:AO(t==null?void 0:t.onBlur,h)}}var[Xge,Zge]=Pn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),cr=Ae((e,t)=>{const n=Mi("FormError",e),r=Sn(e),i=lp();return i!=null&&i.isInvalid?N.createElement(Xge,{value:n},N.createElement(we.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:C0("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});cr.displayName="FormErrorMessage";var Qge=Ae((e,t)=>{const n=Zge(),r=lp();if(!(r!=null&&r.isInvalid))return null;const i=C0("chakra-form__error-icon",e.className);return N.createElement(Na,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i},N.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))});Qge.displayName="FormErrorIcon";var En=Ae(function(t,n){const r=Oo("FormLabel",t),i=Sn(t),{className:o,children:a,requiredIndicator:s=N.createElement(oF,null),optionalIndicator:l=null,...u}=i,d=lp(),h=(d==null?void 0:d.getLabelProps(u,n))??{ref:n,...u};return N.createElement(we.label,{...h,className:C0("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,d!=null&&d.isRequired?s:l)});En.displayName="FormLabel";var oF=Ae(function(t,n){const r=lp(),i=iF();if(!(r!=null&&r.isRequired))return null;const o=C0("chakra-form__required-indicator",t.className);return N.createElement(we.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});oF.displayName="RequiredIndicator";function qd(e,t){const n=w.useRef(!1),r=w.useRef(!1);w.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var gk={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},Jge=we("span",{baseStyle:gk});Jge.displayName="VisuallyHidden";var eme=we("input",{baseStyle:gk});eme.displayName="VisuallyHiddenInput";var OO=!1,nx=null,Km=!1,G7=new Set,tme=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function nme(e){return!(e.metaKey||!tme&&e.altKey||e.ctrlKey)}function mk(e,t){G7.forEach(n=>n(e,t))}function MO(e){Km=!0,nme(e)&&(nx="keyboard",mk("keyboard",e))}function Pg(e){nx="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Km=!0,mk("pointer",e))}function rme(e){e.target===window||e.target===document||(Km||(nx="keyboard",mk("keyboard",e)),Km=!1)}function ime(){Km=!1}function IO(){return nx!=="pointer"}function ome(){if(typeof window>"u"||OO)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Km=!0,e.apply(this,n)},document.addEventListener("keydown",MO,!0),document.addEventListener("keyup",MO,!0),window.addEventListener("focus",rme,!0),window.addEventListener("blur",ime,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Pg,!0),document.addEventListener("pointermove",Pg,!0),document.addEventListener("pointerup",Pg,!0)):(document.addEventListener("mousedown",Pg,!0),document.addEventListener("mousemove",Pg,!0),document.addEventListener("mouseup",Pg,!0)),OO=!0}function aF(e){ome(),e(IO());const t=()=>e(IO());return G7.add(t),()=>{G7.delete(t)}}var[mze,ame]=Pn({name:"CheckboxGroupContext",strict:!1}),sme=(...e)=>e.filter(Boolean).join(" "),bo=e=>e?"":void 0;function Ka(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function lme(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function ume(e){return N.createElement(we.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},N.createElement("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function cme(e){return N.createElement(we.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},N.createElement("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function dme(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?cme:ume;return n||t?N.createElement(we.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},N.createElement(i,{...r})):null}function fme(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function sF(e={}){const t=pk(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:d,isChecked:h,isFocusable:m,onChange:y,isIndeterminate:b,name:x,value:k,tabIndex:E=void 0,"aria-label":_,"aria-labelledby":P,"aria-invalid":A,...M}=e,R=fme(M,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=Er(y),j=Er(s),z=Er(l),[H,K]=w.useState(!1),[te,G]=w.useState(!1),[$,W]=w.useState(!1),[X,Z]=w.useState(!1);w.useEffect(()=>aF(K),[]);const U=w.useRef(null),[Q,re]=w.useState(!0),[he,Ee]=w.useState(!!d),Ce=h!==void 0,de=Ce?h:he,ze=w.useCallback(Le=>{if(r||n){Le.preventDefault();return}Ce||Ee(de?Le.target.checked:b?!0:Le.target.checked),D==null||D(Le)},[r,n,de,Ce,b,D]);Gs(()=>{U.current&&(U.current.indeterminate=Boolean(b))},[b]),qd(()=>{n&&G(!1)},[n,G]),Gs(()=>{const Le=U.current;Le!=null&&Le.form&&(Le.form.onreset=()=>{Ee(!!d)})},[]);const Me=n&&!m,rt=w.useCallback(Le=>{Le.key===" "&&Z(!0)},[Z]),We=w.useCallback(Le=>{Le.key===" "&&Z(!1)},[Z]);Gs(()=>{if(!U.current)return;U.current.checked!==de&&Ee(U.current.checked)},[U.current]);const Be=w.useCallback((Le={},ut=null)=>{const Mt=ct=>{te&&ct.preventDefault(),Z(!0)};return{...Le,ref:ut,"data-active":bo(X),"data-hover":bo($),"data-checked":bo(de),"data-focus":bo(te),"data-focus-visible":bo(te&&H),"data-indeterminate":bo(b),"data-disabled":bo(n),"data-invalid":bo(o),"data-readonly":bo(r),"aria-hidden":!0,onMouseDown:Ka(Le.onMouseDown,Mt),onMouseUp:Ka(Le.onMouseUp,()=>Z(!1)),onMouseEnter:Ka(Le.onMouseEnter,()=>W(!0)),onMouseLeave:Ka(Le.onMouseLeave,()=>W(!1))}},[X,de,n,te,H,$,b,o,r]),wt=w.useCallback((Le={},ut=null)=>({...R,...Le,ref:Hn(ut,Mt=>{Mt&&re(Mt.tagName==="LABEL")}),onClick:Ka(Le.onClick,()=>{var Mt;Q||((Mt=U.current)==null||Mt.click(),requestAnimationFrame(()=>{var ct;(ct=U.current)==null||ct.focus()}))}),"data-disabled":bo(n),"data-checked":bo(de),"data-invalid":bo(o)}),[R,n,de,o,Q]),$e=w.useCallback((Le={},ut=null)=>({...Le,ref:Hn(U,ut),type:"checkbox",name:x,value:k,id:a,tabIndex:E,onChange:Ka(Le.onChange,ze),onBlur:Ka(Le.onBlur,j,()=>G(!1)),onFocus:Ka(Le.onFocus,z,()=>G(!0)),onKeyDown:Ka(Le.onKeyDown,rt),onKeyUp:Ka(Le.onKeyUp,We),required:i,checked:de,disabled:Me,readOnly:r,"aria-label":_,"aria-labelledby":P,"aria-invalid":A?Boolean(A):o,"aria-describedby":u,"aria-disabled":n,style:gk}),[x,k,a,ze,j,z,rt,We,i,de,Me,r,_,P,A,o,u,n,E]),at=w.useCallback((Le={},ut=null)=>({...Le,ref:ut,onMouseDown:Ka(Le.onMouseDown,RO),onTouchStart:Ka(Le.onTouchStart,RO),"data-disabled":bo(n),"data-checked":bo(de),"data-invalid":bo(o)}),[de,n,o]);return{state:{isInvalid:o,isFocused:te,isChecked:de,isActive:X,isHovered:$,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:wt,getCheckboxProps:Be,getInputProps:$e,getLabelProps:at,htmlProps:R}}function RO(e){e.preventDefault(),e.stopPropagation()}var hme={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},pme={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},gme=af({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),mme=af({from:{opacity:0},to:{opacity:1}}),vme=af({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),lF=Ae(function(t,n){const r=ame(),i={...r,...t},o=Mi("Checkbox",i),a=Sn(t),{spacing:s="0.5rem",className:l,children:u,iconColor:d,iconSize:h,icon:m=N.createElement(dme,null),isChecked:y,isDisabled:b=r==null?void 0:r.isDisabled,onChange:x,inputProps:k,...E}=a;let _=y;r!=null&&r.value&&a.value&&(_=r.value.includes(a.value));let P=x;r!=null&&r.onChange&&a.value&&(P=lme(r.onChange,x));const{state:A,getInputProps:M,getCheckboxProps:R,getLabelProps:D,getRootProps:j}=sF({...E,isDisabled:b,isChecked:_,onChange:P}),z=w.useMemo(()=>({animation:A.isIndeterminate?`${mme} 20ms linear, ${vme} 200ms linear`:`${gme} 200ms linear`,fontSize:h,color:d,...o.icon}),[d,h,,A.isIndeterminate,o.icon]),H=w.cloneElement(m,{__css:z,isIndeterminate:A.isIndeterminate,isChecked:A.isChecked});return N.createElement(we.label,{__css:{...pme,...o.container},className:sme("chakra-checkbox",l),...j()},N.createElement("input",{className:"chakra-checkbox__input",...M(k,n)}),N.createElement(we.span,{__css:{...hme,...o.control},className:"chakra-checkbox__control",...R()},H),u&&N.createElement(we.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:s,...o.label}},u))});lF.displayName="Checkbox";function yme(e){return N.createElement(Na,{focusable:"false","aria-hidden":!0,...e},N.createElement("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}))}var rx=Ae(function(t,n){const r=Oo("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=Sn(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return N.createElement(we.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||N.createElement(yme,{width:"1em",height:"1em"}))});rx.displayName="CloseButton";function bme(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function vk(e,t){let n=bme(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function q7(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function f5(e,t,n){return(e-t)*100/(n-t)}function uF(e,t,n){return(n-t)*e+t}function Y7(e,t,n){const r=Math.round((e-t)/n)*n+t,i=q7(n);return vk(r,i)}function Tm(e,t,n){return e==null?e:(nr==null?"":T6(r,o,n)??""),m=typeof i<"u",y=m?i:d,b=cF(hd(y),o),x=n??b,k=w.useCallback(H=>{H!==y&&(m||h(H.toString()),u==null||u(H.toString(),hd(H)))},[u,m,y]),E=w.useCallback(H=>{let K=H;return l&&(K=Tm(K,a,s)),vk(K,x)},[x,l,s,a]),_=w.useCallback((H=o)=>{let K;y===""?K=hd(H):K=hd(y)+H,K=E(K),k(K)},[E,o,k,y]),P=w.useCallback((H=o)=>{let K;y===""?K=hd(-H):K=hd(y)-H,K=E(K),k(K)},[E,o,k,y]),A=w.useCallback(()=>{let H;r==null?H="":H=T6(r,o,n)??a,k(H)},[r,n,o,k,a]),M=w.useCallback(H=>{const K=T6(H,o,x)??a;k(K)},[x,o,k,a]),R=hd(y);return{isOutOfRange:R>s||Rt in e?wee(e,t,{enumerable:!0,con --chakra-vh: 100dvh; } } -`,xme=()=>N.createElement(DS,{styles:d$}),wme=()=>N.createElement(DS,{styles:` +`,xme=()=>N.createElement(DS,{styles:dF}),wme=()=>N.createElement(DS,{styles:` html { line-height: 1.5; -webkit-text-size-adjust: 100%; @@ -343,8 +343,8 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con display: none; } - ${d$} - `});function jh(e,t,n,r){const i=Er(n);return w.useEffect(()=>{const o=typeof e=="function"?e():e??document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e??document;o==null||o.removeEventListener(t,i,r)}}function Cme(e){return"current"in e}var f$=()=>typeof window<"u";function _me(){const e=navigator.userAgentData;return(e==null?void 0:e.platform)??navigator.platform}var kme=e=>f$()&&e.test(navigator.vendor),Eme=e=>f$()&&e.test(_me()),Pme=()=>Eme(/mac|iphone|ipad|ipod/i),Tme=()=>Pme()&&kme(/apple/i);function Lme(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var o;return((o=t.current)==null?void 0:o.ownerDocument)??document};jh(i,"pointerdown",o=>{if(!Tme()||!r)return;const a=o.target,l=(n??[t]).some(u=>{const d=Cme(u)?u.current:u;return(d==null?void 0:d.contains(a))||d===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}var Ame=xre?w.useLayoutEffect:w.useEffect;function DO(e,t=[]){const n=w.useRef(e);return Ame(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Ome(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Mme(e,t){const n=w.useId();return w.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function qh(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=DO(n),a=DO(t),[s,l]=w.useState(e.defaultIsOpen||!1),[u,d]=Ome(r,s),h=Mme(i,"disclosure"),m=w.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),y=w.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),b=w.useCallback(()=>{(d?m:y)()},[d,y,m]);return{isOpen:!!d,onOpen:y,onClose:m,onToggle:b,isControlled:u,getButtonProps:(x={})=>({...x,"aria-expanded":d,"aria-controls":h,onClick:wre(x.onClick,b)}),getDisclosureProps:(x={})=>({...x,hidden:!d,id:h})}}function yk(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var bk=Ae(function(t,n){const{htmlSize:r,...i}=t,o=Oi("Input",i),a=Sn(i),s=hk(a),l=Qr("chakra-input",t.className);return N.createElement(Ce.input,{size:r,...s,__css:o.field,ref:n,className:l})});bk.displayName="Input";bk.id="Input";var[Ime,h$]=Pn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Rme=Ae(function(t,n){const r=Oi("Input",t),{children:i,className:o,...a}=Sn(t),s=Qr("chakra-input__group",o),l={},u=ex(i),d=r.field;u.forEach(m=>{r&&(d&&m.type.id==="InputLeftElement"&&(l.paddingStart=d.height??d.h),d&&m.type.id==="InputRightElement"&&(l.paddingEnd=d.height??d.h),m.type.id==="InputRightAddon"&&(l.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const h=u.map(m=>{var y,b;const x=yk({size:((y=m.props)==null?void 0:y.size)||t.size,variant:((b=m.props)==null?void 0:b.variant)||t.variant});return m.type.id!=="Input"?w.cloneElement(m,x):w.cloneElement(m,Object.assign(x,l,m.props))});return N.createElement(Ce.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},N.createElement(Ime,{value:r},h))});Rme.displayName="InputGroup";var Dme={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},Nme=Ce("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),Sk=Ae(function(t,n){const{placement:r="left",...i}=t,o=Dme[r]??{},a=h$();return N.createElement(Nme,{ref:n,...i,__css:{...a.addon,...o}})});Sk.displayName="InputAddon";var p$=Ae(function(t,n){return N.createElement(Sk,{ref:n,placement:"left",...t,className:Qr("chakra-input__left-addon",t.className)})});p$.displayName="InputLeftAddon";p$.id="InputLeftAddon";var g$=Ae(function(t,n){return N.createElement(Sk,{ref:n,placement:"right",...t,className:Qr("chakra-input__right-addon",t.className)})});g$.displayName="InputRightAddon";g$.id="InputRightAddon";var jme=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),ix=Ae(function(t,n){const{placement:r="left",...i}=t,o=h$(),a=o.field,l={[r==="left"?"insetStart":"insetEnd"]:"0",width:(a==null?void 0:a.height)??(a==null?void 0:a.h),height:(a==null?void 0:a.height)??(a==null?void 0:a.h),fontSize:a==null?void 0:a.fontSize,...o.element};return N.createElement(jme,{ref:n,__css:l,...i})});ix.id="InputElement";ix.displayName="InputElement";var m$=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__left-element",r);return N.createElement(ix,{ref:n,placement:"left",className:o,...i})});m$.id="InputLeftElement";m$.displayName="InputLeftElement";var v$=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__right-element",r);return N.createElement(ix,{ref:n,placement:"right",className:o,...i})});v$.id="InputRightElement";v$.displayName="InputRightElement";function Bme(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function qd(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Bme(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Fme=Ae(function(e,t){const{ratio:n=4/3,children:r,className:i,...o}=e,a=w.Children.only(r),s=Qr("chakra-aspect-ratio",i);return N.createElement(Ce.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:qd(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o},a)});Fme.displayName="AspectRatio";var $me=Ae(function(t,n){const r=Oo("Badge",t),{className:i,...o}=Sn(t);return N.createElement(Ce.span,{ref:n,className:Qr("chakra-badge",t.className),...o,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});$me.displayName="Badge";var Eo=Ce("div");Eo.displayName="Box";var y$=Ae(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return N.createElement(Eo,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});y$.displayName="Square";var zme=Ae(function(t,n){const{size:r,...i}=t;return N.createElement(y$,{size:r,ref:n,borderRadius:"9999px",...i})});zme.displayName="Circle";var b$=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});b$.displayName="Center";var Hme={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Ae(function(t,n){const{axis:r="both",...i}=t;return N.createElement(Ce.div,{ref:n,__css:Hme[r],...i,position:"absolute"})});var Vme=Ae(function(t,n){const r=Oo("Code",t),{className:i,...o}=Sn(t);return N.createElement(Ce.code,{ref:n,className:Qr("chakra-code",t.className),...o,__css:{display:"inline-block",...r}})});Vme.displayName="Code";var Wme=Ae(function(t,n){const{className:r,centerContent:i,...o}=Sn(t),a=Oo("Container",t);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-container",r),...o,__css:{...a,...i&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});Wme.displayName="Container";var Ume=Ae(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:o,borderRightWidth:a,borderWidth:s,borderStyle:l,borderColor:u,...d}=Oo("Divider",t),{className:h,orientation:m="horizontal",__css:y,...b}=Sn(t),x={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:i||o||s||"1px",width:"100%"}};return N.createElement(Ce.hr,{ref:n,"aria-orientation":m,...b,__css:{...d,border:"0",borderColor:u,borderStyle:l,...x[m],...y},className:Qr("chakra-divider",h)})});Ume.displayName="Divider";var je=Ae(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...d}=t,h={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return N.createElement(Ce.div,{ref:n,__css:h,...d})});je.displayName="Flex";var S$=Ae(function(t,n){const{templateAreas:r,gap:i,rowGap:o,columnGap:a,column:s,row:l,autoFlow:u,autoRows:d,templateRows:h,autoColumns:m,templateColumns:y,...b}=t,x={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:o,gridColumnGap:a,gridAutoColumns:m,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:d,gridTemplateRows:h,gridTemplateColumns:y};return N.createElement(Ce.div,{ref:n,__css:x,...b})});S$.displayName="Grid";function NO(e){return qd(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Gme=Ae(function(t,n){const{area:r,colSpan:i,colStart:o,colEnd:a,rowEnd:s,rowSpan:l,rowStart:u,...d}=t,h=yk({gridArea:r,gridColumn:NO(i),gridRow:NO(l),gridColumnStart:o,gridColumnEnd:a,gridRowStart:u,gridRowEnd:s});return N.createElement(Ce.div,{ref:n,__css:h,...d})});Gme.displayName="GridItem";var Bh=Ae(function(t,n){const r=Oo("Heading",t),{className:i,...o}=Sn(t);return N.createElement(Ce.h2,{ref:n,className:Qr("chakra-heading",t.className),...o,__css:r})});Bh.displayName="Heading";Ae(function(t,n){const r=Oo("Mark",t),i=Sn(t);return N.createElement(Eo,{ref:n,...i,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var qme=Ae(function(t,n){const r=Oo("Kbd",t),{className:i,...o}=Sn(t);return N.createElement(Ce.kbd,{ref:n,className:Qr("chakra-kbd",i),...o,__css:{fontFamily:"mono",...r}})});qme.displayName="Kbd";var Fh=Ae(function(t,n){const r=Oo("Link",t),{className:i,isExternal:o,...a}=Sn(t);return N.createElement(Ce.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:Qr("chakra-link",i),...a,__css:r})});Fh.displayName="Link";Ae(function(t,n){const{isExternal:r,target:i,rel:o,className:a,...s}=t;return N.createElement(Ce.a,{...s,ref:n,className:Qr("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":o,target:r?"_blank":i,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});Ae(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.div,{ref:n,position:"relative",...i,className:Qr("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[Yme,x$]=Pn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),xk=Ae(function(t,n){const r=Oi("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=Sn(t),u=ex(i),h=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return N.createElement(Yme,{value:r},N.createElement(Ce.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...h},...l},u))});xk.displayName="List";var Kme=Ae((e,t)=>{const{as:n,...r}=e;return N.createElement(xk,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});Kme.displayName="OrderedList";var w$=Ae(function(t,n){const{as:r,...i}=t;return N.createElement(xk,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});w$.displayName="UnorderedList";var xv=Ae(function(t,n){const r=x$();return N.createElement(Ce.li,{ref:n,...t,__css:r.item})});xv.displayName="ListItem";var Xme=Ae(function(t,n){const r=x$();return N.createElement(Na,{ref:n,role:"presentation",...t,__css:r.icon})});Xme.displayName="ListIcon";var Zme=Ae(function(t,n){const{columns:r,spacingX:i,spacingY:o,spacing:a,minChildWidth:s,...l}=t,u=v0(),d=s?Jme(s,u):e0e(r);return N.createElement(S$,{ref:n,gap:a,columnGap:i,rowGap:o,templateColumns:d,...l})});Zme.displayName="SimpleGrid";function Qme(e){return typeof e=="number"?`${e}px`:e}function Jme(e,t){return qd(e,n=>{const r=rce("sizes",n,Qme(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function e0e(e){return qd(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var C$=Ce("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});C$.displayName="Spacer";var K7="& > *:not(style) ~ *:not(style)";function t0e(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[K7]:qd(n,i=>r[i])}}function n0e(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":qd(n,i=>r[i])}}var _$=e=>N.createElement(Ce.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});_$.displayName="StackItem";var wk=Ae((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:d,shouldWrapChildren:h,...m}=e,y=n?"row":r??"column",b=w.useMemo(()=>t0e({direction:y,spacing:a}),[y,a]),x=w.useMemo(()=>n0e({spacing:a,direction:y}),[a,y]),k=!!u,E=!h&&!k,_=w.useMemo(()=>{const A=ex(l);return E?A:A.map((M,R)=>{const D=typeof M.key<"u"?M.key:R,j=R+1===A.length,H=h?N.createElement(_$,{key:D},M):M;if(!k)return H;const K=w.cloneElement(u,{__css:x}),te=j?null:K;return N.createElement(w.Fragment,{key:D},H,te)})},[u,x,k,E,h,l]),P=Qr("chakra-stack",d);return N.createElement(Ce.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:b.flexDirection,flexWrap:s,className:P,__css:k?{}:{[K7]:b[K7]},...m},_)});wk.displayName="Stack";var Ey=Ae((e,t)=>N.createElement(wk,{align:"center",...e,direction:"row",ref:t}));Ey.displayName="HStack";var yn=Ae((e,t)=>N.createElement(wk,{align:"center",...e,direction:"column",ref:t}));yn.displayName="VStack";var Yt=Ae(function(t,n){const r=Oo("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=Sn(t),u=yk({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return N.createElement(Ce.p,{ref:n,className:Qr("chakra-text",t.className),...u,...l,__css:r})});Yt.displayName="Text";function jO(e){return typeof e=="number"?`${e}px`:e}var r0e=Ae(function(t,n){const{spacing:r="0.5rem",spacingX:i,spacingY:o,children:a,justify:s,direction:l,align:u,className:d,shouldWrapChildren:h,...m}=t,y=w.useMemo(()=>{const{spacingX:x=r,spacingY:k=r}={spacingX:i,spacingY:o};return{"--chakra-wrap-x-spacing":E=>qd(x,_=>jO(r7("space",_)(E))),"--chakra-wrap-y-spacing":E=>qd(k,_=>jO(r7("space",_)(E))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,i,o,s,u,l]),b=w.useMemo(()=>h?w.Children.map(a,(x,k)=>N.createElement(k$,{key:k},x)):a,[a,h]);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-wrap",d),overflow:"hidden",...m},N.createElement(Ce.ul,{className:"chakra-wrap__list",__css:y},b))});r0e.displayName="Wrap";var k$=Ae(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:Qr("chakra-wrap__listitem",r),...i})});k$.displayName="WrapItem";var i0e={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},E$=i0e,Pg=()=>{},o0e={document:E$,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:Pg,removeEventListener:Pg,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:Pg,removeListener:Pg}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:Pg,setInterval:()=>0,clearInterval:Pg},a0e=o0e,s0e={window:a0e,document:E$},P$=typeof window<"u"?{window,document}:s0e,T$=w.createContext(P$);T$.displayName="EnvironmentContext";function L$(e){const{children:t,environment:n}=e,[r,i]=w.useState(null),[o,a]=w.useState(!1);w.useEffect(()=>a(!0),[]);const s=w.useMemo(()=>{if(n)return n;const l=r==null?void 0:r.ownerDocument,u=r==null?void 0:r.ownerDocument.defaultView;return l?{document:l,window:u}:P$},[r,n]);return N.createElement(T$.Provider,{value:s},t,!n&&o&&N.createElement("span",{id:"__chakra_env",hidden:!0,ref:l=>{w.startTransition(()=>{l&&i(l)})}}))}L$.displayName="EnvironmentProvider";var l0e=e=>e?"":void 0;function u0e(){const e=w.useRef(new Map),t=e.current,n=w.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=w.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return w.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function L6(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function c0e(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:d,tabIndex:h,onMouseOver:m,onMouseLeave:y,...b}=e,[x,k]=w.useState(!0),[E,_]=w.useState(!1),P=u0e(),A=Z=>{Z&&Z.tagName!=="BUTTON"&&k(!1)},M=x?h:h||0,R=n&&!r,D=w.useCallback(Z=>{if(n){Z.stopPropagation(),Z.preventDefault();return}Z.currentTarget.focus(),l==null||l(Z)},[n,l]),j=w.useCallback(Z=>{E&&L6(Z)&&(Z.preventDefault(),Z.stopPropagation(),_(!1),P.remove(document,"keyup",j,!1))},[E,P]),z=w.useCallback(Z=>{if(u==null||u(Z),n||Z.defaultPrevented||Z.metaKey||!L6(Z.nativeEvent)||x)return;const U=i&&Z.key==="Enter";o&&Z.key===" "&&(Z.preventDefault(),_(!0)),U&&(Z.preventDefault(),Z.currentTarget.click()),P.add(document,"keyup",j,!1)},[n,x,u,i,o,P,j]),H=w.useCallback(Z=>{if(d==null||d(Z),n||Z.defaultPrevented||Z.metaKey||!L6(Z.nativeEvent)||x)return;o&&Z.key===" "&&(Z.preventDefault(),_(!1),Z.currentTarget.click())},[o,x,n,d]),K=w.useCallback(Z=>{Z.button===0&&(_(!1),P.remove(document,"mouseup",K,!1))},[P]),te=w.useCallback(Z=>{if(Z.button!==0)return;if(n){Z.stopPropagation(),Z.preventDefault();return}x||_(!0),Z.currentTarget.focus({preventScroll:!0}),P.add(document,"mouseup",K,!1),a==null||a(Z)},[n,x,a,P,K]),G=w.useCallback(Z=>{Z.button===0&&(x||_(!1),s==null||s(Z))},[s,x]),F=w.useCallback(Z=>{if(n){Z.preventDefault();return}m==null||m(Z)},[n,m]),W=w.useCallback(Z=>{E&&(Z.preventDefault(),_(!1)),y==null||y(Z)},[E,y]),X=Hn(t,A);return x?{...b,ref:X,type:"button","aria-disabled":R?void 0:n,disabled:R,onClick:D,onMouseDown:a,onMouseUp:s,onKeyUp:d,onKeyDown:u,onMouseOver:m,onMouseLeave:y}:{...b,ref:X,role:"button","data-active":l0e(E),"aria-disabled":n?"true":void 0,tabIndex:R?void 0:M,onClick:D,onMouseDown:te,onMouseUp:G,onKeyUp:H,onKeyDown:z,onMouseOver:F,onMouseLeave:W}}function A$(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function O$(e){if(!A$(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function d0e(e){var t;return((t=M$(e))==null?void 0:t.defaultView)??window}function M$(e){return A$(e)?e.ownerDocument:document}function f0e(e){return M$(e).activeElement}var I$=e=>e.hasAttribute("tabindex"),h0e=e=>I$(e)&&e.tabIndex===-1;function p0e(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function R$(e){return e.parentElement&&R$(e.parentElement)?!0:e.hidden}function g0e(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function D$(e){if(!O$(e)||R$(e)||p0e(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():g0e(e)?!0:I$(e)}function m0e(e){return e?O$(e)&&D$(e)&&!h0e(e):!1}var v0e=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],y0e=v0e.join(),b0e=e=>e.offsetWidth>0&&e.offsetHeight>0;function N$(e){const t=Array.from(e.querySelectorAll(y0e));return t.unshift(e),t.filter(n=>D$(n)&&b0e(n))}function S0e(e){const t=e.current;if(!t)return!1;const n=f0e(t);return!n||t.contains(n)?!1:!!m0e(n)}function x0e(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;Gd(()=>{if(!o||S0e(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var w0e={preventScroll:!0,shouldFocus:!1};function C0e(e,t=w0e){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=_0e(e)?e.current:e,s=i&&o,l=w.useRef(s),u=w.useRef(o);Gs(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const d=w.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=N$(a);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[o,r,a,n]);Gd(()=>{d()},[d]),jh(a,"transitionend",d)}function _0e(e){return"current"in e}var Qo="top",cs="bottom",ds="right",Jo="left",Ck="auto",Py=[Qo,cs,ds,Jo],Km="start",I2="end",k0e="clippingParents",j$="viewport",K1="popper",E0e="reference",BO=Py.reduce(function(e,t){return e.concat([t+"-"+Km,t+"-"+I2])},[]),B$=[].concat(Py,[Ck]).reduce(function(e,t){return e.concat([t,t+"-"+Km,t+"-"+I2])},[]),P0e="beforeRead",T0e="read",L0e="afterRead",A0e="beforeMain",O0e="main",M0e="afterMain",I0e="beforeWrite",R0e="write",D0e="afterWrite",N0e=[P0e,T0e,L0e,A0e,O0e,M0e,I0e,R0e,D0e];function lu(e){return e?(e.nodeName||"").toLowerCase():null}function gs(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Yh(e){var t=gs(e).Element;return e instanceof t||e instanceof Element}function as(e){var t=gs(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function _k(e){if(typeof ShadowRoot>"u")return!1;var t=gs(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function j0e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!as(o)||!lu(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function B0e(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!as(i)||!lu(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const F0e={name:"applyStyles",enabled:!0,phase:"write",fn:j0e,effect:B0e,requires:["computeStyles"]};function Jl(e){return e.split("-")[0]}var $h=Math.max,h5=Math.min,Xm=Math.round;function X7(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function F$(){return!/^((?!chrome|android).)*safari/i.test(X7())}function Zm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&as(e)&&(i=e.offsetWidth>0&&Xm(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Xm(r.height)/e.offsetHeight||1);var a=Yh(e)?gs(e):window,s=a.visualViewport,l=!F$()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,d=(r.top+(l&&s?s.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:d,right:u+h,bottom:d+m,left:u,x:u,y:d}}function kk(e){var t=Zm(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function $$(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_k(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function nc(e){return gs(e).getComputedStyle(e)}function $0e(e){return["table","td","th"].indexOf(lu(e))>=0}function sf(e){return((Yh(e)?e.ownerDocument:e.document)||window.document).documentElement}function ox(e){return lu(e)==="html"?e:e.assignedSlot||e.parentNode||(_k(e)?e.host:null)||sf(e)}function FO(e){return!as(e)||nc(e).position==="fixed"?null:e.offsetParent}function z0e(e){var t=/firefox/i.test(X7()),n=/Trident/i.test(X7());if(n&&as(e)){var r=nc(e);if(r.position==="fixed")return null}var i=ox(e);for(_k(i)&&(i=i.host);as(i)&&["html","body"].indexOf(lu(i))<0;){var o=nc(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Ty(e){for(var t=gs(e),n=FO(e);n&&$0e(n)&&nc(n).position==="static";)n=FO(n);return n&&(lu(n)==="html"||lu(n)==="body"&&nc(n).position==="static")?t:n||z0e(e)||t}function Ek(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Zv(e,t,n){return $h(e,h5(t,n))}function H0e(e,t,n){var r=Zv(e,t,n);return r>n?n:r}function z$(){return{top:0,right:0,bottom:0,left:0}}function H$(e){return Object.assign({},z$(),e)}function V$(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var V0e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,H$(typeof t!="number"?t:V$(t,Py))};function W0e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Jl(n.placement),l=Ek(s),u=[Jo,ds].indexOf(s)>=0,d=u?"height":"width";if(!(!o||!a)){var h=V0e(i.padding,n),m=kk(o),y=l==="y"?Qo:Jo,b=l==="y"?cs:ds,x=n.rects.reference[d]+n.rects.reference[l]-a[l]-n.rects.popper[d],k=a[l]-n.rects.reference[l],E=Ty(o),_=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,P=x/2-k/2,A=h[y],M=_-m[d]-h[b],R=_/2-m[d]/2+P,D=Zv(A,R,M),j=l;n.modifiersData[r]=(t={},t[j]=D,t.centerOffset=D-R,t)}}function U0e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||$$(t.elements.popper,i)&&(t.elements.arrow=i))}const G0e={name:"arrow",enabled:!0,phase:"main",fn:W0e,effect:U0e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Qm(e){return e.split("-")[1]}var q0e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Y0e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Xm(t*i)/i||0,y:Xm(n*i)/i||0}}function $O(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,m=a.x,y=m===void 0?0:m,b=a.y,x=b===void 0?0:b,k=typeof d=="function"?d({x:y,y:x}):{x:y,y:x};y=k.x,x=k.y;var E=a.hasOwnProperty("x"),_=a.hasOwnProperty("y"),P=Jo,A=Qo,M=window;if(u){var R=Ty(n),D="clientHeight",j="clientWidth";if(R===gs(n)&&(R=sf(n),nc(R).position!=="static"&&s==="absolute"&&(D="scrollHeight",j="scrollWidth")),R=R,i===Qo||(i===Jo||i===ds)&&o===I2){A=cs;var z=h&&R===M&&M.visualViewport?M.visualViewport.height:R[D];x-=z-r.height,x*=l?1:-1}if(i===Jo||(i===Qo||i===cs)&&o===I2){P=ds;var H=h&&R===M&&M.visualViewport?M.visualViewport.width:R[j];y-=H-r.width,y*=l?1:-1}}var K=Object.assign({position:s},u&&q0e),te=d===!0?Y0e({x:y,y:x}):{x:y,y:x};if(y=te.x,x=te.y,l){var G;return Object.assign({},K,(G={},G[A]=_?"0":"",G[P]=E?"0":"",G.transform=(M.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",G))}return Object.assign({},K,(t={},t[A]=_?x+"px":"",t[P]=E?y+"px":"",t.transform="",t))}function K0e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Jl(t.placement),variation:Qm(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,$O(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,$O(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const X0e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:K0e,data:{}};var ib={passive:!0};function Z0e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=gs(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,ib)}),s&&l.addEventListener("resize",n.update,ib),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,ib)}),s&&l.removeEventListener("resize",n.update,ib)}}const Q0e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Z0e,data:{}};var J0e={left:"right",right:"left",bottom:"top",top:"bottom"};function v4(e){return e.replace(/left|right|bottom|top/g,function(t){return J0e[t]})}var e1e={start:"end",end:"start"};function zO(e){return e.replace(/start|end/g,function(t){return e1e[t]})}function Pk(e){var t=gs(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Tk(e){return Zm(sf(e)).left+Pk(e).scrollLeft}function t1e(e,t){var n=gs(e),r=sf(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=F$();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+Tk(e),y:l}}function n1e(e){var t,n=sf(e),r=Pk(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=$h(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=$h(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Tk(e),l=-r.scrollTop;return nc(i||n).direction==="rtl"&&(s+=$h(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function Lk(e){var t=nc(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function W$(e){return["html","body","#document"].indexOf(lu(e))>=0?e.ownerDocument.body:as(e)&&Lk(e)?e:W$(ox(e))}function Qv(e,t){var n;t===void 0&&(t=[]);var r=W$(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=gs(r),a=i?[o].concat(o.visualViewport||[],Lk(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Qv(ox(a)))}function Z7(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function r1e(e,t){var n=Zm(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function HO(e,t,n){return t===j$?Z7(t1e(e,n)):Yh(t)?r1e(t,n):Z7(n1e(sf(e)))}function i1e(e){var t=Qv(ox(e)),n=["absolute","fixed"].indexOf(nc(e).position)>=0,r=n&&as(e)?Ty(e):e;return Yh(r)?t.filter(function(i){return Yh(i)&&$$(i,r)&&lu(i)!=="body"}):[]}function o1e(e,t,n,r){var i=t==="clippingParents"?i1e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var d=HO(e,u,r);return l.top=$h(d.top,l.top),l.right=h5(d.right,l.right),l.bottom=h5(d.bottom,l.bottom),l.left=$h(d.left,l.left),l},HO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function U$(e){var t=e.reference,n=e.element,r=e.placement,i=r?Jl(r):null,o=r?Qm(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Qo:l={x:a,y:t.y-n.height};break;case cs:l={x:a,y:t.y+t.height};break;case ds:l={x:t.x+t.width,y:s};break;case Jo:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?Ek(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case Km:l[u]=l[u]-(t[d]/2-n[d]/2);break;case I2:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function R2(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?k0e:s,u=n.rootBoundary,d=u===void 0?j$:u,h=n.elementContext,m=h===void 0?K1:h,y=n.altBoundary,b=y===void 0?!1:y,x=n.padding,k=x===void 0?0:x,E=H$(typeof k!="number"?k:V$(k,Py)),_=m===K1?E0e:K1,P=e.rects.popper,A=e.elements[b?_:m],M=o1e(Yh(A)?A:A.contextElement||sf(e.elements.popper),l,d,a),R=Zm(e.elements.reference),D=U$({reference:R,element:P,strategy:"absolute",placement:i}),j=Z7(Object.assign({},P,D)),z=m===K1?j:R,H={top:M.top-z.top+E.top,bottom:z.bottom-M.bottom+E.bottom,left:M.left-z.left+E.left,right:z.right-M.right+E.right},K=e.modifiersData.offset;if(m===K1&&K){var te=K[i];Object.keys(H).forEach(function(G){var F=[ds,cs].indexOf(G)>=0?1:-1,W=[Qo,cs].indexOf(G)>=0?"y":"x";H[G]+=te[W]*F})}return H}function a1e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?B$:l,d=Qm(r),h=d?s?BO:BO.filter(function(b){return Qm(b)===d}):Py,m=h.filter(function(b){return u.indexOf(b)>=0});m.length===0&&(m=h);var y=m.reduce(function(b,x){return b[x]=R2(e,{placement:x,boundary:i,rootBoundary:o,padding:a})[Jl(x)],b},{});return Object.keys(y).sort(function(b,x){return y[b]-y[x]})}function s1e(e){if(Jl(e)===Ck)return[];var t=v4(e);return[zO(e),t,zO(t)]}function l1e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,y=n.flipVariations,b=y===void 0?!0:y,x=n.allowedAutoPlacements,k=t.options.placement,E=Jl(k),_=E===k,P=l||(_||!b?[v4(k)]:s1e(k)),A=[k].concat(P).reduce(function(ye,ze){return ye.concat(Jl(ze)===Ck?a1e(t,{placement:ze,boundary:d,rootBoundary:h,padding:u,flipVariations:b,allowedAutoPlacements:x}):ze)},[]),M=t.rects.reference,R=t.rects.popper,D=new Map,j=!0,z=A[0],H=0;H=0,W=F?"width":"height",X=R2(t,{placement:K,boundary:d,rootBoundary:h,altBoundary:m,padding:u}),Z=F?G?ds:Jo:G?cs:Qo;M[W]>R[W]&&(Z=v4(Z));var U=v4(Z),Q=[];if(o&&Q.push(X[te]<=0),s&&Q.push(X[Z]<=0,X[U]<=0),Q.every(function(ye){return ye})){z=K,j=!1;break}D.set(K,Q)}if(j)for(var re=b?3:1,fe=function(ze){var Me=A.find(function(rt){var We=D.get(rt);if(We)return We.slice(0,ze).every(function(Be){return Be})});if(Me)return z=Me,"break"},Ee=re;Ee>0;Ee--){var be=fe(Ee);if(be==="break")break}t.placement!==z&&(t.modifiersData[r]._skip=!0,t.placement=z,t.reset=!0)}}const u1e={name:"flip",enabled:!0,phase:"main",fn:l1e,requiresIfExists:["offset"],data:{_skip:!1}};function VO(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function WO(e){return[Qo,ds,cs,Jo].some(function(t){return e[t]>=0})}function c1e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=R2(t,{elementContext:"reference"}),s=R2(t,{altBoundary:!0}),l=VO(a,r),u=VO(s,i,o),d=WO(l),h=WO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const d1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:c1e};function f1e(e,t,n){var r=Jl(e),i=[Jo,Qo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Jo,ds].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function h1e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=B$.reduce(function(d,h){return d[h]=f1e(h,t.rects,o),d},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const p1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:h1e};function g1e(e){var t=e.state,n=e.name;t.modifiersData[n]=U$({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const m1e={name:"popperOffsets",enabled:!0,phase:"read",fn:g1e,data:{}};function v1e(e){return e==="x"?"y":"x"}function y1e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,m=n.tether,y=m===void 0?!0:m,b=n.tetherOffset,x=b===void 0?0:b,k=R2(t,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),E=Jl(t.placement),_=Qm(t.placement),P=!_,A=Ek(E),M=v1e(A),R=t.modifiersData.popperOffsets,D=t.rects.reference,j=t.rects.popper,z=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,H=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,te={x:0,y:0};if(R){if(o){var G,F=A==="y"?Qo:Jo,W=A==="y"?cs:ds,X=A==="y"?"height":"width",Z=R[A],U=Z+k[F],Q=Z-k[W],re=y?-j[X]/2:0,fe=_===Km?D[X]:j[X],Ee=_===Km?-j[X]:-D[X],be=t.elements.arrow,ye=y&&be?kk(be):{width:0,height:0},ze=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:z$(),Me=ze[F],rt=ze[W],We=Zv(0,D[X],ye[X]),Be=P?D[X]/2-re-We-Me-H.mainAxis:fe-We-Me-H.mainAxis,wt=P?-D[X]/2+re+We+rt+H.mainAxis:Ee+We+rt+H.mainAxis,Fe=t.elements.arrow&&Ty(t.elements.arrow),at=Fe?A==="y"?Fe.clientTop||0:Fe.clientLeft||0:0,bt=(G=K==null?void 0:K[A])!=null?G:0,Le=Z+Be-bt-at,ut=Z+wt-bt,Mt=Zv(y?h5(U,Le):U,Z,y?$h(Q,ut):Q);R[A]=Mt,te[A]=Mt-Z}if(s){var ct,_t=A==="x"?Qo:Jo,un=A==="x"?cs:ds,ae=R[M],De=M==="y"?"height":"width",Ke=ae+k[_t],Xe=ae-k[un],xe=[Qo,Jo].indexOf(E)!==-1,Ne=(ct=K==null?void 0:K[M])!=null?ct:0,Ct=xe?Ke:ae-D[De]-j[De]-Ne+H.altAxis,Dt=xe?ae+D[De]+j[De]-Ne-H.altAxis:Xe,Te=y&&xe?H0e(Ct,ae,Dt):Zv(y?Ct:Ke,ae,y?Dt:Xe);R[M]=Te,te[M]=Te-ae}t.modifiersData[r]=te}}const b1e={name:"preventOverflow",enabled:!0,phase:"main",fn:y1e,requiresIfExists:["offset"]};function S1e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function x1e(e){return e===gs(e)||!as(e)?Pk(e):S1e(e)}function w1e(e){var t=e.getBoundingClientRect(),n=Xm(t.width)/e.offsetWidth||1,r=Xm(t.height)/e.offsetHeight||1;return n!==1||r!==1}function C1e(e,t,n){n===void 0&&(n=!1);var r=as(t),i=as(t)&&w1e(t),o=sf(t),a=Zm(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((lu(t)!=="body"||Lk(o))&&(s=x1e(t)),as(t)?(l=Zm(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Tk(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function _1e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function k1e(e){var t=_1e(e);return N0e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function E1e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function P1e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var UO={placement:"bottom",modifiers:[],strategy:"absolute"};function GO(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),oi={arrowShadowColor:Tg("--popper-arrow-shadow-color"),arrowSize:Tg("--popper-arrow-size","8px"),arrowSizeHalf:Tg("--popper-arrow-size-half"),arrowBg:Tg("--popper-arrow-bg"),transformOrigin:Tg("--popper-transform-origin"),arrowOffset:Tg("--popper-arrow-offset")};function O1e(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var M1e={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},I1e=e=>M1e[e],qO={scroll:!0,resize:!0};function R1e(e){let t;return typeof e=="object"?t={enabled:!0,options:{...qO,...e}}:t={enabled:e,options:qO},t}var D1e={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},N1e={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{YO(e)},effect:({state:e})=>()=>{YO(e)}},YO=e=>{e.elements.popper.style.setProperty(oi.transformOrigin.var,I1e(e.placement))},j1e={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{B1e(e)}},B1e=e=>{var t;if(!e.placement)return;const n=F1e(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:oi.arrowSize.varRef,height:oi.arrowSize.varRef,zIndex:-1});const r={[oi.arrowSizeHalf.var]:`calc(${oi.arrowSize.varRef} / 2)`,[oi.arrowOffset.var]:`calc(${oi.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},F1e=e=>{if(e.startsWith("top"))return{property:"bottom",value:oi.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:oi.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:oi.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:oi.arrowOffset.varRef}},$1e={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{KO(e)},effect:({state:e})=>()=>{KO(e)}},KO=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");t&&Object.assign(t.style,{transform:"rotate(45deg)",background:oi.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:O1e(e.placement)})},z1e={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},H1e={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function V1e(e,t="ltr"){var n;const r=((n=z1e[e])==null?void 0:n[t])||e;return t==="ltr"?r:H1e[e]??r}function G$(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:s,gutter:l=8,flip:u=!0,boundary:d="clippingParents",preventOverflow:h=!0,matchWidth:m,direction:y="ltr"}=e,b=w.useRef(null),x=w.useRef(null),k=w.useRef(null),E=V1e(r,y),_=w.useRef(()=>{}),P=w.useCallback(()=>{var H;!t||!b.current||!x.current||((H=_.current)==null||H.call(_),k.current=A1e(b.current,x.current,{placement:E,modifiers:[$1e,j1e,N1e,{...D1e,enabled:!!m},{name:"eventListeners",...R1e(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:d}},...n??[]],strategy:i}),k.current.forceUpdate(),_.current=k.current.destroy)},[E,t,n,m,a,o,s,l,u,h,d,i]);w.useEffect(()=>()=>{var H;!b.current&&!x.current&&((H=k.current)==null||H.destroy(),k.current=null)},[]);const A=w.useCallback(H=>{b.current=H,P()},[P]),M=w.useCallback((H={},K=null)=>({...H,ref:Hn(A,K)}),[A]),R=w.useCallback(H=>{x.current=H,P()},[P]),D=w.useCallback((H={},K=null)=>({...H,ref:Hn(R,K),style:{...H.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,R,m]),j=w.useCallback((H={},K=null)=>{const{size:te,shadowColor:G,bg:F,style:W,...X}=H;return{...X,ref:K,"data-popper-arrow":"",style:W1e(H)}},[]),z=w.useCallback((H={},K=null)=>({...H,ref:K,"data-popper-arrow-inner":""}),[]);return{update(){var H;(H=k.current)==null||H.update()},forceUpdate(){var H;(H=k.current)==null||H.forceUpdate()},transformOrigin:oi.transformOrigin.varRef,referenceRef:A,popperRef:R,getPopperProps:D,getArrowProps:j,getArrowInnerProps:z,getReferenceProps:M}}function W1e(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function q$(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=Er(n),a=Er(t),[s,l]=w.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,d=r!==void 0,h=w.useId(),m=i??`disclosure-${h}`,y=w.useCallback(()=>{d||l(!1),a==null||a()},[d,a]),b=w.useCallback(()=>{d||l(!0),o==null||o()},[d,o]),x=w.useCallback(()=>{u?y():b()},[u,b,y]);function k(_={}){return{..._,"aria-expanded":u,"aria-controls":m,onClick(P){var A;(A=_.onClick)==null||A.call(_,P),x()}}}function E(_={}){return{..._,hidden:!u,id:m}}return{isOpen:u,onOpen:b,onClose:y,onToggle:x,isControlled:d,getButtonProps:k,getDisclosureProps:E}}function U1e(e){const{isOpen:t,ref:n}=e,[r,i]=w.useState(t),[o,a]=w.useState(!1);return w.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),jh(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=d0e(n.current),d=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(d)}}}function Y$(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var el={},G1e={get exports(){return el},set exports(e){el=e}},ja={},zh={},q1e={get exports(){return zh},set exports(e){zh=e}},K$={};/** + ${dF} + `});function Bh(e,t,n,r){const i=Er(n);return w.useEffect(()=>{const o=typeof e=="function"?e():e??document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e??document;o==null||o.removeEventListener(t,i,r)}}function Cme(e){return"current"in e}var fF=()=>typeof window<"u";function _me(){const e=navigator.userAgentData;return(e==null?void 0:e.platform)??navigator.platform}var kme=e=>fF()&&e.test(navigator.vendor),Eme=e=>fF()&&e.test(_me()),Pme=()=>Eme(/mac|iphone|ipad|ipod/i),Tme=()=>Pme()&&kme(/apple/i);function Lme(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var o;return((o=t.current)==null?void 0:o.ownerDocument)??document};Bh(i,"pointerdown",o=>{if(!Tme()||!r)return;const a=o.target,l=(n??[t]).some(u=>{const d=Cme(u)?u.current:u;return(d==null?void 0:d.contains(a))||d===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}var Ame=xre?w.useLayoutEffect:w.useEffect;function DO(e,t=[]){const n=w.useRef(e);return Ame(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Ome(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Mme(e,t){const n=w.useId();return w.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Yh(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=DO(n),a=DO(t),[s,l]=w.useState(e.defaultIsOpen||!1),[u,d]=Ome(r,s),h=Mme(i,"disclosure"),m=w.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),y=w.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),b=w.useCallback(()=>{(d?m:y)()},[d,y,m]);return{isOpen:!!d,onOpen:y,onClose:m,onToggle:b,isControlled:u,getButtonProps:(x={})=>({...x,"aria-expanded":d,"aria-controls":h,onClick:wre(x.onClick,b)}),getDisclosureProps:(x={})=>({...x,hidden:!d,id:h})}}function yk(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var bk=Ae(function(t,n){const{htmlSize:r,...i}=t,o=Mi("Input",i),a=Sn(i),s=hk(a),l=Qr("chakra-input",t.className);return N.createElement(we.input,{size:r,...s,__css:o.field,ref:n,className:l})});bk.displayName="Input";bk.id="Input";var[Ime,hF]=Pn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Rme=Ae(function(t,n){const r=Mi("Input",t),{children:i,className:o,...a}=Sn(t),s=Qr("chakra-input__group",o),l={},u=ex(i),d=r.field;u.forEach(m=>{r&&(d&&m.type.id==="InputLeftElement"&&(l.paddingStart=d.height??d.h),d&&m.type.id==="InputRightElement"&&(l.paddingEnd=d.height??d.h),m.type.id==="InputRightAddon"&&(l.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const h=u.map(m=>{var y,b;const x=yk({size:((y=m.props)==null?void 0:y.size)||t.size,variant:((b=m.props)==null?void 0:b.variant)||t.variant});return m.type.id!=="Input"?w.cloneElement(m,x):w.cloneElement(m,Object.assign(x,l,m.props))});return N.createElement(we.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},N.createElement(Ime,{value:r},h))});Rme.displayName="InputGroup";var Dme={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},Nme=we("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),Sk=Ae(function(t,n){const{placement:r="left",...i}=t,o=Dme[r]??{},a=hF();return N.createElement(Nme,{ref:n,...i,__css:{...a.addon,...o}})});Sk.displayName="InputAddon";var pF=Ae(function(t,n){return N.createElement(Sk,{ref:n,placement:"left",...t,className:Qr("chakra-input__left-addon",t.className)})});pF.displayName="InputLeftAddon";pF.id="InputLeftAddon";var gF=Ae(function(t,n){return N.createElement(Sk,{ref:n,placement:"right",...t,className:Qr("chakra-input__right-addon",t.className)})});gF.displayName="InputRightAddon";gF.id="InputRightAddon";var jme=we("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),ix=Ae(function(t,n){const{placement:r="left",...i}=t,o=hF(),a=o.field,l={[r==="left"?"insetStart":"insetEnd"]:"0",width:(a==null?void 0:a.height)??(a==null?void 0:a.h),height:(a==null?void 0:a.height)??(a==null?void 0:a.h),fontSize:a==null?void 0:a.fontSize,...o.element};return N.createElement(jme,{ref:n,__css:l,...i})});ix.id="InputElement";ix.displayName="InputElement";var mF=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__left-element",r);return N.createElement(ix,{ref:n,placement:"left",className:o,...i})});mF.id="InputLeftElement";mF.displayName="InputLeftElement";var vF=Ae(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__right-element",r);return N.createElement(ix,{ref:n,placement:"right",className:o,...i})});vF.id="InputRightElement";vF.displayName="InputRightElement";function Bme(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Yd(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Bme(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var $me=Ae(function(e,t){const{ratio:n=4/3,children:r,className:i,...o}=e,a=w.Children.only(r),s=Qr("chakra-aspect-ratio",i);return N.createElement(we.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:Yd(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o},a)});$me.displayName="AspectRatio";var Fme=Ae(function(t,n){const r=Oo("Badge",t),{className:i,...o}=Sn(t);return N.createElement(we.span,{ref:n,className:Qr("chakra-badge",t.className),...o,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Fme.displayName="Badge";var Eo=we("div");Eo.displayName="Box";var yF=Ae(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return N.createElement(Eo,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});yF.displayName="Square";var zme=Ae(function(t,n){const{size:r,...i}=t;return N.createElement(yF,{size:r,ref:n,borderRadius:"9999px",...i})});zme.displayName="Circle";var bF=we("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});bF.displayName="Center";var Hme={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Ae(function(t,n){const{axis:r="both",...i}=t;return N.createElement(we.div,{ref:n,__css:Hme[r],...i,position:"absolute"})});var Vme=Ae(function(t,n){const r=Oo("Code",t),{className:i,...o}=Sn(t);return N.createElement(we.code,{ref:n,className:Qr("chakra-code",t.className),...o,__css:{display:"inline-block",...r}})});Vme.displayName="Code";var Wme=Ae(function(t,n){const{className:r,centerContent:i,...o}=Sn(t),a=Oo("Container",t);return N.createElement(we.div,{ref:n,className:Qr("chakra-container",r),...o,__css:{...a,...i&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});Wme.displayName="Container";var Ume=Ae(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:o,borderRightWidth:a,borderWidth:s,borderStyle:l,borderColor:u,...d}=Oo("Divider",t),{className:h,orientation:m="horizontal",__css:y,...b}=Sn(t),x={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:i||o||s||"1px",width:"100%"}};return N.createElement(we.hr,{ref:n,"aria-orientation":m,...b,__css:{...d,border:"0",borderColor:u,borderStyle:l,...x[m],...y},className:Qr("chakra-divider",h)})});Ume.displayName="Divider";var je=Ae(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...d}=t,h={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return N.createElement(we.div,{ref:n,__css:h,...d})});je.displayName="Flex";var SF=Ae(function(t,n){const{templateAreas:r,gap:i,rowGap:o,columnGap:a,column:s,row:l,autoFlow:u,autoRows:d,templateRows:h,autoColumns:m,templateColumns:y,...b}=t,x={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:o,gridColumnGap:a,gridAutoColumns:m,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:d,gridTemplateRows:h,gridTemplateColumns:y};return N.createElement(we.div,{ref:n,__css:x,...b})});SF.displayName="Grid";function NO(e){return Yd(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Gme=Ae(function(t,n){const{area:r,colSpan:i,colStart:o,colEnd:a,rowEnd:s,rowSpan:l,rowStart:u,...d}=t,h=yk({gridArea:r,gridColumn:NO(i),gridRow:NO(l),gridColumnStart:o,gridColumnEnd:a,gridRowStart:u,gridRowEnd:s});return N.createElement(we.div,{ref:n,__css:h,...d})});Gme.displayName="GridItem";var $h=Ae(function(t,n){const r=Oo("Heading",t),{className:i,...o}=Sn(t);return N.createElement(we.h2,{ref:n,className:Qr("chakra-heading",t.className),...o,__css:r})});$h.displayName="Heading";Ae(function(t,n){const r=Oo("Mark",t),i=Sn(t);return N.createElement(Eo,{ref:n,...i,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var qme=Ae(function(t,n){const r=Oo("Kbd",t),{className:i,...o}=Sn(t);return N.createElement(we.kbd,{ref:n,className:Qr("chakra-kbd",i),...o,__css:{fontFamily:"mono",...r}})});qme.displayName="Kbd";var Fh=Ae(function(t,n){const r=Oo("Link",t),{className:i,isExternal:o,...a}=Sn(t);return N.createElement(we.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:Qr("chakra-link",i),...a,__css:r})});Fh.displayName="Link";Ae(function(t,n){const{isExternal:r,target:i,rel:o,className:a,...s}=t;return N.createElement(we.a,{...s,ref:n,className:Qr("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":o,target:r?"_blank":i,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});Ae(function(t,n){const{className:r,...i}=t;return N.createElement(we.div,{ref:n,position:"relative",...i,className:Qr("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[Yme,xF]=Pn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),xk=Ae(function(t,n){const r=Mi("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=Sn(t),u=ex(i),h=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return N.createElement(Yme,{value:r},N.createElement(we.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...h},...l},u))});xk.displayName="List";var Kme=Ae((e,t)=>{const{as:n,...r}=e;return N.createElement(xk,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});Kme.displayName="OrderedList";var wF=Ae(function(t,n){const{as:r,...i}=t;return N.createElement(xk,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});wF.displayName="UnorderedList";var Cv=Ae(function(t,n){const r=xF();return N.createElement(we.li,{ref:n,...t,__css:r.item})});Cv.displayName="ListItem";var Xme=Ae(function(t,n){const r=xF();return N.createElement(Na,{ref:n,role:"presentation",...t,__css:r.icon})});Xme.displayName="ListIcon";var Zme=Ae(function(t,n){const{columns:r,spacingX:i,spacingY:o,spacing:a,minChildWidth:s,...l}=t,u=y0(),d=s?Jme(s,u):e0e(r);return N.createElement(SF,{ref:n,gap:a,columnGap:i,rowGap:o,templateColumns:d,...l})});Zme.displayName="SimpleGrid";function Qme(e){return typeof e=="number"?`${e}px`:e}function Jme(e,t){return Yd(e,n=>{const r=rce("sizes",n,Qme(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function e0e(e){return Yd(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var CF=we("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});CF.displayName="Spacer";var K7="& > *:not(style) ~ *:not(style)";function t0e(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[K7]:Yd(n,i=>r[i])}}function n0e(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":Yd(n,i=>r[i])}}var _F=e=>N.createElement(we.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});_F.displayName="StackItem";var wk=Ae((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:d,shouldWrapChildren:h,...m}=e,y=n?"row":r??"column",b=w.useMemo(()=>t0e({direction:y,spacing:a}),[y,a]),x=w.useMemo(()=>n0e({spacing:a,direction:y}),[a,y]),k=!!u,E=!h&&!k,_=w.useMemo(()=>{const A=ex(l);return E?A:A.map((M,R)=>{const D=typeof M.key<"u"?M.key:R,j=R+1===A.length,H=h?N.createElement(_F,{key:D},M):M;if(!k)return H;const K=w.cloneElement(u,{__css:x}),te=j?null:K;return N.createElement(w.Fragment,{key:D},H,te)})},[u,x,k,E,h,l]),P=Qr("chakra-stack",d);return N.createElement(we.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:b.flexDirection,flexWrap:s,className:P,__css:k?{}:{[K7]:b[K7]},...m},_)});wk.displayName="Stack";var Ty=Ae((e,t)=>N.createElement(wk,{align:"center",...e,direction:"row",ref:t}));Ty.displayName="HStack";var yn=Ae((e,t)=>N.createElement(wk,{align:"center",...e,direction:"column",ref:t}));yn.displayName="VStack";var Yt=Ae(function(t,n){const r=Oo("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=Sn(t),u=yk({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return N.createElement(we.p,{ref:n,className:Qr("chakra-text",t.className),...u,...l,__css:r})});Yt.displayName="Text";function jO(e){return typeof e=="number"?`${e}px`:e}var r0e=Ae(function(t,n){const{spacing:r="0.5rem",spacingX:i,spacingY:o,children:a,justify:s,direction:l,align:u,className:d,shouldWrapChildren:h,...m}=t,y=w.useMemo(()=>{const{spacingX:x=r,spacingY:k=r}={spacingX:i,spacingY:o};return{"--chakra-wrap-x-spacing":E=>Yd(x,_=>jO(r7("space",_)(E))),"--chakra-wrap-y-spacing":E=>Yd(k,_=>jO(r7("space",_)(E))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,i,o,s,u,l]),b=w.useMemo(()=>h?w.Children.map(a,(x,k)=>N.createElement(kF,{key:k},x)):a,[a,h]);return N.createElement(we.div,{ref:n,className:Qr("chakra-wrap",d),overflow:"hidden",...m},N.createElement(we.ul,{className:"chakra-wrap__list",__css:y},b))});r0e.displayName="Wrap";var kF=Ae(function(t,n){const{className:r,...i}=t;return N.createElement(we.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:Qr("chakra-wrap__listitem",r),...i})});kF.displayName="WrapItem";var i0e={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},EF=i0e,Tg=()=>{},o0e={document:EF,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:Tg,removeEventListener:Tg,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:Tg,removeListener:Tg}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:Tg,setInterval:()=>0,clearInterval:Tg},a0e=o0e,s0e={window:a0e,document:EF},PF=typeof window<"u"?{window,document}:s0e,TF=w.createContext(PF);TF.displayName="EnvironmentContext";function LF(e){const{children:t,environment:n}=e,[r,i]=w.useState(null),[o,a]=w.useState(!1);w.useEffect(()=>a(!0),[]);const s=w.useMemo(()=>{if(n)return n;const l=r==null?void 0:r.ownerDocument,u=r==null?void 0:r.ownerDocument.defaultView;return l?{document:l,window:u}:PF},[r,n]);return N.createElement(TF.Provider,{value:s},t,!n&&o&&N.createElement("span",{id:"__chakra_env",hidden:!0,ref:l=>{w.startTransition(()=>{l&&i(l)})}}))}LF.displayName="EnvironmentProvider";var l0e=e=>e?"":void 0;function u0e(){const e=w.useRef(new Map),t=e.current,n=w.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=w.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return w.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function L6(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function c0e(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:d,tabIndex:h,onMouseOver:m,onMouseLeave:y,...b}=e,[x,k]=w.useState(!0),[E,_]=w.useState(!1),P=u0e(),A=Z=>{Z&&Z.tagName!=="BUTTON"&&k(!1)},M=x?h:h||0,R=n&&!r,D=w.useCallback(Z=>{if(n){Z.stopPropagation(),Z.preventDefault();return}Z.currentTarget.focus(),l==null||l(Z)},[n,l]),j=w.useCallback(Z=>{E&&L6(Z)&&(Z.preventDefault(),Z.stopPropagation(),_(!1),P.remove(document,"keyup",j,!1))},[E,P]),z=w.useCallback(Z=>{if(u==null||u(Z),n||Z.defaultPrevented||Z.metaKey||!L6(Z.nativeEvent)||x)return;const U=i&&Z.key==="Enter";o&&Z.key===" "&&(Z.preventDefault(),_(!0)),U&&(Z.preventDefault(),Z.currentTarget.click()),P.add(document,"keyup",j,!1)},[n,x,u,i,o,P,j]),H=w.useCallback(Z=>{if(d==null||d(Z),n||Z.defaultPrevented||Z.metaKey||!L6(Z.nativeEvent)||x)return;o&&Z.key===" "&&(Z.preventDefault(),_(!1),Z.currentTarget.click())},[o,x,n,d]),K=w.useCallback(Z=>{Z.button===0&&(_(!1),P.remove(document,"mouseup",K,!1))},[P]),te=w.useCallback(Z=>{if(Z.button!==0)return;if(n){Z.stopPropagation(),Z.preventDefault();return}x||_(!0),Z.currentTarget.focus({preventScroll:!0}),P.add(document,"mouseup",K,!1),a==null||a(Z)},[n,x,a,P,K]),G=w.useCallback(Z=>{Z.button===0&&(x||_(!1),s==null||s(Z))},[s,x]),$=w.useCallback(Z=>{if(n){Z.preventDefault();return}m==null||m(Z)},[n,m]),W=w.useCallback(Z=>{E&&(Z.preventDefault(),_(!1)),y==null||y(Z)},[E,y]),X=Hn(t,A);return x?{...b,ref:X,type:"button","aria-disabled":R?void 0:n,disabled:R,onClick:D,onMouseDown:a,onMouseUp:s,onKeyUp:d,onKeyDown:u,onMouseOver:m,onMouseLeave:y}:{...b,ref:X,role:"button","data-active":l0e(E),"aria-disabled":n?"true":void 0,tabIndex:R?void 0:M,onClick:D,onMouseDown:te,onMouseUp:G,onKeyUp:H,onKeyDown:z,onMouseOver:$,onMouseLeave:W}}function AF(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function OF(e){if(!AF(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function d0e(e){var t;return((t=MF(e))==null?void 0:t.defaultView)??window}function MF(e){return AF(e)?e.ownerDocument:document}function f0e(e){return MF(e).activeElement}var IF=e=>e.hasAttribute("tabindex"),h0e=e=>IF(e)&&e.tabIndex===-1;function p0e(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function RF(e){return e.parentElement&&RF(e.parentElement)?!0:e.hidden}function g0e(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function DF(e){if(!OF(e)||RF(e)||p0e(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():g0e(e)?!0:IF(e)}function m0e(e){return e?OF(e)&&DF(e)&&!h0e(e):!1}var v0e=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],y0e=v0e.join(),b0e=e=>e.offsetWidth>0&&e.offsetHeight>0;function NF(e){const t=Array.from(e.querySelectorAll(y0e));return t.unshift(e),t.filter(n=>DF(n)&&b0e(n))}function S0e(e){const t=e.current;if(!t)return!1;const n=f0e(t);return!n||t.contains(n)?!1:!!m0e(n)}function x0e(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;qd(()=>{if(!o||S0e(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var w0e={preventScroll:!0,shouldFocus:!1};function C0e(e,t=w0e){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=_0e(e)?e.current:e,s=i&&o,l=w.useRef(s),u=w.useRef(o);Gs(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const d=w.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=NF(a);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[o,r,a,n]);qd(()=>{d()},[d]),Bh(a,"transitionend",d)}function _0e(e){return"current"in e}var Qo="top",cs="bottom",ds="right",Jo="left",Ck="auto",Ly=[Qo,cs,ds,Jo],Xm="start",D2="end",k0e="clippingParents",jF="viewport",X1="popper",E0e="reference",BO=Ly.reduce(function(e,t){return e.concat([t+"-"+Xm,t+"-"+D2])},[]),BF=[].concat(Ly,[Ck]).reduce(function(e,t){return e.concat([t,t+"-"+Xm,t+"-"+D2])},[]),P0e="beforeRead",T0e="read",L0e="afterRead",A0e="beforeMain",O0e="main",M0e="afterMain",I0e="beforeWrite",R0e="write",D0e="afterWrite",N0e=[P0e,T0e,L0e,A0e,O0e,M0e,I0e,R0e,D0e];function lu(e){return e?(e.nodeName||"").toLowerCase():null}function gs(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Kh(e){var t=gs(e).Element;return e instanceof t||e instanceof Element}function as(e){var t=gs(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function _k(e){if(typeof ShadowRoot>"u")return!1;var t=gs(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function j0e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!as(o)||!lu(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function B0e(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!as(i)||!lu(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const $0e={name:"applyStyles",enabled:!0,phase:"write",fn:j0e,effect:B0e,requires:["computeStyles"]};function Jl(e){return e.split("-")[0]}var zh=Math.max,h5=Math.min,Zm=Math.round;function X7(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function $F(){return!/^((?!chrome|android).)*safari/i.test(X7())}function Qm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&as(e)&&(i=e.offsetWidth>0&&Zm(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Zm(r.height)/e.offsetHeight||1);var a=Kh(e)?gs(e):window,s=a.visualViewport,l=!$F()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,d=(r.top+(l&&s?s.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:d,right:u+h,bottom:d+m,left:u,x:u,y:d}}function kk(e){var t=Qm(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function FF(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_k(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function nc(e){return gs(e).getComputedStyle(e)}function F0e(e){return["table","td","th"].indexOf(lu(e))>=0}function lf(e){return((Kh(e)?e.ownerDocument:e.document)||window.document).documentElement}function ox(e){return lu(e)==="html"?e:e.assignedSlot||e.parentNode||(_k(e)?e.host:null)||lf(e)}function $O(e){return!as(e)||nc(e).position==="fixed"?null:e.offsetParent}function z0e(e){var t=/firefox/i.test(X7()),n=/Trident/i.test(X7());if(n&&as(e)){var r=nc(e);if(r.position==="fixed")return null}var i=ox(e);for(_k(i)&&(i=i.host);as(i)&&["html","body"].indexOf(lu(i))<0;){var o=nc(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Ay(e){for(var t=gs(e),n=$O(e);n&&F0e(n)&&nc(n).position==="static";)n=$O(n);return n&&(lu(n)==="html"||lu(n)==="body"&&nc(n).position==="static")?t:n||z0e(e)||t}function Ek(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Jv(e,t,n){return zh(e,h5(t,n))}function H0e(e,t,n){var r=Jv(e,t,n);return r>n?n:r}function zF(){return{top:0,right:0,bottom:0,left:0}}function HF(e){return Object.assign({},zF(),e)}function VF(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var V0e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,HF(typeof t!="number"?t:VF(t,Ly))};function W0e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Jl(n.placement),l=Ek(s),u=[Jo,ds].indexOf(s)>=0,d=u?"height":"width";if(!(!o||!a)){var h=V0e(i.padding,n),m=kk(o),y=l==="y"?Qo:Jo,b=l==="y"?cs:ds,x=n.rects.reference[d]+n.rects.reference[l]-a[l]-n.rects.popper[d],k=a[l]-n.rects.reference[l],E=Ay(o),_=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,P=x/2-k/2,A=h[y],M=_-m[d]-h[b],R=_/2-m[d]/2+P,D=Jv(A,R,M),j=l;n.modifiersData[r]=(t={},t[j]=D,t.centerOffset=D-R,t)}}function U0e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||FF(t.elements.popper,i)&&(t.elements.arrow=i))}const G0e={name:"arrow",enabled:!0,phase:"main",fn:W0e,effect:U0e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Jm(e){return e.split("-")[1]}var q0e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Y0e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Zm(t*i)/i||0,y:Zm(n*i)/i||0}}function FO(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,m=a.x,y=m===void 0?0:m,b=a.y,x=b===void 0?0:b,k=typeof d=="function"?d({x:y,y:x}):{x:y,y:x};y=k.x,x=k.y;var E=a.hasOwnProperty("x"),_=a.hasOwnProperty("y"),P=Jo,A=Qo,M=window;if(u){var R=Ay(n),D="clientHeight",j="clientWidth";if(R===gs(n)&&(R=lf(n),nc(R).position!=="static"&&s==="absolute"&&(D="scrollHeight",j="scrollWidth")),R=R,i===Qo||(i===Jo||i===ds)&&o===D2){A=cs;var z=h&&R===M&&M.visualViewport?M.visualViewport.height:R[D];x-=z-r.height,x*=l?1:-1}if(i===Jo||(i===Qo||i===cs)&&o===D2){P=ds;var H=h&&R===M&&M.visualViewport?M.visualViewport.width:R[j];y-=H-r.width,y*=l?1:-1}}var K=Object.assign({position:s},u&&q0e),te=d===!0?Y0e({x:y,y:x}):{x:y,y:x};if(y=te.x,x=te.y,l){var G;return Object.assign({},K,(G={},G[A]=_?"0":"",G[P]=E?"0":"",G.transform=(M.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",G))}return Object.assign({},K,(t={},t[A]=_?x+"px":"",t[P]=E?y+"px":"",t.transform="",t))}function K0e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Jl(t.placement),variation:Jm(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,FO(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,FO(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const X0e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:K0e,data:{}};var ab={passive:!0};function Z0e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=gs(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,ab)}),s&&l.addEventListener("resize",n.update,ab),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,ab)}),s&&l.removeEventListener("resize",n.update,ab)}}const Q0e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Z0e,data:{}};var J0e={left:"right",right:"left",bottom:"top",top:"bottom"};function y4(e){return e.replace(/left|right|bottom|top/g,function(t){return J0e[t]})}var e1e={start:"end",end:"start"};function zO(e){return e.replace(/start|end/g,function(t){return e1e[t]})}function Pk(e){var t=gs(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Tk(e){return Qm(lf(e)).left+Pk(e).scrollLeft}function t1e(e,t){var n=gs(e),r=lf(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=$F();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+Tk(e),y:l}}function n1e(e){var t,n=lf(e),r=Pk(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=zh(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=zh(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Tk(e),l=-r.scrollTop;return nc(i||n).direction==="rtl"&&(s+=zh(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function Lk(e){var t=nc(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function WF(e){return["html","body","#document"].indexOf(lu(e))>=0?e.ownerDocument.body:as(e)&&Lk(e)?e:WF(ox(e))}function e2(e,t){var n;t===void 0&&(t=[]);var r=WF(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=gs(r),a=i?[o].concat(o.visualViewport||[],Lk(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(e2(ox(a)))}function Z7(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function r1e(e,t){var n=Qm(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function HO(e,t,n){return t===jF?Z7(t1e(e,n)):Kh(t)?r1e(t,n):Z7(n1e(lf(e)))}function i1e(e){var t=e2(ox(e)),n=["absolute","fixed"].indexOf(nc(e).position)>=0,r=n&&as(e)?Ay(e):e;return Kh(r)?t.filter(function(i){return Kh(i)&&FF(i,r)&&lu(i)!=="body"}):[]}function o1e(e,t,n,r){var i=t==="clippingParents"?i1e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var d=HO(e,u,r);return l.top=zh(d.top,l.top),l.right=h5(d.right,l.right),l.bottom=h5(d.bottom,l.bottom),l.left=zh(d.left,l.left),l},HO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function UF(e){var t=e.reference,n=e.element,r=e.placement,i=r?Jl(r):null,o=r?Jm(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Qo:l={x:a,y:t.y-n.height};break;case cs:l={x:a,y:t.y+t.height};break;case ds:l={x:t.x+t.width,y:s};break;case Jo:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?Ek(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case Xm:l[u]=l[u]-(t[d]/2-n[d]/2);break;case D2:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function N2(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?k0e:s,u=n.rootBoundary,d=u===void 0?jF:u,h=n.elementContext,m=h===void 0?X1:h,y=n.altBoundary,b=y===void 0?!1:y,x=n.padding,k=x===void 0?0:x,E=HF(typeof k!="number"?k:VF(k,Ly)),_=m===X1?E0e:X1,P=e.rects.popper,A=e.elements[b?_:m],M=o1e(Kh(A)?A:A.contextElement||lf(e.elements.popper),l,d,a),R=Qm(e.elements.reference),D=UF({reference:R,element:P,strategy:"absolute",placement:i}),j=Z7(Object.assign({},P,D)),z=m===X1?j:R,H={top:M.top-z.top+E.top,bottom:z.bottom-M.bottom+E.bottom,left:M.left-z.left+E.left,right:z.right-M.right+E.right},K=e.modifiersData.offset;if(m===X1&&K){var te=K[i];Object.keys(H).forEach(function(G){var $=[ds,cs].indexOf(G)>=0?1:-1,W=[Qo,cs].indexOf(G)>=0?"y":"x";H[G]+=te[W]*$})}return H}function a1e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?BF:l,d=Jm(r),h=d?s?BO:BO.filter(function(b){return Jm(b)===d}):Ly,m=h.filter(function(b){return u.indexOf(b)>=0});m.length===0&&(m=h);var y=m.reduce(function(b,x){return b[x]=N2(e,{placement:x,boundary:i,rootBoundary:o,padding:a})[Jl(x)],b},{});return Object.keys(y).sort(function(b,x){return y[b]-y[x]})}function s1e(e){if(Jl(e)===Ck)return[];var t=y4(e);return[zO(e),t,zO(t)]}function l1e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,y=n.flipVariations,b=y===void 0?!0:y,x=n.allowedAutoPlacements,k=t.options.placement,E=Jl(k),_=E===k,P=l||(_||!b?[y4(k)]:s1e(k)),A=[k].concat(P).reduce(function(de,ze){return de.concat(Jl(ze)===Ck?a1e(t,{placement:ze,boundary:d,rootBoundary:h,padding:u,flipVariations:b,allowedAutoPlacements:x}):ze)},[]),M=t.rects.reference,R=t.rects.popper,D=new Map,j=!0,z=A[0],H=0;H=0,W=$?"width":"height",X=N2(t,{placement:K,boundary:d,rootBoundary:h,altBoundary:m,padding:u}),Z=$?G?ds:Jo:G?cs:Qo;M[W]>R[W]&&(Z=y4(Z));var U=y4(Z),Q=[];if(o&&Q.push(X[te]<=0),s&&Q.push(X[Z]<=0,X[U]<=0),Q.every(function(de){return de})){z=K,j=!1;break}D.set(K,Q)}if(j)for(var re=b?3:1,he=function(ze){var Me=A.find(function(rt){var We=D.get(rt);if(We)return We.slice(0,ze).every(function(Be){return Be})});if(Me)return z=Me,"break"},Ee=re;Ee>0;Ee--){var Ce=he(Ee);if(Ce==="break")break}t.placement!==z&&(t.modifiersData[r]._skip=!0,t.placement=z,t.reset=!0)}}const u1e={name:"flip",enabled:!0,phase:"main",fn:l1e,requiresIfExists:["offset"],data:{_skip:!1}};function VO(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function WO(e){return[Qo,ds,cs,Jo].some(function(t){return e[t]>=0})}function c1e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=N2(t,{elementContext:"reference"}),s=N2(t,{altBoundary:!0}),l=VO(a,r),u=VO(s,i,o),d=WO(l),h=WO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const d1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:c1e};function f1e(e,t,n){var r=Jl(e),i=[Jo,Qo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Jo,ds].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function h1e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=BF.reduce(function(d,h){return d[h]=f1e(h,t.rects,o),d},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const p1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:h1e};function g1e(e){var t=e.state,n=e.name;t.modifiersData[n]=UF({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const m1e={name:"popperOffsets",enabled:!0,phase:"read",fn:g1e,data:{}};function v1e(e){return e==="x"?"y":"x"}function y1e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,m=n.tether,y=m===void 0?!0:m,b=n.tetherOffset,x=b===void 0?0:b,k=N2(t,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),E=Jl(t.placement),_=Jm(t.placement),P=!_,A=Ek(E),M=v1e(A),R=t.modifiersData.popperOffsets,D=t.rects.reference,j=t.rects.popper,z=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,H=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,te={x:0,y:0};if(R){if(o){var G,$=A==="y"?Qo:Jo,W=A==="y"?cs:ds,X=A==="y"?"height":"width",Z=R[A],U=Z+k[$],Q=Z-k[W],re=y?-j[X]/2:0,he=_===Xm?D[X]:j[X],Ee=_===Xm?-j[X]:-D[X],Ce=t.elements.arrow,de=y&&Ce?kk(Ce):{width:0,height:0},ze=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:zF(),Me=ze[$],rt=ze[W],We=Jv(0,D[X],de[X]),Be=P?D[X]/2-re-We-Me-H.mainAxis:he-We-Me-H.mainAxis,wt=P?-D[X]/2+re+We+rt+H.mainAxis:Ee+We+rt+H.mainAxis,$e=t.elements.arrow&&Ay(t.elements.arrow),at=$e?A==="y"?$e.clientTop||0:$e.clientLeft||0:0,bt=(G=K==null?void 0:K[A])!=null?G:0,Le=Z+Be-bt-at,ut=Z+wt-bt,Mt=Jv(y?h5(U,Le):U,Z,y?zh(Q,ut):Q);R[A]=Mt,te[A]=Mt-Z}if(s){var ct,_t=A==="x"?Qo:Jo,un=A==="x"?cs:ds,ae=R[M],De=M==="y"?"height":"width",Ke=ae+k[_t],Xe=ae-k[un],Se=[Qo,Jo].indexOf(E)!==-1,Ne=(ct=K==null?void 0:K[M])!=null?ct:0,Ct=Se?Ke:ae-D[De]-j[De]-Ne+H.altAxis,Nt=Se?ae+D[De]+j[De]-Ne-H.altAxis:Xe,Te=y&&Se?H0e(Ct,ae,Nt):Jv(y?Ct:Ke,ae,y?Nt:Xe);R[M]=Te,te[M]=Te-ae}t.modifiersData[r]=te}}const b1e={name:"preventOverflow",enabled:!0,phase:"main",fn:y1e,requiresIfExists:["offset"]};function S1e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function x1e(e){return e===gs(e)||!as(e)?Pk(e):S1e(e)}function w1e(e){var t=e.getBoundingClientRect(),n=Zm(t.width)/e.offsetWidth||1,r=Zm(t.height)/e.offsetHeight||1;return n!==1||r!==1}function C1e(e,t,n){n===void 0&&(n=!1);var r=as(t),i=as(t)&&w1e(t),o=lf(t),a=Qm(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((lu(t)!=="body"||Lk(o))&&(s=x1e(t)),as(t)?(l=Qm(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Tk(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function _1e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function k1e(e){var t=_1e(e);return N0e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function E1e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function P1e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var UO={placement:"bottom",modifiers:[],strategy:"absolute"};function GO(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),oi={arrowShadowColor:Lg("--popper-arrow-shadow-color"),arrowSize:Lg("--popper-arrow-size","8px"),arrowSizeHalf:Lg("--popper-arrow-size-half"),arrowBg:Lg("--popper-arrow-bg"),transformOrigin:Lg("--popper-transform-origin"),arrowOffset:Lg("--popper-arrow-offset")};function O1e(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var M1e={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},I1e=e=>M1e[e],qO={scroll:!0,resize:!0};function R1e(e){let t;return typeof e=="object"?t={enabled:!0,options:{...qO,...e}}:t={enabled:e,options:qO},t}var D1e={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},N1e={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{YO(e)},effect:({state:e})=>()=>{YO(e)}},YO=e=>{e.elements.popper.style.setProperty(oi.transformOrigin.var,I1e(e.placement))},j1e={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{B1e(e)}},B1e=e=>{var t;if(!e.placement)return;const n=$1e(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:oi.arrowSize.varRef,height:oi.arrowSize.varRef,zIndex:-1});const r={[oi.arrowSizeHalf.var]:`calc(${oi.arrowSize.varRef} / 2)`,[oi.arrowOffset.var]:`calc(${oi.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},$1e=e=>{if(e.startsWith("top"))return{property:"bottom",value:oi.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:oi.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:oi.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:oi.arrowOffset.varRef}},F1e={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{KO(e)},effect:({state:e})=>()=>{KO(e)}},KO=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");t&&Object.assign(t.style,{transform:"rotate(45deg)",background:oi.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:O1e(e.placement)})},z1e={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},H1e={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function V1e(e,t="ltr"){var n;const r=((n=z1e[e])==null?void 0:n[t])||e;return t==="ltr"?r:H1e[e]??r}function GF(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:s,gutter:l=8,flip:u=!0,boundary:d="clippingParents",preventOverflow:h=!0,matchWidth:m,direction:y="ltr"}=e,b=w.useRef(null),x=w.useRef(null),k=w.useRef(null),E=V1e(r,y),_=w.useRef(()=>{}),P=w.useCallback(()=>{var H;!t||!b.current||!x.current||((H=_.current)==null||H.call(_),k.current=A1e(b.current,x.current,{placement:E,modifiers:[F1e,j1e,N1e,{...D1e,enabled:!!m},{name:"eventListeners",...R1e(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:d}},...n??[]],strategy:i}),k.current.forceUpdate(),_.current=k.current.destroy)},[E,t,n,m,a,o,s,l,u,h,d,i]);w.useEffect(()=>()=>{var H;!b.current&&!x.current&&((H=k.current)==null||H.destroy(),k.current=null)},[]);const A=w.useCallback(H=>{b.current=H,P()},[P]),M=w.useCallback((H={},K=null)=>({...H,ref:Hn(A,K)}),[A]),R=w.useCallback(H=>{x.current=H,P()},[P]),D=w.useCallback((H={},K=null)=>({...H,ref:Hn(R,K),style:{...H.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,R,m]),j=w.useCallback((H={},K=null)=>{const{size:te,shadowColor:G,bg:$,style:W,...X}=H;return{...X,ref:K,"data-popper-arrow":"",style:W1e(H)}},[]),z=w.useCallback((H={},K=null)=>({...H,ref:K,"data-popper-arrow-inner":""}),[]);return{update(){var H;(H=k.current)==null||H.update()},forceUpdate(){var H;(H=k.current)==null||H.forceUpdate()},transformOrigin:oi.transformOrigin.varRef,referenceRef:A,popperRef:R,getPopperProps:D,getArrowProps:j,getArrowInnerProps:z,getReferenceProps:M}}function W1e(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function qF(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=Er(n),a=Er(t),[s,l]=w.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,d=r!==void 0,h=w.useId(),m=i??`disclosure-${h}`,y=w.useCallback(()=>{d||l(!1),a==null||a()},[d,a]),b=w.useCallback(()=>{d||l(!0),o==null||o()},[d,o]),x=w.useCallback(()=>{u?y():b()},[u,b,y]);function k(_={}){return{..._,"aria-expanded":u,"aria-controls":m,onClick(P){var A;(A=_.onClick)==null||A.call(_,P),x()}}}function E(_={}){return{..._,hidden:!u,id:m}}return{isOpen:u,onOpen:b,onClose:y,onToggle:x,isControlled:d,getButtonProps:k,getDisclosureProps:E}}function U1e(e){const{isOpen:t,ref:n}=e,[r,i]=w.useState(t),[o,a]=w.useState(!1);return w.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),Bh(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=d0e(n.current),d=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(d)}}}function YF(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var el={},G1e={get exports(){return el},set exports(e){el=e}},ja={},Hh={},q1e={get exports(){return Hh},set exports(e){Hh=e}},KF={};/** * @license React * scheduler.production.min.js * @@ -352,7 +352,7 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(U,Q){var re=U.length;U.push(Q);e:for(;0>>1,Ee=U[fe];if(0>>1;fei(ze,re))Mei(rt,ze)?(U[fe]=rt,U[Me]=re,fe=Me):(U[fe]=ze,U[ye]=re,fe=ye);else if(Mei(rt,re))U[fe]=rt,U[Me]=re,fe=Me;else break e}}return Q}function i(U,Q){var re=U.sortIndex-Q.sortIndex;return re!==0?re:U.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],d=1,h=null,m=3,y=!1,b=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(U){for(var Q=n(u);Q!==null;){if(Q.callback===null)r(u);else if(Q.startTime<=U)r(u),Q.sortIndex=Q.expirationTime,t(l,Q);else break;Q=n(u)}}function A(U){if(x=!1,P(U),!b)if(n(l)!==null)b=!0,X(M);else{var Q=n(u);Q!==null&&Z(A,Q.startTime-U)}}function M(U,Q){b=!1,x&&(x=!1,E(j),j=-1),y=!0;var re=m;try{for(P(Q),h=n(l);h!==null&&(!(h.expirationTime>Q)||U&&!K());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,m=h.priorityLevel;var Ee=fe(h.expirationTime<=Q);Q=e.unstable_now(),typeof Ee=="function"?h.callback=Ee:h===n(l)&&r(l),P(Q)}else r(l);h=n(l)}if(h!==null)var be=!0;else{var ye=n(u);ye!==null&&Z(A,ye.startTime-Q),be=!1}return be}finally{h=null,m=re,y=!1}}var R=!1,D=null,j=-1,z=5,H=-1;function K(){return!(e.unstable_now()-HU||125fe?(U.sortIndex=re,t(u,U),n(l)===null&&U===n(u)&&(x?(E(j),j=-1):x=!0,Z(A,re-fe))):(U.sortIndex=Ee,t(l,U),b||y||(b=!0,X(M))),U},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(U){var Q=m;return function(){var re=m;m=Q;try{return U.apply(this,arguments)}finally{m=re}}}})(K$);(function(e){e.exports=K$})(q1e);/** + */(function(e){function t(U,Q){var re=U.length;U.push(Q);e:for(;0>>1,Ee=U[he];if(0>>1;hei(ze,re))Mei(rt,ze)?(U[he]=rt,U[Me]=re,he=Me):(U[he]=ze,U[de]=re,he=de);else if(Mei(rt,re))U[he]=rt,U[Me]=re,he=Me;else break e}}return Q}function i(U,Q){var re=U.sortIndex-Q.sortIndex;return re!==0?re:U.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],d=1,h=null,m=3,y=!1,b=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(U){for(var Q=n(u);Q!==null;){if(Q.callback===null)r(u);else if(Q.startTime<=U)r(u),Q.sortIndex=Q.expirationTime,t(l,Q);else break;Q=n(u)}}function A(U){if(x=!1,P(U),!b)if(n(l)!==null)b=!0,X(M);else{var Q=n(u);Q!==null&&Z(A,Q.startTime-U)}}function M(U,Q){b=!1,x&&(x=!1,E(j),j=-1),y=!0;var re=m;try{for(P(Q),h=n(l);h!==null&&(!(h.expirationTime>Q)||U&&!K());){var he=h.callback;if(typeof he=="function"){h.callback=null,m=h.priorityLevel;var Ee=he(h.expirationTime<=Q);Q=e.unstable_now(),typeof Ee=="function"?h.callback=Ee:h===n(l)&&r(l),P(Q)}else r(l);h=n(l)}if(h!==null)var Ce=!0;else{var de=n(u);de!==null&&Z(A,de.startTime-Q),Ce=!1}return Ce}finally{h=null,m=re,y=!1}}var R=!1,D=null,j=-1,z=5,H=-1;function K(){return!(e.unstable_now()-HU||125he?(U.sortIndex=re,t(u,U),n(l)===null&&U===n(u)&&(x?(E(j),j=-1):x=!0,Z(A,re-he))):(U.sortIndex=Ee,t(l,U),b||y||(b=!0,X(M))),U},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(U){var Q=m;return function(){var re=m;m=Q;try{return U.apply(this,arguments)}finally{m=re}}}})(KF);(function(e){e.exports=KF})(q1e);/** * @license React * react-dom.production.min.js * @@ -360,14 +360,14 @@ var wee=Object.defineProperty;var Cee=(e,t,n)=>t in e?wee(e,t,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var X$=w,Ia=zh;function Ve(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Q7=Object.prototype.hasOwnProperty,Y1e=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,XO={},ZO={};function K1e(e){return Q7.call(ZO,e)?!0:Q7.call(XO,e)?!1:Y1e.test(e)?ZO[e]=!0:(XO[e]=!0,!1)}function X1e(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Z1e(e,t,n,r){if(t===null||typeof t>"u"||X1e(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mo(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Yi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Yi[e]=new Mo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Yi[t]=new Mo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Yi[e]=new Mo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Yi[e]=new Mo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Yi[e]=new Mo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Yi[e]=new Mo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Yi[e]=new Mo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Yi[e]=new Mo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Yi[e]=new Mo(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ak=/[\-:]([a-z])/g;function Ok(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ak,Ok);Yi[t]=new Mo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Yi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!1,!1)});Yi.xlinkHref=new Mo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Yi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!0,!0)});function Mk(e,t,n,r){var i=Yi.hasOwnProperty(t)?Yi[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Q7=Object.prototype.hasOwnProperty,Y1e=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,XO={},ZO={};function K1e(e){return Q7.call(ZO,e)?!0:Q7.call(XO,e)?!1:Y1e.test(e)?ZO[e]=!0:(XO[e]=!0,!1)}function X1e(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Z1e(e,t,n,r){if(t===null||typeof t>"u"||X1e(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mo(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Zi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Zi[e]=new Mo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Zi[t]=new Mo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Zi[e]=new Mo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Zi[e]=new Mo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Zi[e]=new Mo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Zi[e]=new Mo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Zi[e]=new Mo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Zi[e]=new Mo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Zi[e]=new Mo(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ak=/[\-:]([a-z])/g;function Ok(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ak,Ok);Zi[t]=new Mo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ak,Ok);Zi[t]=new Mo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ak,Ok);Zi[t]=new Mo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Zi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!1,!1)});Zi.xlinkHref=new Mo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Zi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!0,!0)});function Mk(e,t,n,r){var i=Zi.hasOwnProperty(t)?Zi[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` -`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{O6=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?wv(e):""}function Q1e(e){switch(e.tag){case 5:return wv(e.type);case 16:return wv("Lazy");case 13:return wv("Suspense");case 19:return wv("SuspenseList");case 0:case 2:case 15:return e=M6(e.type,!1),e;case 11:return e=M6(e.type.render,!1),e;case 1:return e=M6(e.type,!0),e;default:return""}}function n9(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Jg:return"Fragment";case Qg:return"Portal";case J7:return"Profiler";case Ik:return"StrictMode";case e9:return"Suspense";case t9:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case J$:return(e.displayName||"Context")+".Consumer";case Q$:return(e._context.displayName||"Context")+".Provider";case Rk:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dk:return t=e.displayName||null,t!==null?t:n9(e.type)||"Memo";case md:t=e._payload,e=e._init;try{return n9(e(t))}catch{}}return null}function J1e(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return n9(t);case 8:return t===Ik?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Yd(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tz(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function eve(e){var t=tz(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ab(e){e._valueTracker||(e._valueTracker=eve(e))}function nz(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tz(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function p5(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function r9(e,t){var n=t.checked;return Lr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function JO(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Yd(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rz(e,t){t=t.checked,t!=null&&Mk(e,"checked",t,!1)}function i9(e,t){rz(e,t);var n=Yd(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?o9(e,t.type,n):t.hasOwnProperty("defaultValue")&&o9(e,t.type,Yd(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function eM(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function o9(e,t,n){(t!=="number"||p5(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cv=Array.isArray;function Tm(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=sb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function N2(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jv={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tve=["Webkit","ms","Moz","O"];Object.keys(Jv).forEach(function(e){tve.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jv[t]=Jv[e]})});function sz(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jv.hasOwnProperty(e)&&Jv[e]?(""+t).trim():t+"px"}function lz(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=sz(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var nve=Lr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function l9(e,t){if(t){if(nve[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ve(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ve(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ve(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ve(62))}}function u9(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var c9=null;function Nk(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var d9=null,Lm=null,Am=null;function rM(e){if(e=Oy(e)){if(typeof d9!="function")throw Error(Ve(280));var t=e.stateNode;t&&(t=cx(t),d9(e.stateNode,e.type,t))}}function uz(e){Lm?Am?Am.push(e):Am=[e]:Lm=e}function cz(){if(Lm){var e=Lm,t=Am;if(Am=Lm=null,rM(e),t)for(e=0;e>>=0,e===0?32:31-(hve(e)/pve|0)|0}var lb=64,ub=4194304;function _v(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function y5(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=_v(s):(o&=a,o!==0&&(r=_v(o)))}else a=n&~i,a!==0?r=_v(a):o!==0&&(r=_v(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ly(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xs(t),e[t]=n}function yve(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=t2),fM=String.fromCharCode(32),hM=!1;function Az(e,t){switch(e){case"keyup":return Gve.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Oz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var em=!1;function Yve(e,t){switch(e){case"compositionend":return Oz(t);case"keypress":return t.which!==32?null:(hM=!0,fM);case"textInput":return e=t.data,e===fM&&hM?null:e;default:return null}}function Kve(e,t){if(em)return e==="compositionend"||!Wk&&Az(e,t)?(e=Tz(),b4=zk=Ed=null,em=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=vM(n)}}function Dz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nz(){for(var e=window,t=p5();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=p5(e.document)}return t}function Uk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function i2e(e){var t=Nz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Dz(n.ownerDocument.documentElement,n)){if(r!==null&&Uk(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=yM(n,o);var a=yM(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,tm=null,v9=null,r2=null,y9=!1;function bM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;y9||tm==null||tm!==p5(r)||(r=tm,"selectionStart"in r&&Uk(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),r2&&H2(r2,r)||(r2=r,r=x5(v9,"onSelect"),0im||(e.current=_9[im],_9[im]=null,im--)}function rr(e,t){im++,_9[im]=e.current,e.current=t}var Kd={},lo=uf(Kd),ea=uf(!1),Kh=Kd;function e0(e,t){var n=e.type.contextTypes;if(!n)return Kd;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ta(e){return e=e.childContextTypes,e!=null}function C5(){hr(ea),hr(lo)}function EM(e,t,n){if(lo.current!==Kd)throw Error(Ve(168));rr(lo,t),rr(ea,n)}function Uz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Ve(108,J1e(e)||"Unknown",i));return Lr({},n,r)}function _5(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kd,Kh=lo.current,rr(lo,e),rr(ea,ea.current),!0}function PM(e,t,n){var r=e.stateNode;if(!r)throw Error(Ve(169));n?(e=Uz(e,t,Kh),r.__reactInternalMemoizedMergedChildContext=e,hr(ea),hr(lo),rr(lo,e)):hr(ea),rr(ea,n)}var Wu=null,dx=!1,G6=!1;function Gz(e){Wu===null?Wu=[e]:Wu.push(e)}function m2e(e){dx=!0,Gz(e)}function cf(){if(!G6&&Wu!==null){G6=!0;var e=0,t=Bn;try{var n=Wu;for(Bn=1;e>=a,i-=a,qu=1<<32-Xs(t)+i|n<j?(z=D,D=null):z=D.sibling;var H=m(E,D,P[j],A);if(H===null){D===null&&(D=z);break}e&&D&&H.alternate===null&&t(E,D),_=o(H,_,j),R===null?M=H:R.sibling=H,R=H,D=z}if(j===P.length)return n(E,D),br&&ph(E,j),M;if(D===null){for(;jj?(z=D,D=null):z=D.sibling;var K=m(E,D,H.value,A);if(K===null){D===null&&(D=z);break}e&&D&&K.alternate===null&&t(E,D),_=o(K,_,j),R===null?M=K:R.sibling=K,R=K,D=z}if(H.done)return n(E,D),br&&ph(E,j),M;if(D===null){for(;!H.done;j++,H=P.next())H=h(E,H.value,A),H!==null&&(_=o(H,_,j),R===null?M=H:R.sibling=H,R=H);return br&&ph(E,j),M}for(D=r(E,D);!H.done;j++,H=P.next())H=y(D,E,j,H.value,A),H!==null&&(e&&H.alternate!==null&&D.delete(H.key===null?j:H.key),_=o(H,_,j),R===null?M=H:R.sibling=H,R=H);return e&&D.forEach(function(te){return t(E,te)}),br&&ph(E,j),M}function k(E,_,P,A){if(typeof P=="object"&&P!==null&&P.type===Jg&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case ob:e:{for(var M=P.key,R=_;R!==null;){if(R.key===M){if(M=P.type,M===Jg){if(R.tag===7){n(E,R.sibling),_=i(R,P.props.children),_.return=E,E=_;break e}}else if(R.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===md&&RM(M)===R.type){n(E,R.sibling),_=i(R,P.props),_.ref=tv(E,R,P),_.return=E,E=_;break e}n(E,R);break}else t(E,R);R=R.sibling}P.type===Jg?(_=Vh(P.props.children,E.mode,A,P.key),_.return=E,E=_):(A=P4(P.type,P.key,P.props,null,E.mode,A),A.ref=tv(E,_,P),A.return=E,E=A)}return a(E);case Qg:e:{for(R=P.key;_!==null;){if(_.key===R)if(_.tag===4&&_.stateNode.containerInfo===P.containerInfo&&_.stateNode.implementation===P.implementation){n(E,_.sibling),_=i(_,P.children||[]),_.return=E,E=_;break e}else{n(E,_);break}else t(E,_);_=_.sibling}_=eC(P,E.mode,A),_.return=E,E=_}return a(E);case md:return R=P._init,k(E,_,R(P._payload),A)}if(Cv(P))return b(E,_,P,A);if(X1(P))return x(E,_,P,A);mb(E,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,_!==null&&_.tag===6?(n(E,_.sibling),_=i(_,P),_.return=E,E=_):(n(E,_),_=J6(P,E.mode,A),_.return=E,E=_),a(E)):n(E,_)}return k}var n0=eH(!0),tH=eH(!1),My={},tu=uf(My),G2=uf(My),q2=uf(My);function Ah(e){if(e===My)throw Error(Ve(174));return e}function eE(e,t){switch(rr(q2,t),rr(G2,e),rr(tu,My),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:s9(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=s9(t,e)}hr(tu),rr(tu,t)}function r0(){hr(tu),hr(G2),hr(q2)}function nH(e){Ah(q2.current);var t=Ah(tu.current),n=s9(t,e.type);t!==n&&(rr(G2,e),rr(tu,n))}function tE(e){G2.current===e&&(hr(tu),hr(G2))}var kr=uf(0);function A5(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var q6=[];function nE(){for(var e=0;en?n:4,e(!0);var r=Y6.transition;Y6.transition={};try{e(!1),t()}finally{Bn=n,Y6.transition=r}}function yH(){return hs().memoizedState}function S2e(e,t,n){var r=Bd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bH(e))SH(t,n);else if(n=Xz(e,t,n,r),n!==null){var i=Lo();Zs(n,e,r,i),xH(n,t,r)}}function x2e(e,t,n){var r=Bd(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bH(e))SH(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,tl(s,a)){var l=t.interleaved;l===null?(i.next=i,Qk(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Xz(e,t,i,r),n!==null&&(i=Lo(),Zs(n,e,r,i),xH(n,t,r))}}function bH(e){var t=e.alternate;return e===Pr||t!==null&&t===Pr}function SH(e,t){i2=O5=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xH(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bk(e,n)}}var M5={readContext:fs,useCallback:Qi,useContext:Qi,useEffect:Qi,useImperativeHandle:Qi,useInsertionEffect:Qi,useLayoutEffect:Qi,useMemo:Qi,useReducer:Qi,useRef:Qi,useState:Qi,useDebugValue:Qi,useDeferredValue:Qi,useTransition:Qi,useMutableSource:Qi,useSyncExternalStore:Qi,useId:Qi,unstable_isNewReconciler:!1},w2e={readContext:fs,useCallback:function(e,t){return jl().memoizedState=[e,t===void 0?null:t],e},useContext:fs,useEffect:NM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,C4(4194308,4,hH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return C4(4194308,4,e,t)},useInsertionEffect:function(e,t){return C4(4,2,e,t)},useMemo:function(e,t){var n=jl();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jl();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=S2e.bind(null,Pr,e),[r.memoizedState,e]},useRef:function(e){var t=jl();return e={current:e},t.memoizedState=e},useState:DM,useDebugValue:sE,useDeferredValue:function(e){return jl().memoizedState=e},useTransition:function(){var e=DM(!1),t=e[0];return e=b2e.bind(null,e[1]),jl().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pr,i=jl();if(br){if(n===void 0)throw Error(Ve(407));n=n()}else{if(n=t(),Li===null)throw Error(Ve(349));Zh&30||oH(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,NM(sH.bind(null,r,o,e),[e]),r.flags|=2048,X2(9,aH.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=jl(),t=Li.identifierPrefix;if(br){var n=Yu,r=qu;n=(r&~(1<<32-Xs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Y2++,0")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{O6=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_v(e):""}function Q1e(e){switch(e.tag){case 5:return _v(e.type);case 16:return _v("Lazy");case 13:return _v("Suspense");case 19:return _v("SuspenseList");case 0:case 2:case 15:return e=M6(e.type,!1),e;case 11:return e=M6(e.type.render,!1),e;case 1:return e=M6(e.type,!0),e;default:return""}}function n9(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case tm:return"Fragment";case em:return"Portal";case J7:return"Profiler";case Ik:return"StrictMode";case e9:return"Suspense";case t9:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case JF:return(e.displayName||"Context")+".Consumer";case QF:return(e._context.displayName||"Context")+".Provider";case Rk:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dk:return t=e.displayName||null,t!==null?t:n9(e.type)||"Memo";case md:t=e._payload,e=e._init;try{return n9(e(t))}catch{}}return null}function J1e(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return n9(t);case 8:return t===Ik?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Kd(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tz(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function eve(e){var t=tz(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lb(e){e._valueTracker||(e._valueTracker=eve(e))}function nz(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tz(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function p5(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function r9(e,t){var n=t.checked;return Lr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function JO(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kd(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rz(e,t){t=t.checked,t!=null&&Mk(e,"checked",t,!1)}function i9(e,t){rz(e,t);var n=Kd(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?o9(e,t.type,n):t.hasOwnProperty("defaultValue")&&o9(e,t.type,Kd(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function eM(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function o9(e,t,n){(t!=="number"||p5(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var kv=Array.isArray;function Lm(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=ub.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function B2(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var t2={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tve=["Webkit","ms","Moz","O"];Object.keys(t2).forEach(function(e){tve.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),t2[t]=t2[e]})});function sz(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||t2.hasOwnProperty(e)&&t2[e]?(""+t).trim():t+"px"}function lz(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=sz(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var nve=Lr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function l9(e,t){if(t){if(nve[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ve(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ve(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ve(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ve(62))}}function u9(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var c9=null;function Nk(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var d9=null,Am=null,Om=null;function rM(e){if(e=Iy(e)){if(typeof d9!="function")throw Error(Ve(280));var t=e.stateNode;t&&(t=cx(t),d9(e.stateNode,e.type,t))}}function uz(e){Am?Om?Om.push(e):Om=[e]:Am=e}function cz(){if(Am){var e=Am,t=Om;if(Om=Am=null,rM(e),t)for(e=0;e>>=0,e===0?32:31-(hve(e)/pve|0)|0}var cb=64,db=4194304;function Ev(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function y5(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Ev(s):(o&=a,o!==0&&(r=Ev(o)))}else a=n&~i,a!==0?r=Ev(a):o!==0&&(r=Ev(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Oy(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xs(t),e[t]=n}function yve(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=r2),fM=String.fromCharCode(32),hM=!1;function Az(e,t){switch(e){case"keyup":return Gve.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Oz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var nm=!1;function Yve(e,t){switch(e){case"compositionend":return Oz(t);case"keypress":return t.which!==32?null:(hM=!0,fM);case"textInput":return e=t.data,e===fM&&hM?null:e;default:return null}}function Kve(e,t){if(nm)return e==="compositionend"||!Wk&&Az(e,t)?(e=Tz(),S4=zk=Ed=null,nm=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=vM(n)}}function Dz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nz(){for(var e=window,t=p5();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=p5(e.document)}return t}function Uk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function i2e(e){var t=Nz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Dz(n.ownerDocument.documentElement,n)){if(r!==null&&Uk(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=yM(n,o);var a=yM(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,rm=null,v9=null,o2=null,y9=!1;function bM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;y9||rm==null||rm!==p5(r)||(r=rm,"selectionStart"in r&&Uk(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),o2&&W2(o2,r)||(o2=r,r=x5(v9,"onSelect"),0am||(e.current=_9[am],_9[am]=null,am--)}function rr(e,t){am++,_9[am]=e.current,e.current=t}var Xd={},uo=cf(Xd),ea=cf(!1),Xh=Xd;function t0(e,t){var n=e.type.contextTypes;if(!n)return Xd;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ta(e){return e=e.childContextTypes,e!=null}function C5(){hr(ea),hr(uo)}function EM(e,t,n){if(uo.current!==Xd)throw Error(Ve(168));rr(uo,t),rr(ea,n)}function Uz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Ve(108,J1e(e)||"Unknown",i));return Lr({},n,r)}function _5(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xd,Xh=uo.current,rr(uo,e),rr(ea,ea.current),!0}function PM(e,t,n){var r=e.stateNode;if(!r)throw Error(Ve(169));n?(e=Uz(e,t,Xh),r.__reactInternalMemoizedMergedChildContext=e,hr(ea),hr(uo),rr(uo,e)):hr(ea),rr(ea,n)}var Wu=null,dx=!1,G6=!1;function Gz(e){Wu===null?Wu=[e]:Wu.push(e)}function m2e(e){dx=!0,Gz(e)}function df(){if(!G6&&Wu!==null){G6=!0;var e=0,t=Bn;try{var n=Wu;for(Bn=1;e>=a,i-=a,qu=1<<32-Xs(t)+i|n<j?(z=D,D=null):z=D.sibling;var H=m(E,D,P[j],A);if(H===null){D===null&&(D=z);break}e&&D&&H.alternate===null&&t(E,D),_=o(H,_,j),R===null?M=H:R.sibling=H,R=H,D=z}if(j===P.length)return n(E,D),br&&gh(E,j),M;if(D===null){for(;jj?(z=D,D=null):z=D.sibling;var K=m(E,D,H.value,A);if(K===null){D===null&&(D=z);break}e&&D&&K.alternate===null&&t(E,D),_=o(K,_,j),R===null?M=K:R.sibling=K,R=K,D=z}if(H.done)return n(E,D),br&&gh(E,j),M;if(D===null){for(;!H.done;j++,H=P.next())H=h(E,H.value,A),H!==null&&(_=o(H,_,j),R===null?M=H:R.sibling=H,R=H);return br&&gh(E,j),M}for(D=r(E,D);!H.done;j++,H=P.next())H=y(D,E,j,H.value,A),H!==null&&(e&&H.alternate!==null&&D.delete(H.key===null?j:H.key),_=o(H,_,j),R===null?M=H:R.sibling=H,R=H);return e&&D.forEach(function(te){return t(E,te)}),br&&gh(E,j),M}function k(E,_,P,A){if(typeof P=="object"&&P!==null&&P.type===tm&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case sb:e:{for(var M=P.key,R=_;R!==null;){if(R.key===M){if(M=P.type,M===tm){if(R.tag===7){n(E,R.sibling),_=i(R,P.props.children),_.return=E,E=_;break e}}else if(R.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===md&&RM(M)===R.type){n(E,R.sibling),_=i(R,P.props),_.ref=nv(E,R,P),_.return=E,E=_;break e}n(E,R);break}else t(E,R);R=R.sibling}P.type===tm?(_=Wh(P.props.children,E.mode,A,P.key),_.return=E,E=_):(A=T4(P.type,P.key,P.props,null,E.mode,A),A.ref=nv(E,_,P),A.return=E,E=A)}return a(E);case em:e:{for(R=P.key;_!==null;){if(_.key===R)if(_.tag===4&&_.stateNode.containerInfo===P.containerInfo&&_.stateNode.implementation===P.implementation){n(E,_.sibling),_=i(_,P.children||[]),_.return=E,E=_;break e}else{n(E,_);break}else t(E,_);_=_.sibling}_=eC(P,E.mode,A),_.return=E,E=_}return a(E);case md:return R=P._init,k(E,_,R(P._payload),A)}if(kv(P))return b(E,_,P,A);if(Z1(P))return x(E,_,P,A);yb(E,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,_!==null&&_.tag===6?(n(E,_.sibling),_=i(_,P),_.return=E,E=_):(n(E,_),_=J6(P,E.mode,A),_.return=E,E=_),a(E)):n(E,_)}return k}var r0=eH(!0),tH=eH(!1),Ry={},tu=cf(Ry),Y2=cf(Ry),K2=cf(Ry);function Oh(e){if(e===Ry)throw Error(Ve(174));return e}function eE(e,t){switch(rr(K2,t),rr(Y2,e),rr(tu,Ry),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:s9(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=s9(t,e)}hr(tu),rr(tu,t)}function i0(){hr(tu),hr(Y2),hr(K2)}function nH(e){Oh(K2.current);var t=Oh(tu.current),n=s9(t,e.type);t!==n&&(rr(Y2,e),rr(tu,n))}function tE(e){Y2.current===e&&(hr(tu),hr(Y2))}var kr=cf(0);function A5(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var q6=[];function nE(){for(var e=0;en?n:4,e(!0);var r=Y6.transition;Y6.transition={};try{e(!1),t()}finally{Bn=n,Y6.transition=r}}function yH(){return hs().memoizedState}function S2e(e,t,n){var r=$d(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bH(e))SH(t,n);else if(n=Xz(e,t,n,r),n!==null){var i=Lo();Zs(n,e,r,i),xH(n,t,r)}}function x2e(e,t,n){var r=$d(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bH(e))SH(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,tl(s,a)){var l=t.interleaved;l===null?(i.next=i,Qk(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Xz(e,t,i,r),n!==null&&(i=Lo(),Zs(n,e,r,i),xH(n,t,r))}}function bH(e){var t=e.alternate;return e===Pr||t!==null&&t===Pr}function SH(e,t){a2=O5=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xH(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bk(e,n)}}var M5={readContext:fs,useCallback:to,useContext:to,useEffect:to,useImperativeHandle:to,useInsertionEffect:to,useLayoutEffect:to,useMemo:to,useReducer:to,useRef:to,useState:to,useDebugValue:to,useDeferredValue:to,useTransition:to,useMutableSource:to,useSyncExternalStore:to,useId:to,unstable_isNewReconciler:!1},w2e={readContext:fs,useCallback:function(e,t){return jl().memoizedState=[e,t===void 0?null:t],e},useContext:fs,useEffect:NM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_4(4194308,4,hH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _4(4194308,4,e,t)},useInsertionEffect:function(e,t){return _4(4,2,e,t)},useMemo:function(e,t){var n=jl();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jl();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=S2e.bind(null,Pr,e),[r.memoizedState,e]},useRef:function(e){var t=jl();return e={current:e},t.memoizedState=e},useState:DM,useDebugValue:sE,useDeferredValue:function(e){return jl().memoizedState=e},useTransition:function(){var e=DM(!1),t=e[0];return e=b2e.bind(null,e[1]),jl().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pr,i=jl();if(br){if(n===void 0)throw Error(Ve(407));n=n()}else{if(n=t(),Ai===null)throw Error(Ve(349));Qh&30||oH(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,NM(sH.bind(null,r,o,e),[e]),r.flags|=2048,Q2(9,aH.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=jl(),t=Ai.identifierPrefix;if(br){var n=Yu,r=qu;n=(r&~(1<<32-Xs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=X2++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Vl]=t,e[U2]=r,AH(e,t,!1,!1),t.stateNode=e;e:{switch(a=u9(n,r),n){case"dialog":ar("cancel",e),ar("close",e),i=r;break;case"iframe":case"object":case"embed":ar("load",e),i=r;break;case"video":case"audio":for(i=0;io0&&(t.flags|=128,r=!0,nv(o,!1),t.lanes=4194304)}else{if(!r)if(e=A5(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),nv(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!br)return Ji(t),null}else 2*Zr()-o.renderingStartTime>o0&&n!==1073741824&&(t.flags|=128,r=!0,nv(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Zr(),t.sibling=null,n=kr.current,rr(kr,r?n&1|2:n&1),t):(Ji(t),null);case 22:case 23:return hE(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ka&1073741824&&(Ji(t),t.subtreeFlags&6&&(t.flags|=8192)):Ji(t),null;case 24:return null;case 25:return null}throw Error(Ve(156,t.tag))}function A2e(e,t){switch(qk(t),t.tag){case 1:return ta(t.type)&&C5(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return r0(),hr(ea),hr(lo),nE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tE(t),null;case 13:if(hr(kr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ve(340));t0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return hr(kr),null;case 4:return r0(),null;case 10:return Zk(t.type._context),null;case 22:case 23:return hE(),null;case 24:return null;default:return null}}var yb=!1,io=!1,O2e=typeof WeakSet=="function"?WeakSet:Set,pt=null;function lm(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$r(e,t,r)}else n.current=null}function N9(e,t,n){try{n()}catch(r){$r(e,t,r)}}var UM=!1;function M2e(e,t){if(b9=b5,e=Nz(),Uk(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,d=0,h=e,m=null;t:for(;;){for(var y;h!==n||i!==0&&h.nodeType!==3||(s=a+i),h!==o||r!==0&&h.nodeType!==3||(l=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(y=h.firstChild)!==null;)m=h,h=y;for(;;){if(h===e)break t;if(m===n&&++u===i&&(s=a),m===o&&++d===r&&(l=a),(y=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=y}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(S9={focusedElem:e,selectionRange:n},b5=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){t=pt;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var x=b.memoizedProps,k=b.memoizedState,E=t.stateNode,_=E.getSnapshotBeforeUpdate(t.elementType===t.type?x:Fs(t.type,x),k);E.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var P=t.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ve(163))}}catch(A){$r(t,t.return,A)}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}return b=UM,UM=!1,b}function o2(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&N9(t,n,o)}i=i.next}while(i!==r)}}function px(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function j9(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function IH(e){var t=e.alternate;t!==null&&(e.alternate=null,IH(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vl],delete t[U2],delete t[C9],delete t[p2e],delete t[g2e])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function RH(e){return e.tag===5||e.tag===3||e.tag===4}function GM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||RH(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function B9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=w5));else if(r!==4&&(e=e.child,e!==null))for(B9(e,t,n),e=e.sibling;e!==null;)B9(e,t,n),e=e.sibling}function F9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(F9(e,t,n),e=e.sibling;e!==null;)F9(e,t,n),e=e.sibling}var Vi=null,$s=!1;function ud(e,t,n){for(n=n.child;n!==null;)DH(e,t,n),n=n.sibling}function DH(e,t,n){if(eu&&typeof eu.onCommitFiberUnmount=="function")try{eu.onCommitFiberUnmount(ax,n)}catch{}switch(n.tag){case 5:io||lm(n,t);case 6:var r=Vi,i=$s;Vi=null,ud(e,t,n),Vi=r,$s=i,Vi!==null&&($s?(e=Vi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Vi.removeChild(n.stateNode));break;case 18:Vi!==null&&($s?(e=Vi,n=n.stateNode,e.nodeType===8?U6(e.parentNode,n):e.nodeType===1&&U6(e,n),$2(e)):U6(Vi,n.stateNode));break;case 4:r=Vi,i=$s,Vi=n.stateNode.containerInfo,$s=!0,ud(e,t,n),Vi=r,$s=i;break;case 0:case 11:case 14:case 15:if(!io&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&N9(n,t,a),i=i.next}while(i!==r)}ud(e,t,n);break;case 1:if(!io&&(lm(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){$r(n,t,s)}ud(e,t,n);break;case 21:ud(e,t,n);break;case 22:n.mode&1?(io=(r=io)||n.memoizedState!==null,ud(e,t,n),io=r):ud(e,t,n);break;default:ud(e,t,n)}}function qM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new O2e),t.forEach(function(r){var i=z2e.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ds(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Zr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*R2e(r/1960))-r,10e?16:e,Pd===null)var r=!1;else{if(e=Pd,Pd=null,D5=0,pn&6)throw Error(Ve(331));var i=pn;for(pn|=4,pt=e.current;pt!==null;){var o=pt,a=o.child;if(pt.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lZr()-dE?Hh(e,0):cE|=n),na(e,t)}function VH(e,t){t===0&&(e.mode&1?(t=ub,ub<<=1,!(ub&130023424)&&(ub=4194304)):t=1);var n=Lo();e=oc(e,t),e!==null&&(Ly(e,t,n),na(e,n))}function $2e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),VH(e,n)}function z2e(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ve(314))}r!==null&&r.delete(t),VH(e,n)}var WH;WH=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ea.current)Zo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Zo=!1,T2e(e,t,n);Zo=!!(e.flags&131072)}else Zo=!1,br&&t.flags&1048576&&qz(t,E5,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_4(e,t),e=t.pendingProps;var i=e0(t,lo.current);Mm(t,n),i=iE(null,t,r,e,i,n);var o=oE();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ta(r)?(o=!0,_5(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Jk(t),i.updater=fx,t.stateNode=i,i._reactInternals=t,L9(t,r,e,n),t=M9(null,t,r,!0,o,n)):(t.tag=0,br&&o&&Gk(t),Co(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_4(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=V2e(r),e=Fs(r,e),i){case 0:t=O9(null,t,r,e,n);break e;case 1:t=HM(null,t,r,e,n);break e;case 11:t=$M(null,t,r,e,n);break e;case 14:t=zM(null,t,r,Fs(r.type,e),n);break e}throw Error(Ve(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fs(r,i),O9(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fs(r,i),HM(e,t,r,i,n);case 3:e:{if(PH(t),e===null)throw Error(Ve(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Zz(e,t),L5(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=i0(Error(Ve(423)),t),t=VM(e,t,r,n,i);break e}else if(r!==i){i=i0(Error(Ve(424)),t),t=VM(e,t,r,n,i);break e}else for(Pa=Dd(t.stateNode.containerInfo.firstChild),Aa=t,br=!0,Hs=null,n=tH(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(t0(),r===i){t=ac(e,t,n);break e}Co(e,t,r,n)}t=t.child}return t;case 5:return nH(t),e===null&&E9(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,x9(r,i)?a=null:o!==null&&x9(r,o)&&(t.flags|=32),EH(e,t),Co(e,t,a,n),t.child;case 6:return e===null&&E9(t),null;case 13:return TH(e,t,n);case 4:return eE(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=n0(t,null,r,n):Co(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fs(r,i),$M(e,t,r,i,n);case 7:return Co(e,t,t.pendingProps,n),t.child;case 8:return Co(e,t,t.pendingProps.children,n),t.child;case 12:return Co(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,rr(P5,r._currentValue),r._currentValue=a,o!==null)if(tl(o.value,a)){if(o.children===i.children&&!ea.current){t=ac(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ku(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),P9(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Ve(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),P9(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Co(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Mm(t,n),i=fs(i),r=r(i),t.flags|=1,Co(e,t,r,n),t.child;case 14:return r=t.type,i=Fs(r,t.pendingProps),i=Fs(r.type,i),zM(e,t,r,i,n);case 15:return _H(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fs(r,i),_4(e,t),t.tag=1,ta(r)?(e=!0,_5(t)):e=!1,Mm(t,n),Jz(t,r,i),L9(t,r,i,n),M9(null,t,r,!0,e,n);case 19:return LH(e,t,n);case 22:return kH(e,t,n)}throw Error(Ve(156,t.tag))};function UH(e,t){return vz(e,t)}function H2e(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function is(e,t,n,r){return new H2e(e,t,n,r)}function gE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function V2e(e){if(typeof e=="function")return gE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rk)return 11;if(e===Dk)return 14}return 2}function Fd(e,t){var n=e.alternate;return n===null?(n=is(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function P4(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")gE(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Jg:return Vh(n.children,i,o,t);case Ik:a=8,i|=8;break;case J7:return e=is(12,n,t,i|2),e.elementType=J7,e.lanes=o,e;case e9:return e=is(13,n,t,i),e.elementType=e9,e.lanes=o,e;case t9:return e=is(19,n,t,i),e.elementType=t9,e.lanes=o,e;case ez:return mx(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q$:a=10;break e;case J$:a=9;break e;case Rk:a=11;break e;case Dk:a=14;break e;case md:a=16,r=null;break e}throw Error(Ve(130,e==null?e:typeof e,""))}return t=is(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Vh(e,t,n,r){return e=is(7,e,r,t),e.lanes=n,e}function mx(e,t,n,r){return e=is(22,e,r,t),e.elementType=ez,e.lanes=n,e.stateNode={isHidden:!1},e}function J6(e,t,n){return e=is(6,e,null,t),e.lanes=n,e}function eC(e,t,n){return t=is(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function W2e(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=R6(0),this.expirationTimes=R6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R6(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function mE(e,t,n,r,i,o,a,s,l){return e=new W2e(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=is(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jk(o),e}function U2e(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=ja})(G1e);const xb=v_(el);var[X2e,Z2e]=Pn({strict:!1,name:"PortalManagerContext"});function KH(e){const{children:t,zIndex:n}=e;return N.createElement(X2e,{value:{zIndex:n}},t)}KH.displayName="PortalManager";var[XH,Q2e]=Pn({strict:!1,name:"PortalContext"}),SE="chakra-portal",J2e=".chakra-portal",eye=e=>N.createElement("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0}},e.children),tye=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=w.useState(null),o=w.useRef(null),[,a]=w.useState({});w.useEffect(()=>a({}),[]);const s=Q2e(),l=Z2e();Gs(()=>{if(!r)return;const d=r.ownerDocument,h=t?s??d.body:d.body;if(!h)return;o.current=d.createElement("div"),o.current.className=SE,h.appendChild(o.current),a({});const m=o.current;return()=>{h.contains(m)&&h.removeChild(m)}},[r]);const u=l!=null&&l.zIndex?N.createElement(eye,{zIndex:l==null?void 0:l.zIndex},n):n;return o.current?el.createPortal(N.createElement(XH,{value:o.current},u),o.current):N.createElement("span",{ref:d=>{d&&i(d)}})},nye=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=w.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=SE),l},[i]),[,s]=w.useState({});return Gs(()=>s({}),[]),Gs(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?el.createPortal(N.createElement(XH,{value:r?a:null},t),a):null};function cp(e){const{containerRef:t,...n}=e;return t?N.createElement(nye,{containerRef:t,...n}):N.createElement(tye,{...n})}cp.defaultProps={appendToParentPortal:!0};cp.className=SE;cp.selector=J2e;cp.displayName="Portal";var rye=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ag=new WeakMap,wb=new WeakMap,Cb={},tC=0,ZH=function(e){return e&&(e.host||ZH(e.parentNode))},iye=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ZH(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},oye=function(e,t,n,r){var i=iye(t,Array.isArray(e)?e:[e]);Cb[n]||(Cb[n]=new WeakMap);var o=Cb[n],a=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(s.has(m))d(m);else{var y=m.getAttribute(r),b=y!==null&&y!=="false",x=(Ag.get(m)||0)+1,k=(o.get(m)||0)+1;Ag.set(m,x),o.set(m,k),a.push(m),x===1&&b&&wb.set(m,!0),k===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}})};return d(t),s.clear(),tC++,function(){a.forEach(function(h){var m=Ag.get(h)-1,y=o.get(h)-1;Ag.set(h,m),o.set(h,y),m||(wb.has(h)||h.removeAttribute(r),wb.delete(h)),y||h.removeAttribute(n)}),tC--,tC||(Ag=new WeakMap,Ag=new WeakMap,wb=new WeakMap,Cb={})}},QH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||rye(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),oye(r,i,n,"aria-hidden")):function(){return null}};function xE(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var jn={},aye={get exports(){return jn},set exports(e){jn=e}},sye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",lye=sye,uye=lye;function JH(){}function eV(){}eV.resetWarningCache=JH;var cye=function(){function e(r,i,o,a,s,l){if(l!==uye){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:eV,resetWarningCache:JH};return n.PropTypes=n,n};aye.exports=cye();var W9="data-focus-lock",tV="data-focus-lock-disabled",dye="data-no-focus-lock",fye="data-autofocus-inside",hye="data-no-autofocus";function pye(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gye(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function nV(e,t){return gye(t||null,function(n){return e.forEach(function(r){return pye(r,n)})})}var nC={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function rV(e){return e}function iV(e,t){t===void 0&&(t=rV);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function wE(e,t){return t===void 0&&(t=rV),iV(e,t)}function oV(e){e===void 0&&(e={});var t=iV(null);return t.options=Hl({async:!0,ssr:!1},e),t}var aV=function(e){var t=e.sideCar,n=YF(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Hl({},n))};aV.isSideCarExport=!0;function mye(e,t){return e.useMedium(t),aV}var sV=wE({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),lV=wE(),vye=wE(),yye=oV({async:!0}),bye=[],CE=w.forwardRef(function(t,n){var r,i=w.useState(),o=i[0],a=i[1],s=w.useRef(),l=w.useRef(!1),u=w.useRef(null),d=t.children,h=t.disabled,m=t.noFocusGuards,y=t.persistentFocus,b=t.crossFrame,x=t.autoFocus;t.allowTextSelection;var k=t.group,E=t.className,_=t.whiteList,P=t.hasPositiveIndices,A=t.shards,M=A===void 0?bye:A,R=t.as,D=R===void 0?"div":R,j=t.lockProps,z=j===void 0?{}:j,H=t.sideCar,K=t.returnFocus,te=t.focusOptions,G=t.onActivation,F=t.onDeactivation,W=w.useState({}),X=W[0],Z=w.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&G&&G(s.current),l.current=!0},[G]),U=w.useCallback(function(){l.current=!1,F&&F(s.current)},[F]);w.useEffect(function(){h||(u.current=null)},[]);var Q=w.useCallback(function(rt){var We=u.current;if(We&&We.focus){var Be=typeof K=="function"?K(We):K;if(Be){var wt=typeof Be=="object"?Be:void 0;u.current=null,rt?Promise.resolve().then(function(){return We.focus(wt)}):We.focus(wt)}}},[K]),re=w.useCallback(function(rt){l.current&&sV.useMedium(rt)},[]),fe=lV.useMedium,Ee=w.useCallback(function(rt){s.current!==rt&&(s.current=rt,a(rt))},[]),be=bn((r={},r[tV]=h&&"disabled",r[W9]=k,r),z),ye=m!==!0,ze=ye&&m!=="tail",Me=nV([n,Ee]);return w.createElement(w.Fragment,null,ye&&[w.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:nC}),P?w.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:nC}):null],!h&&w.createElement(H,{id:X,sideCar:yye,observed:o,disabled:h,persistentFocus:y,crossFrame:b,autoFocus:x,whiteList:_,shards:M,onActivation:Z,onDeactivation:U,returnFocus:Q,focusOptions:te}),w.createElement(D,bn({ref:Me},be,{className:E,onBlur:fe,onFocus:re}),d),ze&&w.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:nC}))});CE.propTypes={};CE.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const uV=CE;function U9(e,t){return U9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},U9(e,t)}function _E(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,U9(e,t)}function cV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sye(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){_E(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return a};var h=d.prototype;return h.componentDidMount=function(){o.push(this),s()},h.componentDidUpdate=function(){s()},h.componentWillUnmount=function(){var y=o.indexOf(this);o.splice(y,1),s()},h.render=function(){return N.createElement(i,this.props)},d}(w.PureComponent);return cV(l,"displayName","SideEffect("+n(i)+")"),l}}var pu=function(e){for(var t=Array(e.length),n=0;n=0}).sort(Tye)},Lye=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],EE=Lye.join(","),Aye="".concat(EE,", [data-focus-guard]"),bV=function(e,t){var n;return pu(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,i){return r.concat(i.matches(t?Aye:EE)?[i]:[],bV(i))},[])},PE=function(e,t){return e.reduce(function(n,r){return n.concat(bV(r,t),r.parentNode?pu(r.parentNode.querySelectorAll(EE)).filter(function(i){return i===r}):[])},[])},Oye=function(e){var t=e.querySelectorAll("[".concat(fye,"]"));return pu(t).map(function(n){return PE([n])}).reduce(function(n,r){return n.concat(r)},[])},TE=function(e,t){return pu(e).filter(function(n){return hV(t,n)}).filter(function(n){return kye(n)})},tI=function(e,t){return t===void 0&&(t=new Map),pu(e).filter(function(n){return pV(t,n)})},q9=function(e,t,n){return yV(TE(PE(e,n),t),!0,n)},nI=function(e,t){return yV(TE(PE(e),t),!1)},Mye=function(e,t){return TE(Oye(e),t)},Q2=function(e,t){return e.shadowRoot?Q2(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:pu(e.children).some(function(n){return Q2(n,t)})},Iye=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},SV=function(e){return e.parentNode?SV(e.parentNode):e},LE=function(e){var t=G9(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(W9);return n.push.apply(n,i?Iye(pu(SV(r).querySelectorAll("[".concat(W9,'="').concat(i,'"]:not([').concat(tV,'="disabled"])')))):[r]),n},[])},xV=function(e){return e.activeElement?e.activeElement.shadowRoot?xV(e.activeElement.shadowRoot):e.activeElement:void 0},AE=function(){return document.activeElement?document.activeElement.shadowRoot?xV(document.activeElement.shadowRoot):document.activeElement:void 0},Rye=function(e){return e===document.activeElement},Dye=function(e){return Boolean(pu(e.querySelectorAll("iframe")).some(function(t){return Rye(t)}))},wV=function(e){var t=document&&AE();return!t||t.dataset&&t.dataset.focusGuard?!1:LE(e).some(function(n){return Q2(n,t)||Dye(n)})},Nye=function(){var e=document&&AE();return e?pu(document.querySelectorAll("[".concat(dye,"]"))).some(function(t){return Q2(t,e)}):!1},jye=function(e,t){return t.filter(vV).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},OE=function(e,t){return vV(e)&&e.name?jye(e,t):e},Bye=function(e){var t=new Set;return e.forEach(function(n){return t.add(OE(n,e))}),e.filter(function(n){return t.has(n)})},rI=function(e){return e[0]&&e.length>1?OE(e[0],e):e[0]},iI=function(e,t){return e.length>1?e.indexOf(OE(e[t],e)):t},CV="NEW_FOCUS",Fye=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=kE(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,d=r?e.indexOf(r):-1,h=l-u,m=t.indexOf(o),y=t.indexOf(a),b=Bye(t),x=n!==void 0?b.indexOf(n):-1,k=x-(r?b.indexOf(r):l),E=iI(e,0),_=iI(e,i-1);if(l===-1||d===-1)return CV;if(!h&&d>=0)return d;if(l<=m&&s&&Math.abs(h)>1)return _;if(l>=y&&s&&Math.abs(h)>1)return E;if(h&&Math.abs(k)>1)return d;if(l<=m)return _;if(l>y)return E;if(h)return Math.abs(h)>1?d:(i+d+h)%i}},$ye=function(e){return function(t){var n,r=(n=gV(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},zye=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=tI(r.filter($ye(n)));return i&&i.length?rI(i):rI(tI(t))},Y9=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Y9(e.parentNode.host||e.parentNode,t),t},rC=function(e,t){for(var n=Y9(e),r=Y9(t),i=0;i=0)return o}return!1},_V=function(e,t,n){var r=G9(e),i=G9(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=rC(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=rC(o,l);u&&(!a||Q2(u,a)?a=u:a=rC(u,a))})}),a},Hye=function(e,t){return e.reduce(function(n,r){return n.concat(Mye(r,t))},[])},Vye=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Pye)},Wye=function(e,t){var n=document&&AE(),r=LE(e).filter(B5),i=_V(n||e,e,r),o=new Map,a=nI(r,o),s=q9(r,o).filter(function(m){var y=m.node;return B5(y)});if(!(!s[0]&&(s=a,!s[0]))){var l=nI([i],o).map(function(m){var y=m.node;return y}),u=Vye(l,s),d=u.map(function(m){var y=m.node;return y}),h=Fye(d,l,n,t);return h===CV?{node:zye(a,d,Hye(r,o))}:h===void 0?h:u[h]}},Uye=function(e){var t=LE(e).filter(B5),n=_V(e,e,t),r=new Map,i=q9([n],r,!0),o=q9(t,r).filter(function(a){var s=a.node;return B5(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:kE(s)}})},Gye=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},iC=0,oC=!1,qye=function(e,t,n){n===void 0&&(n={});var r=Wye(e,t);if(!oC&&r){if(iC>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),oC=!0,setTimeout(function(){oC=!1},1);return}iC++,Gye(r.node,n.focusOptions),iC--}};const kV=qye;function EV(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var Yye=function(){return document&&document.activeElement===document.body},Kye=function(){return Yye()||Nye()},Rm=null,cm=null,Dm=null,J2=!1,Xye=function(){return!0},Zye=function(t){return(Rm.whiteList||Xye)(t)},Qye=function(t,n){Dm={observerNode:t,portaledElement:n}},Jye=function(t){return Dm&&Dm.portaledElement===t};function oI(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var e3e=function(t){return t&&"current"in t?t.current:t},t3e=function(t){return t?Boolean(J2):J2==="meanwhile"},n3e=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},r3e=function(t,n){return n.some(function(r){return n3e(t,r,r)})},F5=function(){var t=!1;if(Rm){var n=Rm,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||Dm&&Dm.portaledElement,d=document&&document.activeElement;if(u){var h=[u].concat(a.map(e3e).filter(Boolean));if((!d||Zye(d))&&(i||t3e(s)||!Kye()||!cm&&o)&&(u&&!(wV(h)||d&&r3e(d,h)||Jye(d))&&(document&&!cm&&d&&!o?(d.blur&&d.blur(),document.body.focus()):(t=kV(h,cm,{focusOptions:l}),Dm={})),J2=!1,cm=document&&document.activeElement),document){var m=document&&document.activeElement,y=Uye(h),b=y.map(function(x){var k=x.node;return k}).indexOf(m);b>-1&&(y.filter(function(x){var k=x.guard,E=x.node;return k&&E.dataset.focusAutoGuard}).forEach(function(x){var k=x.node;return k.removeAttribute("tabIndex")}),oI(b,y.length,1,y),oI(b,-1,-1,y))}}}return t},PV=function(t){F5()&&t&&(t.stopPropagation(),t.preventDefault())},ME=function(){return EV(F5)},i3e=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Qye(r,n)},o3e=function(){return null},TV=function(){J2="just",setTimeout(function(){J2="meanwhile"},0)},a3e=function(){document.addEventListener("focusin",PV),document.addEventListener("focusout",ME),window.addEventListener("blur",TV)},s3e=function(){document.removeEventListener("focusin",PV),document.removeEventListener("focusout",ME),window.removeEventListener("blur",TV)};function l3e(e){return e.filter(function(t){var n=t.disabled;return!n})}function u3e(e){var t=e.slice(-1)[0];t&&!Rm&&a3e();var n=Rm,r=n&&t&&t.id===n.id;Rm=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(cm=null,(!r||n.observed!==t.observed)&&t.onActivation(),F5(),EV(F5)):(s3e(),cm=null)}sV.assignSyncMedium(i3e);lV.assignMedium(ME);vye.assignMedium(function(e){return e({moveFocusInside:kV,focusInside:wV})});const c3e=Sye(l3e,u3e)(o3e);var LV=w.forwardRef(function(t,n){return w.createElement(uV,bn({sideCar:c3e,ref:n},t))}),AV=uV.propTypes||{};AV.sideCar;xE(AV,["sideCar"]);LV.propTypes={};const d3e=LV;var OV=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,d=w.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&N$(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),h=w.useCallback(()=>{var y;(y=n==null?void 0:n.current)==null||y.focus()},[n]),m=i&&!n;return N.createElement(d3e,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:d,onDeactivation:h,returnFocus:m},o)};OV.displayName="FocusLock";var T4="right-scroll-bar-position",L4="width-before-scroll-bar",f3e="with-scroll-bars-hidden",h3e="--removed-body-scroll-bar-size",MV=oV(),aC=function(){},xx=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:aC,onWheelCapture:aC,onTouchMoveCapture:aC}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,m=e.sideCar,y=e.noIsolation,b=e.inert,x=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,_=YF(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),P=m,A=nV([n,t]),M=Hl(Hl({},_),i);return w.createElement(w.Fragment,null,d&&w.createElement(P,{sideCar:MV,removeScrollBar:u,shards:h,noIsolation:y,inert:b,setCallbacks:o,allowPinchZoom:!!x,lockRef:n}),a?w.cloneElement(w.Children.only(s),Hl(Hl({},M),{ref:A})):w.createElement(E,Hl({},M,{className:l,ref:A}),s))});xx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xx.classNames={fullWidth:L4,zeroRight:T4};var p3e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function g3e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=p3e();return t&&e.setAttribute("nonce",t),e}function m3e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function v3e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var y3e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=g3e())&&(m3e(t,n),v3e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b3e=function(){var e=y3e();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},IV=function(){var e=b3e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},S3e={left:0,top:0,right:0,gap:0},sC=function(e){return parseInt(e||"",10)||0},x3e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[sC(n),sC(r),sC(i)]},w3e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return S3e;var t=x3e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},C3e=IV(),_3e=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` +`+o.stack}return{value:e,source:t,stack:i,digest:null}}function Z6(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function A9(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var k2e=typeof WeakMap=="function"?WeakMap:Map;function wH(e,t,n){n=Ku(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){R5||(R5=!0,F9=r),A9(e,t)},n}function CH(e,t,n){n=Ku(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){A9(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){A9(e,t),typeof r!="function"&&(Bd===null?Bd=new Set([this]):Bd.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function jM(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new k2e;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=$2e.bind(null,e,t,n),t.then(e,e))}function BM(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function $M(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ku(-1,1),t.tag=2,jd(n,t,1))),n.lanes|=1),e)}var E2e=dc.ReactCurrentOwner,Zo=!1;function Co(e,t,n,r){t.child=e===null?tH(t,null,n,r):r0(t,e.child,n,r)}function FM(e,t,n,r,i){n=n.render;var o=t.ref;return Im(t,i),r=iE(e,t,n,r,o,i),n=oE(),e!==null&&!Zo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ac(e,t,i)):(br&&n&&Gk(t),t.flags|=1,Co(e,t,r,i),t.child)}function zM(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!gE(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,_H(e,t,o,r,i)):(e=T4(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:W2,n(a,r)&&e.ref===t.ref)return ac(e,t,i)}return t.flags|=1,e=Fd(o,r),e.ref=t.ref,e.return=t,t.child=e}function _H(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(W2(o,r)&&e.ref===t.ref)if(Zo=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Zo=!0);else return t.lanes=e.lanes,ac(e,t,i)}return O9(e,t,n,r,i)}function kH(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},rr(dm,ka),ka|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,rr(dm,ka),ka|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,rr(dm,ka),ka|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,rr(dm,ka),ka|=r;return Co(e,t,i,n),t.child}function EH(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function O9(e,t,n,r,i){var o=ta(n)?Xh:uo.current;return o=t0(t,o),Im(t,i),n=iE(e,t,n,r,o,i),r=oE(),e!==null&&!Zo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ac(e,t,i)):(br&&r&&Gk(t),t.flags|=1,Co(e,t,n,i),t.child)}function HM(e,t,n,r,i){if(ta(n)){var o=!0;_5(t)}else o=!1;if(Im(t,i),t.stateNode===null)k4(e,t),Jz(t,n,r),L9(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=fs(u):(u=ta(n)?Xh:uo.current,u=t0(t,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";h||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&IM(t,a,r,u),vd=!1;var m=t.memoizedState;a.state=m,L5(t,r,a,i),l=t.memoizedState,s!==r||m!==l||ea.current||vd?(typeof d=="function"&&(T9(t,n,d,r),l=t.memoizedState),(s=vd||MM(t,n,s,r,m,l,u))?(h||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Zz(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:$s(t.type,s),a.props=u,h=t.pendingProps,m=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=fs(l):(l=ta(n)?Xh:uo.current,l=t0(t,l));var y=n.getDerivedStateFromProps;(d=typeof y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==h||m!==l)&&IM(t,a,r,l),vd=!1,m=t.memoizedState,a.state=m,L5(t,r,a,i);var b=t.memoizedState;s!==h||m!==b||ea.current||vd?(typeof y=="function"&&(T9(t,n,y,r),b=t.memoizedState),(u=vd||MM(t,n,u,r,m,b,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,b,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,b,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),a.props=r,a.state=b,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return M9(e,t,n,r,o,i)}function M9(e,t,n,r,i,o){EH(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&PM(t,n,!1),ac(e,t,o);r=t.stateNode,E2e.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=r0(t,e.child,null,o),t.child=r0(t,null,s,o)):Co(e,t,s,o),t.memoizedState=r.state,i&&PM(t,n,!0),t.child}function PH(e){var t=e.stateNode;t.pendingContext?EM(e,t.pendingContext,t.pendingContext!==t.context):t.context&&EM(e,t.context,!1),eE(e,t.containerInfo)}function VM(e,t,n,r,i){return n0(),Yk(i),t.flags|=256,Co(e,t,n,r),t.child}var I9={dehydrated:null,treeContext:null,retryLane:0};function R9(e){return{baseLanes:e,cachePool:null,transitions:null}}function TH(e,t,n){var r=t.pendingProps,i=kr.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),rr(kr,i&1),e===null)return E9(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=mx(a,r,0,null),e=Wh(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=R9(n),t.memoizedState=I9,e):lE(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return P2e(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Fd(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=Fd(s,o):(o=Wh(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?R9(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=I9,r}return o=e.child,e=o.sibling,r=Fd(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function lE(e,t){return t=mx({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function bb(e,t,n,r){return r!==null&&Yk(r),r0(t,e.child,null,n),e=lE(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function P2e(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=Z6(Error(Ve(422))),bb(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=mx({mode:"visible",children:r.children},i,0,null),o=Wh(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&r0(t,e.child,null,a),t.child.memoizedState=R9(a),t.memoizedState=I9,o);if(!(t.mode&1))return bb(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(Ve(419)),r=Z6(o,r,void 0),bb(e,t,a,r)}if(s=(a&e.childLanes)!==0,Zo||s){if(r=Ai,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,oc(e,i),Zs(r,e,i,-1))}return pE(),r=Z6(Error(Ve(421))),bb(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=F2e.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Pa=Nd(i.nextSibling),Aa=t,br=!0,Hs=null,e!==null&&(Qa[Ja++]=qu,Qa[Ja++]=Yu,Qa[Ja++]=Zh,qu=e.id,Yu=e.overflow,Zh=t),t=lE(t,r.children),t.flags|=4096,t)}function WM(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),P9(e.return,t,n)}function Q6(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function LH(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Co(e,t,r.children,n),r=kr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&WM(e,n,t);else if(e.tag===19)WM(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(rr(kr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&A5(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Q6(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&A5(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Q6(t,!0,n,null,o);break;case"together":Q6(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function k4(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jh|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Ve(153));if(t.child!==null){for(e=t.child,n=Fd(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fd(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function T2e(e,t,n){switch(t.tag){case 3:PH(t),n0();break;case 5:nH(t);break;case 1:ta(t.type)&&_5(t);break;case 4:eE(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;rr(P5,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(rr(kr,kr.current&1),t.flags|=128,null):n&t.child.childLanes?TH(e,t,n):(rr(kr,kr.current&1),e=ac(e,t,n),e!==null?e.sibling:null);rr(kr,kr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return LH(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),rr(kr,kr.current),r)break;return null;case 22:case 23:return t.lanes=0,kH(e,t,n)}return ac(e,t,n)}var AH,D9,OH,MH;AH=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};D9=function(){};OH=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Oh(tu.current);var o=null;switch(n){case"input":i=r9(e,i),r=r9(e,r),o=[];break;case"select":i=Lr({},i,{value:void 0}),r=Lr({},r,{value:void 0}),o=[];break;case"textarea":i=a9(e,i),r=a9(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=w5)}l9(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(j2.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(j2.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ar("scroll",e),o||s===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};MH=function(e,t,n,r){n!==r&&(t.flags|=4)};function rv(e,t){if(!br)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function no(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function L2e(e,t,n){var r=t.pendingProps;switch(qk(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return no(t),null;case 1:return ta(t.type)&&C5(),no(t),null;case 3:return r=t.stateNode,i0(),hr(ea),hr(uo),nE(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(vb(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Hs!==null&&(V9(Hs),Hs=null))),D9(e,t),no(t),null;case 5:tE(t);var i=Oh(K2.current);if(n=t.type,e!==null&&t.stateNode!=null)OH(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Ve(166));return no(t),null}if(e=Oh(tu.current),vb(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Vl]=t,r[q2]=o,e=(t.mode&1)!==0,n){case"dialog":ar("cancel",r),ar("close",r);break;case"iframe":case"object":case"embed":ar("load",r);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Vl]=t,e[q2]=r,AH(e,t,!1,!1),t.stateNode=e;e:{switch(a=u9(n,r),n){case"dialog":ar("cancel",e),ar("close",e),i=r;break;case"iframe":case"object":case"embed":ar("load",e),i=r;break;case"video":case"audio":for(i=0;ia0&&(t.flags|=128,r=!0,rv(o,!1),t.lanes=4194304)}else{if(!r)if(e=A5(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),rv(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!br)return no(t),null}else 2*Zr()-o.renderingStartTime>a0&&n!==1073741824&&(t.flags|=128,r=!0,rv(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Zr(),t.sibling=null,n=kr.current,rr(kr,r?n&1|2:n&1),t):(no(t),null);case 22:case 23:return hE(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ka&1073741824&&(no(t),t.subtreeFlags&6&&(t.flags|=8192)):no(t),null;case 24:return null;case 25:return null}throw Error(Ve(156,t.tag))}function A2e(e,t){switch(qk(t),t.tag){case 1:return ta(t.type)&&C5(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return i0(),hr(ea),hr(uo),nE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tE(t),null;case 13:if(hr(kr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ve(340));n0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return hr(kr),null;case 4:return i0(),null;case 10:return Zk(t.type._context),null;case 22:case 23:return hE(),null;case 24:return null;default:return null}}var Sb=!1,oo=!1,O2e=typeof WeakSet=="function"?WeakSet:Set,pt=null;function cm(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Fr(e,t,r)}else n.current=null}function N9(e,t,n){try{n()}catch(r){Fr(e,t,r)}}var UM=!1;function M2e(e,t){if(b9=b5,e=Nz(),Uk(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,d=0,h=e,m=null;t:for(;;){for(var y;h!==n||i!==0&&h.nodeType!==3||(s=a+i),h!==o||r!==0&&h.nodeType!==3||(l=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(y=h.firstChild)!==null;)m=h,h=y;for(;;){if(h===e)break t;if(m===n&&++u===i&&(s=a),m===o&&++d===r&&(l=a),(y=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=y}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(S9={focusedElem:e,selectionRange:n},b5=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){t=pt;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var x=b.memoizedProps,k=b.memoizedState,E=t.stateNode,_=E.getSnapshotBeforeUpdate(t.elementType===t.type?x:$s(t.type,x),k);E.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var P=t.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ve(163))}}catch(A){Fr(t,t.return,A)}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}return b=UM,UM=!1,b}function s2(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&N9(t,n,o)}i=i.next}while(i!==r)}}function px(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function j9(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function IH(e){var t=e.alternate;t!==null&&(e.alternate=null,IH(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vl],delete t[q2],delete t[C9],delete t[p2e],delete t[g2e])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function RH(e){return e.tag===5||e.tag===3||e.tag===4}function GM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||RH(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function B9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=w5));else if(r!==4&&(e=e.child,e!==null))for(B9(e,t,n),e=e.sibling;e!==null;)B9(e,t,n),e=e.sibling}function $9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for($9(e,t,n),e=e.sibling;e!==null;)$9(e,t,n),e=e.sibling}var Gi=null,Fs=!1;function ud(e,t,n){for(n=n.child;n!==null;)DH(e,t,n),n=n.sibling}function DH(e,t,n){if(eu&&typeof eu.onCommitFiberUnmount=="function")try{eu.onCommitFiberUnmount(ax,n)}catch{}switch(n.tag){case 5:oo||cm(n,t);case 6:var r=Gi,i=Fs;Gi=null,ud(e,t,n),Gi=r,Fs=i,Gi!==null&&(Fs?(e=Gi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Gi.removeChild(n.stateNode));break;case 18:Gi!==null&&(Fs?(e=Gi,n=n.stateNode,e.nodeType===8?U6(e.parentNode,n):e.nodeType===1&&U6(e,n),H2(e)):U6(Gi,n.stateNode));break;case 4:r=Gi,i=Fs,Gi=n.stateNode.containerInfo,Fs=!0,ud(e,t,n),Gi=r,Fs=i;break;case 0:case 11:case 14:case 15:if(!oo&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&N9(n,t,a),i=i.next}while(i!==r)}ud(e,t,n);break;case 1:if(!oo&&(cm(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Fr(n,t,s)}ud(e,t,n);break;case 21:ud(e,t,n);break;case 22:n.mode&1?(oo=(r=oo)||n.memoizedState!==null,ud(e,t,n),oo=r):ud(e,t,n);break;default:ud(e,t,n)}}function qM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new O2e),t.forEach(function(r){var i=z2e.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ds(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Zr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*R2e(r/1960))-r,10e?16:e,Pd===null)var r=!1;else{if(e=Pd,Pd=null,D5=0,pn&6)throw Error(Ve(331));var i=pn;for(pn|=4,pt=e.current;pt!==null;){var o=pt,a=o.child;if(pt.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lZr()-dE?Vh(e,0):cE|=n),na(e,t)}function VH(e,t){t===0&&(e.mode&1?(t=db,db<<=1,!(db&130023424)&&(db=4194304)):t=1);var n=Lo();e=oc(e,t),e!==null&&(Oy(e,t,n),na(e,n))}function F2e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),VH(e,n)}function z2e(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ve(314))}r!==null&&r.delete(t),VH(e,n)}var WH;WH=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ea.current)Zo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Zo=!1,T2e(e,t,n);Zo=!!(e.flags&131072)}else Zo=!1,br&&t.flags&1048576&&qz(t,E5,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;k4(e,t),e=t.pendingProps;var i=t0(t,uo.current);Im(t,n),i=iE(null,t,r,e,i,n);var o=oE();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ta(r)?(o=!0,_5(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Jk(t),i.updater=fx,t.stateNode=i,i._reactInternals=t,L9(t,r,e,n),t=M9(null,t,r,!0,o,n)):(t.tag=0,br&&o&&Gk(t),Co(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(k4(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=V2e(r),e=$s(r,e),i){case 0:t=O9(null,t,r,e,n);break e;case 1:t=HM(null,t,r,e,n);break e;case 11:t=FM(null,t,r,e,n);break e;case 14:t=zM(null,t,r,$s(r.type,e),n);break e}throw Error(Ve(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),O9(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),HM(e,t,r,i,n);case 3:e:{if(PH(t),e===null)throw Error(Ve(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Zz(e,t),L5(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=o0(Error(Ve(423)),t),t=VM(e,t,r,n,i);break e}else if(r!==i){i=o0(Error(Ve(424)),t),t=VM(e,t,r,n,i);break e}else for(Pa=Nd(t.stateNode.containerInfo.firstChild),Aa=t,br=!0,Hs=null,n=tH(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(n0(),r===i){t=ac(e,t,n);break e}Co(e,t,r,n)}t=t.child}return t;case 5:return nH(t),e===null&&E9(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,x9(r,i)?a=null:o!==null&&x9(r,o)&&(t.flags|=32),EH(e,t),Co(e,t,a,n),t.child;case 6:return e===null&&E9(t),null;case 13:return TH(e,t,n);case 4:return eE(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=r0(t,null,r,n):Co(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),FM(e,t,r,i,n);case 7:return Co(e,t,t.pendingProps,n),t.child;case 8:return Co(e,t,t.pendingProps.children,n),t.child;case 12:return Co(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,rr(P5,r._currentValue),r._currentValue=a,o!==null)if(tl(o.value,a)){if(o.children===i.children&&!ea.current){t=ac(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ku(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),P9(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Ve(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),P9(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Co(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Im(t,n),i=fs(i),r=r(i),t.flags|=1,Co(e,t,r,n),t.child;case 14:return r=t.type,i=$s(r,t.pendingProps),i=$s(r.type,i),zM(e,t,r,i,n);case 15:return _H(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$s(r,i),k4(e,t),t.tag=1,ta(r)?(e=!0,_5(t)):e=!1,Im(t,n),Jz(t,r,i),L9(t,r,i,n),M9(null,t,r,!0,e,n);case 19:return LH(e,t,n);case 22:return kH(e,t,n)}throw Error(Ve(156,t.tag))};function UH(e,t){return vz(e,t)}function H2e(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function is(e,t,n,r){return new H2e(e,t,n,r)}function gE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function V2e(e){if(typeof e=="function")return gE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rk)return 11;if(e===Dk)return 14}return 2}function Fd(e,t){var n=e.alternate;return n===null?(n=is(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function T4(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")gE(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case tm:return Wh(n.children,i,o,t);case Ik:a=8,i|=8;break;case J7:return e=is(12,n,t,i|2),e.elementType=J7,e.lanes=o,e;case e9:return e=is(13,n,t,i),e.elementType=e9,e.lanes=o,e;case t9:return e=is(19,n,t,i),e.elementType=t9,e.lanes=o,e;case ez:return mx(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case QF:a=10;break e;case JF:a=9;break e;case Rk:a=11;break e;case Dk:a=14;break e;case md:a=16,r=null;break e}throw Error(Ve(130,e==null?e:typeof e,""))}return t=is(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Wh(e,t,n,r){return e=is(7,e,r,t),e.lanes=n,e}function mx(e,t,n,r){return e=is(22,e,r,t),e.elementType=ez,e.lanes=n,e.stateNode={isHidden:!1},e}function J6(e,t,n){return e=is(6,e,null,t),e.lanes=n,e}function eC(e,t,n){return t=is(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function W2e(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=R6(0),this.expirationTimes=R6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R6(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function mE(e,t,n,r,i,o,a,s,l){return e=new W2e(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=is(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jk(o),e}function U2e(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=ja})(G1e);const Cb=v_(el);var[X2e,Z2e]=Pn({strict:!1,name:"PortalManagerContext"});function KH(e){const{children:t,zIndex:n}=e;return N.createElement(X2e,{value:{zIndex:n}},t)}KH.displayName="PortalManager";var[XH,Q2e]=Pn({strict:!1,name:"PortalContext"}),SE="chakra-portal",J2e=".chakra-portal",eye=e=>N.createElement("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0}},e.children),tye=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=w.useState(null),o=w.useRef(null),[,a]=w.useState({});w.useEffect(()=>a({}),[]);const s=Q2e(),l=Z2e();Gs(()=>{if(!r)return;const d=r.ownerDocument,h=t?s??d.body:d.body;if(!h)return;o.current=d.createElement("div"),o.current.className=SE,h.appendChild(o.current),a({});const m=o.current;return()=>{h.contains(m)&&h.removeChild(m)}},[r]);const u=l!=null&&l.zIndex?N.createElement(eye,{zIndex:l==null?void 0:l.zIndex},n):n;return o.current?el.createPortal(N.createElement(XH,{value:o.current},u),o.current):N.createElement("span",{ref:d=>{d&&i(d)}})},nye=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=w.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=SE),l},[i]),[,s]=w.useState({});return Gs(()=>s({}),[]),Gs(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?el.createPortal(N.createElement(XH,{value:r?a:null},t),a):null};function dp(e){const{containerRef:t,...n}=e;return t?N.createElement(nye,{containerRef:t,...n}):N.createElement(tye,{...n})}dp.defaultProps={appendToParentPortal:!0};dp.className=SE;dp.selector=J2e;dp.displayName="Portal";var rye=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Og=new WeakMap,_b=new WeakMap,kb={},tC=0,ZH=function(e){return e&&(e.host||ZH(e.parentNode))},iye=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ZH(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},oye=function(e,t,n,r){var i=iye(t,Array.isArray(e)?e:[e]);kb[n]||(kb[n]=new WeakMap);var o=kb[n],a=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(s.has(m))d(m);else{var y=m.getAttribute(r),b=y!==null&&y!=="false",x=(Og.get(m)||0)+1,k=(o.get(m)||0)+1;Og.set(m,x),o.set(m,k),a.push(m),x===1&&b&&_b.set(m,!0),k===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}})};return d(t),s.clear(),tC++,function(){a.forEach(function(h){var m=Og.get(h)-1,y=o.get(h)-1;Og.set(h,m),o.set(h,y),m||(_b.has(h)||h.removeAttribute(r),_b.delete(h)),y||h.removeAttribute(n)}),tC--,tC||(Og=new WeakMap,Og=new WeakMap,_b=new WeakMap,kb={})}},QH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||rye(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),oye(r,i,n,"aria-hidden")):function(){return null}};function xE(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var jn={},aye={get exports(){return jn},set exports(e){jn=e}},sye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",lye=sye,uye=lye;function JH(){}function eV(){}eV.resetWarningCache=JH;var cye=function(){function e(r,i,o,a,s,l){if(l!==uye){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:eV,resetWarningCache:JH};return n.PropTypes=n,n};aye.exports=cye();var W9="data-focus-lock",tV="data-focus-lock-disabled",dye="data-no-focus-lock",fye="data-autofocus-inside",hye="data-no-autofocus";function pye(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gye(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function nV(e,t){return gye(t||null,function(n){return e.forEach(function(r){return pye(r,n)})})}var nC={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function rV(e){return e}function iV(e,t){t===void 0&&(t=rV);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function wE(e,t){return t===void 0&&(t=rV),iV(e,t)}function oV(e){e===void 0&&(e={});var t=iV(null);return t.options=Hl({async:!0,ssr:!1},e),t}var aV=function(e){var t=e.sideCar,n=Y$(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Hl({},n))};aV.isSideCarExport=!0;function mye(e,t){return e.useMedium(t),aV}var sV=wE({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),lV=wE(),vye=wE(),yye=oV({async:!0}),bye=[],CE=w.forwardRef(function(t,n){var r,i=w.useState(),o=i[0],a=i[1],s=w.useRef(),l=w.useRef(!1),u=w.useRef(null),d=t.children,h=t.disabled,m=t.noFocusGuards,y=t.persistentFocus,b=t.crossFrame,x=t.autoFocus;t.allowTextSelection;var k=t.group,E=t.className,_=t.whiteList,P=t.hasPositiveIndices,A=t.shards,M=A===void 0?bye:A,R=t.as,D=R===void 0?"div":R,j=t.lockProps,z=j===void 0?{}:j,H=t.sideCar,K=t.returnFocus,te=t.focusOptions,G=t.onActivation,$=t.onDeactivation,W=w.useState({}),X=W[0],Z=w.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&G&&G(s.current),l.current=!0},[G]),U=w.useCallback(function(){l.current=!1,$&&$(s.current)},[$]);w.useEffect(function(){h||(u.current=null)},[]);var Q=w.useCallback(function(rt){var We=u.current;if(We&&We.focus){var Be=typeof K=="function"?K(We):K;if(Be){var wt=typeof Be=="object"?Be:void 0;u.current=null,rt?Promise.resolve().then(function(){return We.focus(wt)}):We.focus(wt)}}},[K]),re=w.useCallback(function(rt){l.current&&sV.useMedium(rt)},[]),he=lV.useMedium,Ee=w.useCallback(function(rt){s.current!==rt&&(s.current=rt,a(rt))},[]),Ce=bn((r={},r[tV]=h&&"disabled",r[W9]=k,r),z),de=m!==!0,ze=de&&m!=="tail",Me=nV([n,Ee]);return w.createElement(w.Fragment,null,de&&[w.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:nC}),P?w.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:nC}):null],!h&&w.createElement(H,{id:X,sideCar:yye,observed:o,disabled:h,persistentFocus:y,crossFrame:b,autoFocus:x,whiteList:_,shards:M,onActivation:Z,onDeactivation:U,returnFocus:Q,focusOptions:te}),w.createElement(D,bn({ref:Me},Ce,{className:E,onBlur:he,onFocus:re}),d),ze&&w.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:nC}))});CE.propTypes={};CE.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const uV=CE;function U9(e,t){return U9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},U9(e,t)}function _E(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,U9(e,t)}function cV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sye(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){_E(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return a};var h=d.prototype;return h.componentDidMount=function(){o.push(this),s()},h.componentDidUpdate=function(){s()},h.componentWillUnmount=function(){var y=o.indexOf(this);o.splice(y,1),s()},h.render=function(){return N.createElement(i,this.props)},d}(w.PureComponent);return cV(l,"displayName","SideEffect("+n(i)+")"),l}}var pu=function(e){for(var t=Array(e.length),n=0;n=0}).sort(Tye)},Lye=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],EE=Lye.join(","),Aye="".concat(EE,", [data-focus-guard]"),bV=function(e,t){var n;return pu(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,i){return r.concat(i.matches(t?Aye:EE)?[i]:[],bV(i))},[])},PE=function(e,t){return e.reduce(function(n,r){return n.concat(bV(r,t),r.parentNode?pu(r.parentNode.querySelectorAll(EE)).filter(function(i){return i===r}):[])},[])},Oye=function(e){var t=e.querySelectorAll("[".concat(fye,"]"));return pu(t).map(function(n){return PE([n])}).reduce(function(n,r){return n.concat(r)},[])},TE=function(e,t){return pu(e).filter(function(n){return hV(t,n)}).filter(function(n){return kye(n)})},tI=function(e,t){return t===void 0&&(t=new Map),pu(e).filter(function(n){return pV(t,n)})},q9=function(e,t,n){return yV(TE(PE(e,n),t),!0,n)},nI=function(e,t){return yV(TE(PE(e),t),!1)},Mye=function(e,t){return TE(Oye(e),t)},ey=function(e,t){return e.shadowRoot?ey(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:pu(e.children).some(function(n){return ey(n,t)})},Iye=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},SV=function(e){return e.parentNode?SV(e.parentNode):e},LE=function(e){var t=G9(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(W9);return n.push.apply(n,i?Iye(pu(SV(r).querySelectorAll("[".concat(W9,'="').concat(i,'"]:not([').concat(tV,'="disabled"])')))):[r]),n},[])},xV=function(e){return e.activeElement?e.activeElement.shadowRoot?xV(e.activeElement.shadowRoot):e.activeElement:void 0},AE=function(){return document.activeElement?document.activeElement.shadowRoot?xV(document.activeElement.shadowRoot):document.activeElement:void 0},Rye=function(e){return e===document.activeElement},Dye=function(e){return Boolean(pu(e.querySelectorAll("iframe")).some(function(t){return Rye(t)}))},wV=function(e){var t=document&&AE();return!t||t.dataset&&t.dataset.focusGuard?!1:LE(e).some(function(n){return ey(n,t)||Dye(n)})},Nye=function(){var e=document&&AE();return e?pu(document.querySelectorAll("[".concat(dye,"]"))).some(function(t){return ey(t,e)}):!1},jye=function(e,t){return t.filter(vV).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},OE=function(e,t){return vV(e)&&e.name?jye(e,t):e},Bye=function(e){var t=new Set;return e.forEach(function(n){return t.add(OE(n,e))}),e.filter(function(n){return t.has(n)})},rI=function(e){return e[0]&&e.length>1?OE(e[0],e):e[0]},iI=function(e,t){return e.length>1?e.indexOf(OE(e[t],e)):t},CV="NEW_FOCUS",$ye=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=kE(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,d=r?e.indexOf(r):-1,h=l-u,m=t.indexOf(o),y=t.indexOf(a),b=Bye(t),x=n!==void 0?b.indexOf(n):-1,k=x-(r?b.indexOf(r):l),E=iI(e,0),_=iI(e,i-1);if(l===-1||d===-1)return CV;if(!h&&d>=0)return d;if(l<=m&&s&&Math.abs(h)>1)return _;if(l>=y&&s&&Math.abs(h)>1)return E;if(h&&Math.abs(k)>1)return d;if(l<=m)return _;if(l>y)return E;if(h)return Math.abs(h)>1?d:(i+d+h)%i}},Fye=function(e){return function(t){var n,r=(n=gV(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},zye=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=tI(r.filter(Fye(n)));return i&&i.length?rI(i):rI(tI(t))},Y9=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Y9(e.parentNode.host||e.parentNode,t),t},rC=function(e,t){for(var n=Y9(e),r=Y9(t),i=0;i=0)return o}return!1},_V=function(e,t,n){var r=G9(e),i=G9(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=rC(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=rC(o,l);u&&(!a||ey(u,a)?a=u:a=rC(u,a))})}),a},Hye=function(e,t){return e.reduce(function(n,r){return n.concat(Mye(r,t))},[])},Vye=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Pye)},Wye=function(e,t){var n=document&&AE(),r=LE(e).filter(B5),i=_V(n||e,e,r),o=new Map,a=nI(r,o),s=q9(r,o).filter(function(m){var y=m.node;return B5(y)});if(!(!s[0]&&(s=a,!s[0]))){var l=nI([i],o).map(function(m){var y=m.node;return y}),u=Vye(l,s),d=u.map(function(m){var y=m.node;return y}),h=$ye(d,l,n,t);return h===CV?{node:zye(a,d,Hye(r,o))}:h===void 0?h:u[h]}},Uye=function(e){var t=LE(e).filter(B5),n=_V(e,e,t),r=new Map,i=q9([n],r,!0),o=q9(t,r).filter(function(a){var s=a.node;return B5(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:kE(s)}})},Gye=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},iC=0,oC=!1,qye=function(e,t,n){n===void 0&&(n={});var r=Wye(e,t);if(!oC&&r){if(iC>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),oC=!0,setTimeout(function(){oC=!1},1);return}iC++,Gye(r.node,n.focusOptions),iC--}};const kV=qye;function EV(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var Yye=function(){return document&&document.activeElement===document.body},Kye=function(){return Yye()||Nye()},Dm=null,fm=null,Nm=null,ty=!1,Xye=function(){return!0},Zye=function(t){return(Dm.whiteList||Xye)(t)},Qye=function(t,n){Nm={observerNode:t,portaledElement:n}},Jye=function(t){return Nm&&Nm.portaledElement===t};function oI(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var e3e=function(t){return t&&"current"in t?t.current:t},t3e=function(t){return t?Boolean(ty):ty==="meanwhile"},n3e=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},r3e=function(t,n){return n.some(function(r){return n3e(t,r,r)})},$5=function(){var t=!1;if(Dm){var n=Dm,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||Nm&&Nm.portaledElement,d=document&&document.activeElement;if(u){var h=[u].concat(a.map(e3e).filter(Boolean));if((!d||Zye(d))&&(i||t3e(s)||!Kye()||!fm&&o)&&(u&&!(wV(h)||d&&r3e(d,h)||Jye(d))&&(document&&!fm&&d&&!o?(d.blur&&d.blur(),document.body.focus()):(t=kV(h,fm,{focusOptions:l}),Nm={})),ty=!1,fm=document&&document.activeElement),document){var m=document&&document.activeElement,y=Uye(h),b=y.map(function(x){var k=x.node;return k}).indexOf(m);b>-1&&(y.filter(function(x){var k=x.guard,E=x.node;return k&&E.dataset.focusAutoGuard}).forEach(function(x){var k=x.node;return k.removeAttribute("tabIndex")}),oI(b,y.length,1,y),oI(b,-1,-1,y))}}}return t},PV=function(t){$5()&&t&&(t.stopPropagation(),t.preventDefault())},ME=function(){return EV($5)},i3e=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Qye(r,n)},o3e=function(){return null},TV=function(){ty="just",setTimeout(function(){ty="meanwhile"},0)},a3e=function(){document.addEventListener("focusin",PV),document.addEventListener("focusout",ME),window.addEventListener("blur",TV)},s3e=function(){document.removeEventListener("focusin",PV),document.removeEventListener("focusout",ME),window.removeEventListener("blur",TV)};function l3e(e){return e.filter(function(t){var n=t.disabled;return!n})}function u3e(e){var t=e.slice(-1)[0];t&&!Dm&&a3e();var n=Dm,r=n&&t&&t.id===n.id;Dm=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(fm=null,(!r||n.observed!==t.observed)&&t.onActivation(),$5(),EV($5)):(s3e(),fm=null)}sV.assignSyncMedium(i3e);lV.assignMedium(ME);vye.assignMedium(function(e){return e({moveFocusInside:kV,focusInside:wV})});const c3e=Sye(l3e,u3e)(o3e);var LV=w.forwardRef(function(t,n){return w.createElement(uV,bn({sideCar:c3e,ref:n},t))}),AV=uV.propTypes||{};AV.sideCar;xE(AV,["sideCar"]);LV.propTypes={};const d3e=LV;var OV=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,d=w.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&NF(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),h=w.useCallback(()=>{var y;(y=n==null?void 0:n.current)==null||y.focus()},[n]),m=i&&!n;return N.createElement(d3e,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:d,onDeactivation:h,returnFocus:m},o)};OV.displayName="FocusLock";var L4="right-scroll-bar-position",A4="width-before-scroll-bar",f3e="with-scroll-bars-hidden",h3e="--removed-body-scroll-bar-size",MV=oV(),aC=function(){},xx=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:aC,onWheelCapture:aC,onTouchMoveCapture:aC}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,m=e.sideCar,y=e.noIsolation,b=e.inert,x=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,_=Y$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),P=m,A=nV([n,t]),M=Hl(Hl({},_),i);return w.createElement(w.Fragment,null,d&&w.createElement(P,{sideCar:MV,removeScrollBar:u,shards:h,noIsolation:y,inert:b,setCallbacks:o,allowPinchZoom:!!x,lockRef:n}),a?w.cloneElement(w.Children.only(s),Hl(Hl({},M),{ref:A})):w.createElement(E,Hl({},M,{className:l,ref:A}),s))});xx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xx.classNames={fullWidth:A4,zeroRight:L4};var p3e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function g3e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=p3e();return t&&e.setAttribute("nonce",t),e}function m3e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function v3e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var y3e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=g3e())&&(m3e(t,n),v3e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b3e=function(){var e=y3e();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},IV=function(){var e=b3e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},S3e={left:0,top:0,right:0,gap:0},sC=function(e){return parseInt(e||"",10)||0},x3e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[sC(n),sC(r),sC(i)]},w3e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return S3e;var t=x3e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},C3e=IV(),_3e=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(f3e,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; @@ -385,29 +385,29 @@ Error generating stack: `+o.message+` `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` } - .`).concat(T4,` { + .`).concat(L4,` { right: `).concat(s,"px ").concat(r,`; } - .`).concat(L4,` { + .`).concat(A4,` { margin-right: `).concat(s,"px ").concat(r,`; } - .`).concat(T4," .").concat(T4,` { + .`).concat(L4," .").concat(L4,` { right: 0 `).concat(r,`; } - .`).concat(L4," .").concat(L4,` { + .`).concat(A4," .").concat(A4,` { margin-right: 0 `).concat(r,`; } body { `).concat(h3e,": ").concat(s,`px; } -`)},k3e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=w.useMemo(function(){return w3e(i)},[i]);return w.createElement(C3e,{styles:_3e(o,!t,i,n?"":"!important")})},K9=!1;if(typeof window<"u")try{var _b=Object.defineProperty({},"passive",{get:function(){return K9=!0,!0}});window.addEventListener("test",_b,_b),window.removeEventListener("test",_b,_b)}catch{K9=!1}var Og=K9?{passive:!1}:!1,E3e=function(e){return e.tagName==="TEXTAREA"},RV=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!E3e(e)&&n[t]==="visible")},P3e=function(e){return RV(e,"overflowY")},T3e=function(e){return RV(e,"overflowX")},aI=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=DV(e,n);if(r){var i=NV(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},L3e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},A3e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},DV=function(e,t){return e==="v"?P3e(t):T3e(t)},NV=function(e,t){return e==="v"?L3e(t):A3e(t)},O3e=function(e,t){return e==="h"&&t==="rtl"?-1:1},M3e=function(e,t,n,r,i){var o=O3e(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,d=a>0,h=0,m=0;do{var y=NV(e,s),b=y[0],x=y[1],k=y[2],E=x-k-o*b;(b||E)&&DV(e,s)&&(h+=E,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(i&&h===0||!i&&a>h)||!d&&(i&&m===0||!i&&-a>m))&&(u=!0),u},kb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sI=function(e){return[e.deltaX,e.deltaY]},lI=function(e){return e&&"current"in e?e.current:e},I3e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},R3e=function(e){return` +`)},k3e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=w.useMemo(function(){return w3e(i)},[i]);return w.createElement(C3e,{styles:_3e(o,!t,i,n?"":"!important")})},K9=!1;if(typeof window<"u")try{var Eb=Object.defineProperty({},"passive",{get:function(){return K9=!0,!0}});window.addEventListener("test",Eb,Eb),window.removeEventListener("test",Eb,Eb)}catch{K9=!1}var Mg=K9?{passive:!1}:!1,E3e=function(e){return e.tagName==="TEXTAREA"},RV=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!E3e(e)&&n[t]==="visible")},P3e=function(e){return RV(e,"overflowY")},T3e=function(e){return RV(e,"overflowX")},aI=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=DV(e,n);if(r){var i=NV(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},L3e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},A3e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},DV=function(e,t){return e==="v"?P3e(t):T3e(t)},NV=function(e,t){return e==="v"?L3e(t):A3e(t)},O3e=function(e,t){return e==="h"&&t==="rtl"?-1:1},M3e=function(e,t,n,r,i){var o=O3e(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,d=a>0,h=0,m=0;do{var y=NV(e,s),b=y[0],x=y[1],k=y[2],E=x-k-o*b;(b||E)&&DV(e,s)&&(h+=E,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(i&&h===0||!i&&a>h)||!d&&(i&&m===0||!i&&-a>m))&&(u=!0),u},Pb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sI=function(e){return[e.deltaX,e.deltaY]},lI=function(e){return e&&"current"in e?e.current:e},I3e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},R3e=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},D3e=0,Mg=[];function N3e(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(D3e++)[0],o=w.useState(function(){return IV()})[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=z7([e.lockRef.current],(e.shards||[]).map(lI),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(x,k){if("touches"in x&&x.touches.length===2)return!a.current.allowPinchZoom;var E=kb(x),_=n.current,P="deltaX"in x?x.deltaX:_[0]-E[0],A="deltaY"in x?x.deltaY:_[1]-E[1],M,R=x.target,D=Math.abs(P)>Math.abs(A)?"h":"v";if("touches"in x&&D==="h"&&R.type==="range")return!1;var j=aI(D,R);if(!j)return!0;if(j?M=D:(M=D==="v"?"h":"v",j=aI(D,R)),!j)return!1;if(!r.current&&"changedTouches"in x&&(P||A)&&(r.current=M),!M)return!0;var z=r.current||M;return M3e(z,k,x,z==="h"?P:A,!0)},[]),l=w.useCallback(function(x){var k=x;if(!(!Mg.length||Mg[Mg.length-1]!==o)){var E="deltaY"in k?sI(k):kb(k),_=t.current.filter(function(M){return M.name===k.type&&M.target===k.target&&I3e(M.delta,E)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var P=(a.current.shards||[]).map(lI).filter(Boolean).filter(function(M){return M.contains(k.target)}),A=P.length>0?s(k,P[0]):!a.current.noIsolation;A&&k.cancelable&&k.preventDefault()}}},[]),u=w.useCallback(function(x,k,E,_){var P={name:x,delta:k,target:E,should:_};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(A){return A!==P})},1)},[]),d=w.useCallback(function(x){n.current=kb(x),r.current=void 0},[]),h=w.useCallback(function(x){u(x.type,sI(x),x.target,s(x,e.lockRef.current))},[]),m=w.useCallback(function(x){u(x.type,kb(x),x.target,s(x,e.lockRef.current))},[]);w.useEffect(function(){return Mg.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Og),document.addEventListener("touchmove",l,Og),document.addEventListener("touchstart",d,Og),function(){Mg=Mg.filter(function(x){return x!==o}),document.removeEventListener("wheel",l,Og),document.removeEventListener("touchmove",l,Og),document.removeEventListener("touchstart",d,Og)}},[]);var y=e.removeScrollBar,b=e.inert;return w.createElement(w.Fragment,null,b?w.createElement(o,{styles:R3e(i)}):null,y?w.createElement(k3e,{gapMode:"margin"}):null)}const j3e=mye(MV,N3e);var jV=w.forwardRef(function(e,t){return w.createElement(xx,Hl({},e,{ref:t,sideCar:j3e}))});jV.classNames=xx.classNames;const BV=jV;var dp=(...e)=>e.filter(Boolean).join(" ");function Ev(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var B3e=class{constructor(){sn(this,"modals");this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},X9=new B3e;function F3e(e,t){w.useEffect(()=>(t&&X9.add(e),()=>{X9.remove(e)}),[t,e])}function $3e(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=w.useRef(null),d=w.useRef(null),[h,m,y]=H3e(r,"chakra-modal","chakra-modal--header","chakra-modal--body");z3e(u,t&&a),F3e(u,t);const b=w.useRef(null),x=w.useCallback(j=>{b.current=j.target},[]),k=w.useCallback(j=>{j.key==="Escape"&&(j.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[E,_]=w.useState(!1),[P,A]=w.useState(!1),M=w.useCallback((j={},z=null)=>({role:"dialog",...j,ref:Hn(z,u),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":E?m:void 0,"aria-describedby":P?y:void 0,onClick:Ev(j.onClick,H=>H.stopPropagation())}),[y,P,h,m,E]),R=w.useCallback(j=>{j.stopPropagation(),b.current===j.target&&X9.isTopModal(u)&&(i&&(n==null||n()),s==null||s())},[n,i,s]),D=w.useCallback((j={},z=null)=>({...j,ref:Hn(z,d),onClick:Ev(j.onClick,R),onKeyDown:Ev(j.onKeyDown,k),onMouseDown:Ev(j.onMouseDown,x)}),[k,x,R]);return{isOpen:t,onClose:n,headerId:m,bodyId:y,setBodyMounted:A,setHeaderMounted:_,dialogRef:u,overlayRef:d,getDialogProps:M,getDialogContainerProps:D}}function z3e(e,t){const n=e.current;w.useEffect(()=>{if(!(!e.current||!t))return QH(e.current)},[t,e,n])}function H3e(e,...t){const n=w.useId(),r=e||n;return w.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[V3e,fp]=Pn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[W3e,Xd]=Pn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Zd=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m,onCloseComplete:y}=e,b=Oi("Modal",e),k={...$3e(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m};return N.createElement(W3e,{value:k},N.createElement(V3e,{value:b},N.createElement(af,{onExitComplete:y},k.isOpen&&N.createElement(cp,{...t},n))))};Zd.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};Zd.displayName="Modal";var a0=Ae((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=Xd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=dp("chakra-modal__body",n),s=fp();return N.createElement(Ce.div,{ref:t,className:a,id:i,...r,__css:s.body})});a0.displayName="ModalBody";var Iy=Ae((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=Xd(),a=dp("chakra-modal__close-btn",r),s=fp();return N.createElement(rx,{ref:t,__css:s.closeButton,className:a,onClick:Ev(n,l=>{l.stopPropagation(),o()}),...i})});Iy.displayName="ModalCloseButton";function FV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:d}=Xd(),[h,m]=tk();return w.useEffect(()=>{!h&&m&&setTimeout(m)},[h,m]),N.createElement(OV,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:d},N.createElement(BV,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0},e.children))}var U3e={slideInBottom:{...V7,custom:{offsetY:16,reverse:!0}},slideInRight:{...V7,custom:{offsetX:16,reverse:!0}},scale:{...ZF,custom:{initialScale:.95,reverse:!0}},none:{}},G3e=Ce(hu.section),q3e=e=>U3e[e||"none"],$V=w.forwardRef((e,t)=>{const{preset:n,motionProps:r=q3e(n),...i}=e;return N.createElement(G3e,{ref:t,...r,...i})});$V.displayName="ModalTransition";var ep=Ae((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Xd(),u=s(a,t),d=l(i),h=dp("chakra-modal__content",n),m=fp(),y={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:x}=Xd();return N.createElement(FV,null,N.createElement(Ce.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:b},N.createElement($V,{preset:x,motionProps:o,className:h,...u,__css:y},r)))});ep.displayName="ModalContent";var wx=Ae((e,t)=>{const{className:n,...r}=e,i=dp("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...fp().footer};return N.createElement(Ce.footer,{ref:t,...r,__css:a,className:i})});wx.displayName="ModalFooter";var k0=Ae((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=Xd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=dp("chakra-modal__header",n),l={flex:0,...fp().header};return N.createElement(Ce.header,{ref:t,className:a,id:i,...r,__css:l})});k0.displayName="ModalHeader";var Y3e=Ce(hu.div),Qd=Ae((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=dp("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...fp().overlay},{motionPreset:u}=Xd(),h=i||(u==="none"?{}:XF);return N.createElement(Y3e,{...h,__css:l,ref:t,className:a,...o})});Qd.displayName="ModalOverlay";function zV(e){const{leastDestructiveRef:t,...n}=e;return N.createElement(Zd,{...n,initialFocusRef:t})}var HV=Ae((e,t)=>N.createElement(ep,{ref:t,role:"alertdialog",...e})),[mze,K3e]=Pn(),X3e=Ce(QF),Z3e=Ae((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=Xd(),d=s(a,t),h=l(o),m=dp("chakra-modal__content",n),y=fp(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...y.dialog},x={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...y.dialogContainer},{placement:k}=K3e();return N.createElement(FV,null,N.createElement(Ce.div,{...h,className:"chakra-modal__content-container",__css:x},N.createElement(X3e,{motionProps:i,direction:k,in:u,className:m,...d,__css:b},r)))});Z3e.displayName="DrawerContent";function Q3e(e,t){const n=Er(e);w.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var VV=(...e)=>e.filter(Boolean).join(" "),lC=e=>e?!0:void 0;function Ml(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var J3e=e=>N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})),ebe=e=>N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"}));function uI(e,t,n,r){w.useEffect(()=>{if(!e.current||!r)return;const i=e.current.ownerDocument.defaultView??window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(s=>{for(const l of s)l.type==="attributes"&&l.attributeName&&o.includes(l.attributeName)&&n(l)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var tbe=50,cI=300;function nbe(e,t){const[n,r]=w.useState(!1),[i,o]=w.useState(null),[a,s]=w.useState(!0),l=w.useRef(null),u=()=>clearTimeout(l.current);Q3e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?tbe:null);const d=w.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},cI)},[e,a]),h=w.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},cI)},[t,a]),m=w.useCallback(()=>{s(!0),r(!1),u()},[]);return w.useEffect(()=>()=>u(),[]),{up:d,down:h,stop:m,isSpinning:n}}var rbe=/^[Ee0-9+\-.]$/;function ibe(e){return rbe.test(e)}function obe(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function abe(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:d,pattern:h="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:y,id:b,onChange:x,precision:k,name:E,"aria-describedby":_,"aria-label":P,"aria-labelledby":A,onFocus:M,onBlur:R,onInvalid:D,getAriaValueText:j,isValidCharacter:z,format:H,parse:K,...te}=e,G=Er(M),F=Er(R),W=Er(D),X=Er(z??ibe),Z=Er(j),U=Sme(e),{update:Q,increment:re,decrement:fe}=U,[Ee,be]=w.useState(!1),ye=!(s||l),ze=w.useRef(null),Me=w.useRef(null),rt=w.useRef(null),We=w.useRef(null),Be=w.useCallback(Te=>Te.split("").filter(X).join(""),[X]),wt=w.useCallback(Te=>(K==null?void 0:K(Te))??Te,[K]),Fe=w.useCallback(Te=>((H==null?void 0:H(Te))??Te).toString(),[H]);Gd(()=>{(U.valueAsNumber>o||U.valueAsNumber{if(!ze.current)return;if(ze.current.value!=U.value){const At=wt(ze.current.value);U.setValue(Be(At))}},[wt,Be]);const at=w.useCallback((Te=a)=>{ye&&re(Te)},[re,ye,a]),bt=w.useCallback((Te=a)=>{ye&&fe(Te)},[fe,ye,a]),Le=nbe(at,bt);uI(rt,"disabled",Le.stop,Le.isSpinning),uI(We,"disabled",Le.stop,Le.isSpinning);const ut=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;const He=wt(Te.currentTarget.value);Q(Be(He)),Me.current={start:Te.currentTarget.selectionStart,end:Te.currentTarget.selectionEnd}},[Q,Be,wt]),Mt=w.useCallback(Te=>{var At;G==null||G(Te),Me.current&&(Te.target.selectionStart=Me.current.start??((At=Te.currentTarget.value)==null?void 0:At.length),Te.currentTarget.selectionEnd=Me.current.end??Te.currentTarget.selectionStart)},[G]),ct=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;obe(Te,X)||Te.preventDefault();const At=_t(Te)*a,He=Te.key,nn={ArrowUp:()=>at(At),ArrowDown:()=>bt(At),Home:()=>Q(i),End:()=>Q(o)}[He];nn&&(Te.preventDefault(),nn(Te))},[X,a,at,bt,Q,i,o]),_t=Te=>{let At=1;return(Te.metaKey||Te.ctrlKey)&&(At=.1),Te.shiftKey&&(At=10),At},un=w.useMemo(()=>{const Te=Z==null?void 0:Z(U.value);if(Te!=null)return Te;const At=U.value.toString();return At||void 0},[U.value,Z]),ae=w.useCallback(()=>{let Te=U.value;if(U.value==="")return;/^[eE]/.test(U.value.toString())?U.setValue(""):(U.valueAsNumbero&&(Te=o),U.cast(Te))},[U,o,i]),De=w.useCallback(()=>{be(!1),n&&ae()},[n,be,ae]),Ke=w.useCallback(()=>{t&&requestAnimationFrame(()=>{var Te;(Te=ze.current)==null||Te.focus()})},[t]),Xe=w.useCallback(Te=>{Te.preventDefault(),Le.up(),Ke()},[Ke,Le]),xe=w.useCallback(Te=>{Te.preventDefault(),Le.down(),Ke()},[Ke,Le]);jh(()=>ze.current,"wheel",Te=>{var At;const vt=(((At=ze.current)==null?void 0:At.ownerDocument)??document).activeElement===ze.current;if(!y||!vt)return;Te.preventDefault();const nn=_t(Te)*a,Rn=Math.sign(Te.deltaY);Rn===-1?at(nn):Rn===1&&bt(nn)},{passive:!1});const Ne=w.useCallback((Te={},At=null)=>{const He=l||r&&U.isAtMax;return{...Te,ref:Hn(At,rt),role:"button",tabIndex:-1,onPointerDown:Ml(Te.onPointerDown,vt=>{vt.button!==0||He||Xe(vt)}),onPointerLeave:Ml(Te.onPointerLeave,Le.stop),onPointerUp:Ml(Te.onPointerUp,Le.stop),disabled:He,"aria-disabled":lC(He)}},[U.isAtMax,r,Xe,Le.stop,l]),Ct=w.useCallback((Te={},At=null)=>{const He=l||r&&U.isAtMin;return{...Te,ref:Hn(At,We),role:"button",tabIndex:-1,onPointerDown:Ml(Te.onPointerDown,vt=>{vt.button!==0||He||xe(vt)}),onPointerLeave:Ml(Te.onPointerLeave,Le.stop),onPointerUp:Ml(Te.onPointerUp,Le.stop),disabled:He,"aria-disabled":lC(He)}},[U.isAtMin,r,xe,Le.stop,l]),Dt=w.useCallback((Te={},At=null)=>({name:E,inputMode:m,type:"text",pattern:h,"aria-labelledby":A,"aria-label":P,"aria-describedby":_,id:b,disabled:l,...Te,readOnly:Te.readOnly??s,"aria-readonly":Te.readOnly??s,"aria-required":Te.required??u,required:Te.required??u,ref:Hn(ze,At),value:Fe(U.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(U.valueAsNumber)?void 0:U.valueAsNumber,"aria-invalid":lC(d??U.isOutOfRange),"aria-valuetext":un,autoComplete:"off",autoCorrect:"off",onChange:Ml(Te.onChange,ut),onKeyDown:Ml(Te.onKeyDown,ct),onFocus:Ml(Te.onFocus,Mt,()=>be(!0)),onBlur:Ml(Te.onBlur,F,De)}),[E,m,h,A,P,Fe,_,b,l,u,s,d,U.value,U.valueAsNumber,U.isOutOfRange,i,o,un,ut,ct,Mt,F,De]);return{value:Fe(U.value),valueAsNumber:U.valueAsNumber,isFocused:Ee,isDisabled:l,isReadOnly:s,getIncrementButtonProps:Ne,getDecrementButtonProps:Ct,getInputProps:Dt,htmlProps:te}}var[sbe,Cx]=Pn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[lbe,IE]=Pn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),RE=Ae(function(t,n){const r=Oi("NumberInput",t),i=Sn(t),o=pk(i),{htmlProps:a,...s}=abe(o),l=w.useMemo(()=>s,[s]);return N.createElement(lbe,{value:l},N.createElement(sbe,{value:r},N.createElement(Ce.div,{...a,ref:n,className:VV("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});RE.displayName="NumberInput";var WV=Ae(function(t,n){const r=Cx();return N.createElement(Ce.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});WV.displayName="NumberInputStepper";var DE=Ae(function(t,n){const{getInputProps:r}=IE(),i=r(t,n),o=Cx();return N.createElement(Ce.input,{...i,className:VV("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});DE.displayName="NumberInputField";var UV=Ce("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),NE=Ae(function(t,n){const r=Cx(),{getDecrementButtonProps:i}=IE(),o=i(t,n);return N.createElement(UV,{...o,__css:r.stepper},t.children??N.createElement(J3e,null))});NE.displayName="NumberDecrementStepper";var jE=Ae(function(t,n){const{getIncrementButtonProps:r}=IE(),i=r(t,n),o=Cx();return N.createElement(UV,{...i,__css:o.stepper},t.children??N.createElement(ebe,null))});jE.displayName="NumberIncrementStepper";var Ry=(...e)=>e.filter(Boolean).join(" ");function ube(e,...t){return cbe(e)?e(...t):e}var cbe=e=>typeof e=="function";function Il(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function dbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[fbe,hp]=Pn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[hbe,Dy]=Pn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Ig={click:"click",hover:"hover"};function pbe(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=Ig.click,openDelay:d=200,closeDelay:h=200,isLazy:m,lazyBehavior:y="unmount",computePositionOnMount:b,...x}=e,{isOpen:k,onClose:E,onOpen:_,onToggle:P}=q$(e),A=w.useRef(null),M=w.useRef(null),R=w.useRef(null),D=w.useRef(!1),j=w.useRef(!1);k&&(j.current=!0);const[z,H]=w.useState(!1),[K,te]=w.useState(!1),G=w.useId(),F=i??G,[W,X,Z,U]=["popover-trigger","popover-content","popover-header","popover-body"].map(ut=>`${ut}-${F}`),{referenceRef:Q,getArrowProps:re,getPopperProps:fe,getArrowInnerProps:Ee,forceUpdate:be}=G$({...x,enabled:k||!!b}),ye=U1e({isOpen:k,ref:R});Lme({enabled:k,ref:M}),x0e(R,{focusRef:M,visible:k,shouldFocus:o&&u===Ig.click}),C0e(R,{focusRef:r,visible:k,shouldFocus:a&&u===Ig.click});const ze=Y$({wasSelected:j.current,enabled:m,mode:y,isSelected:ye.present}),Me=w.useCallback((ut={},Mt=null)=>{const ct={...ut,style:{...ut.style,transformOrigin:oi.transformOrigin.varRef,[oi.arrowSize.var]:s?`${s}px`:void 0,[oi.arrowShadowColor.var]:l},ref:Hn(R,Mt),children:ze?ut.children:null,id:X,tabIndex:-1,role:"dialog",onKeyDown:Il(ut.onKeyDown,_t=>{n&&_t.key==="Escape"&&E()}),onBlur:Il(ut.onBlur,_t=>{const un=dI(_t),ae=uC(R.current,un),De=uC(M.current,un);k&&t&&(!ae&&!De)&&E()}),"aria-labelledby":z?Z:void 0,"aria-describedby":K?U:void 0};return u===Ig.hover&&(ct.role="tooltip",ct.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0}),ct.onMouseLeave=Il(ut.onMouseLeave,_t=>{_t.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>E(),h))})),ct},[ze,X,z,Z,K,U,u,n,E,k,t,h,l,s]),rt=w.useCallback((ut={},Mt=null)=>fe({...ut,style:{visibility:k?"visible":"hidden",...ut.style}},Mt),[k,fe]),We=w.useCallback((ut,Mt=null)=>({...ut,ref:Hn(Mt,A,Q)}),[A,Q]),Be=w.useRef(),wt=w.useRef(),Fe=w.useCallback(ut=>{A.current==null&&Q(ut)},[Q]),at=w.useCallback((ut={},Mt=null)=>{const ct={...ut,ref:Hn(M,Mt,Fe),id:W,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":X};return u===Ig.click&&(ct.onClick=Il(ut.onClick,P)),u===Ig.hover&&(ct.onFocus=Il(ut.onFocus,()=>{Be.current===void 0&&_()}),ct.onBlur=Il(ut.onBlur,_t=>{const un=dI(_t),ae=!uC(R.current,un);k&&t&&ae&&E()}),ct.onKeyDown=Il(ut.onKeyDown,_t=>{_t.key==="Escape"&&E()}),ct.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0,Be.current=window.setTimeout(()=>_(),d)}),ct.onMouseLeave=Il(ut.onMouseLeave,()=>{D.current=!1,Be.current&&(clearTimeout(Be.current),Be.current=void 0),wt.current=window.setTimeout(()=>{D.current===!1&&E()},h)})),ct},[W,k,X,u,Fe,P,_,t,E,d,h]);w.useEffect(()=>()=>{Be.current&&clearTimeout(Be.current),wt.current&&clearTimeout(wt.current)},[]);const bt=w.useCallback((ut={},Mt=null)=>({...ut,id:Z,ref:Hn(Mt,ct=>{H(!!ct)})}),[Z]),Le=w.useCallback((ut={},Mt=null)=>({...ut,id:U,ref:Hn(Mt,ct=>{te(!!ct)})}),[U]);return{forceUpdate:be,isOpen:k,onAnimationComplete:ye.onComplete,onClose:E,getAnchorProps:We,getArrowProps:re,getArrowInnerProps:Ee,getPopoverPositionerProps:rt,getPopoverProps:Me,getTriggerProps:at,getHeaderProps:bt,getBodyProps:Le}}function uC(e,t){return e===t||(e==null?void 0:e.contains(t))}function dI(e){const t=e.currentTarget.ownerDocument.activeElement;return e.relatedTarget??t}function BE(e){const t=Oi("Popover",e),{children:n,...r}=Sn(e),i=v0(),o=pbe({...r,direction:i.direction});return N.createElement(fbe,{value:o},N.createElement(hbe,{value:t},ube(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})))}BE.displayName="Popover";function FE(e){const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=hp(),a=Dy(),s=t??n??r;return N.createElement(Ce.div,{...i(),className:"chakra-popover__arrow-positioner"},N.createElement(Ce.div,{className:Ry("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}FE.displayName="PopoverArrow";var gbe=Ae(function(t,n){const{getBodyProps:r}=hp(),i=Dy();return N.createElement(Ce.div,{...r(t,n),className:Ry("chakra-popover__body",t.className),__css:i.body})});gbe.displayName="PopoverBody";var mbe=Ae(function(t,n){const{onClose:r}=hp(),i=Dy();return N.createElement(rx,{size:"sm",onClick:r,className:Ry("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});mbe.displayName="PopoverCloseButton";function vbe(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var ybe={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},bbe=Ce(hu.section),GV=Ae(function(t,n){const{variants:r=ybe,...i}=t,{isOpen:o}=hp();return N.createElement(bbe,{ref:n,variants:vbe(r),initial:!1,animate:o?"enter":"exit",...i})});GV.displayName="PopoverTransition";var $E=Ae(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=hp(),u=Dy(),d={position:"relative",display:"flex",flexDirection:"column",...u.content};return N.createElement(Ce.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},N.createElement(GV,{...i,...a(o,n),onAnimationComplete:dbe(l,o.onAnimationComplete),className:Ry("chakra-popover__content",t.className),__css:d}))});$E.displayName="PopoverContent";var Sbe=Ae(function(t,n){const{getHeaderProps:r}=hp(),i=Dy();return N.createElement(Ce.header,{...r(t,n),className:Ry("chakra-popover__header",t.className),__css:i.header})});Sbe.displayName="PopoverHeader";function zE(e){const t=w.Children.only(e.children),{getTriggerProps:n}=hp();return w.cloneElement(t,n(t.props,t.ref))}zE.displayName="PopoverTrigger";function xbe(e,t,n){return(e-t)*100/(n-t)}var wbe=of({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),Cbe=of({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),_be=of({"0%":{left:"-40%"},"100%":{left:"100%"}}),kbe=of({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function qV(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=xbe(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var YV=e=>{const{size:t,isIndeterminate:n,...r}=e;return N.createElement(Ce.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${Cbe} 2s linear infinite`:void 0},...r})};YV.displayName="Shape";var Z9=e=>N.createElement(Ce.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});Z9.displayName="Circle";var Ebe=Ae((e,t)=>{const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:d="10px",color:h="#0078d4",trackColor:m="#edebe9",isIndeterminate:y,...b}=e,x=qV({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:y}),k=y?void 0:(x.percent??0)*2.64,E=k==null?void 0:`${k} ${264-k}`,_=y?{css:{animation:`${wbe} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:E,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},P={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return N.createElement(Ce.div,{ref:t,className:"chakra-progress",...x.bind,...b,__css:P},N.createElement(YV,{size:n,isIndeterminate:y},N.createElement(Z9,{stroke:m,strokeWidth:d,className:"chakra-progress__track"}),N.createElement(Z9,{stroke:h,strokeWidth:d,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:x.value===0&&!y?0:void 0,..._})),u)});Ebe.displayName="CircularProgress";var[Pbe,Tbe]=Pn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Lbe=Ae((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=qV({value:i,min:n,max:r,isIndeterminate:o,role:a}),d={height:"100%",...Tbe().filledTrack};return N.createElement(Ce.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:d})}),KV=Ae((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:d,"aria-label":h,"aria-labelledby":m,title:y,role:b,...x}=Sn(e),k=Oi("Progress",e),E=u??((n=k.track)==null?void 0:n.borderRadius),_={animation:`${kbe} 1s linear infinite`},M={...!d&&a&&s&&_,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${_be} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",...k.track};return N.createElement(Ce.div,{ref:t,borderRadius:E,__css:R,...x},N.createElement(Pbe,{value:k},N.createElement(Lbe,{"aria-label":h,"aria-labelledby":m,min:i,max:o,value:r,isIndeterminate:d,css:M,borderRadius:E,title:y,role:b}),l))});KV.displayName="Progress";var Abe=Ce("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});Abe.displayName="CircularProgressLabel";var Obe=(...e)=>e.filter(Boolean).join(" ");function fI(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var So=e=>e?"":void 0,cC=e=>e?!0:void 0;function Ns(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Mbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function Ibe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}function Rbe(e){return e&&fI(e)&&fI(e.target)}function Dbe(e={}){const{onChange:t,value:n,defaultValue:r,name:i,isDisabled:o,isFocusable:a,isNative:s,...l}=e,[u,d]=w.useState(r||""),h=typeof n<"u",m=h?n:u,y=w.useRef(null),b=w.useCallback(()=>{const M=y.current;if(!M)return;let R="input:not(:disabled):checked";const D=M.querySelector(R);if(D){D.focus();return}R="input:not(:disabled)";const j=M.querySelector(R);j==null||j.focus()},[]),k=`radio-${w.useId()}`,E=i||k,_=w.useCallback(M=>{const R=Rbe(M)?M.target.value:M;h||d(R),t==null||t(String(R))},[t,h]),P=w.useCallback((M={},R=null)=>({...M,ref:Hn(R,y),role:"radiogroup"}),[]),A=w.useCallback((M={},R=null)=>({...M,ref:R,name:E,[s?"checked":"isChecked"]:m!=null?M.value===m:void 0,onChange(j){_(j)},"data-radiogroup":!0}),[s,E,_,m]);return{getRootProps:P,getRadioProps:A,name:E,ref:y,focus:b,setValue:d,value:m,onChange:_,isDisabled:o,isFocusable:a,htmlProps:l}}var[Nbe,XV]=Pn({name:"RadioGroupContext",strict:!1}),HE=Ae((e,t)=>{const{colorScheme:n,size:r,variant:i,children:o,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:d,onChange:h,getRootProps:m,name:y,htmlProps:b}=Dbe(u),x=w.useMemo(()=>({name:y,size:r,onChange:h,colorScheme:n,value:d,variant:i,isDisabled:s,isFocusable:l}),[y,r,h,n,d,i,s,l]);return N.createElement(Nbe,{value:x},N.createElement(Ce.div,{...m(b,t),className:Obe("chakra-radio-group",a)},o))});HE.displayName="RadioGroup";var jbe={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function Bbe(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:i,isReadOnly:o,isRequired:a,onChange:s,isInvalid:l,name:u,value:d,id:h,"data-radiogroup":m,"aria-describedby":y,...b}=e,x=`radio-${w.useId()}`,k=sp(),_=!!XV()||!!m;let A=!!k&&!_?k.id:x;A=h??A;const M=i??(k==null?void 0:k.isDisabled),R=o??(k==null?void 0:k.isReadOnly),D=a??(k==null?void 0:k.isRequired),j=l??(k==null?void 0:k.isInvalid),[z,H]=w.useState(!1),[K,te]=w.useState(!1),[G,F]=w.useState(!1),[W,X]=w.useState(!1),[Z,U]=w.useState(Boolean(t)),Q=typeof n<"u",re=Q?n:Z;w.useEffect(()=>a$(H),[]);const fe=w.useCallback(Fe=>{if(R||M){Fe.preventDefault();return}Q||U(Fe.target.checked),s==null||s(Fe)},[Q,M,R,s]),Ee=w.useCallback(Fe=>{Fe.key===" "&&X(!0)},[X]),be=w.useCallback(Fe=>{Fe.key===" "&&X(!1)},[X]),ye=w.useCallback((Fe={},at=null)=>({...Fe,ref:at,"data-active":So(W),"data-hover":So(G),"data-disabled":So(M),"data-invalid":So(j),"data-checked":So(re),"data-focus":So(K),"data-focus-visible":So(K&&z),"data-readonly":So(R),"aria-hidden":!0,onMouseDown:Ns(Fe.onMouseDown,()=>X(!0)),onMouseUp:Ns(Fe.onMouseUp,()=>X(!1)),onMouseEnter:Ns(Fe.onMouseEnter,()=>F(!0)),onMouseLeave:Ns(Fe.onMouseLeave,()=>F(!1))}),[W,G,M,j,re,K,R,z]),{onFocus:ze,onBlur:Me}=k??{},rt=w.useCallback((Fe={},at=null)=>{const bt=M&&!r;return{...Fe,id:A,ref:at,type:"radio",name:u,value:d,onChange:Ns(Fe.onChange,fe),onBlur:Ns(Me,Fe.onBlur,()=>te(!1)),onFocus:Ns(ze,Fe.onFocus,()=>te(!0)),onKeyDown:Ns(Fe.onKeyDown,Ee),onKeyUp:Ns(Fe.onKeyUp,be),checked:re,disabled:bt,readOnly:R,required:D,"aria-invalid":cC(j),"aria-disabled":cC(bt),"aria-required":cC(D),"data-readonly":So(R),"aria-describedby":y,style:jbe}},[M,r,A,u,d,fe,Me,ze,Ee,be,re,R,D,j,y]);return{state:{isInvalid:j,isFocused:K,isChecked:re,isActive:W,isHovered:G,isDisabled:M,isReadOnly:R,isRequired:D},getCheckboxProps:ye,getInputProps:rt,getLabelProps:(Fe={},at=null)=>({...Fe,ref:at,onMouseDown:Ns(Fe.onMouseDown,hI),onTouchStart:Ns(Fe.onTouchStart,hI),"data-disabled":So(M),"data-checked":So(re),"data-invalid":So(j)}),getRootProps:(Fe,at=null)=>({...Fe,ref:at,"data-disabled":So(M),"data-checked":So(re),"data-invalid":So(j)}),htmlProps:b}}function hI(e){e.preventDefault(),e.stopPropagation()}var Td=Ae((e,t)=>{const n=XV(),{onChange:r,value:i}=e,o=Oi("Radio",{...n,...e}),a=Sn(e),{spacing:s="0.5rem",children:l,isDisabled:u=n==null?void 0:n.isDisabled,isFocusable:d=n==null?void 0:n.isFocusable,inputProps:h,...m}=a;let y=e.isChecked;(n==null?void 0:n.value)!=null&&i!=null&&(y=n.value===i);let b=r;n!=null&&n.onChange&&i!=null&&(b=Mbe(n.onChange,r));const x=(e==null?void 0:e.name)??(n==null?void 0:n.name),{getInputProps:k,getCheckboxProps:E,getLabelProps:_,getRootProps:P,htmlProps:A}=Bbe({...m,isChecked:y,isFocusable:d,isDisabled:u,onChange:b,name:x}),[M,R]=Ibe(A,Lj),D=E(R),j=k(h,t),z=_(),H=Object.assign({},M,P()),K={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...o.container},te={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...o.control},G={userSelect:"none",marginStart:s,...o.label};return N.createElement(Ce.label,{className:"chakra-radio",...H,__css:K},N.createElement("input",{className:"chakra-radio__input",...j}),N.createElement(Ce.span,{className:"chakra-radio__control",...D,__css:te}),l&&N.createElement(Ce.span,{className:"chakra-radio__label",...z,__css:G},l))});Td.displayName="Radio";var Fbe=(...e)=>e.filter(Boolean).join(" "),$be=e=>e?"":void 0;function zbe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var ZV=Ae(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return N.createElement(Ce.select,{...a,ref:n,className:Fbe("chakra-select",o)},i&&N.createElement("option",{value:""},i),r)});ZV.displayName="SelectField";var QV=Ae((e,t)=>{var n;const r=Oi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:d,minHeight:h,iconColor:m,iconSize:y,...b}=Sn(e),[x,k]=zbe(b,Lj),E=hk(k),_={width:"100%",height:"fit-content",position:"relative",color:s},P={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return N.createElement(Ce.div,{className:"chakra-select__wrapper",__css:_,...x,...i},N.createElement(ZV,{ref:t,height:u??l,minH:d??h,placeholder:o,...E,__css:P},e.children),N.createElement(JV,{"data-disabled":$be(E.disabled),...(m||s)&&{color:m||s},__css:r.icon,...y&&{fontSize:y}},a))});QV.displayName="Select";var Hbe=e=>N.createElement("svg",{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Vbe=Ce("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),JV=e=>{const{children:t=N.createElement(Hbe,null),...n}=e,r=w.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return N.createElement(Vbe,{...n,className:"chakra-select__icon-wrapper"},w.isValidElement(t)?r:null)};JV.displayName="SelectIcon";function Wbe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ube(e){const t=qbe(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function eW(e){return!!e.touches}function Gbe(e){return eW(e)&&e.touches.length>1}function qbe(e){return e.view??window}function Ybe(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Kbe(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function tW(e,t="page"){return eW(e)?Ybe(e,t):Kbe(e,t)}function Xbe(e){return t=>{const n=Ube(t);(!n||n&&t.button===0)&&e(t)}}function Zbe(e,t=!1){function n(i){e(i,{point:tW(i)})}return t?Xbe(n):n}function A4(e,t,n,r){return Wbe(e,t,Zbe(n,t==="pointerdown"),r)}function nW(e){const t=w.useRef(null);return t.current=e,t}var Qbe=class{constructor(e,t,n){sn(this,"history",[]);sn(this,"startEvent",null);sn(this,"lastEvent",null);sn(this,"lastEventInfo",null);sn(this,"handlers",{});sn(this,"removeListeners",()=>{});sn(this,"threshold",3);sn(this,"win");sn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=dC(this.lastEventInfo,this.history),t=this.startEvent!==null,n=n4e(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=jL();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});sn(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,fre.update(this.updatePoint,!0)});sn(this,"onPointerUp",(e,t)=>{const n=dC(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});if(this.win=e.view??window,Gbe(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:tW(e)},{timestamp:i}=jL();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,dC(r,this.history)),this.removeListeners=t4e(A4(this.win,"pointermove",this.onPointerMove),A4(this.win,"pointerup",this.onPointerUp),A4(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),hre.update(this.updatePoint)}};function pI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dC(e,t){return{point:e.point,delta:pI(e.point,t[t.length-1]),offset:pI(e.point,t[0]),velocity:e4e(t,.1)}}var Jbe=e=>e*1e3;function e4e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Jbe(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function t4e(...e){return t=>e.reduce((n,r)=>r(n),t)}function fC(e,t){return Math.abs(e-t)}function gI(e){return"x"in e&&"y"in e}function n4e(e,t){if(typeof e=="number"&&typeof t=="number")return fC(e,t);if(gI(e)&&gI(t)){const n=fC(e.x,t.x),r=fC(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function rW(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=w.useRef(null),d=nW({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(h,m){u.current=null,i==null||i(h,m)}});w.useEffect(()=>{var h;(h=u.current)==null||h.updateHandlers(d.current)}),w.useEffect(()=>{const h=e.current;if(!h||!l)return;function m(y){u.current=new Qbe(y,d.current,s)}return A4(h,"pointerdown",m)},[e,l,d,s]),w.useEffect(()=>()=>{var h;(h=u.current)==null||h.end(),u.current=null},[])}function r4e(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const[o]=i;let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;t({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var i4e=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:w.useEffect;function o4e(e,t){var n;if(!e||!e.parentElement)return;const r=((n=e.ownerDocument)==null?void 0:n.defaultView)??window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function iW({getNodes:e,observeMutation:t=!0}){const[n,r]=w.useState([]),[i,o]=w.useState(0);return i4e(()=>{const a=e(),s=a.map((l,u)=>r4e(l,d=>{r(h=>[...h.slice(0,u),d,...h.slice(u+1)])}));if(t){const l=a[0];s.push(o4e(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function a4e(e){return typeof e=="object"&&e!==null&&"current"in e}function s4e(e){const[t]=iW({observeMutation:!1,getNodes(){return[a4e(e)?e.current:e]}});return t}var l4e=Object.getOwnPropertyNames,u4e=(e,t)=>function(){return e&&(t=(0,e[l4e(e)[0]])(e=0)),t},df=u4e({"../../../react-shim.js"(){}});df();df();df();var es=e=>e?"":void 0,Nm=e=>e?!0:void 0,ff=(...e)=>e.filter(Boolean).join(" ");df();function jm(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}df();df();function c4e(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Pv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var O4={width:0,height:0},Eb=e=>e||O4;function oW(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=x=>{const k=r[x]??O4;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Pv({orientation:t,vertical:{bottom:`calc(${n[x]}% - ${k.height/2}px)`},horizontal:{left:`calc(${n[x]}% - ${k.width/2}px)`}})}},a=t==="vertical"?r.reduce((x,k)=>Eb(x).height>Eb(k).height?x:k,O4):r.reduce((x,k)=>Eb(x).width>Eb(k).width?x:k,O4),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Pv({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Pv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,d=[0,i?100-n[0]:n[0]],h=u?d:n;let m=h[0];!u&&i&&(m=100-m);const y=Math.abs(h[h.length-1]-h[0]),b={...l,...Pv({orientation:t,vertical:i?{height:`${y}%`,top:`${m}%`}:{height:`${y}%`,bottom:`${m}%`},horizontal:i?{width:`${y}%`,right:`${m}%`}:{width:`${y}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function aW(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function d4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:y,step:b=1,getAriaValueText:x,"aria-valuetext":k,"aria-label":E,"aria-labelledby":_,name:P,focusThumbOnChange:A=!0,minStepsBetweenThumbs:M=0,...R}=e,D=Er(m),j=Er(y),z=Er(x),H=aW({isReversed:a,direction:s,orientation:l}),[K,te]=FS({value:i,defaultValue:o??[25,75],onChange:r});if(!Array.isArray(K))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof K}\``);const[G,F]=w.useState(!1),[W,X]=w.useState(!1),[Z,U]=w.useState(-1),Q=!(d||h),re=w.useRef(K),fe=K.map(Ze=>Pm(Ze,t,n)),Ee=M*b,be=f4e(fe,t,n,Ee),ye=w.useRef({eventSource:null,value:[],valueBounds:[]});ye.current.value=fe,ye.current.valueBounds=be;const ze=fe.map(Ze=>n-Ze+t),rt=(H?ze:fe).map(Ze=>f5(Ze,t,n)),We=l==="vertical",Be=w.useRef(null),wt=w.useRef(null),Fe=iW({getNodes(){const Ze=wt.current,xt=Ze==null?void 0:Ze.querySelectorAll("[role=slider]");return xt?Array.from(xt):[]}}),at=w.useId(),Le=c4e(u??at),ut=w.useCallback(Ze=>{var xt;if(!Be.current)return;ye.current.eventSource="pointer";const ht=Be.current.getBoundingClientRect(),{clientX:Ht,clientY:rn}=((xt=Ze.touches)==null?void 0:xt[0])??Ze,gr=We?ht.bottom-rn:Ht-ht.left,Io=We?ht.height:ht.width;let Mi=gr/Io;return H&&(Mi=1-Mi),u$(Mi,t,n)},[We,H,n,t]),Mt=(n-t)/10,ct=b||(n-t)/100,_t=w.useMemo(()=>({setValueAtIndex(Ze,xt){if(!Q)return;const ht=ye.current.valueBounds[Ze];xt=parseFloat(Y7(xt,ht.min,ct)),xt=Pm(xt,ht.min,ht.max);const Ht=[...ye.current.value];Ht[Ze]=xt,te(Ht)},setActiveIndex:U,stepUp(Ze,xt=ct){const ht=ye.current.value[Ze],Ht=H?ht-xt:ht+xt;_t.setValueAtIndex(Ze,Ht)},stepDown(Ze,xt=ct){const ht=ye.current.value[Ze],Ht=H?ht+xt:ht-xt;_t.setValueAtIndex(Ze,Ht)},reset(){te(re.current)}}),[ct,H,te,Q]),un=w.useCallback(Ze=>{const xt=Ze.key,Ht={ArrowRight:()=>_t.stepUp(Z),ArrowUp:()=>_t.stepUp(Z),ArrowLeft:()=>_t.stepDown(Z),ArrowDown:()=>_t.stepDown(Z),PageUp:()=>_t.stepUp(Z,Mt),PageDown:()=>_t.stepDown(Z,Mt),Home:()=>{const{min:rn}=be[Z];_t.setValueAtIndex(Z,rn)},End:()=>{const{max:rn}=be[Z];_t.setValueAtIndex(Z,rn)}}[xt];Ht&&(Ze.preventDefault(),Ze.stopPropagation(),Ht(Ze),ye.current.eventSource="keyboard")},[_t,Z,Mt,be]),{getThumbStyle:ae,rootStyle:De,trackStyle:Ke,innerTrackStyle:Xe}=w.useMemo(()=>oW({isReversed:H,orientation:l,thumbRects:Fe,thumbPercents:rt}),[H,l,rt,Fe]),xe=w.useCallback(Ze=>{var xt;const ht=Ze??Z;if(ht!==-1&&A){const Ht=Le.getThumb(ht),rn=(xt=wt.current)==null?void 0:xt.ownerDocument.getElementById(Ht);rn&&setTimeout(()=>rn.focus())}},[A,Z,Le]);Gd(()=>{ye.current.eventSource==="keyboard"&&(j==null||j(ye.current.value))},[fe,j]);const Ne=Ze=>{const xt=ut(Ze)||0,ht=ye.current.value.map(Mi=>Math.abs(Mi-xt)),Ht=Math.min(...ht);let rn=ht.indexOf(Ht);const gr=ht.filter(Mi=>Mi===Ht);gr.length>1&&xt>ye.current.value[rn]&&(rn=rn+gr.length-1),U(rn),_t.setValueAtIndex(rn,xt),xe(rn)},Ct=Ze=>{if(Z==-1)return;const xt=ut(Ze)||0;U(Z),_t.setValueAtIndex(Z,xt),xe(Z)};rW(wt,{onPanSessionStart(Ze){Q&&(F(!0),Ne(Ze),D==null||D(ye.current.value))},onPanSessionEnd(){Q&&(F(!1),j==null||j(ye.current.value))},onPan(Ze){Q&&Ct(Ze)}});const Dt=w.useCallback((Ze={},xt=null)=>({...Ze,...R,id:Le.root,ref:Hn(xt,wt),tabIndex:-1,"aria-disabled":Nm(d),"data-focused":es(W),style:{...Ze.style,...De}}),[R,d,W,De,Le]),Te=w.useCallback((Ze={},xt=null)=>({...Ze,ref:Hn(xt,Be),id:Le.track,"data-disabled":es(d),style:{...Ze.style,...Ke}}),[d,Ke,Le]),At=w.useCallback((Ze={},xt=null)=>({...Ze,ref:xt,id:Le.innerTrack,style:{...Ze.style,...Xe}}),[Xe,Le]),He=w.useCallback((Ze,xt=null)=>{const{index:ht,...Ht}=Ze,rn=fe[ht];if(rn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ht}\`. The \`value\` or \`defaultValue\` length is : ${fe.length}`);const gr=be[ht];return{...Ht,ref:xt,role:"slider",tabIndex:Q?0:void 0,id:Le.getThumb(ht),"data-active":es(G&&Z===ht),"aria-valuetext":(z==null?void 0:z(rn))??(k==null?void 0:k[ht]),"aria-valuemin":gr.min,"aria-valuemax":gr.max,"aria-valuenow":rn,"aria-orientation":l,"aria-disabled":Nm(d),"aria-readonly":Nm(h),"aria-label":E==null?void 0:E[ht],"aria-labelledby":E!=null&&E[ht]||_==null?void 0:_[ht],style:{...Ze.style,...ae(ht)},onKeyDown:jm(Ze.onKeyDown,un),onFocus:jm(Ze.onFocus,()=>{X(!0),U(ht)}),onBlur:jm(Ze.onBlur,()=>{X(!1),U(-1)})}},[Le,fe,be,Q,G,Z,z,k,l,d,h,E,_,ae,un,X]),vt=w.useCallback((Ze={},xt=null)=>({...Ze,ref:xt,id:Le.output,htmlFor:fe.map((ht,Ht)=>Le.getThumb(Ht)).join(" "),"aria-live":"off"}),[Le,fe]),nn=w.useCallback((Ze,xt=null)=>{const{value:ht,...Ht}=Ze,rn=!(htn),gr=ht>=fe[0]&&ht<=fe[fe.length-1];let Io=f5(ht,t,n);Io=H?100-Io:Io;const Mi={position:"absolute",pointerEvents:"none",...Pv({orientation:l,vertical:{bottom:`${Io}%`},horizontal:{left:`${Io}%`}})};return{...Ht,ref:xt,id:Le.getMarker(Ze.value),role:"presentation","aria-hidden":!0,"data-disabled":es(d),"data-invalid":es(!rn),"data-highlighted":es(gr),style:{...Ze.style,...Mi}}},[d,H,n,t,l,fe,Le]),Rn=w.useCallback((Ze,xt=null)=>{const{index:ht,...Ht}=Ze;return{...Ht,ref:xt,id:Le.getInput(ht),type:"hidden",value:fe[ht],name:Array.isArray(P)?P[ht]:`${P}-${ht}`}},[P,fe,Le]);return{state:{value:fe,isFocused:W,isDragging:G,getThumbPercent:Ze=>rt[Ze],getThumbMinValue:Ze=>be[Ze].min,getThumbMaxValue:Ze=>be[Ze].max},actions:_t,getRootProps:Dt,getTrackProps:Te,getInnerTrackProps:At,getThumbProps:He,getMarkerProps:nn,getInputProps:Rn,getOutputProps:vt}}function f4e(e,t,n,r){return e.map((i,o)=>{const a=o===0?t:e[o-1]+r,s=o===e.length-1?n:e[o+1]-r;return{min:a,max:s}})}var[h4e,_x]=Pn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[p4e,VE]=Pn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),sW=Ae(function(t,n){const r=Oi("Slider",t),i=Sn(t),{direction:o}=v0();i.direction=o;const{getRootProps:a,...s}=d4e(i),l=w.useMemo(()=>({...s,name:t.name}),[s,t.name]);return N.createElement(h4e,{value:l},N.createElement(p4e,{value:r},N.createElement(Ce.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});sW.defaultProps={orientation:"horizontal"};sW.displayName="RangeSlider";var g4e=Ae(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=_x(),a=VE(),s=r(t,n);return N.createElement(Ce.div,{...s,className:ff("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&N.createElement("input",{...i({index:t.index})}))});g4e.displayName="RangeSliderThumb";var m4e=Ae(function(t,n){const{getTrackProps:r}=_x(),i=VE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:ff("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});m4e.displayName="RangeSliderTrack";var v4e=Ae(function(t,n){const{getInnerTrackProps:r}=_x(),i=VE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});v4e.displayName="RangeSliderFilledTrack";var y4e=Ae(function(t,n){const{getMarkerProps:r}=_x(),i=r(t,n);return N.createElement(Ce.div,{...i,className:ff("chakra-slider__marker",t.className)})});y4e.displayName="RangeSliderMark";df();df();function b4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:y,step:b=1,getAriaValueText:x,"aria-valuetext":k,"aria-label":E,"aria-labelledby":_,name:P,focusThumbOnChange:A=!0,...M}=e,R=Er(m),D=Er(y),j=Er(x),z=aW({isReversed:a,direction:s,orientation:l}),[H,K]=FS({value:i,defaultValue:o??x4e(t,n),onChange:r}),[te,G]=w.useState(!1),[F,W]=w.useState(!1),X=!(d||h),Z=(n-t)/10,U=b||(n-t)/100,Q=Pm(H,t,n),re=n-Q+t,Ee=f5(z?re:Q,t,n),be=l==="vertical",ye=nW({min:t,max:n,step:b,isDisabled:d,value:Q,isInteractive:X,isReversed:z,isVertical:be,eventSource:null,focusThumbOnChange:A,orientation:l}),ze=w.useRef(null),Me=w.useRef(null),rt=w.useRef(null),We=w.useId(),Be=u??We,[wt,Fe]=[`slider-thumb-${Be}`,`slider-track-${Be}`],at=w.useCallback(He=>{var vt;if(!ze.current)return;const nn=ye.current;nn.eventSource="pointer";const Rn=ze.current.getBoundingClientRect(),{clientX:Ze,clientY:xt}=((vt=He.touches)==null?void 0:vt[0])??He,ht=be?Rn.bottom-xt:Ze-Rn.left,Ht=be?Rn.height:Rn.width;let rn=ht/Ht;z&&(rn=1-rn);let gr=u$(rn,nn.min,nn.max);return nn.step&&(gr=parseFloat(Y7(gr,nn.min,nn.step))),gr=Pm(gr,nn.min,nn.max),gr},[be,z,ye]),bt=w.useCallback(He=>{const vt=ye.current;vt.isInteractive&&(He=parseFloat(Y7(He,vt.min,U)),He=Pm(He,vt.min,vt.max),K(He))},[U,K,ye]),Le=w.useMemo(()=>({stepUp(He=U){const vt=z?Q-He:Q+He;bt(vt)},stepDown(He=U){const vt=z?Q+He:Q-He;bt(vt)},reset(){bt(o||0)},stepTo(He){bt(He)}}),[bt,z,Q,U,o]),ut=w.useCallback(He=>{const vt=ye.current,Rn={ArrowRight:()=>Le.stepUp(),ArrowUp:()=>Le.stepUp(),ArrowLeft:()=>Le.stepDown(),ArrowDown:()=>Le.stepDown(),PageUp:()=>Le.stepUp(Z),PageDown:()=>Le.stepDown(Z),Home:()=>bt(vt.min),End:()=>bt(vt.max)}[He.key];Rn&&(He.preventDefault(),He.stopPropagation(),Rn(He),vt.eventSource="keyboard")},[Le,bt,Z,ye]),Mt=(j==null?void 0:j(Q))??k,ct=s4e(Me),{getThumbStyle:_t,rootStyle:un,trackStyle:ae,innerTrackStyle:De}=w.useMemo(()=>{const He=ye.current,vt=ct??{width:0,height:0};return oW({isReversed:z,orientation:He.orientation,thumbRects:[vt],thumbPercents:[Ee]})},[z,ct,Ee,ye]),Ke=w.useCallback(()=>{ye.current.focusThumbOnChange&&setTimeout(()=>{var vt;return(vt=Me.current)==null?void 0:vt.focus()})},[ye]);Gd(()=>{const He=ye.current;Ke(),He.eventSource==="keyboard"&&(D==null||D(He.value))},[Q,D]);function Xe(He){const vt=at(He);vt!=null&&vt!==ye.current.value&&K(vt)}rW(rt,{onPanSessionStart(He){const vt=ye.current;vt.isInteractive&&(G(!0),Ke(),Xe(He),R==null||R(vt.value))},onPanSessionEnd(){const He=ye.current;He.isInteractive&&(G(!1),D==null||D(He.value))},onPan(He){ye.current.isInteractive&&Xe(He)}});const xe=w.useCallback((He={},vt=null)=>({...He,...M,ref:Hn(vt,rt),tabIndex:-1,"aria-disabled":Nm(d),"data-focused":es(F),style:{...He.style,...un}}),[M,d,F,un]),Ne=w.useCallback((He={},vt=null)=>({...He,ref:Hn(vt,ze),id:Fe,"data-disabled":es(d),style:{...He.style,...ae}}),[d,Fe,ae]),Ct=w.useCallback((He={},vt=null)=>({...He,ref:vt,style:{...He.style,...De}}),[De]),Dt=w.useCallback((He={},vt=null)=>({...He,ref:Hn(vt,Me),role:"slider",tabIndex:X?0:void 0,id:wt,"data-active":es(te),"aria-valuetext":Mt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":Q,"aria-orientation":l,"aria-disabled":Nm(d),"aria-readonly":Nm(h),"aria-label":E,"aria-labelledby":E?void 0:_,style:{...He.style,..._t(0)},onKeyDown:jm(He.onKeyDown,ut),onFocus:jm(He.onFocus,()=>W(!0)),onBlur:jm(He.onBlur,()=>W(!1))}),[X,wt,te,Mt,t,n,Q,l,d,h,E,_,_t,ut]),Te=w.useCallback((He,vt=null)=>{const nn=!(He.valuen),Rn=Q>=He.value,Ze=f5(He.value,t,n),xt={position:"absolute",pointerEvents:"none",...S4e({orientation:l,vertical:{bottom:z?`${100-Ze}%`:`${Ze}%`},horizontal:{left:z?`${100-Ze}%`:`${Ze}%`}})};return{...He,ref:vt,role:"presentation","aria-hidden":!0,"data-disabled":es(d),"data-invalid":es(!nn),"data-highlighted":es(Rn),style:{...He.style,...xt}}},[d,z,n,t,l,Q]),At=w.useCallback((He={},vt=null)=>({...He,ref:vt,type:"hidden",value:Q,name:P}),[P,Q]);return{state:{value:Q,isFocused:F,isDragging:te},actions:Le,getRootProps:xe,getTrackProps:Ne,getInnerTrackProps:Ct,getThumbProps:Dt,getMarkerProps:Te,getInputProps:At}}function S4e(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function x4e(e,t){return t"}),[C4e,Ex]=Pn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),WE=Ae((e,t)=>{const n=Oi("Slider",e),r=Sn(e),{direction:i}=v0();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=b4e(r),l=a(),u=o({},t);return N.createElement(w4e,{value:s},N.createElement(C4e,{value:n},N.createElement(Ce.div,{...l,className:ff("chakra-slider",e.className),__css:n.container},e.children,N.createElement("input",{...u}))))});WE.defaultProps={orientation:"horizontal"};WE.displayName="Slider";var lW=Ae((e,t)=>{const{getThumbProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:ff("chakra-slider__thumb",e.className),__css:r.thumb})});lW.displayName="SliderThumb";var uW=Ae((e,t)=>{const{getTrackProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:ff("chakra-slider__track",e.className),__css:r.track})});uW.displayName="SliderTrack";var cW=Ae((e,t)=>{const{getInnerTrackProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:ff("chakra-slider__filled-track",e.className),__css:r.filledTrack})});cW.displayName="SliderFilledTrack";var Q9=Ae((e,t)=>{const{getMarkerProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(Ce.div,{...i,className:ff("chakra-slider__marker",e.className),__css:r.mark})});Q9.displayName="SliderMark";var _4e=(...e)=>e.filter(Boolean).join(" "),mI=e=>e?"":void 0,UE=Ae(function(t,n){const r=Oi("Switch",t),{spacing:i="0.5rem",children:o,...a}=Sn(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:d,getLabelProps:h}=s$(a),m=w.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),y=w.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=w.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return N.createElement(Ce.label,{...d(),className:_4e("chakra-switch",t.className),__css:m},N.createElement("input",{className:"chakra-switch__input",...l({},n)}),N.createElement(Ce.span,{...u(),className:"chakra-switch__track",__css:y},N.createElement(Ce.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":mI(s.isChecked),"data-hover":mI(s.isHovered)})),o&&N.createElement(Ce.span,{className:"chakra-switch__label",...h(),__css:b},o))});UE.displayName="Switch";var E0=(...e)=>e.filter(Boolean).join(" ");function J9(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[k4e,dW,E4e,P4e]=SB();function T4e(e){const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[d,h]=w.useState(t??0),[m,y]=FS({defaultValue:t??0,value:r,onChange:n});w.useEffect(()=>{r!=null&&h(r)},[r]);const b=E4e(),x=w.useId();return{id:`tabs-${e.id??x}`,selectedIndex:m,focusedIndex:d,setSelectedIndex:y,setFocusedIndex:h,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:b,direction:l,htmlProps:u}}var[L4e,Ny]=Pn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function A4e(e){const{focusedIndex:t,orientation:n,direction:r}=Ny(),i=dW(),o=w.useCallback(a=>{const s=()=>{var _;const P=i.nextEnabled(t);P&&((_=P.node)==null||_.focus())},l=()=>{var _;const P=i.prevEnabled(t);P&&((_=P.node)==null||_.focus())},u=()=>{var _;const P=i.firstEnabled();P&&((_=P.node)==null||_.focus())},d=()=>{var _;const P=i.lastEnabled();P&&((_=P.node)==null||_.focus())},h=n==="horizontal",m=n==="vertical",y=a.key,b=r==="ltr"?"ArrowLeft":"ArrowRight",x=r==="ltr"?"ArrowRight":"ArrowLeft",E={[b]:()=>h&&l(),[x]:()=>h&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:u,End:d}[y];E&&(a.preventDefault(),E(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:J9(e.onKeyDown,o)}}function O4e(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=Ny(),{index:u,register:d}=P4e({disabled:t&&!n}),h=u===l,m=()=>{i(u)},y=()=>{s(u),!o&&!(t&&n)&&i(u)},b=c0e({...r,ref:Hn(d,e.ref),isDisabled:t,isFocusable:n,onClick:J9(e.onClick,m)}),x="button";return{...b,id:fW(a,u),role:"tab",tabIndex:h?0:-1,type:x,"aria-selected":h,"aria-controls":hW(a,u),onFocus:t?void 0:J9(e.onFocus,y)}}var[M4e,I4e]=Pn({});function R4e(e){const t=Ny(),{id:n,selectedIndex:r}=t,o=ex(e.children).map((a,s)=>w.createElement(M4e,{key:s,value:{isSelected:s===r,id:hW(n,s),tabId:fW(n,s),selectedIndex:r}},a));return{...e,children:o}}function D4e(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=Ny(),{isSelected:o,id:a,tabId:s}=I4e(),l=w.useRef(!1);o&&(l.current=!0);const u=Y$({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function N4e(){const e=Ny(),t=dW(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=w.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=w.useState(!1);return Gs(()=>{if(n==null)return;const d=t.item(n);if(d==null)return;i&&s({left:d.node.offsetLeft,width:d.node.offsetWidth}),o&&s({top:d.node.offsetTop,height:d.node.offsetHeight});const h=requestAnimationFrame(()=>{u(!0)});return()=>{h&&cancelAnimationFrame(h)}},[n,i,o,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:l?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function fW(e,t){return`${e}--tab-${t}`}function hW(e,t){return`${e}--tabpanel-${t}`}var[j4e,jy]=Pn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),pW=Ae(function(t,n){const r=Oi("Tabs",t),{children:i,className:o,...a}=Sn(t),{htmlProps:s,descendants:l,...u}=T4e(a),d=w.useMemo(()=>u,[u]),{isFitted:h,...m}=s;return N.createElement(k4e,{value:l},N.createElement(L4e,{value:d},N.createElement(j4e,{value:r},N.createElement(Ce.div,{className:E0("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});pW.displayName="Tabs";var B4e=Ae(function(t,n){const r=N4e(),i={...t.style,...r},o=jy();return N.createElement(Ce.div,{ref:n,...t,className:E0("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});B4e.displayName="TabIndicator";var F4e=Ae(function(t,n){const r=A4e({...t,ref:n}),o={display:"flex",...jy().tablist};return N.createElement(Ce.div,{...r,className:E0("chakra-tabs__tablist",t.className),__css:o})});F4e.displayName="TabList";var gW=Ae(function(t,n){const r=D4e({...t,ref:n}),i=jy();return N.createElement(Ce.div,{outline:"0",...r,className:E0("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});gW.displayName="TabPanel";var mW=Ae(function(t,n){const r=R4e(t),i=jy();return N.createElement(Ce.div,{...r,width:"100%",ref:n,className:E0("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});mW.displayName="TabPanels";var vW=Ae(function(t,n){const r=jy(),i=O4e({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return N.createElement(Ce.button,{...i,className:E0("chakra-tabs__tab",t.className),__css:o})});vW.displayName="Tab";var $4e=(...e)=>e.filter(Boolean).join(" ");function z4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var H4e=["h","minH","height","minHeight"],GE=Ae((e,t)=>{const n=Oo("Textarea",e),{className:r,rows:i,...o}=Sn(e),a=hk(o),s=i?z4e(n,H4e):n;return N.createElement(Ce.textarea,{ref:t,rows:i,...a,className:$4e("chakra-textarea",r),__css:s})});GE.displayName="Textarea";function V4e(e,t){const n=Er(e);w.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function e8(e,...t){return W4e(e)?e(...t):e}var W4e=e=>typeof e=="function";function U4e(e,t){const n=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(i==null?void 0:i[t])??n}var G4e=(e,t)=>e.find(n=>n.id===t);function vI(e,t){const n=yW(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function yW(e,t){for(const[n,r]of Object.entries(e))if(G4e(r,t))return n}function q4e(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Y4e(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}var K4e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Wl=X4e(K4e);function X4e(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=Z4e(i,o),{position:s,id:l}=a;return r(u=>{const h=s.includes("top")?[a,...u[s]??[]]:[...u[s]??[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=vI(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:bW(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(d=>({...d,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=yW(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(vI(Wl.getState(),i).position)}}var yI=0;function Z4e(e,t={}){yI+=1;const n=t.id??yI,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Wl.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var Q4e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return N.createElement(e$,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},N.createElement(n$,null,l),N.createElement(Ce.div,{flex:"1",maxWidth:"100%"},i&&N.createElement(r$,{id:u==null?void 0:u.title},i),s&&N.createElement(t$,{id:u==null?void 0:u.description,display:"block"},s)),o&&N.createElement(rx,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function bW(e={}){const{render:t,toastComponent:n=Q4e}=e;return i=>typeof t=="function"?t({...i,...e}):N.createElement(n,{...i,...e})}function J4e(e,t){const n=i=>({...t,...i,position:U4e((i==null?void 0:i.position)??(t==null?void 0:t.position),e)}),r=i=>{const o=n(i),a=bW(o);return Wl.notify(a,o)};return r.update=(i,o)=>{Wl.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...e8(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...e8(o.error,s)}))},r.closeAll=Wl.closeAll,r.close=Wl.close,r.isActive=Wl.isActive,r}function By(e){const{theme:t}=vB();return w.useMemo(()=>J4e(t.direction,e),[e,t.direction])}var e5e={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},SW=w.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=e5e,toastSpacing:d="0.5rem"}=e,[h,m]=w.useState(s),y=Ufe();Gd(()=>{y||r==null||r()},[y]),Gd(()=>{m(s)},[s]);const b=()=>m(null),x=()=>m(s),k=()=>{y&&i()};w.useEffect(()=>{y&&o&&i()},[y,o,i]),V4e(k,h);const E=w.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:d,...l}),[l,d]),_=w.useMemo(()=>q4e(a),[a]);return N.createElement(hu.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:x,custom:{position:a},style:_},N.createElement(Ce.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:E},e8(n,{id:t,onClose:k})))});SW.displayName="ToastComponent";var t5e=e=>{const t=w.useSyncExternalStore(Wl.subscribe,Wl.getState,Wl.getState),{children:n,motionVariants:r,component:i=SW,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return N.createElement("ul",{role:"region","aria-live":"polite",key:l,id:`chakra-toast-manager-${l}`,style:Y4e(l)},N.createElement(af,{initial:!1},u.map(d=>N.createElement(i,{key:d.id,motionVariants:r,...d}))))});return N.createElement(N.Fragment,null,n,N.createElement(cp,{...o},s))};function n5e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function r5e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var i5e={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};function iv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var $5=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},t8=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function o5e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:d,id:h,isOpen:m,defaultIsOpen:y,arrowSize:b=10,arrowShadowColor:x,arrowPadding:k,modifiers:E,isDisabled:_,gutter:P,offset:A,direction:M,...R}=e,{isOpen:D,onOpen:j,onClose:z}=q$({isOpen:m,defaultIsOpen:y,onOpen:l,onClose:u}),{referenceRef:H,getPopperProps:K,getArrowInnerProps:te,getArrowProps:G}=G$({enabled:D,placement:d,arrowPadding:k,modifiers:E,gutter:P,offset:A,direction:M}),F=w.useId(),X=`tooltip-${h??F}`,Z=w.useRef(null),U=w.useRef(),Q=w.useCallback(()=>{U.current&&(clearTimeout(U.current),U.current=void 0)},[]),re=w.useRef(),fe=w.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=void 0)},[]),Ee=w.useCallback(()=>{fe(),z()},[z,fe]),be=a5e(Z,Ee),ye=w.useCallback(()=>{if(!_&&!U.current){be();const at=t8(Z);U.current=at.setTimeout(j,t)}},[be,_,j,t]),ze=w.useCallback(()=>{Q();const at=t8(Z);re.current=at.setTimeout(Ee,n)},[n,Ee,Q]),Me=w.useCallback(()=>{D&&r&&ze()},[r,ze,D]),rt=w.useCallback(()=>{D&&a&&ze()},[a,ze,D]),We=w.useCallback(at=>{D&&at.key==="Escape"&&ze()},[D,ze]);jh(()=>$5(Z),"keydown",s?We:void 0),jh(()=>$5(Z),"scroll",()=>{D&&o&&Ee()}),w.useEffect(()=>{_&&(Q(),D&&z())},[_,D,z,Q]),w.useEffect(()=>()=>{Q(),fe()},[Q,fe]),jh(()=>Z.current,"pointerleave",ze);const Be=w.useCallback((at={},bt=null)=>({...at,ref:Hn(Z,bt,H),onPointerEnter:iv(at.onPointerEnter,ut=>{ut.pointerType!=="touch"&&ye()}),onClick:iv(at.onClick,Me),onPointerDown:iv(at.onPointerDown,rt),onFocus:iv(at.onFocus,ye),onBlur:iv(at.onBlur,ze),"aria-describedby":D?X:void 0}),[ye,ze,rt,D,X,Me,H]),wt=w.useCallback((at={},bt=null)=>K({...at,style:{...at.style,[oi.arrowSize.var]:b?`${b}px`:void 0,[oi.arrowShadowColor.var]:x}},bt),[K,b,x]),Fe=w.useCallback((at={},bt=null)=>{const Le={...at.style,position:"relative",transformOrigin:oi.transformOrigin.varRef};return{ref:bt,...R,...at,id:X,role:"tooltip",style:Le}},[R,X]);return{isOpen:D,show:ye,hide:ze,getTriggerProps:Be,getTooltipProps:Fe,getTooltipPositionerProps:wt,getArrowProps:G,getArrowInnerProps:te}}var hC="chakra-ui:close-tooltip";function a5e(e,t){return w.useEffect(()=>{const n=$5(e);return n.addEventListener(hC,t),()=>n.removeEventListener(hC,t)},[t,e]),()=>{const n=$5(e),r=t8(e);n.dispatchEvent(new r.CustomEvent(hC))}}var s5e=Ce(hu.div),uo=Ae((e,t)=>{const n=Oo("Tooltip",e),r=Sn(e),i=v0(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:d,portalProps:h,background:m,backgroundColor:y,bgColor:b,motionProps:x,...k}=r,E=m??y??d??b;if(E){n.bg=E;const z=hne(i,"colors",E);n[oi.arrowBg.var]=z}const _=o5e({...k,direction:i.direction}),P=typeof o=="string"||s;let A;if(P)A=N.createElement(Ce.span,{display:"inline-block",tabIndex:0,..._.getTriggerProps()},o);else{const z=w.Children.only(o);A=w.cloneElement(z,_.getTriggerProps(z.props,z.ref))}const M=!!l,R=_.getTooltipProps({},t),D=M?n5e(R,["role","id"]):R,j=r5e(R,["role","id"]);return a?N.createElement(N.Fragment,null,A,N.createElement(af,null,_.isOpen&&N.createElement(cp,{...h},N.createElement(Ce.div,{..._.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},N.createElement(s5e,{variants:i5e,initial:"exit",animate:"enter",exit:"exit",...x,...D,__css:n},a,M&&N.createElement(Ce.span,{srOnly:!0,...j},l),u&&N.createElement(Ce.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},N.createElement(Ce.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))))))):N.createElement(N.Fragment,null,o)});uo.displayName="Tooltip";var l5e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=N.createElement(L$,{environment:a},t);return N.createElement(ice,{theme:o,cssVarsRoot:s},N.createElement(Sj,{colorModeManager:n,options:o.config},i?N.createElement(wme,null):N.createElement(xme,null),N.createElement(ace,null),r?N.createElement(KH,{zIndex:r},l):l))};function u5e({children:e,theme:t=Kue,toastOptions:n,...r}){return N.createElement(l5e,{theme:t,...r},e,N.createElement(t5e,{...n}))}var n8={},bI=el;n8.createRoot=bI.createRoot,n8.hydrateRoot=bI.hydrateRoot;var r8={},c5e={get exports(){return r8},set exports(e){r8=e}},xW={};/** +`)},D3e=0,Ig=[];function N3e(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(D3e++)[0],o=w.useState(function(){return IV()})[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=z7([e.lockRef.current],(e.shards||[]).map(lI),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(x,k){if("touches"in x&&x.touches.length===2)return!a.current.allowPinchZoom;var E=Pb(x),_=n.current,P="deltaX"in x?x.deltaX:_[0]-E[0],A="deltaY"in x?x.deltaY:_[1]-E[1],M,R=x.target,D=Math.abs(P)>Math.abs(A)?"h":"v";if("touches"in x&&D==="h"&&R.type==="range")return!1;var j=aI(D,R);if(!j)return!0;if(j?M=D:(M=D==="v"?"h":"v",j=aI(D,R)),!j)return!1;if(!r.current&&"changedTouches"in x&&(P||A)&&(r.current=M),!M)return!0;var z=r.current||M;return M3e(z,k,x,z==="h"?P:A,!0)},[]),l=w.useCallback(function(x){var k=x;if(!(!Ig.length||Ig[Ig.length-1]!==o)){var E="deltaY"in k?sI(k):Pb(k),_=t.current.filter(function(M){return M.name===k.type&&M.target===k.target&&I3e(M.delta,E)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var P=(a.current.shards||[]).map(lI).filter(Boolean).filter(function(M){return M.contains(k.target)}),A=P.length>0?s(k,P[0]):!a.current.noIsolation;A&&k.cancelable&&k.preventDefault()}}},[]),u=w.useCallback(function(x,k,E,_){var P={name:x,delta:k,target:E,should:_};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(A){return A!==P})},1)},[]),d=w.useCallback(function(x){n.current=Pb(x),r.current=void 0},[]),h=w.useCallback(function(x){u(x.type,sI(x),x.target,s(x,e.lockRef.current))},[]),m=w.useCallback(function(x){u(x.type,Pb(x),x.target,s(x,e.lockRef.current))},[]);w.useEffect(function(){return Ig.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Mg),document.addEventListener("touchmove",l,Mg),document.addEventListener("touchstart",d,Mg),function(){Ig=Ig.filter(function(x){return x!==o}),document.removeEventListener("wheel",l,Mg),document.removeEventListener("touchmove",l,Mg),document.removeEventListener("touchstart",d,Mg)}},[]);var y=e.removeScrollBar,b=e.inert;return w.createElement(w.Fragment,null,b?w.createElement(o,{styles:R3e(i)}):null,y?w.createElement(k3e,{gapMode:"margin"}):null)}const j3e=mye(MV,N3e);var jV=w.forwardRef(function(e,t){return w.createElement(xx,Hl({},e,{ref:t,sideCar:j3e}))});jV.classNames=xx.classNames;const BV=jV;var fp=(...e)=>e.filter(Boolean).join(" ");function Tv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var B3e=class{constructor(){sn(this,"modals");this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},X9=new B3e;function $3e(e,t){w.useEffect(()=>(t&&X9.add(e),()=>{X9.remove(e)}),[t,e])}function F3e(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=w.useRef(null),d=w.useRef(null),[h,m,y]=H3e(r,"chakra-modal","chakra-modal--header","chakra-modal--body");z3e(u,t&&a),$3e(u,t);const b=w.useRef(null),x=w.useCallback(j=>{b.current=j.target},[]),k=w.useCallback(j=>{j.key==="Escape"&&(j.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[E,_]=w.useState(!1),[P,A]=w.useState(!1),M=w.useCallback((j={},z=null)=>({role:"dialog",...j,ref:Hn(z,u),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":E?m:void 0,"aria-describedby":P?y:void 0,onClick:Tv(j.onClick,H=>H.stopPropagation())}),[y,P,h,m,E]),R=w.useCallback(j=>{j.stopPropagation(),b.current===j.target&&X9.isTopModal(u)&&(i&&(n==null||n()),s==null||s())},[n,i,s]),D=w.useCallback((j={},z=null)=>({...j,ref:Hn(z,d),onClick:Tv(j.onClick,R),onKeyDown:Tv(j.onKeyDown,k),onMouseDown:Tv(j.onMouseDown,x)}),[k,x,R]);return{isOpen:t,onClose:n,headerId:m,bodyId:y,setBodyMounted:A,setHeaderMounted:_,dialogRef:u,overlayRef:d,getDialogProps:M,getDialogContainerProps:D}}function z3e(e,t){const n=e.current;w.useEffect(()=>{if(!(!e.current||!t))return QH(e.current)},[t,e,n])}function H3e(e,...t){const n=w.useId(),r=e||n;return w.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[V3e,hp]=Pn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[W3e,Zd]=Pn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Qd=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m,onCloseComplete:y}=e,b=Mi("Modal",e),k={...F3e(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m};return N.createElement(W3e,{value:k},N.createElement(V3e,{value:b},N.createElement(sf,{onExitComplete:y},k.isOpen&&N.createElement(dp,{...t},n))))};Qd.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};Qd.displayName="Modal";var s0=Ae((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=Zd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=fp("chakra-modal__body",n),s=hp();return N.createElement(we.div,{ref:t,className:a,id:i,...r,__css:s.body})});s0.displayName="ModalBody";var Dy=Ae((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=Zd(),a=fp("chakra-modal__close-btn",r),s=hp();return N.createElement(rx,{ref:t,__css:s.closeButton,className:a,onClick:Tv(n,l=>{l.stopPropagation(),o()}),...i})});Dy.displayName="ModalCloseButton";function $V(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:d}=Zd(),[h,m]=tk();return w.useEffect(()=>{!h&&m&&setTimeout(m)},[h,m]),N.createElement(OV,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:d},N.createElement(BV,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0},e.children))}var U3e={slideInBottom:{...V7,custom:{offsetY:16,reverse:!0}},slideInRight:{...V7,custom:{offsetX:16,reverse:!0}},scale:{...Z$,custom:{initialScale:.95,reverse:!0}},none:{}},G3e=we(hu.section),q3e=e=>U3e[e||"none"],FV=w.forwardRef((e,t)=>{const{preset:n,motionProps:r=q3e(n),...i}=e;return N.createElement(G3e,{ref:t,...r,...i})});FV.displayName="ModalTransition";var tp=Ae((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Zd(),u=s(a,t),d=l(i),h=fp("chakra-modal__content",n),m=hp(),y={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:x}=Zd();return N.createElement($V,null,N.createElement(we.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:b},N.createElement(FV,{preset:x,motionProps:o,className:h,...u,__css:y},r)))});tp.displayName="ModalContent";var wx=Ae((e,t)=>{const{className:n,...r}=e,i=fp("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...hp().footer};return N.createElement(we.footer,{ref:t,...r,__css:a,className:i})});wx.displayName="ModalFooter";var E0=Ae((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=Zd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=fp("chakra-modal__header",n),l={flex:0,...hp().header};return N.createElement(we.header,{ref:t,className:a,id:i,...r,__css:l})});E0.displayName="ModalHeader";var Y3e=we(hu.div),Jd=Ae((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=fp("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...hp().overlay},{motionPreset:u}=Zd(),h=i||(u==="none"?{}:X$);return N.createElement(Y3e,{...h,__css:l,ref:t,className:a,...o})});Jd.displayName="ModalOverlay";function zV(e){const{leastDestructiveRef:t,...n}=e;return N.createElement(Qd,{...n,initialFocusRef:t})}var HV=Ae((e,t)=>N.createElement(tp,{ref:t,role:"alertdialog",...e})),[vze,K3e]=Pn(),X3e=we(Q$),Z3e=Ae((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=Zd(),d=s(a,t),h=l(o),m=fp("chakra-modal__content",n),y=hp(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...y.dialog},x={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...y.dialogContainer},{placement:k}=K3e();return N.createElement($V,null,N.createElement(we.div,{...h,className:"chakra-modal__content-container",__css:x},N.createElement(X3e,{motionProps:i,direction:k,in:u,className:m,...d,__css:b},r)))});Z3e.displayName="DrawerContent";function Q3e(e,t){const n=Er(e);w.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var VV=(...e)=>e.filter(Boolean).join(" "),lC=e=>e?!0:void 0;function Ml(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var J3e=e=>N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})),ebe=e=>N.createElement(Na,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"}));function uI(e,t,n,r){w.useEffect(()=>{if(!e.current||!r)return;const i=e.current.ownerDocument.defaultView??window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(s=>{for(const l of s)l.type==="attributes"&&l.attributeName&&o.includes(l.attributeName)&&n(l)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var tbe=50,cI=300;function nbe(e,t){const[n,r]=w.useState(!1),[i,o]=w.useState(null),[a,s]=w.useState(!0),l=w.useRef(null),u=()=>clearTimeout(l.current);Q3e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?tbe:null);const d=w.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},cI)},[e,a]),h=w.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},cI)},[t,a]),m=w.useCallback(()=>{s(!0),r(!1),u()},[]);return w.useEffect(()=>()=>u(),[]),{up:d,down:h,stop:m,isSpinning:n}}var rbe=/^[Ee0-9+\-.]$/;function ibe(e){return rbe.test(e)}function obe(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function abe(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:d,pattern:h="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:y,id:b,onChange:x,precision:k,name:E,"aria-describedby":_,"aria-label":P,"aria-labelledby":A,onFocus:M,onBlur:R,onInvalid:D,getAriaValueText:j,isValidCharacter:z,format:H,parse:K,...te}=e,G=Er(M),$=Er(R),W=Er(D),X=Er(z??ibe),Z=Er(j),U=Sme(e),{update:Q,increment:re,decrement:he}=U,[Ee,Ce]=w.useState(!1),de=!(s||l),ze=w.useRef(null),Me=w.useRef(null),rt=w.useRef(null),We=w.useRef(null),Be=w.useCallback(Te=>Te.split("").filter(X).join(""),[X]),wt=w.useCallback(Te=>(K==null?void 0:K(Te))??Te,[K]),$e=w.useCallback(Te=>((H==null?void 0:H(Te))??Te).toString(),[H]);qd(()=>{(U.valueAsNumber>o||U.valueAsNumber{if(!ze.current)return;if(ze.current.value!=U.value){const At=wt(ze.current.value);U.setValue(Be(At))}},[wt,Be]);const at=w.useCallback((Te=a)=>{de&&re(Te)},[re,de,a]),bt=w.useCallback((Te=a)=>{de&&he(Te)},[he,de,a]),Le=nbe(at,bt);uI(rt,"disabled",Le.stop,Le.isSpinning),uI(We,"disabled",Le.stop,Le.isSpinning);const ut=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;const He=wt(Te.currentTarget.value);Q(Be(He)),Me.current={start:Te.currentTarget.selectionStart,end:Te.currentTarget.selectionEnd}},[Q,Be,wt]),Mt=w.useCallback(Te=>{var At;G==null||G(Te),Me.current&&(Te.target.selectionStart=Me.current.start??((At=Te.currentTarget.value)==null?void 0:At.length),Te.currentTarget.selectionEnd=Me.current.end??Te.currentTarget.selectionStart)},[G]),ct=w.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;obe(Te,X)||Te.preventDefault();const At=_t(Te)*a,He=Te.key,nn={ArrowUp:()=>at(At),ArrowDown:()=>bt(At),Home:()=>Q(i),End:()=>Q(o)}[He];nn&&(Te.preventDefault(),nn(Te))},[X,a,at,bt,Q,i,o]),_t=Te=>{let At=1;return(Te.metaKey||Te.ctrlKey)&&(At=.1),Te.shiftKey&&(At=10),At},un=w.useMemo(()=>{const Te=Z==null?void 0:Z(U.value);if(Te!=null)return Te;const At=U.value.toString();return At||void 0},[U.value,Z]),ae=w.useCallback(()=>{let Te=U.value;if(U.value==="")return;/^[eE]/.test(U.value.toString())?U.setValue(""):(U.valueAsNumbero&&(Te=o),U.cast(Te))},[U,o,i]),De=w.useCallback(()=>{Ce(!1),n&&ae()},[n,Ce,ae]),Ke=w.useCallback(()=>{t&&requestAnimationFrame(()=>{var Te;(Te=ze.current)==null||Te.focus()})},[t]),Xe=w.useCallback(Te=>{Te.preventDefault(),Le.up(),Ke()},[Ke,Le]),Se=w.useCallback(Te=>{Te.preventDefault(),Le.down(),Ke()},[Ke,Le]);Bh(()=>ze.current,"wheel",Te=>{var At;const vt=(((At=ze.current)==null?void 0:At.ownerDocument)??document).activeElement===ze.current;if(!y||!vt)return;Te.preventDefault();const nn=_t(Te)*a,Rn=Math.sign(Te.deltaY);Rn===-1?at(nn):Rn===1&&bt(nn)},{passive:!1});const Ne=w.useCallback((Te={},At=null)=>{const He=l||r&&U.isAtMax;return{...Te,ref:Hn(At,rt),role:"button",tabIndex:-1,onPointerDown:Ml(Te.onPointerDown,vt=>{vt.button!==0||He||Xe(vt)}),onPointerLeave:Ml(Te.onPointerLeave,Le.stop),onPointerUp:Ml(Te.onPointerUp,Le.stop),disabled:He,"aria-disabled":lC(He)}},[U.isAtMax,r,Xe,Le.stop,l]),Ct=w.useCallback((Te={},At=null)=>{const He=l||r&&U.isAtMin;return{...Te,ref:Hn(At,We),role:"button",tabIndex:-1,onPointerDown:Ml(Te.onPointerDown,vt=>{vt.button!==0||He||Se(vt)}),onPointerLeave:Ml(Te.onPointerLeave,Le.stop),onPointerUp:Ml(Te.onPointerUp,Le.stop),disabled:He,"aria-disabled":lC(He)}},[U.isAtMin,r,Se,Le.stop,l]),Nt=w.useCallback((Te={},At=null)=>({name:E,inputMode:m,type:"text",pattern:h,"aria-labelledby":A,"aria-label":P,"aria-describedby":_,id:b,disabled:l,...Te,readOnly:Te.readOnly??s,"aria-readonly":Te.readOnly??s,"aria-required":Te.required??u,required:Te.required??u,ref:Hn(ze,At),value:$e(U.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(U.valueAsNumber)?void 0:U.valueAsNumber,"aria-invalid":lC(d??U.isOutOfRange),"aria-valuetext":un,autoComplete:"off",autoCorrect:"off",onChange:Ml(Te.onChange,ut),onKeyDown:Ml(Te.onKeyDown,ct),onFocus:Ml(Te.onFocus,Mt,()=>Ce(!0)),onBlur:Ml(Te.onBlur,$,De)}),[E,m,h,A,P,$e,_,b,l,u,s,d,U.value,U.valueAsNumber,U.isOutOfRange,i,o,un,ut,ct,Mt,$,De]);return{value:$e(U.value),valueAsNumber:U.valueAsNumber,isFocused:Ee,isDisabled:l,isReadOnly:s,getIncrementButtonProps:Ne,getDecrementButtonProps:Ct,getInputProps:Nt,htmlProps:te}}var[sbe,Cx]=Pn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[lbe,IE]=Pn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),RE=Ae(function(t,n){const r=Mi("NumberInput",t),i=Sn(t),o=pk(i),{htmlProps:a,...s}=abe(o),l=w.useMemo(()=>s,[s]);return N.createElement(lbe,{value:l},N.createElement(sbe,{value:r},N.createElement(we.div,{...a,ref:n,className:VV("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});RE.displayName="NumberInput";var WV=Ae(function(t,n){const r=Cx();return N.createElement(we.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});WV.displayName="NumberInputStepper";var DE=Ae(function(t,n){const{getInputProps:r}=IE(),i=r(t,n),o=Cx();return N.createElement(we.input,{...i,className:VV("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});DE.displayName="NumberInputField";var UV=we("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),NE=Ae(function(t,n){const r=Cx(),{getDecrementButtonProps:i}=IE(),o=i(t,n);return N.createElement(UV,{...o,__css:r.stepper},t.children??N.createElement(J3e,null))});NE.displayName="NumberDecrementStepper";var jE=Ae(function(t,n){const{getIncrementButtonProps:r}=IE(),i=r(t,n),o=Cx();return N.createElement(UV,{...i,__css:o.stepper},t.children??N.createElement(ebe,null))});jE.displayName="NumberIncrementStepper";var Ny=(...e)=>e.filter(Boolean).join(" ");function ube(e,...t){return cbe(e)?e(...t):e}var cbe=e=>typeof e=="function";function Il(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function dbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[fbe,pp]=Pn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[hbe,jy]=Pn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Rg={click:"click",hover:"hover"};function pbe(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=Rg.click,openDelay:d=200,closeDelay:h=200,isLazy:m,lazyBehavior:y="unmount",computePositionOnMount:b,...x}=e,{isOpen:k,onClose:E,onOpen:_,onToggle:P}=qF(e),A=w.useRef(null),M=w.useRef(null),R=w.useRef(null),D=w.useRef(!1),j=w.useRef(!1);k&&(j.current=!0);const[z,H]=w.useState(!1),[K,te]=w.useState(!1),G=w.useId(),$=i??G,[W,X,Z,U]=["popover-trigger","popover-content","popover-header","popover-body"].map(ut=>`${ut}-${$}`),{referenceRef:Q,getArrowProps:re,getPopperProps:he,getArrowInnerProps:Ee,forceUpdate:Ce}=GF({...x,enabled:k||!!b}),de=U1e({isOpen:k,ref:R});Lme({enabled:k,ref:M}),x0e(R,{focusRef:M,visible:k,shouldFocus:o&&u===Rg.click}),C0e(R,{focusRef:r,visible:k,shouldFocus:a&&u===Rg.click});const ze=YF({wasSelected:j.current,enabled:m,mode:y,isSelected:de.present}),Me=w.useCallback((ut={},Mt=null)=>{const ct={...ut,style:{...ut.style,transformOrigin:oi.transformOrigin.varRef,[oi.arrowSize.var]:s?`${s}px`:void 0,[oi.arrowShadowColor.var]:l},ref:Hn(R,Mt),children:ze?ut.children:null,id:X,tabIndex:-1,role:"dialog",onKeyDown:Il(ut.onKeyDown,_t=>{n&&_t.key==="Escape"&&E()}),onBlur:Il(ut.onBlur,_t=>{const un=dI(_t),ae=uC(R.current,un),De=uC(M.current,un);k&&t&&(!ae&&!De)&&E()}),"aria-labelledby":z?Z:void 0,"aria-describedby":K?U:void 0};return u===Rg.hover&&(ct.role="tooltip",ct.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0}),ct.onMouseLeave=Il(ut.onMouseLeave,_t=>{_t.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>E(),h))})),ct},[ze,X,z,Z,K,U,u,n,E,k,t,h,l,s]),rt=w.useCallback((ut={},Mt=null)=>he({...ut,style:{visibility:k?"visible":"hidden",...ut.style}},Mt),[k,he]),We=w.useCallback((ut,Mt=null)=>({...ut,ref:Hn(Mt,A,Q)}),[A,Q]),Be=w.useRef(),wt=w.useRef(),$e=w.useCallback(ut=>{A.current==null&&Q(ut)},[Q]),at=w.useCallback((ut={},Mt=null)=>{const ct={...ut,ref:Hn(M,Mt,$e),id:W,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":X};return u===Rg.click&&(ct.onClick=Il(ut.onClick,P)),u===Rg.hover&&(ct.onFocus=Il(ut.onFocus,()=>{Be.current===void 0&&_()}),ct.onBlur=Il(ut.onBlur,_t=>{const un=dI(_t),ae=!uC(R.current,un);k&&t&&ae&&E()}),ct.onKeyDown=Il(ut.onKeyDown,_t=>{_t.key==="Escape"&&E()}),ct.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0,Be.current=window.setTimeout(()=>_(),d)}),ct.onMouseLeave=Il(ut.onMouseLeave,()=>{D.current=!1,Be.current&&(clearTimeout(Be.current),Be.current=void 0),wt.current=window.setTimeout(()=>{D.current===!1&&E()},h)})),ct},[W,k,X,u,$e,P,_,t,E,d,h]);w.useEffect(()=>()=>{Be.current&&clearTimeout(Be.current),wt.current&&clearTimeout(wt.current)},[]);const bt=w.useCallback((ut={},Mt=null)=>({...ut,id:Z,ref:Hn(Mt,ct=>{H(!!ct)})}),[Z]),Le=w.useCallback((ut={},Mt=null)=>({...ut,id:U,ref:Hn(Mt,ct=>{te(!!ct)})}),[U]);return{forceUpdate:Ce,isOpen:k,onAnimationComplete:de.onComplete,onClose:E,getAnchorProps:We,getArrowProps:re,getArrowInnerProps:Ee,getPopoverPositionerProps:rt,getPopoverProps:Me,getTriggerProps:at,getHeaderProps:bt,getBodyProps:Le}}function uC(e,t){return e===t||(e==null?void 0:e.contains(t))}function dI(e){const t=e.currentTarget.ownerDocument.activeElement;return e.relatedTarget??t}function BE(e){const t=Mi("Popover",e),{children:n,...r}=Sn(e),i=y0(),o=pbe({...r,direction:i.direction});return N.createElement(fbe,{value:o},N.createElement(hbe,{value:t},ube(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})))}BE.displayName="Popover";function $E(e){const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=pp(),a=jy(),s=t??n??r;return N.createElement(we.div,{...i(),className:"chakra-popover__arrow-positioner"},N.createElement(we.div,{className:Ny("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}$E.displayName="PopoverArrow";var gbe=Ae(function(t,n){const{getBodyProps:r}=pp(),i=jy();return N.createElement(we.div,{...r(t,n),className:Ny("chakra-popover__body",t.className),__css:i.body})});gbe.displayName="PopoverBody";var mbe=Ae(function(t,n){const{onClose:r}=pp(),i=jy();return N.createElement(rx,{size:"sm",onClick:r,className:Ny("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});mbe.displayName="PopoverCloseButton";function vbe(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var ybe={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},bbe=we(hu.section),GV=Ae(function(t,n){const{variants:r=ybe,...i}=t,{isOpen:o}=pp();return N.createElement(bbe,{ref:n,variants:vbe(r),initial:!1,animate:o?"enter":"exit",...i})});GV.displayName="PopoverTransition";var FE=Ae(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=pp(),u=jy(),d={position:"relative",display:"flex",flexDirection:"column",...u.content};return N.createElement(we.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},N.createElement(GV,{...i,...a(o,n),onAnimationComplete:dbe(l,o.onAnimationComplete),className:Ny("chakra-popover__content",t.className),__css:d}))});FE.displayName="PopoverContent";var Sbe=Ae(function(t,n){const{getHeaderProps:r}=pp(),i=jy();return N.createElement(we.header,{...r(t,n),className:Ny("chakra-popover__header",t.className),__css:i.header})});Sbe.displayName="PopoverHeader";function zE(e){const t=w.Children.only(e.children),{getTriggerProps:n}=pp();return w.cloneElement(t,n(t.props,t.ref))}zE.displayName="PopoverTrigger";function xbe(e,t,n){return(e-t)*100/(n-t)}var wbe=af({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),Cbe=af({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),_be=af({"0%":{left:"-40%"},"100%":{left:"100%"}}),kbe=af({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function qV(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=xbe(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var YV=e=>{const{size:t,isIndeterminate:n,...r}=e;return N.createElement(we.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${Cbe} 2s linear infinite`:void 0},...r})};YV.displayName="Shape";var Z9=e=>N.createElement(we.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});Z9.displayName="Circle";var Ebe=Ae((e,t)=>{const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:d="10px",color:h="#0078d4",trackColor:m="#edebe9",isIndeterminate:y,...b}=e,x=qV({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:y}),k=y?void 0:(x.percent??0)*2.64,E=k==null?void 0:`${k} ${264-k}`,_=y?{css:{animation:`${wbe} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:E,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},P={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return N.createElement(we.div,{ref:t,className:"chakra-progress",...x.bind,...b,__css:P},N.createElement(YV,{size:n,isIndeterminate:y},N.createElement(Z9,{stroke:m,strokeWidth:d,className:"chakra-progress__track"}),N.createElement(Z9,{stroke:h,strokeWidth:d,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:x.value===0&&!y?0:void 0,..._})),u)});Ebe.displayName="CircularProgress";var[Pbe,Tbe]=Pn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Lbe=Ae((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=qV({value:i,min:n,max:r,isIndeterminate:o,role:a}),d={height:"100%",...Tbe().filledTrack};return N.createElement(we.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:d})}),KV=Ae((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:d,"aria-label":h,"aria-labelledby":m,title:y,role:b,...x}=Sn(e),k=Mi("Progress",e),E=u??((n=k.track)==null?void 0:n.borderRadius),_={animation:`${kbe} 1s linear infinite`},M={...!d&&a&&s&&_,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${_be} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",...k.track};return N.createElement(we.div,{ref:t,borderRadius:E,__css:R,...x},N.createElement(Pbe,{value:k},N.createElement(Lbe,{"aria-label":h,"aria-labelledby":m,min:i,max:o,value:r,isIndeterminate:d,css:M,borderRadius:E,title:y,role:b}),l))});KV.displayName="Progress";var Abe=we("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});Abe.displayName="CircularProgressLabel";var Obe=(...e)=>e.filter(Boolean).join(" ");function fI(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var So=e=>e?"":void 0,cC=e=>e?!0:void 0;function Ns(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Mbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function Ibe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}function Rbe(e){return e&&fI(e)&&fI(e.target)}function Dbe(e={}){const{onChange:t,value:n,defaultValue:r,name:i,isDisabled:o,isFocusable:a,isNative:s,...l}=e,[u,d]=w.useState(r||""),h=typeof n<"u",m=h?n:u,y=w.useRef(null),b=w.useCallback(()=>{const M=y.current;if(!M)return;let R="input:not(:disabled):checked";const D=M.querySelector(R);if(D){D.focus();return}R="input:not(:disabled)";const j=M.querySelector(R);j==null||j.focus()},[]),k=`radio-${w.useId()}`,E=i||k,_=w.useCallback(M=>{const R=Rbe(M)?M.target.value:M;h||d(R),t==null||t(String(R))},[t,h]),P=w.useCallback((M={},R=null)=>({...M,ref:Hn(R,y),role:"radiogroup"}),[]),A=w.useCallback((M={},R=null)=>({...M,ref:R,name:E,[s?"checked":"isChecked"]:m!=null?M.value===m:void 0,onChange(j){_(j)},"data-radiogroup":!0}),[s,E,_,m]);return{getRootProps:P,getRadioProps:A,name:E,ref:y,focus:b,setValue:d,value:m,onChange:_,isDisabled:o,isFocusable:a,htmlProps:l}}var[Nbe,XV]=Pn({name:"RadioGroupContext",strict:!1}),HE=Ae((e,t)=>{const{colorScheme:n,size:r,variant:i,children:o,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:d,onChange:h,getRootProps:m,name:y,htmlProps:b}=Dbe(u),x=w.useMemo(()=>({name:y,size:r,onChange:h,colorScheme:n,value:d,variant:i,isDisabled:s,isFocusable:l}),[y,r,h,n,d,i,s,l]);return N.createElement(Nbe,{value:x},N.createElement(we.div,{...m(b,t),className:Obe("chakra-radio-group",a)},o))});HE.displayName="RadioGroup";var jbe={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function Bbe(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:i,isReadOnly:o,isRequired:a,onChange:s,isInvalid:l,name:u,value:d,id:h,"data-radiogroup":m,"aria-describedby":y,...b}=e,x=`radio-${w.useId()}`,k=lp(),_=!!XV()||!!m;let A=!!k&&!_?k.id:x;A=h??A;const M=i??(k==null?void 0:k.isDisabled),R=o??(k==null?void 0:k.isReadOnly),D=a??(k==null?void 0:k.isRequired),j=l??(k==null?void 0:k.isInvalid),[z,H]=w.useState(!1),[K,te]=w.useState(!1),[G,$]=w.useState(!1),[W,X]=w.useState(!1),[Z,U]=w.useState(Boolean(t)),Q=typeof n<"u",re=Q?n:Z;w.useEffect(()=>aF(H),[]);const he=w.useCallback($e=>{if(R||M){$e.preventDefault();return}Q||U($e.target.checked),s==null||s($e)},[Q,M,R,s]),Ee=w.useCallback($e=>{$e.key===" "&&X(!0)},[X]),Ce=w.useCallback($e=>{$e.key===" "&&X(!1)},[X]),de=w.useCallback(($e={},at=null)=>({...$e,ref:at,"data-active":So(W),"data-hover":So(G),"data-disabled":So(M),"data-invalid":So(j),"data-checked":So(re),"data-focus":So(K),"data-focus-visible":So(K&&z),"data-readonly":So(R),"aria-hidden":!0,onMouseDown:Ns($e.onMouseDown,()=>X(!0)),onMouseUp:Ns($e.onMouseUp,()=>X(!1)),onMouseEnter:Ns($e.onMouseEnter,()=>$(!0)),onMouseLeave:Ns($e.onMouseLeave,()=>$(!1))}),[W,G,M,j,re,K,R,z]),{onFocus:ze,onBlur:Me}=k??{},rt=w.useCallback(($e={},at=null)=>{const bt=M&&!r;return{...$e,id:A,ref:at,type:"radio",name:u,value:d,onChange:Ns($e.onChange,he),onBlur:Ns(Me,$e.onBlur,()=>te(!1)),onFocus:Ns(ze,$e.onFocus,()=>te(!0)),onKeyDown:Ns($e.onKeyDown,Ee),onKeyUp:Ns($e.onKeyUp,Ce),checked:re,disabled:bt,readOnly:R,required:D,"aria-invalid":cC(j),"aria-disabled":cC(bt),"aria-required":cC(D),"data-readonly":So(R),"aria-describedby":y,style:jbe}},[M,r,A,u,d,he,Me,ze,Ee,Ce,re,R,D,j,y]);return{state:{isInvalid:j,isFocused:K,isChecked:re,isActive:W,isHovered:G,isDisabled:M,isReadOnly:R,isRequired:D},getCheckboxProps:de,getInputProps:rt,getLabelProps:($e={},at=null)=>({...$e,ref:at,onMouseDown:Ns($e.onMouseDown,hI),onTouchStart:Ns($e.onTouchStart,hI),"data-disabled":So(M),"data-checked":So(re),"data-invalid":So(j)}),getRootProps:($e,at=null)=>({...$e,ref:at,"data-disabled":So(M),"data-checked":So(re),"data-invalid":So(j)}),htmlProps:b}}function hI(e){e.preventDefault(),e.stopPropagation()}var Td=Ae((e,t)=>{const n=XV(),{onChange:r,value:i}=e,o=Mi("Radio",{...n,...e}),a=Sn(e),{spacing:s="0.5rem",children:l,isDisabled:u=n==null?void 0:n.isDisabled,isFocusable:d=n==null?void 0:n.isFocusable,inputProps:h,...m}=a;let y=e.isChecked;(n==null?void 0:n.value)!=null&&i!=null&&(y=n.value===i);let b=r;n!=null&&n.onChange&&i!=null&&(b=Mbe(n.onChange,r));const x=(e==null?void 0:e.name)??(n==null?void 0:n.name),{getInputProps:k,getCheckboxProps:E,getLabelProps:_,getRootProps:P,htmlProps:A}=Bbe({...m,isChecked:y,isFocusable:d,isDisabled:u,onChange:b,name:x}),[M,R]=Ibe(A,Lj),D=E(R),j=k(h,t),z=_(),H=Object.assign({},M,P()),K={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...o.container},te={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...o.control},G={userSelect:"none",marginStart:s,...o.label};return N.createElement(we.label,{className:"chakra-radio",...H,__css:K},N.createElement("input",{className:"chakra-radio__input",...j}),N.createElement(we.span,{className:"chakra-radio__control",...D,__css:te}),l&&N.createElement(we.span,{className:"chakra-radio__label",...z,__css:G},l))});Td.displayName="Radio";var $be=(...e)=>e.filter(Boolean).join(" "),Fbe=e=>e?"":void 0;function zbe(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var ZV=Ae(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return N.createElement(we.select,{...a,ref:n,className:$be("chakra-select",o)},i&&N.createElement("option",{value:""},i),r)});ZV.displayName="SelectField";var QV=Ae((e,t)=>{var n;const r=Mi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:d,minHeight:h,iconColor:m,iconSize:y,...b}=Sn(e),[x,k]=zbe(b,Lj),E=hk(k),_={width:"100%",height:"fit-content",position:"relative",color:s},P={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return N.createElement(we.div,{className:"chakra-select__wrapper",__css:_,...x,...i},N.createElement(ZV,{ref:t,height:u??l,minH:d??h,placeholder:o,...E,__css:P},e.children),N.createElement(JV,{"data-disabled":Fbe(E.disabled),...(m||s)&&{color:m||s},__css:r.icon,...y&&{fontSize:y}},a))});QV.displayName="Select";var Hbe=e=>N.createElement("svg",{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Vbe=we("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),JV=e=>{const{children:t=N.createElement(Hbe,null),...n}=e,r=w.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return N.createElement(Vbe,{...n,className:"chakra-select__icon-wrapper"},w.isValidElement(t)?r:null)};JV.displayName="SelectIcon";function Wbe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ube(e){const t=qbe(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function eW(e){return!!e.touches}function Gbe(e){return eW(e)&&e.touches.length>1}function qbe(e){return e.view??window}function Ybe(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Kbe(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function tW(e,t="page"){return eW(e)?Ybe(e,t):Kbe(e,t)}function Xbe(e){return t=>{const n=Ube(t);(!n||n&&t.button===0)&&e(t)}}function Zbe(e,t=!1){function n(i){e(i,{point:tW(i)})}return t?Xbe(n):n}function O4(e,t,n,r){return Wbe(e,t,Zbe(n,t==="pointerdown"),r)}function nW(e){const t=w.useRef(null);return t.current=e,t}var Qbe=class{constructor(e,t,n){sn(this,"history",[]);sn(this,"startEvent",null);sn(this,"lastEvent",null);sn(this,"lastEventInfo",null);sn(this,"handlers",{});sn(this,"removeListeners",()=>{});sn(this,"threshold",3);sn(this,"win");sn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=dC(this.lastEventInfo,this.history),t=this.startEvent!==null,n=n4e(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=jL();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});sn(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,fre.update(this.updatePoint,!0)});sn(this,"onPointerUp",(e,t)=>{const n=dC(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});if(this.win=e.view??window,Gbe(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:tW(e)},{timestamp:i}=jL();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,dC(r,this.history)),this.removeListeners=t4e(O4(this.win,"pointermove",this.onPointerMove),O4(this.win,"pointerup",this.onPointerUp),O4(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),hre.update(this.updatePoint)}};function pI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dC(e,t){return{point:e.point,delta:pI(e.point,t[t.length-1]),offset:pI(e.point,t[0]),velocity:e4e(t,.1)}}var Jbe=e=>e*1e3;function e4e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Jbe(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function t4e(...e){return t=>e.reduce((n,r)=>r(n),t)}function fC(e,t){return Math.abs(e-t)}function gI(e){return"x"in e&&"y"in e}function n4e(e,t){if(typeof e=="number"&&typeof t=="number")return fC(e,t);if(gI(e)&&gI(t)){const n=fC(e.x,t.x),r=fC(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function rW(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=w.useRef(null),d=nW({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(h,m){u.current=null,i==null||i(h,m)}});w.useEffect(()=>{var h;(h=u.current)==null||h.updateHandlers(d.current)}),w.useEffect(()=>{const h=e.current;if(!h||!l)return;function m(y){u.current=new Qbe(y,d.current,s)}return O4(h,"pointerdown",m)},[e,l,d,s]),w.useEffect(()=>()=>{var h;(h=u.current)==null||h.end(),u.current=null},[])}function r4e(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const[o]=i;let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;t({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var i4e=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:w.useEffect;function o4e(e,t){var n;if(!e||!e.parentElement)return;const r=((n=e.ownerDocument)==null?void 0:n.defaultView)??window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function iW({getNodes:e,observeMutation:t=!0}){const[n,r]=w.useState([]),[i,o]=w.useState(0);return i4e(()=>{const a=e(),s=a.map((l,u)=>r4e(l,d=>{r(h=>[...h.slice(0,u),d,...h.slice(u+1)])}));if(t){const l=a[0];s.push(o4e(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function a4e(e){return typeof e=="object"&&e!==null&&"current"in e}function s4e(e){const[t]=iW({observeMutation:!1,getNodes(){return[a4e(e)?e.current:e]}});return t}var l4e=Object.getOwnPropertyNames,u4e=(e,t)=>function(){return e&&(t=(0,e[l4e(e)[0]])(e=0)),t},ff=u4e({"../../../react-shim.js"(){}});ff();ff();ff();var es=e=>e?"":void 0,jm=e=>e?!0:void 0,hf=(...e)=>e.filter(Boolean).join(" ");ff();function Bm(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}ff();ff();function c4e(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Lv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var M4={width:0,height:0},Tb=e=>e||M4;function oW(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=x=>{const k=r[x]??M4;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Lv({orientation:t,vertical:{bottom:`calc(${n[x]}% - ${k.height/2}px)`},horizontal:{left:`calc(${n[x]}% - ${k.width/2}px)`}})}},a=t==="vertical"?r.reduce((x,k)=>Tb(x).height>Tb(k).height?x:k,M4):r.reduce((x,k)=>Tb(x).width>Tb(k).width?x:k,M4),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Lv({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Lv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,d=[0,i?100-n[0]:n[0]],h=u?d:n;let m=h[0];!u&&i&&(m=100-m);const y=Math.abs(h[h.length-1]-h[0]),b={...l,...Lv({orientation:t,vertical:i?{height:`${y}%`,top:`${m}%`}:{height:`${y}%`,bottom:`${m}%`},horizontal:i?{width:`${y}%`,right:`${m}%`}:{width:`${y}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function aW(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function d4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:y,step:b=1,getAriaValueText:x,"aria-valuetext":k,"aria-label":E,"aria-labelledby":_,name:P,focusThumbOnChange:A=!0,minStepsBetweenThumbs:M=0,...R}=e,D=Er(m),j=Er(y),z=Er(x),H=aW({isReversed:a,direction:s,orientation:l}),[K,te]=$S({value:i,defaultValue:o??[25,75],onChange:r});if(!Array.isArray(K))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof K}\``);const[G,$]=w.useState(!1),[W,X]=w.useState(!1),[Z,U]=w.useState(-1),Q=!(d||h),re=w.useRef(K),he=K.map(Ze=>Tm(Ze,t,n)),Ee=M*b,Ce=f4e(he,t,n,Ee),de=w.useRef({eventSource:null,value:[],valueBounds:[]});de.current.value=he,de.current.valueBounds=Ce;const ze=he.map(Ze=>n-Ze+t),rt=(H?ze:he).map(Ze=>f5(Ze,t,n)),We=l==="vertical",Be=w.useRef(null),wt=w.useRef(null),$e=iW({getNodes(){const Ze=wt.current,xt=Ze==null?void 0:Ze.querySelectorAll("[role=slider]");return xt?Array.from(xt):[]}}),at=w.useId(),Le=c4e(u??at),ut=w.useCallback(Ze=>{var xt;if(!Be.current)return;de.current.eventSource="pointer";const ht=Be.current.getBoundingClientRect(),{clientX:Ht,clientY:rn}=((xt=Ze.touches)==null?void 0:xt[0])??Ze,gr=We?ht.bottom-rn:Ht-ht.left,Io=We?ht.height:ht.width;let Ii=gr/Io;return H&&(Ii=1-Ii),uF(Ii,t,n)},[We,H,n,t]),Mt=(n-t)/10,ct=b||(n-t)/100,_t=w.useMemo(()=>({setValueAtIndex(Ze,xt){if(!Q)return;const ht=de.current.valueBounds[Ze];xt=parseFloat(Y7(xt,ht.min,ct)),xt=Tm(xt,ht.min,ht.max);const Ht=[...de.current.value];Ht[Ze]=xt,te(Ht)},setActiveIndex:U,stepUp(Ze,xt=ct){const ht=de.current.value[Ze],Ht=H?ht-xt:ht+xt;_t.setValueAtIndex(Ze,Ht)},stepDown(Ze,xt=ct){const ht=de.current.value[Ze],Ht=H?ht+xt:ht-xt;_t.setValueAtIndex(Ze,Ht)},reset(){te(re.current)}}),[ct,H,te,Q]),un=w.useCallback(Ze=>{const xt=Ze.key,Ht={ArrowRight:()=>_t.stepUp(Z),ArrowUp:()=>_t.stepUp(Z),ArrowLeft:()=>_t.stepDown(Z),ArrowDown:()=>_t.stepDown(Z),PageUp:()=>_t.stepUp(Z,Mt),PageDown:()=>_t.stepDown(Z,Mt),Home:()=>{const{min:rn}=Ce[Z];_t.setValueAtIndex(Z,rn)},End:()=>{const{max:rn}=Ce[Z];_t.setValueAtIndex(Z,rn)}}[xt];Ht&&(Ze.preventDefault(),Ze.stopPropagation(),Ht(Ze),de.current.eventSource="keyboard")},[_t,Z,Mt,Ce]),{getThumbStyle:ae,rootStyle:De,trackStyle:Ke,innerTrackStyle:Xe}=w.useMemo(()=>oW({isReversed:H,orientation:l,thumbRects:$e,thumbPercents:rt}),[H,l,rt,$e]),Se=w.useCallback(Ze=>{var xt;const ht=Ze??Z;if(ht!==-1&&A){const Ht=Le.getThumb(ht),rn=(xt=wt.current)==null?void 0:xt.ownerDocument.getElementById(Ht);rn&&setTimeout(()=>rn.focus())}},[A,Z,Le]);qd(()=>{de.current.eventSource==="keyboard"&&(j==null||j(de.current.value))},[he,j]);const Ne=Ze=>{const xt=ut(Ze)||0,ht=de.current.value.map(Ii=>Math.abs(Ii-xt)),Ht=Math.min(...ht);let rn=ht.indexOf(Ht);const gr=ht.filter(Ii=>Ii===Ht);gr.length>1&&xt>de.current.value[rn]&&(rn=rn+gr.length-1),U(rn),_t.setValueAtIndex(rn,xt),Se(rn)},Ct=Ze=>{if(Z==-1)return;const xt=ut(Ze)||0;U(Z),_t.setValueAtIndex(Z,xt),Se(Z)};rW(wt,{onPanSessionStart(Ze){Q&&($(!0),Ne(Ze),D==null||D(de.current.value))},onPanSessionEnd(){Q&&($(!1),j==null||j(de.current.value))},onPan(Ze){Q&&Ct(Ze)}});const Nt=w.useCallback((Ze={},xt=null)=>({...Ze,...R,id:Le.root,ref:Hn(xt,wt),tabIndex:-1,"aria-disabled":jm(d),"data-focused":es(W),style:{...Ze.style,...De}}),[R,d,W,De,Le]),Te=w.useCallback((Ze={},xt=null)=>({...Ze,ref:Hn(xt,Be),id:Le.track,"data-disabled":es(d),style:{...Ze.style,...Ke}}),[d,Ke,Le]),At=w.useCallback((Ze={},xt=null)=>({...Ze,ref:xt,id:Le.innerTrack,style:{...Ze.style,...Xe}}),[Xe,Le]),He=w.useCallback((Ze,xt=null)=>{const{index:ht,...Ht}=Ze,rn=he[ht];if(rn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ht}\`. The \`value\` or \`defaultValue\` length is : ${he.length}`);const gr=Ce[ht];return{...Ht,ref:xt,role:"slider",tabIndex:Q?0:void 0,id:Le.getThumb(ht),"data-active":es(G&&Z===ht),"aria-valuetext":(z==null?void 0:z(rn))??(k==null?void 0:k[ht]),"aria-valuemin":gr.min,"aria-valuemax":gr.max,"aria-valuenow":rn,"aria-orientation":l,"aria-disabled":jm(d),"aria-readonly":jm(h),"aria-label":E==null?void 0:E[ht],"aria-labelledby":E!=null&&E[ht]||_==null?void 0:_[ht],style:{...Ze.style,...ae(ht)},onKeyDown:Bm(Ze.onKeyDown,un),onFocus:Bm(Ze.onFocus,()=>{X(!0),U(ht)}),onBlur:Bm(Ze.onBlur,()=>{X(!1),U(-1)})}},[Le,he,Ce,Q,G,Z,z,k,l,d,h,E,_,ae,un,X]),vt=w.useCallback((Ze={},xt=null)=>({...Ze,ref:xt,id:Le.output,htmlFor:he.map((ht,Ht)=>Le.getThumb(Ht)).join(" "),"aria-live":"off"}),[Le,he]),nn=w.useCallback((Ze,xt=null)=>{const{value:ht,...Ht}=Ze,rn=!(htn),gr=ht>=he[0]&&ht<=he[he.length-1];let Io=f5(ht,t,n);Io=H?100-Io:Io;const Ii={position:"absolute",pointerEvents:"none",...Lv({orientation:l,vertical:{bottom:`${Io}%`},horizontal:{left:`${Io}%`}})};return{...Ht,ref:xt,id:Le.getMarker(Ze.value),role:"presentation","aria-hidden":!0,"data-disabled":es(d),"data-invalid":es(!rn),"data-highlighted":es(gr),style:{...Ze.style,...Ii}}},[d,H,n,t,l,he,Le]),Rn=w.useCallback((Ze,xt=null)=>{const{index:ht,...Ht}=Ze;return{...Ht,ref:xt,id:Le.getInput(ht),type:"hidden",value:he[ht],name:Array.isArray(P)?P[ht]:`${P}-${ht}`}},[P,he,Le]);return{state:{value:he,isFocused:W,isDragging:G,getThumbPercent:Ze=>rt[Ze],getThumbMinValue:Ze=>Ce[Ze].min,getThumbMaxValue:Ze=>Ce[Ze].max},actions:_t,getRootProps:Nt,getTrackProps:Te,getInnerTrackProps:At,getThumbProps:He,getMarkerProps:nn,getInputProps:Rn,getOutputProps:vt}}function f4e(e,t,n,r){return e.map((i,o)=>{const a=o===0?t:e[o-1]+r,s=o===e.length-1?n:e[o+1]-r;return{min:a,max:s}})}var[h4e,_x]=Pn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[p4e,VE]=Pn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),sW=Ae(function(t,n){const r=Mi("Slider",t),i=Sn(t),{direction:o}=y0();i.direction=o;const{getRootProps:a,...s}=d4e(i),l=w.useMemo(()=>({...s,name:t.name}),[s,t.name]);return N.createElement(h4e,{value:l},N.createElement(p4e,{value:r},N.createElement(we.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});sW.defaultProps={orientation:"horizontal"};sW.displayName="RangeSlider";var g4e=Ae(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=_x(),a=VE(),s=r(t,n);return N.createElement(we.div,{...s,className:hf("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&N.createElement("input",{...i({index:t.index})}))});g4e.displayName="RangeSliderThumb";var m4e=Ae(function(t,n){const{getTrackProps:r}=_x(),i=VE(),o=r(t,n);return N.createElement(we.div,{...o,className:hf("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});m4e.displayName="RangeSliderTrack";var v4e=Ae(function(t,n){const{getInnerTrackProps:r}=_x(),i=VE(),o=r(t,n);return N.createElement(we.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});v4e.displayName="RangeSliderFilledTrack";var y4e=Ae(function(t,n){const{getMarkerProps:r}=_x(),i=r(t,n);return N.createElement(we.div,{...i,className:hf("chakra-slider__marker",t.className)})});y4e.displayName="RangeSliderMark";ff();ff();function b4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:y,step:b=1,getAriaValueText:x,"aria-valuetext":k,"aria-label":E,"aria-labelledby":_,name:P,focusThumbOnChange:A=!0,...M}=e,R=Er(m),D=Er(y),j=Er(x),z=aW({isReversed:a,direction:s,orientation:l}),[H,K]=$S({value:i,defaultValue:o??x4e(t,n),onChange:r}),[te,G]=w.useState(!1),[$,W]=w.useState(!1),X=!(d||h),Z=(n-t)/10,U=b||(n-t)/100,Q=Tm(H,t,n),re=n-Q+t,Ee=f5(z?re:Q,t,n),Ce=l==="vertical",de=nW({min:t,max:n,step:b,isDisabled:d,value:Q,isInteractive:X,isReversed:z,isVertical:Ce,eventSource:null,focusThumbOnChange:A,orientation:l}),ze=w.useRef(null),Me=w.useRef(null),rt=w.useRef(null),We=w.useId(),Be=u??We,[wt,$e]=[`slider-thumb-${Be}`,`slider-track-${Be}`],at=w.useCallback(He=>{var vt;if(!ze.current)return;const nn=de.current;nn.eventSource="pointer";const Rn=ze.current.getBoundingClientRect(),{clientX:Ze,clientY:xt}=((vt=He.touches)==null?void 0:vt[0])??He,ht=Ce?Rn.bottom-xt:Ze-Rn.left,Ht=Ce?Rn.height:Rn.width;let rn=ht/Ht;z&&(rn=1-rn);let gr=uF(rn,nn.min,nn.max);return nn.step&&(gr=parseFloat(Y7(gr,nn.min,nn.step))),gr=Tm(gr,nn.min,nn.max),gr},[Ce,z,de]),bt=w.useCallback(He=>{const vt=de.current;vt.isInteractive&&(He=parseFloat(Y7(He,vt.min,U)),He=Tm(He,vt.min,vt.max),K(He))},[U,K,de]),Le=w.useMemo(()=>({stepUp(He=U){const vt=z?Q-He:Q+He;bt(vt)},stepDown(He=U){const vt=z?Q+He:Q-He;bt(vt)},reset(){bt(o||0)},stepTo(He){bt(He)}}),[bt,z,Q,U,o]),ut=w.useCallback(He=>{const vt=de.current,Rn={ArrowRight:()=>Le.stepUp(),ArrowUp:()=>Le.stepUp(),ArrowLeft:()=>Le.stepDown(),ArrowDown:()=>Le.stepDown(),PageUp:()=>Le.stepUp(Z),PageDown:()=>Le.stepDown(Z),Home:()=>bt(vt.min),End:()=>bt(vt.max)}[He.key];Rn&&(He.preventDefault(),He.stopPropagation(),Rn(He),vt.eventSource="keyboard")},[Le,bt,Z,de]),Mt=(j==null?void 0:j(Q))??k,ct=s4e(Me),{getThumbStyle:_t,rootStyle:un,trackStyle:ae,innerTrackStyle:De}=w.useMemo(()=>{const He=de.current,vt=ct??{width:0,height:0};return oW({isReversed:z,orientation:He.orientation,thumbRects:[vt],thumbPercents:[Ee]})},[z,ct,Ee,de]),Ke=w.useCallback(()=>{de.current.focusThumbOnChange&&setTimeout(()=>{var vt;return(vt=Me.current)==null?void 0:vt.focus()})},[de]);qd(()=>{const He=de.current;Ke(),He.eventSource==="keyboard"&&(D==null||D(He.value))},[Q,D]);function Xe(He){const vt=at(He);vt!=null&&vt!==de.current.value&&K(vt)}rW(rt,{onPanSessionStart(He){const vt=de.current;vt.isInteractive&&(G(!0),Ke(),Xe(He),R==null||R(vt.value))},onPanSessionEnd(){const He=de.current;He.isInteractive&&(G(!1),D==null||D(He.value))},onPan(He){de.current.isInteractive&&Xe(He)}});const Se=w.useCallback((He={},vt=null)=>({...He,...M,ref:Hn(vt,rt),tabIndex:-1,"aria-disabled":jm(d),"data-focused":es($),style:{...He.style,...un}}),[M,d,$,un]),Ne=w.useCallback((He={},vt=null)=>({...He,ref:Hn(vt,ze),id:$e,"data-disabled":es(d),style:{...He.style,...ae}}),[d,$e,ae]),Ct=w.useCallback((He={},vt=null)=>({...He,ref:vt,style:{...He.style,...De}}),[De]),Nt=w.useCallback((He={},vt=null)=>({...He,ref:Hn(vt,Me),role:"slider",tabIndex:X?0:void 0,id:wt,"data-active":es(te),"aria-valuetext":Mt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":Q,"aria-orientation":l,"aria-disabled":jm(d),"aria-readonly":jm(h),"aria-label":E,"aria-labelledby":E?void 0:_,style:{...He.style,..._t(0)},onKeyDown:Bm(He.onKeyDown,ut),onFocus:Bm(He.onFocus,()=>W(!0)),onBlur:Bm(He.onBlur,()=>W(!1))}),[X,wt,te,Mt,t,n,Q,l,d,h,E,_,_t,ut]),Te=w.useCallback((He,vt=null)=>{const nn=!(He.valuen),Rn=Q>=He.value,Ze=f5(He.value,t,n),xt={position:"absolute",pointerEvents:"none",...S4e({orientation:l,vertical:{bottom:z?`${100-Ze}%`:`${Ze}%`},horizontal:{left:z?`${100-Ze}%`:`${Ze}%`}})};return{...He,ref:vt,role:"presentation","aria-hidden":!0,"data-disabled":es(d),"data-invalid":es(!nn),"data-highlighted":es(Rn),style:{...He.style,...xt}}},[d,z,n,t,l,Q]),At=w.useCallback((He={},vt=null)=>({...He,ref:vt,type:"hidden",value:Q,name:P}),[P,Q]);return{state:{value:Q,isFocused:$,isDragging:te},actions:Le,getRootProps:Se,getTrackProps:Ne,getInnerTrackProps:Ct,getThumbProps:Nt,getMarkerProps:Te,getInputProps:At}}function S4e(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function x4e(e,t){return t"}),[C4e,Ex]=Pn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),WE=Ae((e,t)=>{const n=Mi("Slider",e),r=Sn(e),{direction:i}=y0();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=b4e(r),l=a(),u=o({},t);return N.createElement(w4e,{value:s},N.createElement(C4e,{value:n},N.createElement(we.div,{...l,className:hf("chakra-slider",e.className),__css:n.container},e.children,N.createElement("input",{...u}))))});WE.defaultProps={orientation:"horizontal"};WE.displayName="Slider";var lW=Ae((e,t)=>{const{getThumbProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(we.div,{...i,className:hf("chakra-slider__thumb",e.className),__css:r.thumb})});lW.displayName="SliderThumb";var uW=Ae((e,t)=>{const{getTrackProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(we.div,{...i,className:hf("chakra-slider__track",e.className),__css:r.track})});uW.displayName="SliderTrack";var cW=Ae((e,t)=>{const{getInnerTrackProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(we.div,{...i,className:hf("chakra-slider__filled-track",e.className),__css:r.filledTrack})});cW.displayName="SliderFilledTrack";var Q9=Ae((e,t)=>{const{getMarkerProps:n}=kx(),r=Ex(),i=n(e,t);return N.createElement(we.div,{...i,className:hf("chakra-slider__marker",e.className),__css:r.mark})});Q9.displayName="SliderMark";var _4e=(...e)=>e.filter(Boolean).join(" "),mI=e=>e?"":void 0,UE=Ae(function(t,n){const r=Mi("Switch",t),{spacing:i="0.5rem",children:o,...a}=Sn(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:d,getLabelProps:h}=sF(a),m=w.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),y=w.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=w.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return N.createElement(we.label,{...d(),className:_4e("chakra-switch",t.className),__css:m},N.createElement("input",{className:"chakra-switch__input",...l({},n)}),N.createElement(we.span,{...u(),className:"chakra-switch__track",__css:y},N.createElement(we.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":mI(s.isChecked),"data-hover":mI(s.isHovered)})),o&&N.createElement(we.span,{className:"chakra-switch__label",...h(),__css:b},o))});UE.displayName="Switch";var P0=(...e)=>e.filter(Boolean).join(" ");function J9(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[k4e,dW,E4e,P4e]=SB();function T4e(e){const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[d,h]=w.useState(t??0),[m,y]=$S({defaultValue:t??0,value:r,onChange:n});w.useEffect(()=>{r!=null&&h(r)},[r]);const b=E4e(),x=w.useId();return{id:`tabs-${e.id??x}`,selectedIndex:m,focusedIndex:d,setSelectedIndex:y,setFocusedIndex:h,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:b,direction:l,htmlProps:u}}var[L4e,By]=Pn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function A4e(e){const{focusedIndex:t,orientation:n,direction:r}=By(),i=dW(),o=w.useCallback(a=>{const s=()=>{var _;const P=i.nextEnabled(t);P&&((_=P.node)==null||_.focus())},l=()=>{var _;const P=i.prevEnabled(t);P&&((_=P.node)==null||_.focus())},u=()=>{var _;const P=i.firstEnabled();P&&((_=P.node)==null||_.focus())},d=()=>{var _;const P=i.lastEnabled();P&&((_=P.node)==null||_.focus())},h=n==="horizontal",m=n==="vertical",y=a.key,b=r==="ltr"?"ArrowLeft":"ArrowRight",x=r==="ltr"?"ArrowRight":"ArrowLeft",E={[b]:()=>h&&l(),[x]:()=>h&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:u,End:d}[y];E&&(a.preventDefault(),E(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:J9(e.onKeyDown,o)}}function O4e(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=By(),{index:u,register:d}=P4e({disabled:t&&!n}),h=u===l,m=()=>{i(u)},y=()=>{s(u),!o&&!(t&&n)&&i(u)},b=c0e({...r,ref:Hn(d,e.ref),isDisabled:t,isFocusable:n,onClick:J9(e.onClick,m)}),x="button";return{...b,id:fW(a,u),role:"tab",tabIndex:h?0:-1,type:x,"aria-selected":h,"aria-controls":hW(a,u),onFocus:t?void 0:J9(e.onFocus,y)}}var[M4e,I4e]=Pn({});function R4e(e){const t=By(),{id:n,selectedIndex:r}=t,o=ex(e.children).map((a,s)=>w.createElement(M4e,{key:s,value:{isSelected:s===r,id:hW(n,s),tabId:fW(n,s),selectedIndex:r}},a));return{...e,children:o}}function D4e(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=By(),{isSelected:o,id:a,tabId:s}=I4e(),l=w.useRef(!1);o&&(l.current=!0);const u=YF({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function N4e(){const e=By(),t=dW(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=w.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=w.useState(!1);return Gs(()=>{if(n==null)return;const d=t.item(n);if(d==null)return;i&&s({left:d.node.offsetLeft,width:d.node.offsetWidth}),o&&s({top:d.node.offsetTop,height:d.node.offsetHeight});const h=requestAnimationFrame(()=>{u(!0)});return()=>{h&&cancelAnimationFrame(h)}},[n,i,o,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:l?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function fW(e,t){return`${e}--tab-${t}`}function hW(e,t){return`${e}--tabpanel-${t}`}var[j4e,$y]=Pn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),pW=Ae(function(t,n){const r=Mi("Tabs",t),{children:i,className:o,...a}=Sn(t),{htmlProps:s,descendants:l,...u}=T4e(a),d=w.useMemo(()=>u,[u]),{isFitted:h,...m}=s;return N.createElement(k4e,{value:l},N.createElement(L4e,{value:d},N.createElement(j4e,{value:r},N.createElement(we.div,{className:P0("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});pW.displayName="Tabs";var B4e=Ae(function(t,n){const r=N4e(),i={...t.style,...r},o=$y();return N.createElement(we.div,{ref:n,...t,className:P0("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});B4e.displayName="TabIndicator";var $4e=Ae(function(t,n){const r=A4e({...t,ref:n}),o={display:"flex",...$y().tablist};return N.createElement(we.div,{...r,className:P0("chakra-tabs__tablist",t.className),__css:o})});$4e.displayName="TabList";var gW=Ae(function(t,n){const r=D4e({...t,ref:n}),i=$y();return N.createElement(we.div,{outline:"0",...r,className:P0("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});gW.displayName="TabPanel";var mW=Ae(function(t,n){const r=R4e(t),i=$y();return N.createElement(we.div,{...r,width:"100%",ref:n,className:P0("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});mW.displayName="TabPanels";var vW=Ae(function(t,n){const r=$y(),i=O4e({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return N.createElement(we.button,{...i,className:P0("chakra-tabs__tab",t.className),__css:o})});vW.displayName="Tab";var F4e=(...e)=>e.filter(Boolean).join(" ");function z4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var H4e=["h","minH","height","minHeight"],GE=Ae((e,t)=>{const n=Oo("Textarea",e),{className:r,rows:i,...o}=Sn(e),a=hk(o),s=i?z4e(n,H4e):n;return N.createElement(we.textarea,{ref:t,rows:i,...a,className:F4e("chakra-textarea",r),__css:s})});GE.displayName="Textarea";function V4e(e,t){const n=Er(e);w.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function e8(e,...t){return W4e(e)?e(...t):e}var W4e=e=>typeof e=="function";function U4e(e,t){const n=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(i==null?void 0:i[t])??n}var G4e=(e,t)=>e.find(n=>n.id===t);function vI(e,t){const n=yW(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function yW(e,t){for(const[n,r]of Object.entries(e))if(G4e(r,t))return n}function q4e(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Y4e(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}var K4e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Wl=X4e(K4e);function X4e(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=Z4e(i,o),{position:s,id:l}=a;return r(u=>{const h=s.includes("top")?[a,...u[s]??[]]:[...u[s]??[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=vI(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:bW(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(d=>({...d,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=yW(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(vI(Wl.getState(),i).position)}}var yI=0;function Z4e(e,t={}){yI+=1;const n=t.id??yI,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Wl.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var Q4e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return N.createElement(eF,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},N.createElement(nF,null,l),N.createElement(we.div,{flex:"1",maxWidth:"100%"},i&&N.createElement(rF,{id:u==null?void 0:u.title},i),s&&N.createElement(tF,{id:u==null?void 0:u.description,display:"block"},s)),o&&N.createElement(rx,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function bW(e={}){const{render:t,toastComponent:n=Q4e}=e;return i=>typeof t=="function"?t({...i,...e}):N.createElement(n,{...i,...e})}function J4e(e,t){const n=i=>({...t,...i,position:U4e((i==null?void 0:i.position)??(t==null?void 0:t.position),e)}),r=i=>{const o=n(i),a=bW(o);return Wl.notify(a,o)};return r.update=(i,o)=>{Wl.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...e8(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...e8(o.error,s)}))},r.closeAll=Wl.closeAll,r.close=Wl.close,r.isActive=Wl.isActive,r}function Fy(e){const{theme:t}=vB();return w.useMemo(()=>J4e(t.direction,e),[e,t.direction])}var e5e={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},SW=w.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=e5e,toastSpacing:d="0.5rem"}=e,[h,m]=w.useState(s),y=Ufe();qd(()=>{y||r==null||r()},[y]),qd(()=>{m(s)},[s]);const b=()=>m(null),x=()=>m(s),k=()=>{y&&i()};w.useEffect(()=>{y&&o&&i()},[y,o,i]),V4e(k,h);const E=w.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:d,...l}),[l,d]),_=w.useMemo(()=>q4e(a),[a]);return N.createElement(hu.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:x,custom:{position:a},style:_},N.createElement(we.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:E},e8(n,{id:t,onClose:k})))});SW.displayName="ToastComponent";var t5e=e=>{const t=w.useSyncExternalStore(Wl.subscribe,Wl.getState,Wl.getState),{children:n,motionVariants:r,component:i=SW,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return N.createElement("ul",{role:"region","aria-live":"polite",key:l,id:`chakra-toast-manager-${l}`,style:Y4e(l)},N.createElement(sf,{initial:!1},u.map(d=>N.createElement(i,{key:d.id,motionVariants:r,...d}))))});return N.createElement(N.Fragment,null,n,N.createElement(dp,{...o},s))};function n5e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function r5e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var i5e={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};function ov(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var F5=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},t8=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function o5e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:d,id:h,isOpen:m,defaultIsOpen:y,arrowSize:b=10,arrowShadowColor:x,arrowPadding:k,modifiers:E,isDisabled:_,gutter:P,offset:A,direction:M,...R}=e,{isOpen:D,onOpen:j,onClose:z}=qF({isOpen:m,defaultIsOpen:y,onOpen:l,onClose:u}),{referenceRef:H,getPopperProps:K,getArrowInnerProps:te,getArrowProps:G}=GF({enabled:D,placement:d,arrowPadding:k,modifiers:E,gutter:P,offset:A,direction:M}),$=w.useId(),X=`tooltip-${h??$}`,Z=w.useRef(null),U=w.useRef(),Q=w.useCallback(()=>{U.current&&(clearTimeout(U.current),U.current=void 0)},[]),re=w.useRef(),he=w.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=void 0)},[]),Ee=w.useCallback(()=>{he(),z()},[z,he]),Ce=a5e(Z,Ee),de=w.useCallback(()=>{if(!_&&!U.current){Ce();const at=t8(Z);U.current=at.setTimeout(j,t)}},[Ce,_,j,t]),ze=w.useCallback(()=>{Q();const at=t8(Z);re.current=at.setTimeout(Ee,n)},[n,Ee,Q]),Me=w.useCallback(()=>{D&&r&&ze()},[r,ze,D]),rt=w.useCallback(()=>{D&&a&&ze()},[a,ze,D]),We=w.useCallback(at=>{D&&at.key==="Escape"&&ze()},[D,ze]);Bh(()=>F5(Z),"keydown",s?We:void 0),Bh(()=>F5(Z),"scroll",()=>{D&&o&&Ee()}),w.useEffect(()=>{_&&(Q(),D&&z())},[_,D,z,Q]),w.useEffect(()=>()=>{Q(),he()},[Q,he]),Bh(()=>Z.current,"pointerleave",ze);const Be=w.useCallback((at={},bt=null)=>({...at,ref:Hn(Z,bt,H),onPointerEnter:ov(at.onPointerEnter,ut=>{ut.pointerType!=="touch"&&de()}),onClick:ov(at.onClick,Me),onPointerDown:ov(at.onPointerDown,rt),onFocus:ov(at.onFocus,de),onBlur:ov(at.onBlur,ze),"aria-describedby":D?X:void 0}),[de,ze,rt,D,X,Me,H]),wt=w.useCallback((at={},bt=null)=>K({...at,style:{...at.style,[oi.arrowSize.var]:b?`${b}px`:void 0,[oi.arrowShadowColor.var]:x}},bt),[K,b,x]),$e=w.useCallback((at={},bt=null)=>{const Le={...at.style,position:"relative",transformOrigin:oi.transformOrigin.varRef};return{ref:bt,...R,...at,id:X,role:"tooltip",style:Le}},[R,X]);return{isOpen:D,show:de,hide:ze,getTriggerProps:Be,getTooltipProps:$e,getTooltipPositionerProps:wt,getArrowProps:G,getArrowInnerProps:te}}var hC="chakra-ui:close-tooltip";function a5e(e,t){return w.useEffect(()=>{const n=F5(e);return n.addEventListener(hC,t),()=>n.removeEventListener(hC,t)},[t,e]),()=>{const n=F5(e),r=t8(e);n.dispatchEvent(new r.CustomEvent(hC))}}var s5e=we(hu.div),yi=Ae((e,t)=>{const n=Oo("Tooltip",e),r=Sn(e),i=y0(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:d,portalProps:h,background:m,backgroundColor:y,bgColor:b,motionProps:x,...k}=r,E=m??y??d??b;if(E){n.bg=E;const z=hne(i,"colors",E);n[oi.arrowBg.var]=z}const _=o5e({...k,direction:i.direction}),P=typeof o=="string"||s;let A;if(P)A=N.createElement(we.span,{display:"inline-block",tabIndex:0,..._.getTriggerProps()},o);else{const z=w.Children.only(o);A=w.cloneElement(z,_.getTriggerProps(z.props,z.ref))}const M=!!l,R=_.getTooltipProps({},t),D=M?n5e(R,["role","id"]):R,j=r5e(R,["role","id"]);return a?N.createElement(N.Fragment,null,A,N.createElement(sf,null,_.isOpen&&N.createElement(dp,{...h},N.createElement(we.div,{..._.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},N.createElement(s5e,{variants:i5e,initial:"exit",animate:"enter",exit:"exit",...x,...D,__css:n},a,M&&N.createElement(we.span,{srOnly:!0,...j},l),u&&N.createElement(we.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},N.createElement(we.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))))))):N.createElement(N.Fragment,null,o)});yi.displayName="Tooltip";var l5e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=N.createElement(LF,{environment:a},t);return N.createElement(ice,{theme:o,cssVarsRoot:s},N.createElement(Sj,{colorModeManager:n,options:o.config},i?N.createElement(wme,null):N.createElement(xme,null),N.createElement(ace,null),r?N.createElement(KH,{zIndex:r},l):l))};function u5e({children:e,theme:t=Kue,toastOptions:n,...r}){return N.createElement(l5e,{theme:t,...r},e,N.createElement(t5e,{...n}))}var n8={},bI=el;n8.createRoot=bI.createRoot,n8.hydrateRoot=bI.hydrateRoot;var r8={},c5e={get exports(){return r8},set exports(e){r8=e}},xW={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -415,7 +415,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var s0=w;function d5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var f5e=typeof Object.is=="function"?Object.is:d5e,h5e=s0.useState,p5e=s0.useEffect,g5e=s0.useLayoutEffect,m5e=s0.useDebugValue;function v5e(e,t){var n=t(),r=h5e({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return g5e(function(){i.value=n,i.getSnapshot=t,pC(i)&&o({inst:i})},[e,n,t]),p5e(function(){return pC(i)&&o({inst:i}),e(function(){pC(i)&&o({inst:i})})},[e]),m5e(n),n}function pC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!f5e(e,n)}catch{return!0}}function y5e(e,t){return t()}var b5e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y5e:v5e;xW.useSyncExternalStore=s0.useSyncExternalStore!==void 0?s0.useSyncExternalStore:b5e;(function(e){e.exports=xW})(c5e);var i8={},S5e={get exports(){return i8},set exports(e){i8=e}},wW={};/** + */var l0=w;function d5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var f5e=typeof Object.is=="function"?Object.is:d5e,h5e=l0.useState,p5e=l0.useEffect,g5e=l0.useLayoutEffect,m5e=l0.useDebugValue;function v5e(e,t){var n=t(),r=h5e({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return g5e(function(){i.value=n,i.getSnapshot=t,pC(i)&&o({inst:i})},[e,n,t]),p5e(function(){return pC(i)&&o({inst:i}),e(function(){pC(i)&&o({inst:i})})},[e]),m5e(n),n}function pC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!f5e(e,n)}catch{return!0}}function y5e(e,t){return t()}var b5e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y5e:v5e;xW.useSyncExternalStore=l0.useSyncExternalStore!==void 0?l0.useSyncExternalStore:b5e;(function(e){e.exports=xW})(c5e);var i8={},S5e={get exports(){return i8},set exports(e){i8=e}},wW={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -423,7 +423,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Px=w,x5e=r8;function w5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var C5e=typeof Object.is=="function"?Object.is:w5e,_5e=x5e.useSyncExternalStore,k5e=Px.useRef,E5e=Px.useEffect,P5e=Px.useMemo,T5e=Px.useDebugValue;wW.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=k5e(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=P5e(function(){function l(y){if(!u){if(u=!0,d=y,y=r(y),i!==void 0&&a.hasValue){var b=a.value;if(i(b,y))return h=b}return h=y}if(b=h,C5e(d,y))return b;var x=r(y);return i!==void 0&&i(b,x)?b:(d=y,h=x)}var u=!1,d,h,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=_5e(e,o[0],o[1]);return E5e(function(){a.hasValue=!0,a.value=s},[s]),T5e(s),s};(function(e){e.exports=wW})(S5e);function L5e(e){e()}let CW=L5e;const A5e=e=>CW=e,O5e=()=>CW,Jd=w.createContext(null);function _W(){return w.useContext(Jd)}const M5e=()=>{throw new Error("uSES not initialized!")};let kW=M5e;const I5e=e=>{kW=e},R5e=(e,t)=>e===t;function D5e(e=Jd){const t=e===Jd?_W:()=>w.useContext(e);return function(r,i=R5e){const{store:o,subscription:a,getServerState:s}=t(),l=kW(a.addNestedSub,o.getState,s||o.getState,r,i);return w.useDebugValue(l),l}}const N5e=D5e();var SI={},j5e={get exports(){return SI},set exports(e){SI=e}},$n={};/** + */var Px=w,x5e=r8;function w5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var C5e=typeof Object.is=="function"?Object.is:w5e,_5e=x5e.useSyncExternalStore,k5e=Px.useRef,E5e=Px.useEffect,P5e=Px.useMemo,T5e=Px.useDebugValue;wW.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=k5e(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=P5e(function(){function l(y){if(!u){if(u=!0,d=y,y=r(y),i!==void 0&&a.hasValue){var b=a.value;if(i(b,y))return h=b}return h=y}if(b=h,C5e(d,y))return b;var x=r(y);return i!==void 0&&i(b,x)?b:(d=y,h=x)}var u=!1,d,h,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=_5e(e,o[0],o[1]);return E5e(function(){a.hasValue=!0,a.value=s},[s]),T5e(s),s};(function(e){e.exports=wW})(S5e);function L5e(e){e()}let CW=L5e;const A5e=e=>CW=e,O5e=()=>CW,ef=w.createContext(null);function _W(){return w.useContext(ef)}const M5e=()=>{throw new Error("uSES not initialized!")};let kW=M5e;const I5e=e=>{kW=e},R5e=(e,t)=>e===t;function D5e(e=ef){const t=e===ef?_W:()=>w.useContext(e);return function(r,i=R5e){const{store:o,subscription:a,getServerState:s}=t(),l=kW(a.addNestedSub,o.getState,s||o.getState,r,i);return w.useDebugValue(l),l}}const N5e=D5e();var SI={},j5e={get exports(){return SI},set exports(e){SI=e}},Fn={};/** * @license React * react-is.production.min.js * @@ -431,9 +431,9 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var qE=Symbol.for("react.element"),YE=Symbol.for("react.portal"),Tx=Symbol.for("react.fragment"),Lx=Symbol.for("react.strict_mode"),Ax=Symbol.for("react.profiler"),Ox=Symbol.for("react.provider"),Mx=Symbol.for("react.context"),B5e=Symbol.for("react.server_context"),Ix=Symbol.for("react.forward_ref"),Rx=Symbol.for("react.suspense"),Dx=Symbol.for("react.suspense_list"),Nx=Symbol.for("react.memo"),jx=Symbol.for("react.lazy"),F5e=Symbol.for("react.offscreen"),EW;EW=Symbol.for("react.module.reference");function ms(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case qE:switch(e=e.type,e){case Tx:case Ax:case Lx:case Rx:case Dx:return e;default:switch(e=e&&e.$$typeof,e){case B5e:case Mx:case Ix:case jx:case Nx:case Ox:return e;default:return t}}case YE:return t}}}$n.ContextConsumer=Mx;$n.ContextProvider=Ox;$n.Element=qE;$n.ForwardRef=Ix;$n.Fragment=Tx;$n.Lazy=jx;$n.Memo=Nx;$n.Portal=YE;$n.Profiler=Ax;$n.StrictMode=Lx;$n.Suspense=Rx;$n.SuspenseList=Dx;$n.isAsyncMode=function(){return!1};$n.isConcurrentMode=function(){return!1};$n.isContextConsumer=function(e){return ms(e)===Mx};$n.isContextProvider=function(e){return ms(e)===Ox};$n.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===qE};$n.isForwardRef=function(e){return ms(e)===Ix};$n.isFragment=function(e){return ms(e)===Tx};$n.isLazy=function(e){return ms(e)===jx};$n.isMemo=function(e){return ms(e)===Nx};$n.isPortal=function(e){return ms(e)===YE};$n.isProfiler=function(e){return ms(e)===Ax};$n.isStrictMode=function(e){return ms(e)===Lx};$n.isSuspense=function(e){return ms(e)===Rx};$n.isSuspenseList=function(e){return ms(e)===Dx};$n.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Tx||e===Ax||e===Lx||e===Rx||e===Dx||e===F5e||typeof e=="object"&&e!==null&&(e.$$typeof===jx||e.$$typeof===Nx||e.$$typeof===Ox||e.$$typeof===Mx||e.$$typeof===Ix||e.$$typeof===EW||e.getModuleId!==void 0)};$n.typeOf=ms;(function(e){e.exports=$n})(j5e);function $5e(){const e=O5e();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const xI={notify(){},get:()=>[]};function z5e(e,t){let n,r=xI;function i(h){return l(),r.subscribe(h)}function o(){r.notify()}function a(){d.onStateChange&&d.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=$5e())}function u(){n&&(n(),n=void 0,r.clear(),r=xI)}const d={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return d}const H5e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",V5e=H5e?w.useLayoutEffect:w.useEffect;function W5e({store:e,context:t,children:n,serverState:r}){const i=w.useMemo(()=>{const s=z5e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=w.useMemo(()=>e.getState(),[e]);V5e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]);const a=t||Jd;return N.createElement(a.Provider,{value:i},n)}function PW(e=Jd){const t=e===Jd?_W:()=>w.useContext(e);return function(){const{store:r}=t();return r}}const U5e=PW();function G5e(e=Jd){const t=e===Jd?U5e:PW(e);return function(){return t().dispatch}}const q5e=G5e();I5e(i8.useSyncExternalStoreWithSelector);A5e(el.unstable_batchedUpdates);function M4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?M4=function(n){return typeof n}:M4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},M4(e)}function Y5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:KE(e)?2:XE(e)?3:0}function Bm(e,t){return P0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Q5e(e,t){return P0(e)===2?e.get(t):e[t]}function LW(e,t,n){var r=P0(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function AW(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function KE(e){return iSe&&e instanceof Map}function XE(e){return oSe&&e instanceof Set}function mh(e){return e.o||e.t}function ZE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=MW(e);delete t[yr];for(var n=Fm(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=J5e),Object.freeze(e),t&&tp(e,function(n,r){return QE(r,!0)},!0)),e}function J5e(){Ws(2)}function JE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function nu(e){var t=c8[e];return t||Ws(18,e),t}function eSe(e,t){c8[e]||(c8[e]=t)}function s8(){return ey}function gC(e,t){t&&(nu("Patches"),e.u=[],e.s=[],e.v=t)}function z5(e){l8(e),e.p.forEach(tSe),e.p=null}function l8(e){e===ey&&(ey=e.l)}function CI(e){return ey={p:[],l:ey,h:e,m:!0,_:0}}function tSe(e){var t=e[yr];t.i===0||t.i===1?t.j():t.O=!0}function mC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||nu("ES5").S(t,e,r),r?(n[yr].P&&(z5(t),Ws(4)),sc(e)&&(e=H5(t,e),t.l||V5(t,e)),t.u&&nu("Patches").M(n[yr].t,e,t.u,t.s)):e=H5(t,n,[]),z5(t),t.u&&t.v(t.u,t.s),e!==OW?e:void 0}function H5(e,t,n){if(JE(t))return t;var r=t[yr];if(!r)return tp(t,function(o,a){return _I(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return V5(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=ZE(r.k):r.o;tp(r.i===3?new Set(i):i,function(o,a){return _I(e,r,i,o,a,n)}),V5(e,i,!1),n&&e.u&&nu("Patches").R(r,n,e.u,e.s)}return r.o}function _I(e,t,n,r,i,o){if(ef(i)){var a=H5(e,i,o&&t&&t.i!==3&&!Bm(t.D,r)?o.concat(r):void 0);if(LW(n,r,a),!ef(a))return;e.m=!1}if(sc(i)&&!JE(i)){if(!e.h.F&&e._<1)return;H5(e,i),t&&t.A.l||V5(e,i)}}function V5(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&QE(t,n)}function vC(e,t){var n=e[yr];return(n?mh(n):e)[t]}function kI(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function wd(e){e.P||(e.P=!0,e.l&&wd(e.l))}function yC(e){e.o||(e.o=ZE(e.t))}function u8(e,t,n){var r=KE(t)?nu("MapSet").N(t,n):XE(t)?nu("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:s8(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=ty;a&&(l=[s],u=Tv);var d=Proxy.revocable(l,u),h=d.revoke,m=d.proxy;return s.k=m,s.j=h,m}(t,n):nu("ES5").J(t,n);return(n?n.A:s8()).p.push(r),r}function nSe(e){return ef(e)||Ws(22,e),function t(n){if(!sc(n))return n;var r,i=n[yr],o=P0(n);if(i){if(!i.P&&(i.i<4||!nu("ES5").K(i)))return i.t;i.I=!0,r=EI(n,o),i.I=!1}else r=EI(n,o);return tp(r,function(a,s){i&&Q5e(i.t,a)===s||LW(r,a,t(s))}),o===3?new Set(r):r}(e)}function EI(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return ZE(e)}function rSe(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[yr];return ty.get(l,o)},set:function(l){var u=this[yr];ty.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][yr];if(!s.P)switch(s.i){case 5:r(s)&&wd(s);break;case 4:n(s)&&wd(s)}}}function n(o){for(var a=o.t,s=o.k,l=Fm(s),u=l.length-1;u>=0;u--){var d=l[u];if(d!==yr){var h=a[d];if(h===void 0&&!Bm(a,d))return!0;var m=s[d],y=m&&m[yr];if(y?y.t!==h:!AW(m,h))return!0}}var b=!!a[yr];return l.length!==Fm(a).length+(b?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?E-1:0),P=1;P1?d-1:0),m=1;m=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=nu("Patches").$;return ef(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Ra=new sSe,IW=Ra.produce;Ra.produceWithPatches.bind(Ra);Ra.setAutoFreeze.bind(Ra);Ra.setUseProxies.bind(Ra);Ra.applyPatches.bind(Ra);Ra.createDraft.bind(Ra);Ra.finishDraft.bind(Ra);function AI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OI(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ro(1));return n(tP)(e,t)}if(typeof e!="function")throw new Error(ro(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function d(){if(l)throw new Error(ro(3));return o}function h(x){if(typeof x!="function")throw new Error(ro(4));if(l)throw new Error(ro(5));var k=!0;return u(),s.push(x),function(){if(k){if(l)throw new Error(ro(6));k=!1,u();var _=s.indexOf(x);s.splice(_,1),a=null}}}function m(x){if(!lSe(x))throw new Error(ro(7));if(typeof x.type>"u")throw new Error(ro(8));if(l)throw new Error(ro(9));try{l=!0,o=i(o,x)}finally{l=!1}for(var k=a=s,E=0;E"u")throw new Error(ro(12));if(typeof n(void 0,{type:W5.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ro(13))})}function RW(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(ro(14));h[y]=k,d=d||k!==x}return d=d||o.length!==Object.keys(l).length,d?h:l}}function U5(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return G5}function i(s,l){r(s)===G5&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var hSe=function(t,n){return t===n};function pSe(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(R).forEach(function(D){P(D)&&d[D]!==R[D]&&m.indexOf(D)===-1&&m.push(D)}),Object.keys(d).forEach(function(D){R[D]===void 0&&P(D)&&m.indexOf(D)===-1&&d[D]!==void 0&&m.push(D)}),y===null&&(y=setInterval(E,i)),d=R},o)}function E(){if(m.length===0){y&&clearInterval(y),y=null;return}var R=m.shift(),D=r.reduce(function(j,z){return z.in(j,R,d)},d[R]);if(D!==void 0)try{h[R]=l(D)}catch(j){console.error("redux-persist/createPersistoid: error serializing state",j)}else delete h[R];m.length===0&&_()}function _(){Object.keys(h).forEach(function(R){d[R]===void 0&&delete h[R]}),b=s.setItem(a,l(h)).catch(A)}function P(R){return!(n&&n.indexOf(R)===-1&&R!=="_persist"||t&&t.indexOf(R)!==-1)}function A(R){u&&u(R)}var M=function(){for(;m.length!==0;)E();return b||Promise.resolve()};return{update:k,flush:M}}function YSe(e){return JSON.stringify(e)}function KSe(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:rP).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=XSe,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,d){return d.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function XSe(e){return JSON.parse(e)}function ZSe(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:rP).concat(e.key);return t.removeItem(n,QSe)}function QSe(e){}function FI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zu(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function txe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var nxe=5e3;function rxe(e,t){var n=e.version!==void 0?e.version:VSe;e.debug;var r=e.stateReconciler===void 0?GSe:e.stateReconciler,i=e.getStoredState||KSe,o=e.timeout!==void 0?e.timeout:nxe,a=null,s=!1,l=!0,u=function(h){return h._persist.rehydrated&&a&&!l&&a.update(h),h};return function(d,h){var m=d||{},y=m._persist,b=exe(m,["_persist"]),x=b;if(h.type===$W){var k=!1,E=function(j,z){k||(h.rehydrate(e.key,j,z),k=!0)};if(o&&setTimeout(function(){!k&&E(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=qSe(e)),y)return zu({},t(x,h),{_persist:y});if(typeof h.rehydrate!="function"||typeof h.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return h.register(e.key),i(e).then(function(D){var j=e.migrate||function(z,H){return Promise.resolve(z)};j(D,n).then(function(z){E(z)},function(z){E(void 0,z)})},function(D){E(void 0,D)}),zu({},t(x,h),{_persist:{version:n,rehydrated:!1}})}else{if(h.type===zW)return s=!0,h.result(ZSe(e)),zu({},t(x,h),{_persist:y});if(h.type===BW)return h.result(a&&a.flush()),zu({},t(x,h),{_persist:y});if(h.type===FW)l=!0;else if(h.type===iP){if(s)return zu({},x,{_persist:zu({},y,{rehydrated:!0})});if(h.key===e.key){var _=t(x,h),P=h.payload,A=r!==!1&&P!==void 0?r(P,d,_,e):_,M=zu({},A,{_persist:zu({},y,{rehydrated:!0})});return u(M)}}}if(!y)return t(d,h);var R=t(x,h);return R===x?d:u(zu({},R,{_persist:y}))}}function $I(e){return axe(e)||oxe(e)||ixe()}function ixe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function oxe(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function axe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:VW,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case HW:return f8({},t,{registry:[].concat($I(t.registry),[n.key])});case iP:var r=t.registry.indexOf(n.key),i=$I(t.registry);return i.splice(r,1),f8({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function uxe(e,t,n){var r=n||!1,i=tP(lxe,VW,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:HW,key:u})},a=function(u,d,h){var m={type:iP,payload:d,err:h,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=f8({},i,{purge:function(){var u=[];return e.dispatch({type:zW,result:function(h){u.push(h)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:BW,result:function(h){u.push(h)}}),Promise.all(u)},pause:function(){e.dispatch({type:FW})},persist:function(){e.dispatch({type:$W,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var oP={},aP={};aP.__esModule=!0;aP.default=fxe;function N4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?N4=function(n){return typeof n}:N4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},N4(e)}function wC(){}var cxe={getItem:wC,setItem:wC,removeItem:wC};function dxe(e){if((typeof self>"u"?"undefined":N4(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function fxe(e){var t="".concat(e,"Storage");return dxe(t)?self[t]:cxe}oP.__esModule=!0;oP.default=gxe;var hxe=pxe(aP);function pxe(e){return e&&e.__esModule?e:{default:e}}function gxe(e){var t=(0,hxe.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var WW=void 0,mxe=vxe(oP);function vxe(e){return e&&e.__esModule?e:{default:e}}var yxe=(0,mxe.default)("local");WW=yxe;var UW={},GW={},np={};Object.defineProperty(np,"__esModule",{value:!0});np.PLACEHOLDER_UNDEFINED=np.PACKAGE_NAME=void 0;np.PACKAGE_NAME="redux-deep-persist";np.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var sP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(sP);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=np,n=sP,r=function(G){return typeof G=="object"&&G!==null};e.isObjectLike=r;const i=function(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(G){return(0,e.isLength)(G&&G.length)&&Object.prototype.toString.call(G)==="[object Array]"};const o=function(G){return!!G&&typeof G=="object"&&!(0,e.isArray)(G)};e.isPlainObject=o;const a=function(G){return String(~~G)===G&&Number(G)>=0};e.isIntegerString=a;const s=function(G){return Object.prototype.toString.call(G)==="[object String]"};e.isString=s;const l=function(G){return Object.prototype.toString.call(G)==="[object Date]"};e.isDate=l;const u=function(G){return Object.keys(G).length===0};e.isEmpty=u;const d=Object.prototype.hasOwnProperty,h=function(G,F,W){W||(W=new Set([G])),F||(F="");for(const X in G){const Z=F?`${F}.${X}`:X,U=G[X];if((0,e.isObjectLike)(U))return W.has(U)?`${F}.${X}:`:(W.add(U),(0,e.getCircularPath)(U,Z,W))}return null};e.getCircularPath=h;const m=function(G){if(!(0,e.isObjectLike)(G))return G;if((0,e.isDate)(G))return new Date(+G);const F=(0,e.isArray)(G)?[]:{};for(const W in G){const X=G[W];F[W]=(0,e._cloneDeep)(X)}return F};e._cloneDeep=m;const y=function(G){const F=(0,e.getCircularPath)(G);if(F)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${F}' of object you're trying to persist: ${G}`);return(0,e._cloneDeep)(G)};e.cloneDeep=y;const b=function(G,F){if(G===F)return{};if(!(0,e.isObjectLike)(G)||!(0,e.isObjectLike)(F))return F;const W=(0,e.cloneDeep)(G),X=(0,e.cloneDeep)(F),Z=Object.keys(W).reduce((Q,re)=>(d.call(X,re)||(Q[re]=void 0),Q),{});if((0,e.isDate)(W)||(0,e.isDate)(X))return W.valueOf()===X.valueOf()?{}:X;const U=Object.keys(X).reduce((Q,re)=>{if(!d.call(W,re))return Q[re]=X[re],Q;const fe=(0,e.difference)(W[re],X[re]);return(0,e.isObjectLike)(fe)&&(0,e.isEmpty)(fe)&&!(0,e.isDate)(fe)?(0,e.isArray)(W)&&!(0,e.isArray)(X)||!(0,e.isArray)(W)&&(0,e.isArray)(X)?X:Q:(Q[re]=fe,Q)},Z);return delete U._persist,U};e.difference=b;const x=function(G,F){return F.reduce((W,X)=>{if(W){const Z=parseInt(X,10),U=(0,e.isIntegerString)(X)&&Z<0?W.length+Z:X;return(0,e.isString)(W)?W.charAt(U):W[U]}},G)};e.path=x;const k=function(G,F){return[...G].reverse().reduce((Z,U,Q)=>{const re=(0,e.isIntegerString)(U)?[]:{};return re[U]=Q===0?F:Z,re},{})};e.assocPath=k;const E=function(G,F){const W=(0,e.cloneDeep)(G);return F.reduce((X,Z,U)=>(U===F.length-1&&X&&(0,e.isObjectLike)(X)&&delete X[Z],X&&X[Z]),W),W};e.dissocPath=E;const _=function(G,F,...W){if(!W||!W.length)return F;const X=W.shift(),{preservePlaceholder:Z,preserveUndefined:U}=G;if((0,e.isObjectLike)(F)&&(0,e.isObjectLike)(X))for(const Q in X)if((0,e.isObjectLike)(X[Q])&&(0,e.isObjectLike)(F[Q]))F[Q]||(F[Q]={}),_(G,F[Q],X[Q]);else if((0,e.isArray)(F)){let re=X[Q];const fe=Z?t.PLACEHOLDER_UNDEFINED:void 0;U||(re=typeof re<"u"?re:F[parseInt(Q,10)]),re=re!==t.PLACEHOLDER_UNDEFINED?re:fe,F[parseInt(Q,10)]=re}else{const re=X[Q]!==t.PLACEHOLDER_UNDEFINED?X[Q]:void 0;F[Q]=re}return _(G,F,...W)},P=function(G,F,W){return _({preservePlaceholder:W==null?void 0:W.preservePlaceholder,preserveUndefined:W==null?void 0:W.preserveUndefined},(0,e.cloneDeep)(G),(0,e.cloneDeep)(F))};e.mergeDeep=P;const A=function(G,F=[],W,X,Z){if(!(0,e.isObjectLike)(G))return G;for(const U in G){const Q=G[U],re=(0,e.isArray)(G),fe=X?X+"."+U:U;Q===null&&(W===n.ConfigType.WHITELIST&&F.indexOf(fe)===-1||W===n.ConfigType.BLACKLIST&&F.indexOf(fe)!==-1)&&re&&(G[parseInt(U,10)]=void 0),Q===void 0&&Z&&W===n.ConfigType.BLACKLIST&&F.indexOf(fe)===-1&&re&&(G[parseInt(U,10)]=t.PLACEHOLDER_UNDEFINED),A(Q,F,W,fe,Z)}},M=function(G,F,W,X){const Z=(0,e.cloneDeep)(G);return A(Z,F,W,"",X),Z};e.preserveUndefined=M;const R=function(G,F,W){return W.indexOf(G)===F};e.unique=R;const D=function(G){return G.reduce((F,W)=>{const X=G.filter(Ee=>Ee===W),Z=G.filter(Ee=>(W+".").indexOf(Ee+".")===0),{duplicates:U,subsets:Q}=F,re=X.length>1&&U.indexOf(W)===-1,fe=Z.length>1;return{duplicates:[...U,...re?X:[]],subsets:[...Q,...fe?Z:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=D;const j=function(G,F,W){const X=W===n.ConfigType.WHITELIST?"whitelist":"blacklist",Z=`${t.PACKAGE_NAME}: incorrect ${X} configuration.`,U=`Check your create${W===n.ConfigType.WHITELIST?"White":"Black"}list arguments. + */var qE=Symbol.for("react.element"),YE=Symbol.for("react.portal"),Tx=Symbol.for("react.fragment"),Lx=Symbol.for("react.strict_mode"),Ax=Symbol.for("react.profiler"),Ox=Symbol.for("react.provider"),Mx=Symbol.for("react.context"),B5e=Symbol.for("react.server_context"),Ix=Symbol.for("react.forward_ref"),Rx=Symbol.for("react.suspense"),Dx=Symbol.for("react.suspense_list"),Nx=Symbol.for("react.memo"),jx=Symbol.for("react.lazy"),$5e=Symbol.for("react.offscreen"),EW;EW=Symbol.for("react.module.reference");function ms(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case qE:switch(e=e.type,e){case Tx:case Ax:case Lx:case Rx:case Dx:return e;default:switch(e=e&&e.$$typeof,e){case B5e:case Mx:case Ix:case jx:case Nx:case Ox:return e;default:return t}}case YE:return t}}}Fn.ContextConsumer=Mx;Fn.ContextProvider=Ox;Fn.Element=qE;Fn.ForwardRef=Ix;Fn.Fragment=Tx;Fn.Lazy=jx;Fn.Memo=Nx;Fn.Portal=YE;Fn.Profiler=Ax;Fn.StrictMode=Lx;Fn.Suspense=Rx;Fn.SuspenseList=Dx;Fn.isAsyncMode=function(){return!1};Fn.isConcurrentMode=function(){return!1};Fn.isContextConsumer=function(e){return ms(e)===Mx};Fn.isContextProvider=function(e){return ms(e)===Ox};Fn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===qE};Fn.isForwardRef=function(e){return ms(e)===Ix};Fn.isFragment=function(e){return ms(e)===Tx};Fn.isLazy=function(e){return ms(e)===jx};Fn.isMemo=function(e){return ms(e)===Nx};Fn.isPortal=function(e){return ms(e)===YE};Fn.isProfiler=function(e){return ms(e)===Ax};Fn.isStrictMode=function(e){return ms(e)===Lx};Fn.isSuspense=function(e){return ms(e)===Rx};Fn.isSuspenseList=function(e){return ms(e)===Dx};Fn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Tx||e===Ax||e===Lx||e===Rx||e===Dx||e===$5e||typeof e=="object"&&e!==null&&(e.$$typeof===jx||e.$$typeof===Nx||e.$$typeof===Ox||e.$$typeof===Mx||e.$$typeof===Ix||e.$$typeof===EW||e.getModuleId!==void 0)};Fn.typeOf=ms;(function(e){e.exports=Fn})(j5e);function F5e(){const e=O5e();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const xI={notify(){},get:()=>[]};function z5e(e,t){let n,r=xI;function i(h){return l(),r.subscribe(h)}function o(){r.notify()}function a(){d.onStateChange&&d.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=F5e())}function u(){n&&(n(),n=void 0,r.clear(),r=xI)}const d={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return d}const H5e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",V5e=H5e?w.useLayoutEffect:w.useEffect;function W5e({store:e,context:t,children:n,serverState:r}){const i=w.useMemo(()=>{const s=z5e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=w.useMemo(()=>e.getState(),[e]);V5e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]);const a=t||ef;return N.createElement(a.Provider,{value:i},n)}function PW(e=ef){const t=e===ef?_W:()=>w.useContext(e);return function(){const{store:r}=t();return r}}const U5e=PW();function G5e(e=ef){const t=e===ef?U5e:PW(e);return function(){return t().dispatch}}const q5e=G5e();I5e(i8.useSyncExternalStoreWithSelector);A5e(el.unstable_batchedUpdates);function I4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?I4=function(n){return typeof n}:I4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},I4(e)}function Y5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:KE(e)?2:XE(e)?3:0}function $m(e,t){return T0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Q5e(e,t){return T0(e)===2?e.get(t):e[t]}function LW(e,t,n){var r=T0(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function AW(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function KE(e){return iSe&&e instanceof Map}function XE(e){return oSe&&e instanceof Set}function vh(e){return e.o||e.t}function ZE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=MW(e);delete t[yr];for(var n=Fm(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=J5e),Object.freeze(e),t&&np(e,function(n,r){return QE(r,!0)},!0)),e}function J5e(){Ws(2)}function JE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function nu(e){var t=c8[e];return t||Ws(18,e),t}function eSe(e,t){c8[e]||(c8[e]=t)}function s8(){return ny}function gC(e,t){t&&(nu("Patches"),e.u=[],e.s=[],e.v=t)}function z5(e){l8(e),e.p.forEach(tSe),e.p=null}function l8(e){e===ny&&(ny=e.l)}function CI(e){return ny={p:[],l:ny,h:e,m:!0,_:0}}function tSe(e){var t=e[yr];t.i===0||t.i===1?t.j():t.O=!0}function mC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||nu("ES5").S(t,e,r),r?(n[yr].P&&(z5(t),Ws(4)),sc(e)&&(e=H5(t,e),t.l||V5(t,e)),t.u&&nu("Patches").M(n[yr].t,e,t.u,t.s)):e=H5(t,n,[]),z5(t),t.u&&t.v(t.u,t.s),e!==OW?e:void 0}function H5(e,t,n){if(JE(t))return t;var r=t[yr];if(!r)return np(t,function(o,a){return _I(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return V5(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=ZE(r.k):r.o;np(r.i===3?new Set(i):i,function(o,a){return _I(e,r,i,o,a,n)}),V5(e,i,!1),n&&e.u&&nu("Patches").R(r,n,e.u,e.s)}return r.o}function _I(e,t,n,r,i,o){if(tf(i)){var a=H5(e,i,o&&t&&t.i!==3&&!$m(t.D,r)?o.concat(r):void 0);if(LW(n,r,a),!tf(a))return;e.m=!1}if(sc(i)&&!JE(i)){if(!e.h.F&&e._<1)return;H5(e,i),t&&t.A.l||V5(e,i)}}function V5(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&QE(t,n)}function vC(e,t){var n=e[yr];return(n?vh(n):e)[t]}function kI(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function wd(e){e.P||(e.P=!0,e.l&&wd(e.l))}function yC(e){e.o||(e.o=ZE(e.t))}function u8(e,t,n){var r=KE(t)?nu("MapSet").N(t,n):XE(t)?nu("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:s8(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=ry;a&&(l=[s],u=Av);var d=Proxy.revocable(l,u),h=d.revoke,m=d.proxy;return s.k=m,s.j=h,m}(t,n):nu("ES5").J(t,n);return(n?n.A:s8()).p.push(r),r}function nSe(e){return tf(e)||Ws(22,e),function t(n){if(!sc(n))return n;var r,i=n[yr],o=T0(n);if(i){if(!i.P&&(i.i<4||!nu("ES5").K(i)))return i.t;i.I=!0,r=EI(n,o),i.I=!1}else r=EI(n,o);return np(r,function(a,s){i&&Q5e(i.t,a)===s||LW(r,a,t(s))}),o===3?new Set(r):r}(e)}function EI(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return ZE(e)}function rSe(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[yr];return ry.get(l,o)},set:function(l){var u=this[yr];ry.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][yr];if(!s.P)switch(s.i){case 5:r(s)&&wd(s);break;case 4:n(s)&&wd(s)}}}function n(o){for(var a=o.t,s=o.k,l=Fm(s),u=l.length-1;u>=0;u--){var d=l[u];if(d!==yr){var h=a[d];if(h===void 0&&!$m(a,d))return!0;var m=s[d],y=m&&m[yr];if(y?y.t!==h:!AW(m,h))return!0}}var b=!!a[yr];return l.length!==Fm(a).length+(b?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?E-1:0),P=1;P1?d-1:0),m=1;m=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=nu("Patches").$;return tf(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Ra=new sSe,IW=Ra.produce;Ra.produceWithPatches.bind(Ra);Ra.setAutoFreeze.bind(Ra);Ra.setUseProxies.bind(Ra);Ra.applyPatches.bind(Ra);Ra.createDraft.bind(Ra);Ra.finishDraft.bind(Ra);function AI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OI(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(io(1));return n(tP)(e,t)}if(typeof e!="function")throw new Error(io(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function d(){if(l)throw new Error(io(3));return o}function h(x){if(typeof x!="function")throw new Error(io(4));if(l)throw new Error(io(5));var k=!0;return u(),s.push(x),function(){if(k){if(l)throw new Error(io(6));k=!1,u();var _=s.indexOf(x);s.splice(_,1),a=null}}}function m(x){if(!lSe(x))throw new Error(io(7));if(typeof x.type>"u")throw new Error(io(8));if(l)throw new Error(io(9));try{l=!0,o=i(o,x)}finally{l=!1}for(var k=a=s,E=0;E"u")throw new Error(io(12));if(typeof n(void 0,{type:W5.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(io(13))})}function RW(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(io(14));h[y]=k,d=d||k!==x}return d=d||o.length!==Object.keys(l).length,d?h:l}}function U5(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return G5}function i(s,l){r(s)===G5&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var hSe=function(t,n){return t===n};function pSe(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(R).forEach(function(D){P(D)&&d[D]!==R[D]&&m.indexOf(D)===-1&&m.push(D)}),Object.keys(d).forEach(function(D){R[D]===void 0&&P(D)&&m.indexOf(D)===-1&&d[D]!==void 0&&m.push(D)}),y===null&&(y=setInterval(E,i)),d=R},o)}function E(){if(m.length===0){y&&clearInterval(y),y=null;return}var R=m.shift(),D=r.reduce(function(j,z){return z.in(j,R,d)},d[R]);if(D!==void 0)try{h[R]=l(D)}catch(j){console.error("redux-persist/createPersistoid: error serializing state",j)}else delete h[R];m.length===0&&_()}function _(){Object.keys(h).forEach(function(R){d[R]===void 0&&delete h[R]}),b=s.setItem(a,l(h)).catch(A)}function P(R){return!(n&&n.indexOf(R)===-1&&R!=="_persist"||t&&t.indexOf(R)!==-1)}function A(R){u&&u(R)}var M=function(){for(;m.length!==0;)E();return b||Promise.resolve()};return{update:k,flush:M}}function YSe(e){return JSON.stringify(e)}function KSe(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:rP).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=XSe,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,d){return d.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function XSe(e){return JSON.parse(e)}function ZSe(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:rP).concat(e.key);return t.removeItem(n,QSe)}function QSe(e){}function $I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zu(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function txe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var nxe=5e3;function rxe(e,t){var n=e.version!==void 0?e.version:VSe;e.debug;var r=e.stateReconciler===void 0?GSe:e.stateReconciler,i=e.getStoredState||KSe,o=e.timeout!==void 0?e.timeout:nxe,a=null,s=!1,l=!0,u=function(h){return h._persist.rehydrated&&a&&!l&&a.update(h),h};return function(d,h){var m=d||{},y=m._persist,b=exe(m,["_persist"]),x=b;if(h.type===FW){var k=!1,E=function(j,z){k||(h.rehydrate(e.key,j,z),k=!0)};if(o&&setTimeout(function(){!k&&E(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=qSe(e)),y)return zu({},t(x,h),{_persist:y});if(typeof h.rehydrate!="function"||typeof h.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return h.register(e.key),i(e).then(function(D){var j=e.migrate||function(z,H){return Promise.resolve(z)};j(D,n).then(function(z){E(z)},function(z){E(void 0,z)})},function(D){E(void 0,D)}),zu({},t(x,h),{_persist:{version:n,rehydrated:!1}})}else{if(h.type===zW)return s=!0,h.result(ZSe(e)),zu({},t(x,h),{_persist:y});if(h.type===BW)return h.result(a&&a.flush()),zu({},t(x,h),{_persist:y});if(h.type===$W)l=!0;else if(h.type===iP){if(s)return zu({},x,{_persist:zu({},y,{rehydrated:!0})});if(h.key===e.key){var _=t(x,h),P=h.payload,A=r!==!1&&P!==void 0?r(P,d,_,e):_,M=zu({},A,{_persist:zu({},y,{rehydrated:!0})});return u(M)}}}if(!y)return t(d,h);var R=t(x,h);return R===x?d:u(zu({},R,{_persist:y}))}}function FI(e){return axe(e)||oxe(e)||ixe()}function ixe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function oxe(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function axe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:VW,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case HW:return f8({},t,{registry:[].concat(FI(t.registry),[n.key])});case iP:var r=t.registry.indexOf(n.key),i=FI(t.registry);return i.splice(r,1),f8({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function uxe(e,t,n){var r=n||!1,i=tP(lxe,VW,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:HW,key:u})},a=function(u,d,h){var m={type:iP,payload:d,err:h,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=f8({},i,{purge:function(){var u=[];return e.dispatch({type:zW,result:function(h){u.push(h)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:BW,result:function(h){u.push(h)}}),Promise.all(u)},pause:function(){e.dispatch({type:$W})},persist:function(){e.dispatch({type:FW,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var oP={},aP={};aP.__esModule=!0;aP.default=fxe;function j4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j4=function(n){return typeof n}:j4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},j4(e)}function wC(){}var cxe={getItem:wC,setItem:wC,removeItem:wC};function dxe(e){if((typeof self>"u"?"undefined":j4(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function fxe(e){var t="".concat(e,"Storage");return dxe(t)?self[t]:cxe}oP.__esModule=!0;oP.default=gxe;var hxe=pxe(aP);function pxe(e){return e&&e.__esModule?e:{default:e}}function gxe(e){var t=(0,hxe.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var WW=void 0,mxe=vxe(oP);function vxe(e){return e&&e.__esModule?e:{default:e}}var yxe=(0,mxe.default)("local");WW=yxe;var UW={},GW={},rp={};Object.defineProperty(rp,"__esModule",{value:!0});rp.PLACEHOLDER_UNDEFINED=rp.PACKAGE_NAME=void 0;rp.PACKAGE_NAME="redux-deep-persist";rp.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var sP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(sP);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=rp,n=sP,r=function(G){return typeof G=="object"&&G!==null};e.isObjectLike=r;const i=function(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(G){return(0,e.isLength)(G&&G.length)&&Object.prototype.toString.call(G)==="[object Array]"};const o=function(G){return!!G&&typeof G=="object"&&!(0,e.isArray)(G)};e.isPlainObject=o;const a=function(G){return String(~~G)===G&&Number(G)>=0};e.isIntegerString=a;const s=function(G){return Object.prototype.toString.call(G)==="[object String]"};e.isString=s;const l=function(G){return Object.prototype.toString.call(G)==="[object Date]"};e.isDate=l;const u=function(G){return Object.keys(G).length===0};e.isEmpty=u;const d=Object.prototype.hasOwnProperty,h=function(G,$,W){W||(W=new Set([G])),$||($="");for(const X in G){const Z=$?`${$}.${X}`:X,U=G[X];if((0,e.isObjectLike)(U))return W.has(U)?`${$}.${X}:`:(W.add(U),(0,e.getCircularPath)(U,Z,W))}return null};e.getCircularPath=h;const m=function(G){if(!(0,e.isObjectLike)(G))return G;if((0,e.isDate)(G))return new Date(+G);const $=(0,e.isArray)(G)?[]:{};for(const W in G){const X=G[W];$[W]=(0,e._cloneDeep)(X)}return $};e._cloneDeep=m;const y=function(G){const $=(0,e.getCircularPath)(G);if($)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${$}' of object you're trying to persist: ${G}`);return(0,e._cloneDeep)(G)};e.cloneDeep=y;const b=function(G,$){if(G===$)return{};if(!(0,e.isObjectLike)(G)||!(0,e.isObjectLike)($))return $;const W=(0,e.cloneDeep)(G),X=(0,e.cloneDeep)($),Z=Object.keys(W).reduce((Q,re)=>(d.call(X,re)||(Q[re]=void 0),Q),{});if((0,e.isDate)(W)||(0,e.isDate)(X))return W.valueOf()===X.valueOf()?{}:X;const U=Object.keys(X).reduce((Q,re)=>{if(!d.call(W,re))return Q[re]=X[re],Q;const he=(0,e.difference)(W[re],X[re]);return(0,e.isObjectLike)(he)&&(0,e.isEmpty)(he)&&!(0,e.isDate)(he)?(0,e.isArray)(W)&&!(0,e.isArray)(X)||!(0,e.isArray)(W)&&(0,e.isArray)(X)?X:Q:(Q[re]=he,Q)},Z);return delete U._persist,U};e.difference=b;const x=function(G,$){return $.reduce((W,X)=>{if(W){const Z=parseInt(X,10),U=(0,e.isIntegerString)(X)&&Z<0?W.length+Z:X;return(0,e.isString)(W)?W.charAt(U):W[U]}},G)};e.path=x;const k=function(G,$){return[...G].reverse().reduce((Z,U,Q)=>{const re=(0,e.isIntegerString)(U)?[]:{};return re[U]=Q===0?$:Z,re},{})};e.assocPath=k;const E=function(G,$){const W=(0,e.cloneDeep)(G);return $.reduce((X,Z,U)=>(U===$.length-1&&X&&(0,e.isObjectLike)(X)&&delete X[Z],X&&X[Z]),W),W};e.dissocPath=E;const _=function(G,$,...W){if(!W||!W.length)return $;const X=W.shift(),{preservePlaceholder:Z,preserveUndefined:U}=G;if((0,e.isObjectLike)($)&&(0,e.isObjectLike)(X))for(const Q in X)if((0,e.isObjectLike)(X[Q])&&(0,e.isObjectLike)($[Q]))$[Q]||($[Q]={}),_(G,$[Q],X[Q]);else if((0,e.isArray)($)){let re=X[Q];const he=Z?t.PLACEHOLDER_UNDEFINED:void 0;U||(re=typeof re<"u"?re:$[parseInt(Q,10)]),re=re!==t.PLACEHOLDER_UNDEFINED?re:he,$[parseInt(Q,10)]=re}else{const re=X[Q]!==t.PLACEHOLDER_UNDEFINED?X[Q]:void 0;$[Q]=re}return _(G,$,...W)},P=function(G,$,W){return _({preservePlaceholder:W==null?void 0:W.preservePlaceholder,preserveUndefined:W==null?void 0:W.preserveUndefined},(0,e.cloneDeep)(G),(0,e.cloneDeep)($))};e.mergeDeep=P;const A=function(G,$=[],W,X,Z){if(!(0,e.isObjectLike)(G))return G;for(const U in G){const Q=G[U],re=(0,e.isArray)(G),he=X?X+"."+U:U;Q===null&&(W===n.ConfigType.WHITELIST&&$.indexOf(he)===-1||W===n.ConfigType.BLACKLIST&&$.indexOf(he)!==-1)&&re&&(G[parseInt(U,10)]=void 0),Q===void 0&&Z&&W===n.ConfigType.BLACKLIST&&$.indexOf(he)===-1&&re&&(G[parseInt(U,10)]=t.PLACEHOLDER_UNDEFINED),A(Q,$,W,he,Z)}},M=function(G,$,W,X){const Z=(0,e.cloneDeep)(G);return A(Z,$,W,"",X),Z};e.preserveUndefined=M;const R=function(G,$,W){return W.indexOf(G)===$};e.unique=R;const D=function(G){return G.reduce(($,W)=>{const X=G.filter(Ee=>Ee===W),Z=G.filter(Ee=>(W+".").indexOf(Ee+".")===0),{duplicates:U,subsets:Q}=$,re=X.length>1&&U.indexOf(W)===-1,he=Z.length>1;return{duplicates:[...U,...re?X:[]],subsets:[...Q,...he?Z:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=D;const j=function(G,$,W){const X=W===n.ConfigType.WHITELIST?"whitelist":"blacklist",Z=`${t.PACKAGE_NAME}: incorrect ${X} configuration.`,U=`Check your create${W===n.ConfigType.WHITELIST?"White":"Black"}list arguments. -`;if(!(0,e.isString)(F)||F.length<1)throw new Error(`${Z} Name (key) of reducer is required. ${U}`);if(!G||!G.length)return;const{duplicates:Q,subsets:re}=(0,e.findDuplicatesAndSubsets)(G);if(Q.length>1)throw new Error(`${Z} Duplicated paths. +`;if(!(0,e.isString)($)||$.length<1)throw new Error(`${Z} Name (key) of reducer is required. ${U}`);if(!G||!G.length)return;const{duplicates:Q,subsets:re}=(0,e.findDuplicatesAndSubsets)(G);if(Q.length>1)throw new Error(`${Z} Duplicated paths. ${JSON.stringify(Q)} @@ -441,23 +441,23 @@ Error generating stack: `+o.message+` ${JSON.stringify(re)} - ${U}`)};e.singleTransformValidator=j;const z=function(G){if(!(0,e.isArray)(G))return;const F=(G==null?void 0:G.map(W=>W.deepPersistKey).filter(W=>W))||[];if(F.length){const W=F.filter((X,Z)=>F.indexOf(X)!==Z);if(W.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. + ${U}`)};e.singleTransformValidator=j;const z=function(G){if(!(0,e.isArray)(G))return;const $=(G==null?void 0:G.map(W=>W.deepPersistKey).filter(W=>W))||[];if($.length){const W=$.filter((X,Z)=>$.indexOf(X)!==Z);if(W.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. - Duplicates: ${JSON.stringify(W)}`)}};e.transformsValidator=z;const H=function({whitelist:G,blacklist:F}){if(G&&G.length&&F&&F.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(G){const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)(G);(0,e.throwError)({duplicates:W,subsets:X},"whitelist")}if(F){const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)(F);(0,e.throwError)({duplicates:W,subsets:X},"blacklist")}};e.configValidator=H;const K=function({duplicates:G,subsets:F},W){if(G.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${W}. + Duplicates: ${JSON.stringify(W)}`)}};e.transformsValidator=z;const H=function({whitelist:G,blacklist:$}){if(G&&G.length&&$&&$.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(G){const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)(G);(0,e.throwError)({duplicates:W,subsets:X},"whitelist")}if($){const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)($);(0,e.throwError)({duplicates:W,subsets:X},"blacklist")}};e.configValidator=H;const K=function({duplicates:G,subsets:$},W){if(G.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${W}. - ${JSON.stringify(G)}`);if(F.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${W}. You must decide if you want to persist an entire path or its specific subset. + ${JSON.stringify(G)}`);if($.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${W}. You must decide if you want to persist an entire path or its specific subset. - ${JSON.stringify(F)}`)};e.throwError=K;const te=function(G){return(0,e.isArray)(G)?G.filter(e.unique).reduce((F,W)=>{const X=W.split("."),Z=X[0],U=X.slice(1).join(".")||void 0,Q=F.filter(fe=>Object.keys(fe)[0]===Z)[0],re=Q?Object.values(Q)[0]:void 0;return Q||F.push({[Z]:U?[U]:void 0}),Q&&!re&&U&&(Q[Z]=[U]),Q&&re&&U&&re.push(U),F},[]):[]};e.getRootKeysGroup=te})(GW);(function(e){var t=_o&&_o.__rest||function(h,m){var y={};for(var b in h)Object.prototype.hasOwnProperty.call(h,b)&&m.indexOf(b)<0&&(y[b]=h[b]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,b=Object.getOwnPropertySymbols(h);x!k(_)&&h?h(E,_,P):E,out:(E,_,P)=>!k(_)&&m?m(E,_,P):E,deepPersistKey:b&&b[0]}},a=(h,m,y,{debug:b,whitelist:x,blacklist:k,transforms:E})=>{if(x||k)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(E);const _=(0,n.cloneDeep)(y);let P=h;if(P&&(0,n.isObjectLike)(P)){const A=(0,n.difference)(m,y);(0,n.isEmpty)(A)||(P=(0,n.mergeDeep)(h,A,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(A)}`)),Object.keys(P).forEach(M=>{if(M!=="_persist"){if((0,n.isObjectLike)(_[M])){_[M]=(0,n.mergeDeep)(_[M],P[M]);return}_[M]=P[M]}})}return b&&P&&(0,n.isObjectLike)(P)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(P)}`),_};e.autoMergeDeep=a;const s=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.WHITELIST),o(y=>{if(!m||!m.length)return y;let b=null,x;return m.forEach(k=>{const E=k.split(".");x=(0,n.path)(y,E),typeof x>"u"&&(0,n.isIntegerString)(E[E.length-1])&&(x=r.PLACEHOLDER_UNDEFINED);const _=(0,n.assocPath)(E,x),P=(0,n.isArray)(_)?[]:{};b=(0,n.mergeDeep)(b||P,_,{preservePlaceholder:!0})}),b||y},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.WHITELIST),{whitelist:[h]}));e.createWhitelist=s;const l=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.BLACKLIST),o(y=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST,!0);return m.map(k=>k.split(".")).reduce((k,E)=>(0,n.dissocPath)(k,E),b)},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST),{whitelist:[h]}));e.createBlacklist=l;const u=function(h,m){return m.map(y=>{const b=Object.keys(y)[0],x=y[b];return h===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,x):(0,e.createBlacklist)(b,x)})};e.getTransforms=u;const d=h=>{var{key:m,whitelist:y,blacklist:b,storage:x,transforms:k,rootReducer:E}=h,_=t(h,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:y,blacklist:b});const P=(0,n.getRootKeysGroup)(y),A=(0,n.getRootKeysGroup)(b),M=Object.keys(E(void 0,{type:""})),R=P.map(te=>Object.keys(te)[0]),D=A.map(te=>Object.keys(te)[0]),j=M.filter(te=>R.indexOf(te)===-1&&D.indexOf(te)===-1),z=(0,e.getTransforms)(i.ConfigType.WHITELIST,P),H=(0,e.getTransforms)(i.ConfigType.BLACKLIST,A),K=(0,n.isArray)(y)?j.map(te=>(0,e.createBlacklist)(te)):[];return Object.assign(Object.assign({},_),{key:m,storage:x,transforms:[...z,...H,...K,...k||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=d})(UW);const Ld=(e,t)=>Math.floor(e/t)*t,Yl=(e,t)=>Math.round(e/t)*t;var ke={},bxe={get exports(){return ke},set exports(e){ke=e}};/** + ${JSON.stringify($)}`)};e.throwError=K;const te=function(G){return(0,e.isArray)(G)?G.filter(e.unique).reduce(($,W)=>{const X=W.split("."),Z=X[0],U=X.slice(1).join(".")||void 0,Q=$.filter(he=>Object.keys(he)[0]===Z)[0],re=Q?Object.values(Q)[0]:void 0;return Q||$.push({[Z]:U?[U]:void 0}),Q&&!re&&U&&(Q[Z]=[U]),Q&&re&&U&&re.push(U),$},[]):[]};e.getRootKeysGroup=te})(GW);(function(e){var t=_o&&_o.__rest||function(h,m){var y={};for(var b in h)Object.prototype.hasOwnProperty.call(h,b)&&m.indexOf(b)<0&&(y[b]=h[b]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,b=Object.getOwnPropertySymbols(h);x!k(_)&&h?h(E,_,P):E,out:(E,_,P)=>!k(_)&&m?m(E,_,P):E,deepPersistKey:b&&b[0]}},a=(h,m,y,{debug:b,whitelist:x,blacklist:k,transforms:E})=>{if(x||k)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(E);const _=(0,n.cloneDeep)(y);let P=h;if(P&&(0,n.isObjectLike)(P)){const A=(0,n.difference)(m,y);(0,n.isEmpty)(A)||(P=(0,n.mergeDeep)(h,A,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(A)}`)),Object.keys(P).forEach(M=>{if(M!=="_persist"){if((0,n.isObjectLike)(_[M])){_[M]=(0,n.mergeDeep)(_[M],P[M]);return}_[M]=P[M]}})}return b&&P&&(0,n.isObjectLike)(P)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(P)}`),_};e.autoMergeDeep=a;const s=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.WHITELIST),o(y=>{if(!m||!m.length)return y;let b=null,x;return m.forEach(k=>{const E=k.split(".");x=(0,n.path)(y,E),typeof x>"u"&&(0,n.isIntegerString)(E[E.length-1])&&(x=r.PLACEHOLDER_UNDEFINED);const _=(0,n.assocPath)(E,x),P=(0,n.isArray)(_)?[]:{};b=(0,n.mergeDeep)(b||P,_,{preservePlaceholder:!0})}),b||y},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.WHITELIST),{whitelist:[h]}));e.createWhitelist=s;const l=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.BLACKLIST),o(y=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST,!0);return m.map(k=>k.split(".")).reduce((k,E)=>(0,n.dissocPath)(k,E),b)},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST),{whitelist:[h]}));e.createBlacklist=l;const u=function(h,m){return m.map(y=>{const b=Object.keys(y)[0],x=y[b];return h===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,x):(0,e.createBlacklist)(b,x)})};e.getTransforms=u;const d=h=>{var{key:m,whitelist:y,blacklist:b,storage:x,transforms:k,rootReducer:E}=h,_=t(h,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:y,blacklist:b});const P=(0,n.getRootKeysGroup)(y),A=(0,n.getRootKeysGroup)(b),M=Object.keys(E(void 0,{type:""})),R=P.map(te=>Object.keys(te)[0]),D=A.map(te=>Object.keys(te)[0]),j=M.filter(te=>R.indexOf(te)===-1&&D.indexOf(te)===-1),z=(0,e.getTransforms)(i.ConfigType.WHITELIST,P),H=(0,e.getTransforms)(i.ConfigType.BLACKLIST,A),K=(0,n.isArray)(y)?j.map(te=>(0,e.createBlacklist)(te)):[];return Object.assign(Object.assign({},_),{key:m,storage:x,transforms:[...z,...H,...K,...k||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=d})(UW);const Ld=(e,t)=>Math.floor(e/t)*t,Yl=(e,t)=>Math.round(e/t)*t;var ke={},bxe={get exports(){return ke},set exports(e){ke=e}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,m=2,y=4,b=1,x=2,k=1,E=2,_=4,P=8,A=16,M=32,R=64,D=128,j=256,z=512,H=30,K="...",te=800,G=16,F=1,W=2,X=3,Z=1/0,U=9007199254740991,Q=17976931348623157e292,re=0/0,fe=4294967295,Ee=fe-1,be=fe>>>1,ye=[["ary",D],["bind",k],["bindKey",E],["curry",P],["curryRight",A],["flip",z],["partial",M],["partialRight",R],["rearg",j]],ze="[object Arguments]",Me="[object Array]",rt="[object AsyncFunction]",We="[object Boolean]",Be="[object Date]",wt="[object DOMException]",Fe="[object Error]",at="[object Function]",bt="[object GeneratorFunction]",Le="[object Map]",ut="[object Number]",Mt="[object Null]",ct="[object Object]",_t="[object Promise]",un="[object Proxy]",ae="[object RegExp]",De="[object Set]",Ke="[object String]",Xe="[object Symbol]",xe="[object Undefined]",Ne="[object WeakMap]",Ct="[object WeakSet]",Dt="[object ArrayBuffer]",Te="[object DataView]",At="[object Float32Array]",He="[object Float64Array]",vt="[object Int8Array]",nn="[object Int16Array]",Rn="[object Int32Array]",Ze="[object Uint8Array]",xt="[object Uint8ClampedArray]",ht="[object Uint16Array]",Ht="[object Uint32Array]",rn=/\b__p \+= '';/g,gr=/\b(__p \+=) '' \+/g,Io=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Mi=/&(?:amp|lt|gt|quot|#39);/g,ol=/[&<>"']/g,N0=RegExp(Mi.source),Fa=RegExp(ol.source),Lp=/<%-([\s\S]+?)%>/g,j0=/<%([\s\S]+?)%>/g,Sc=/<%=([\s\S]+?)%>/g,Ap=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Op=/^\w*$/,oa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sf=/[\\^$.*+?()[\]{}|]/g,B0=RegExp(Sf.source),xc=/^\s+/,xf=/\s/,F0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,al=/\{\n\/\* \[wrapped with (.+)\] \*/,wc=/,? & /,$0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,z0=/[()=,{}\[\]\/\s]/,H0=/\\(\\)?/g,V0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vs=/\w*$/,W0=/^[-+]0x[0-9a-f]+$/i,U0=/^0b[01]+$/i,G0=/^\[object .+?Constructor\]$/,q0=/^0o[0-7]+$/i,Y0=/^(?:0|[1-9]\d*)$/,K0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sl=/($^)/,X0=/['\n\r\u2028\u2029\\]/g,ys="\\ud800-\\udfff",bu="\\u0300-\\u036f",Su="\\ufe20-\\ufe2f",ll="\\u20d0-\\u20ff",xu=bu+Su+ll,Mp="\\u2700-\\u27bf",Cc="a-z\\xdf-\\xf6\\xf8-\\xff",ul="\\xac\\xb1\\xd7\\xf7",aa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dn="\\u2000-\\u206f",Tn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",sa="A-Z\\xc0-\\xd6\\xd8-\\xde",Hr="\\ufe0e\\ufe0f",li=ul+aa+Dn+Tn,la="['’]",cl="["+ys+"]",ui="["+li+"]",bs="["+xu+"]",wf="\\d+",wu="["+Mp+"]",Ss="["+Cc+"]",Cf="[^"+ys+li+wf+Mp+Cc+sa+"]",Ii="\\ud83c[\\udffb-\\udfff]",Ip="(?:"+bs+"|"+Ii+")",Rp="[^"+ys+"]",_f="(?:\\ud83c[\\udde6-\\uddff]){2}",dl="[\\ud800-\\udbff][\\udc00-\\udfff]",Ro="["+sa+"]",fl="\\u200d",Cu="(?:"+Ss+"|"+Cf+")",Z0="(?:"+Ro+"|"+Cf+")",_c="(?:"+la+"(?:d|ll|m|re|s|t|ve))?",kc="(?:"+la+"(?:D|LL|M|RE|S|T|VE))?",kf=Ip+"?",Ec="["+Hr+"]?",$a="(?:"+fl+"(?:"+[Rp,_f,dl].join("|")+")"+Ec+kf+")*",Ef="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_u="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Kt=Ec+kf+$a,Dp="(?:"+[wu,_f,dl].join("|")+")"+Kt,Pc="(?:"+[Rp+bs+"?",bs,_f,dl,cl].join("|")+")",Tc=RegExp(la,"g"),Np=RegExp(bs,"g"),ua=RegExp(Ii+"(?="+Ii+")|"+Pc+Kt,"g"),Kn=RegExp([Ro+"?"+Ss+"+"+_c+"(?="+[ui,Ro,"$"].join("|")+")",Z0+"+"+kc+"(?="+[ui,Ro+Cu,"$"].join("|")+")",Ro+"?"+Cu+"+"+_c,Ro+"+"+kc,_u,Ef,wf,Dp].join("|"),"g"),Pf=RegExp("["+fl+ys+xu+Hr+"]"),jp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Tf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Bp=-1,gn={};gn[At]=gn[He]=gn[vt]=gn[nn]=gn[Rn]=gn[Ze]=gn[xt]=gn[ht]=gn[Ht]=!0,gn[ze]=gn[Me]=gn[Dt]=gn[We]=gn[Te]=gn[Be]=gn[Fe]=gn[at]=gn[Le]=gn[ut]=gn[ct]=gn[ae]=gn[De]=gn[Ke]=gn[Ne]=!1;var Xt={};Xt[ze]=Xt[Me]=Xt[Dt]=Xt[Te]=Xt[We]=Xt[Be]=Xt[At]=Xt[He]=Xt[vt]=Xt[nn]=Xt[Rn]=Xt[Le]=Xt[ut]=Xt[ct]=Xt[ae]=Xt[De]=Xt[Ke]=Xt[Xe]=Xt[Ze]=Xt[xt]=Xt[ht]=Xt[Ht]=!0,Xt[Fe]=Xt[at]=Xt[Ne]=!1;var Fp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Q0={"&":"&","<":"<",">":">",'"':""","'":"'"},Y={"&":"&","<":"<",">":">",""":'"',"'":"'"},ie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ge=parseFloat,st=parseInt,Wt=typeof _o=="object"&&_o&&_o.Object===Object&&_o,xn=typeof self=="object"&&self&&self.Object===Object&&self,kt=Wt||xn||Function("return this")(),Nt=t&&!t.nodeType&&t,Zt=Nt&&!0&&e&&!e.nodeType&&e,Jr=Zt&&Zt.exports===Nt,Rr=Jr&&Wt.process,wn=function(){try{var oe=Zt&&Zt.require&&Zt.require("util").types;return oe||Rr&&Rr.binding&&Rr.binding("util")}catch{}}(),ci=wn&&wn.isArrayBuffer,Do=wn&&wn.isDate,co=wn&&wn.isMap,za=wn&&wn.isRegExp,hl=wn&&wn.isSet,J0=wn&&wn.isTypedArray;function Ri(oe,we,ve){switch(ve.length){case 0:return oe.call(we);case 1:return oe.call(we,ve[0]);case 2:return oe.call(we,ve[0],ve[1]);case 3:return oe.call(we,ve[0],ve[1],ve[2])}return oe.apply(we,ve)}function e1(oe,we,ve,it){for(var It=-1,on=oe==null?0:oe.length;++It-1}function $p(oe,we,ve){for(var it=-1,It=oe==null?0:oe.length;++it-1;);return ve}function xs(oe,we){for(var ve=oe.length;ve--&&Oc(we,oe[ve],0)>-1;);return ve}function n1(oe,we){for(var ve=oe.length,it=0;ve--;)oe[ve]===we&&++it;return it}var r3=Mf(Fp),ws=Mf(Q0);function gl(oe){return"\\"+ie[oe]}function Hp(oe,we){return oe==null?n:oe[we]}function Eu(oe){return Pf.test(oe)}function Vp(oe){return jp.test(oe)}function i3(oe){for(var we,ve=[];!(we=oe.next()).done;)ve.push(we.value);return ve}function Wp(oe){var we=-1,ve=Array(oe.size);return oe.forEach(function(it,It){ve[++we]=[It,it]}),ve}function Up(oe,we){return function(ve){return oe(we(ve))}}function fa(oe,we){for(var ve=-1,it=oe.length,It=0,on=[];++ve-1}function C3(c,g){var C=this.__data__,O=Wr(C,c);return O<0?(++this.size,C.push([c,g])):C[O][1]=g,this}ha.prototype.clear=x3,ha.prototype.delete=w3,ha.prototype.get=v1,ha.prototype.has=y1,ha.prototype.set=C3;function pa(c){var g=-1,C=c==null?0:c.length;for(this.clear();++g=g?c:g)),c}function wi(c,g,C,O,B,V){var J,ne=g&h,ce=g&m,_e=g&y;if(C&&(J=B?C(c,O,B,V):C(c)),J!==n)return J;if(!Cr(c))return c;var Pe=$t(c);if(Pe){if(J=ZK(c),!ne)return $i(c,J)}else{var Re=ki(c),nt=Re==at||Re==bt;if(od(c))return El(c,ne);if(Re==ct||Re==ze||nt&&!B){if(J=ce||nt?{}:ET(c),!ne)return ce?N1(c,Kc(J,c)):Ho(c,dt(J,c))}else{if(!Xt[Re])return B?c:{};J=QK(c,Re,ne)}}V||(V=new Nr);var St=V.get(c);if(St)return St;V.set(c,J),tL(c)?c.forEach(function(Tt){J.add(wi(Tt,g,C,Tt,c,V))}):JT(c)&&c.forEach(function(Tt,Jt){J.set(Jt,wi(Tt,g,C,Jt,c,V))});var Pt=_e?ce?me:ba:ce?Wo:Ei,qt=Pe?n:Pt(c);return Xn(qt||c,function(Tt,Jt){qt&&(Jt=Tt,Tt=c[Jt]),yl(J,Jt,wi(Tt,g,C,Jt,c,V))}),J}function Jp(c){var g=Ei(c);return function(C){return eg(C,c,g)}}function eg(c,g,C){var O=C.length;if(c==null)return!O;for(c=mn(c);O--;){var B=C[O],V=g[B],J=c[B];if(J===n&&!(B in c)||!V(J))return!1}return!0}function w1(c,g,C){if(typeof c!="function")throw new Di(a);return z1(function(){c.apply(n,C)},g)}function Xc(c,g,C,O){var B=-1,V=Ki,J=!0,ne=c.length,ce=[],_e=g.length;if(!ne)return ce;C&&(g=Un(g,Vr(C))),O?(V=$p,J=!1):g.length>=i&&(V=Ic,J=!1,g=new Ua(g));e:for(;++BB?0:B+C),O=O===n||O>B?B:Vt(O),O<0&&(O+=B),O=C>O?0:rL(O);C0&&C(ne)?g>1?Ur(ne,g-1,C,O,B):Ha(B,ne):O||(B[B.length]=ne)}return B}var ng=Pl(),Fo=Pl(!0);function ya(c,g){return c&&ng(c,g,Ei)}function $o(c,g){return c&&Fo(c,g,Ei)}function rg(c,g){return jo(g,function(C){return Du(c[C])})}function bl(c,g){g=kl(g,c);for(var C=0,O=g.length;c!=null&&Cg}function og(c,g){return c!=null&&cn.call(c,g)}function ag(c,g){return c!=null&&g in mn(c)}function sg(c,g,C){return c>=fi(g,C)&&c=120&&Pe.length>=120)?new Ua(J&&Pe):n}Pe=c[0];var Re=-1,nt=ne[0];e:for(;++Re-1;)ne!==c&&$f.call(ne,ce,1),$f.call(c,ce,1);return c}function Kf(c,g){for(var C=c?g.length:0,O=C-1;C--;){var B=g[C];if(C==O||B!==V){var V=B;Ru(B)?$f.call(c,B,1):vg(c,B)}}return c}function Xf(c,g){return c+Tu(d1()*(g-c+1))}function Cl(c,g,C,O){for(var B=-1,V=Dr(Vf((g-c)/(C||1)),0),J=ve(V);V--;)J[O?V:++B]=c,c+=C;return J}function nd(c,g){var C="";if(!c||g<1||g>U)return C;do g%2&&(C+=c),g=Tu(g/2),g&&(c+=c);while(g);return C}function Ot(c,g){return Iw(LT(c,g,Uo),c+"")}function fg(c){return Yc(_g(c))}function Zf(c,g){var C=_g(c);return O3(C,Au(g,0,C.length))}function Mu(c,g,C,O){if(!Cr(c))return c;g=kl(g,c);for(var B=-1,V=g.length,J=V-1,ne=c;ne!=null&&++BB?0:B+g),C=C>B?B:C,C<0&&(C+=B),B=g>C?0:C-g>>>0,g>>>=0;for(var V=ve(B);++O>>1,J=c[V];J!==null&&!Sa(J)&&(C?J<=g:J=i){var _e=g?null:q(c);if(_e)return Nf(_e);J=!1,B=Ic,ce=new Ua}else ce=g?[]:ne;e:for(;++O=O?c:qr(c,g,C)}var M1=u3||function(c){return kt.clearTimeout(c)};function El(c,g){if(g)return c.slice();var C=c.length,O=Bc?Bc(C):new c.constructor(C);return c.copy(O),O}function I1(c){var g=new c.constructor(c.byteLength);return new Ni(g).set(new Ni(c)),g}function Iu(c,g){var C=g?I1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.byteLength)}function P3(c){var g=new c.constructor(c.source,vs.exec(c));return g.lastIndex=c.lastIndex,g}function Zn(c){return Uf?mn(Uf.call(c)):{}}function T3(c,g){var C=g?I1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.length)}function R1(c,g){if(c!==g){var C=c!==n,O=c===null,B=c===c,V=Sa(c),J=g!==n,ne=g===null,ce=g===g,_e=Sa(g);if(!ne&&!_e&&!V&&c>g||V&&J&&ce&&!ne&&!_e||O&&J&&ce||!C&&ce||!B)return 1;if(!O&&!V&&!_e&&c=ne)return ce;var _e=C[O];return ce*(_e=="desc"?-1:1)}}return c.index-g.index}function L3(c,g,C,O){for(var B=-1,V=c.length,J=C.length,ne=-1,ce=g.length,_e=Dr(V-J,0),Pe=ve(ce+_e),Re=!O;++ne1?C[B-1]:n,J=B>2?C[2]:n;for(V=c.length>3&&typeof V=="function"?(B--,V):n,J&&vo(C[0],C[1],J)&&(V=B<3?n:V,B=1),g=mn(g);++O-1?B[V?g[J]:J]:n}}function B1(c){return vr(function(g){var C=g.length,O=C,B=ho.prototype.thru;for(c&&g.reverse();O--;){var V=g[O];if(typeof V!="function")throw new Di(a);if(B&&!J&&Se(V)=="wrapper")var J=new ho([],!0)}for(O=J?O:C;++O1&&an.reverse(),Pe&&cene))return!1;var _e=V.get(c),Pe=V.get(g);if(_e&&Pe)return _e==g&&Pe==c;var Re=-1,nt=!0,St=C&x?new Ua:n;for(V.set(c,g),V.set(g,c);++Re1?"& ":"")+g[O],g=g.join(C>2?", ":" "),c.replace(F0,`{ + */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,m=2,y=4,b=1,x=2,k=1,E=2,_=4,P=8,A=16,M=32,R=64,D=128,j=256,z=512,H=30,K="...",te=800,G=16,$=1,W=2,X=3,Z=1/0,U=9007199254740991,Q=17976931348623157e292,re=0/0,he=4294967295,Ee=he-1,Ce=he>>>1,de=[["ary",D],["bind",k],["bindKey",E],["curry",P],["curryRight",A],["flip",z],["partial",M],["partialRight",R],["rearg",j]],ze="[object Arguments]",Me="[object Array]",rt="[object AsyncFunction]",We="[object Boolean]",Be="[object Date]",wt="[object DOMException]",$e="[object Error]",at="[object Function]",bt="[object GeneratorFunction]",Le="[object Map]",ut="[object Number]",Mt="[object Null]",ct="[object Object]",_t="[object Promise]",un="[object Proxy]",ae="[object RegExp]",De="[object Set]",Ke="[object String]",Xe="[object Symbol]",Se="[object Undefined]",Ne="[object WeakMap]",Ct="[object WeakSet]",Nt="[object ArrayBuffer]",Te="[object DataView]",At="[object Float32Array]",He="[object Float64Array]",vt="[object Int8Array]",nn="[object Int16Array]",Rn="[object Int32Array]",Ze="[object Uint8Array]",xt="[object Uint8ClampedArray]",ht="[object Uint16Array]",Ht="[object Uint32Array]",rn=/\b__p \+= '';/g,gr=/\b(__p \+=) '' \+/g,Io=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ii=/&(?:amp|lt|gt|quot|#39);/g,ol=/[&<>"']/g,j0=RegExp(Ii.source),$a=RegExp(ol.source),Ap=/<%-([\s\S]+?)%>/g,B0=/<%([\s\S]+?)%>/g,Sc=/<%=([\s\S]+?)%>/g,Op=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mp=/^\w*$/,oa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xf=/[\\^$.*+?()[\]{}|]/g,$0=RegExp(xf.source),xc=/^\s+/,wf=/\s/,F0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,al=/\{\n\/\* \[wrapped with (.+)\] \*/,wc=/,? & /,z0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,H0=/[()=,{}\[\]\/\s]/,V0=/\\(\\)?/g,W0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vs=/\w*$/,U0=/^[-+]0x[0-9a-f]+$/i,G0=/^0b[01]+$/i,q0=/^\[object .+?Constructor\]$/,Y0=/^0o[0-7]+$/i,K0=/^(?:0|[1-9]\d*)$/,X0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sl=/($^)/,Z0=/['\n\r\u2028\u2029\\]/g,ys="\\ud800-\\udfff",bu="\\u0300-\\u036f",Su="\\ufe20-\\ufe2f",ll="\\u20d0-\\u20ff",xu=bu+Su+ll,Ip="\\u2700-\\u27bf",Cc="a-z\\xdf-\\xf6\\xf8-\\xff",ul="\\xac\\xb1\\xd7\\xf7",aa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dn="\\u2000-\\u206f",Tn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",sa="A-Z\\xc0-\\xd6\\xd8-\\xde",Hr="\\ufe0e\\ufe0f",li=ul+aa+Dn+Tn,la="['’]",cl="["+ys+"]",ui="["+li+"]",bs="["+xu+"]",Cf="\\d+",wu="["+Ip+"]",Ss="["+Cc+"]",_f="[^"+ys+li+Cf+Ip+Cc+sa+"]",Ri="\\ud83c[\\udffb-\\udfff]",Rp="(?:"+bs+"|"+Ri+")",Dp="[^"+ys+"]",kf="(?:\\ud83c[\\udde6-\\uddff]){2}",dl="[\\ud800-\\udbff][\\udc00-\\udfff]",Ro="["+sa+"]",fl="\\u200d",Cu="(?:"+Ss+"|"+_f+")",Q0="(?:"+Ro+"|"+_f+")",_c="(?:"+la+"(?:d|ll|m|re|s|t|ve))?",kc="(?:"+la+"(?:D|LL|M|RE|S|T|VE))?",Ef=Rp+"?",Ec="["+Hr+"]?",Fa="(?:"+fl+"(?:"+[Dp,kf,dl].join("|")+")"+Ec+Ef+")*",Pf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_u="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Kt=Ec+Ef+Fa,Np="(?:"+[wu,kf,dl].join("|")+")"+Kt,Pc="(?:"+[Dp+bs+"?",bs,kf,dl,cl].join("|")+")",Tc=RegExp(la,"g"),jp=RegExp(bs,"g"),ua=RegExp(Ri+"(?="+Ri+")|"+Pc+Kt,"g"),Kn=RegExp([Ro+"?"+Ss+"+"+_c+"(?="+[ui,Ro,"$"].join("|")+")",Q0+"+"+kc+"(?="+[ui,Ro+Cu,"$"].join("|")+")",Ro+"?"+Cu+"+"+_c,Ro+"+"+kc,_u,Pf,Cf,Np].join("|"),"g"),Tf=RegExp("["+fl+ys+xu+Hr+"]"),Bp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$p=-1,gn={};gn[At]=gn[He]=gn[vt]=gn[nn]=gn[Rn]=gn[Ze]=gn[xt]=gn[ht]=gn[Ht]=!0,gn[ze]=gn[Me]=gn[Nt]=gn[We]=gn[Te]=gn[Be]=gn[$e]=gn[at]=gn[Le]=gn[ut]=gn[ct]=gn[ae]=gn[De]=gn[Ke]=gn[Ne]=!1;var Xt={};Xt[ze]=Xt[Me]=Xt[Nt]=Xt[Te]=Xt[We]=Xt[Be]=Xt[At]=Xt[He]=Xt[vt]=Xt[nn]=Xt[Rn]=Xt[Le]=Xt[ut]=Xt[ct]=Xt[ae]=Xt[De]=Xt[Ke]=Xt[Xe]=Xt[Ze]=Xt[xt]=Xt[ht]=Xt[Ht]=!0,Xt[$e]=Xt[at]=Xt[Ne]=!1;var Fp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},J0={"&":"&","<":"<",">":">",'"':""","'":"'"},Y={"&":"&","<":"<",">":">",""":'"',"'":"'"},ie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},me=parseFloat,st=parseInt,Wt=typeof _o=="object"&&_o&&_o.Object===Object&&_o,xn=typeof self=="object"&&self&&self.Object===Object&&self,kt=Wt||xn||Function("return this")(),jt=t&&!t.nodeType&&t,Zt=jt&&!0&&e&&!e.nodeType&&e,Jr=Zt&&Zt.exports===jt,Rr=Jr&&Wt.process,wn=function(){try{var oe=Zt&&Zt.require&&Zt.require("util").types;return oe||Rr&&Rr.binding&&Rr.binding("util")}catch{}}(),ci=wn&&wn.isArrayBuffer,Do=wn&&wn.isDate,co=wn&&wn.isMap,za=wn&&wn.isRegExp,hl=wn&&wn.isSet,e1=wn&&wn.isTypedArray;function Di(oe,xe,ye){switch(ye.length){case 0:return oe.call(xe);case 1:return oe.call(xe,ye[0]);case 2:return oe.call(xe,ye[0],ye[1]);case 3:return oe.call(xe,ye[0],ye[1],ye[2])}return oe.apply(xe,ye)}function t1(oe,xe,ye,it){for(var It=-1,on=oe==null?0:oe.length;++It-1}function zp(oe,xe,ye){for(var it=-1,It=oe==null?0:oe.length;++it-1;);return ye}function xs(oe,xe){for(var ye=oe.length;ye--&&Oc(xe,oe[ye],0)>-1;);return ye}function r1(oe,xe){for(var ye=oe.length,it=0;ye--;)oe[ye]===xe&&++it;return it}var o3=If(Fp),ws=If(J0);function gl(oe){return"\\"+ie[oe]}function Vp(oe,xe){return oe==null?n:oe[xe]}function Eu(oe){return Tf.test(oe)}function Wp(oe){return Bp.test(oe)}function a3(oe){for(var xe,ye=[];!(xe=oe.next()).done;)ye.push(xe.value);return ye}function Up(oe){var xe=-1,ye=Array(oe.size);return oe.forEach(function(it,It){ye[++xe]=[It,it]}),ye}function Gp(oe,xe){return function(ye){return oe(xe(ye))}}function fa(oe,xe){for(var ye=-1,it=oe.length,It=0,on=[];++ye-1}function k3(c,g){var C=this.__data__,O=Wr(C,c);return O<0?(++this.size,C.push([c,g])):C[O][1]=g,this}ha.prototype.clear=C3,ha.prototype.delete=_3,ha.prototype.get=y1,ha.prototype.has=b1,ha.prototype.set=k3;function pa(c){var g=-1,C=c==null?0:c.length;for(this.clear();++g=g?c:g)),c}function Ci(c,g,C,O,B,V){var J,ne=g&h,ce=g&m,_e=g&y;if(C&&(J=B?C(c,O,B,V):C(c)),J!==n)return J;if(!Cr(c))return c;var Pe=zt(c);if(Pe){if(J=ZK(c),!ne)return zi(c,J)}else{var Re=Ei(c),nt=Re==at||Re==bt;if(od(c))return El(c,ne);if(Re==ct||Re==ze||nt&&!B){if(J=ce||nt?{}:ET(c),!ne)return ce?j1(c,Kc(J,c)):Ho(c,dt(J,c))}else{if(!Xt[Re])return B?c:{};J=QK(c,Re,ne)}}V||(V=new Nr);var St=V.get(c);if(St)return St;V.set(c,J),tL(c)?c.forEach(function(Tt){J.add(Ci(Tt,g,C,Tt,c,V))}):JT(c)&&c.forEach(function(Tt,Jt){J.set(Jt,Ci(Tt,g,C,Jt,c,V))});var Pt=_e?ce?ve:ba:ce?Wo:Pi,qt=Pe?n:Pt(c);return Xn(qt||c,function(Tt,Jt){qt&&(Jt=Tt,Tt=c[Jt]),yl(J,Jt,Ci(Tt,g,C,Jt,c,V))}),J}function eg(c){var g=Pi(c);return function(C){return tg(C,c,g)}}function tg(c,g,C){var O=C.length;if(c==null)return!O;for(c=mn(c);O--;){var B=C[O],V=g[B],J=c[B];if(J===n&&!(B in c)||!V(J))return!1}return!0}function C1(c,g,C){if(typeof c!="function")throw new Ni(a);return H1(function(){c.apply(n,C)},g)}function Xc(c,g,C,O){var B=-1,V=Qi,J=!0,ne=c.length,ce=[],_e=g.length;if(!ne)return ce;C&&(g=Un(g,Vr(C))),O?(V=zp,J=!1):g.length>=i&&(V=Ic,J=!1,g=new Ua(g));e:for(;++BB?0:B+C),O=O===n||O>B?B:Vt(O),O<0&&(O+=B),O=C>O?0:rL(O);C0&&C(ne)?g>1?Ur(ne,g-1,C,O,B):Ha(B,ne):O||(B[B.length]=ne)}return B}var rg=Pl(),$o=Pl(!0);function ya(c,g){return c&&rg(c,g,Pi)}function Fo(c,g){return c&&$o(c,g,Pi)}function ig(c,g){return jo(g,function(C){return Du(c[C])})}function bl(c,g){g=kl(g,c);for(var C=0,O=g.length;c!=null&&Cg}function ag(c,g){return c!=null&&cn.call(c,g)}function sg(c,g){return c!=null&&g in mn(c)}function lg(c,g,C){return c>=fi(g,C)&&c=120&&Pe.length>=120)?new Ua(J&&Pe):n}Pe=c[0];var Re=-1,nt=ne[0];e:for(;++Re-1;)ne!==c&&zf.call(ne,ce,1),zf.call(c,ce,1);return c}function Xf(c,g){for(var C=c?g.length:0,O=C-1;C--;){var B=g[C];if(C==O||B!==V){var V=B;Ru(B)?zf.call(c,B,1):yg(c,B)}}return c}function Zf(c,g){return c+Tu(f1()*(g-c+1))}function Cl(c,g,C,O){for(var B=-1,V=Dr(Wf((g-c)/(C||1)),0),J=ye(V);V--;)J[O?V:++B]=c,c+=C;return J}function nd(c,g){var C="";if(!c||g<1||g>U)return C;do g%2&&(C+=c),g=Tu(g/2),g&&(c+=c);while(g);return C}function Ot(c,g){return Iw(LT(c,g,Uo),c+"")}function hg(c){return Yc(kg(c))}function Qf(c,g){var C=kg(c);return I3(C,Au(g,0,C.length))}function Mu(c,g,C,O){if(!Cr(c))return c;g=kl(g,c);for(var B=-1,V=g.length,J=V-1,ne=c;ne!=null&&++BB?0:B+g),C=C>B?B:C,C<0&&(C+=B),B=g>C?0:C-g>>>0,g>>>=0;for(var V=ye(B);++O>>1,J=c[V];J!==null&&!Sa(J)&&(C?J<=g:J=i){var _e=g?null:q(c);if(_e)return jf(_e);J=!1,B=Ic,ce=new Ua}else ce=g?[]:ne;e:for(;++O=O?c:qr(c,g,C)}var I1=d3||function(c){return kt.clearTimeout(c)};function El(c,g){if(g)return c.slice();var C=c.length,O=Bc?Bc(C):new c.constructor(C);return c.copy(O),O}function R1(c){var g=new c.constructor(c.byteLength);return new ji(g).set(new ji(c)),g}function Iu(c,g){var C=g?R1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.byteLength)}function L3(c){var g=new c.constructor(c.source,vs.exec(c));return g.lastIndex=c.lastIndex,g}function Zn(c){return Gf?mn(Gf.call(c)):{}}function A3(c,g){var C=g?R1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.length)}function D1(c,g){if(c!==g){var C=c!==n,O=c===null,B=c===c,V=Sa(c),J=g!==n,ne=g===null,ce=g===g,_e=Sa(g);if(!ne&&!_e&&!V&&c>g||V&&J&&ce&&!ne&&!_e||O&&J&&ce||!C&&ce||!B)return 1;if(!O&&!V&&!_e&&c=ne)return ce;var _e=C[O];return ce*(_e=="desc"?-1:1)}}return c.index-g.index}function O3(c,g,C,O){for(var B=-1,V=c.length,J=C.length,ne=-1,ce=g.length,_e=Dr(V-J,0),Pe=ye(ce+_e),Re=!O;++ne1?C[B-1]:n,J=B>2?C[2]:n;for(V=c.length>3&&typeof V=="function"?(B--,V):n,J&&vo(C[0],C[1],J)&&(V=B<3?n:V,B=1),g=mn(g);++O-1?B[V?g[J]:J]:n}}function $1(c){return vr(function(g){var C=g.length,O=C,B=ho.prototype.thru;for(c&&g.reverse();O--;){var V=g[O];if(typeof V!="function")throw new Ni(a);if(B&&!J&&be(V)=="wrapper")var J=new ho([],!0)}for(O=J?O:C;++O1&&an.reverse(),Pe&&cene))return!1;var _e=V.get(c),Pe=V.get(g);if(_e&&Pe)return _e==g&&Pe==c;var Re=-1,nt=!0,St=C&x?new Ua:n;for(V.set(c,g),V.set(g,c);++Re1?"& ":"")+g[O],g=g.join(C>2?", ":" "),c.replace(F0,`{ /* [wrapped with `+g+`] */ -`)}function eX(c){return $t(c)||oh(c)||!!(u1&&c&&c[u1])}function Ru(c,g){var C=typeof c;return g=g??U,!!g&&(C=="number"||C!="symbol"&&Y0.test(c))&&c>-1&&c%1==0&&c0){if(++g>=te)return arguments[0]}else g=0;return c.apply(n,arguments)}}function O3(c,g){var C=-1,O=c.length,B=O-1;for(g=g===n?O:g;++C1?c[g-1]:n;return C=typeof C=="function"?(c.pop(),C):n,zT(c,C)});function HT(c){var g=$(c);return g.__chain__=!0,g}function dZ(c,g){return g(c),c}function M3(c,g){return g(c)}var fZ=vr(function(c){var g=c.length,C=g?c[0]:0,O=this.__wrapped__,B=function(V){return Qp(V,c)};return g>1||this.__actions__.length||!(O instanceof Qt)||!Ru(C)?this.thru(B):(O=O.slice(C,+C+(g?1:0)),O.__actions__.push({func:M3,args:[B],thisArg:n}),new ho(O,this.__chain__).thru(function(V){return g&&!V.length&&V.push(n),V}))});function hZ(){return HT(this)}function pZ(){return new ho(this.value(),this.__chain__)}function gZ(){this.__values__===n&&(this.__values__=nL(this.value()));var c=this.__index__>=this.__values__.length,g=c?n:this.__values__[this.__index__++];return{done:c,value:g}}function mZ(){return this}function vZ(c){for(var g,C=this;C instanceof Gf;){var O=DT(C);O.__index__=0,O.__values__=n,g?B.__wrapped__=O:g=O;var B=O;C=C.__wrapped__}return B.__wrapped__=c,g}function yZ(){var c=this.__wrapped__;if(c instanceof Qt){var g=c;return this.__actions__.length&&(g=new Qt(this)),g=g.reverse(),g.__actions__.push({func:M3,args:[Rw],thisArg:n}),new ho(g,this.__chain__)}return this.thru(Rw)}function bZ(){return _l(this.__wrapped__,this.__actions__)}var SZ=bg(function(c,g,C){cn.call(c,C)?++c[C]:ga(c,C,1)});function xZ(c,g,C){var O=$t(c)?Wn:C1;return C&&vo(c,g,C)&&(g=n),O(c,Ie(g,3))}function wZ(c,g){var C=$t(c)?jo:va;return C(c,Ie(g,3))}var CZ=j1(NT),_Z=j1(jT);function kZ(c,g){return Ur(I3(c,g),1)}function EZ(c,g){return Ur(I3(c,g),Z)}function PZ(c,g,C){return C=C===n?1:Vt(C),Ur(I3(c,g),C)}function VT(c,g){var C=$t(c)?Xn:ks;return C(c,Ie(g,3))}function WT(c,g){var C=$t(c)?No:tg;return C(c,Ie(g,3))}var TZ=bg(function(c,g,C){cn.call(c,C)?c[C].push(g):ga(c,C,[g])});function LZ(c,g,C,O){c=Vo(c)?c:_g(c),C=C&&!O?Vt(C):0;var B=c.length;return C<0&&(C=Dr(B+C,0)),B3(c)?C<=B&&c.indexOf(g,C)>-1:!!B&&Oc(c,g,C)>-1}var AZ=Ot(function(c,g,C){var O=-1,B=typeof g=="function",V=Vo(c)?ve(c.length):[];return ks(c,function(J){V[++O]=B?Ri(g,J,C):Es(J,g,C)}),V}),OZ=bg(function(c,g,C){ga(c,C,g)});function I3(c,g){var C=$t(c)?Un:Br;return C(c,Ie(g,3))}function MZ(c,g,C,O){return c==null?[]:($t(g)||(g=g==null?[]:[g]),C=O?n:C,$t(C)||(C=C==null?[]:[C]),Bi(c,g,C))}var IZ=bg(function(c,g,C){c[C?0:1].push(g)},function(){return[[],[]]});function RZ(c,g,C){var O=$t(c)?Lf:zp,B=arguments.length<3;return O(c,Ie(g,4),C,B,ks)}function DZ(c,g,C){var O=$t(c)?Jy:zp,B=arguments.length<3;return O(c,Ie(g,4),C,B,tg)}function NZ(c,g){var C=$t(c)?jo:va;return C(c,N3(Ie(g,3)))}function jZ(c){var g=$t(c)?Yc:fg;return g(c)}function BZ(c,g,C){(C?vo(c,g,C):g===n)?g=1:g=Vt(g);var O=$t(c)?xi:Zf;return O(c,g)}function FZ(c){var g=$t(c)?kw:_i;return g(c)}function $Z(c){if(c==null)return 0;if(Vo(c))return B3(c)?Va(c):c.length;var g=ki(c);return g==Le||g==De?c.size:Gr(c).length}function zZ(c,g,C){var O=$t(c)?Lc:zo;return C&&vo(c,g,C)&&(g=n),O(c,Ie(g,3))}var HZ=Ot(function(c,g){if(c==null)return[];var C=g.length;return C>1&&vo(c,g[0],g[1])?g=[]:C>2&&vo(g[0],g[1],g[2])&&(g=[g[0]]),Bi(c,Ur(g,1),[])}),R3=c3||function(){return kt.Date.now()};function VZ(c,g){if(typeof g!="function")throw new Di(a);return c=Vt(c),function(){if(--c<1)return g.apply(this,arguments)}}function UT(c,g,C){return g=C?n:g,g=c&&g==null?c.length:g,pe(c,D,n,n,n,n,g)}function GT(c,g){var C;if(typeof g!="function")throw new Di(a);return c=Vt(c),function(){return--c>0&&(C=g.apply(this,arguments)),c<=1&&(g=n),C}}var Nw=Ot(function(c,g,C){var O=k;if(C.length){var B=fa(C,tt(Nw));O|=M}return pe(c,O,g,C,B)}),qT=Ot(function(c,g,C){var O=k|E;if(C.length){var B=fa(C,tt(qT));O|=M}return pe(g,O,c,C,B)});function YT(c,g,C){g=C?n:g;var O=pe(c,P,n,n,n,n,n,g);return O.placeholder=YT.placeholder,O}function KT(c,g,C){g=C?n:g;var O=pe(c,A,n,n,n,n,n,g);return O.placeholder=KT.placeholder,O}function XT(c,g,C){var O,B,V,J,ne,ce,_e=0,Pe=!1,Re=!1,nt=!0;if(typeof c!="function")throw new Di(a);g=Ya(g)||0,Cr(C)&&(Pe=!!C.leading,Re="maxWait"in C,V=Re?Dr(Ya(C.maxWait)||0,g):V,nt="trailing"in C?!!C.trailing:nt);function St(Kr){var Os=O,ju=B;return O=B=n,_e=Kr,J=c.apply(ju,Os),J}function Pt(Kr){return _e=Kr,ne=z1(Jt,g),Pe?St(Kr):J}function qt(Kr){var Os=Kr-ce,ju=Kr-_e,gL=g-Os;return Re?fi(gL,V-ju):gL}function Tt(Kr){var Os=Kr-ce,ju=Kr-_e;return ce===n||Os>=g||Os<0||Re&&ju>=V}function Jt(){var Kr=R3();if(Tt(Kr))return an(Kr);ne=z1(Jt,qt(Kr))}function an(Kr){return ne=n,nt&&O?St(Kr):(O=B=n,J)}function xa(){ne!==n&&M1(ne),_e=0,O=ce=B=ne=n}function yo(){return ne===n?J:an(R3())}function wa(){var Kr=R3(),Os=Tt(Kr);if(O=arguments,B=this,ce=Kr,Os){if(ne===n)return Pt(ce);if(Re)return M1(ne),ne=z1(Jt,g),St(ce)}return ne===n&&(ne=z1(Jt,g)),J}return wa.cancel=xa,wa.flush=yo,wa}var WZ=Ot(function(c,g){return w1(c,1,g)}),UZ=Ot(function(c,g,C){return w1(c,Ya(g)||0,C)});function GZ(c){return pe(c,z)}function D3(c,g){if(typeof c!="function"||g!=null&&typeof g!="function")throw new Di(a);var C=function(){var O=arguments,B=g?g.apply(this,O):O[0],V=C.cache;if(V.has(B))return V.get(B);var J=c.apply(this,O);return C.cache=V.set(B,J)||V,J};return C.cache=new(D3.Cache||pa),C}D3.Cache=pa;function N3(c){if(typeof c!="function")throw new Di(a);return function(){var g=arguments;switch(g.length){case 0:return!c.call(this);case 1:return!c.call(this,g[0]);case 2:return!c.call(this,g[0],g[1]);case 3:return!c.call(this,g[0],g[1],g[2])}return!c.apply(this,g)}}function qZ(c){return GT(2,c)}var YZ=Tw(function(c,g){g=g.length==1&&$t(g[0])?Un(g[0],Vr(Ie())):Un(Ur(g,1),Vr(Ie()));var C=g.length;return Ot(function(O){for(var B=-1,V=fi(O.length,C);++B=g}),oh=ug(function(){return arguments}())?ug:function(c){return Fr(c)&&cn.call(c,"callee")&&!l1.call(c,"callee")},$t=ve.isArray,uQ=ci?Vr(ci):k1;function Vo(c){return c!=null&&j3(c.length)&&!Du(c)}function Yr(c){return Fr(c)&&Vo(c)}function cQ(c){return c===!0||c===!1||Fr(c)&&Ci(c)==We}var od=d3||Yw,dQ=Do?Vr(Do):E1;function fQ(c){return Fr(c)&&c.nodeType===1&&!H1(c)}function hQ(c){if(c==null)return!0;if(Vo(c)&&($t(c)||typeof c=="string"||typeof c.splice=="function"||od(c)||Cg(c)||oh(c)))return!c.length;var g=ki(c);if(g==Le||g==De)return!c.size;if($1(c))return!Gr(c).length;for(var C in c)if(cn.call(c,C))return!1;return!0}function pQ(c,g){return Qc(c,g)}function gQ(c,g,C){C=typeof C=="function"?C:n;var O=C?C(c,g):n;return O===n?Qc(c,g,n,C):!!O}function Bw(c){if(!Fr(c))return!1;var g=Ci(c);return g==Fe||g==wt||typeof c.message=="string"&&typeof c.name=="string"&&!H1(c)}function mQ(c){return typeof c=="number"&&Yp(c)}function Du(c){if(!Cr(c))return!1;var g=Ci(c);return g==at||g==bt||g==rt||g==un}function QT(c){return typeof c=="number"&&c==Vt(c)}function j3(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=U}function Cr(c){var g=typeof c;return c!=null&&(g=="object"||g=="function")}function Fr(c){return c!=null&&typeof c=="object"}var JT=co?Vr(co):Pw;function vQ(c,g){return c===g||Jc(c,g,Rt(g))}function yQ(c,g,C){return C=typeof C=="function"?C:n,Jc(c,g,Rt(g),C)}function bQ(c){return eL(c)&&c!=+c}function SQ(c){if(rX(c))throw new It(o);return cg(c)}function xQ(c){return c===null}function wQ(c){return c==null}function eL(c){return typeof c=="number"||Fr(c)&&Ci(c)==ut}function H1(c){if(!Fr(c)||Ci(c)!=ct)return!1;var g=Fc(c);if(g===null)return!0;var C=cn.call(g,"constructor")&&g.constructor;return typeof C=="function"&&C instanceof C&&Sr.call(C)==Si}var Fw=za?Vr(za):xr;function CQ(c){return QT(c)&&c>=-U&&c<=U}var tL=hl?Vr(hl):Ut;function B3(c){return typeof c=="string"||!$t(c)&&Fr(c)&&Ci(c)==Ke}function Sa(c){return typeof c=="symbol"||Fr(c)&&Ci(c)==Xe}var Cg=J0?Vr(J0):ei;function _Q(c){return c===n}function kQ(c){return Fr(c)&&ki(c)==Ne}function EQ(c){return Fr(c)&&Ci(c)==Ct}var PQ=T(Sl),TQ=T(function(c,g){return c<=g});function nL(c){if(!c)return[];if(Vo(c))return B3(c)?Xi(c):$i(c);if($c&&c[$c])return i3(c[$c]());var g=ki(c),C=g==Le?Wp:g==De?Nf:_g;return C(c)}function Nu(c){if(!c)return c===0?c:0;if(c=Ya(c),c===Z||c===-Z){var g=c<0?-1:1;return g*Q}return c===c?c:0}function Vt(c){var g=Nu(c),C=g%1;return g===g?C?g-C:g:0}function rL(c){return c?Au(Vt(c),0,fe):0}function Ya(c){if(typeof c=="number")return c;if(Sa(c))return re;if(Cr(c)){var g=typeof c.valueOf=="function"?c.valueOf():c;c=Cr(g)?g+"":g}if(typeof c!="string")return c===0?c:+c;c=fo(c);var C=U0.test(c);return C||q0.test(c)?st(c.slice(2),C?2:8):W0.test(c)?re:+c}function iL(c){return Ga(c,Wo(c))}function LQ(c){return c?Au(Vt(c),-U,U):c===0?c:0}function An(c){return c==null?"":go(c)}var AQ=mo(function(c,g){if($1(g)||Vo(g)){Ga(g,Ei(g),c);return}for(var C in g)cn.call(g,C)&&yl(c,C,g[C])}),oL=mo(function(c,g){Ga(g,Wo(g),c)}),F3=mo(function(c,g,C,O){Ga(g,Wo(g),c,O)}),OQ=mo(function(c,g,C,O){Ga(g,Ei(g),c,O)}),MQ=vr(Qp);function IQ(c,g){var C=Lu(c);return g==null?C:dt(C,g)}var RQ=Ot(function(c,g){c=mn(c);var C=-1,O=g.length,B=O>2?g[2]:n;for(B&&vo(g[0],g[1],B)&&(O=1);++C1),V}),Ga(c,me(c),C),O&&(C=wi(C,h|m|y,jt));for(var B=g.length;B--;)vg(C,g[B]);return C});function QQ(c,g){return sL(c,N3(Ie(g)))}var JQ=vr(function(c,g){return c==null?{}:L1(c,g)});function sL(c,g){if(c==null)return{};var C=Un(me(c),function(O){return[O]});return g=Ie(g),dg(c,C,function(O,B){return g(O,B[0])})}function eJ(c,g,C){g=kl(g,c);var O=-1,B=g.length;for(B||(B=1,c=n);++Og){var O=c;c=g,g=O}if(C||c%1||g%1){var B=d1();return fi(c+B*(g-c+ge("1e-"+((B+"").length-1))),g)}return Xf(c,g)}var dJ=Tl(function(c,g,C){return g=g.toLowerCase(),c+(C?cL(g):g)});function cL(c){return Hw(An(c).toLowerCase())}function dL(c){return c=An(c),c&&c.replace(K0,r3).replace(Np,"")}function fJ(c,g,C){c=An(c),g=go(g);var O=c.length;C=C===n?O:Au(Vt(C),0,O);var B=C;return C-=g.length,C>=0&&c.slice(C,B)==g}function hJ(c){return c=An(c),c&&Fa.test(c)?c.replace(ol,ws):c}function pJ(c){return c=An(c),c&&B0.test(c)?c.replace(Sf,"\\$&"):c}var gJ=Tl(function(c,g,C){return c+(C?"-":"")+g.toLowerCase()}),mJ=Tl(function(c,g,C){return c+(C?" ":"")+g.toLowerCase()}),vJ=xg("toLowerCase");function yJ(c,g,C){c=An(c),g=Vt(g);var O=g?Va(c):0;if(!g||O>=g)return c;var B=(g-O)/2;return f(Tu(B),C)+c+f(Vf(B),C)}function bJ(c,g,C){c=An(c),g=Vt(g);var O=g?Va(c):0;return g&&O>>0,C?(c=An(c),c&&(typeof g=="string"||g!=null&&!Fw(g))&&(g=go(g),!g&&Eu(c))?Ts(Xi(c),0,C):c.split(g,C)):[]}var EJ=Tl(function(c,g,C){return c+(C?" ":"")+Hw(g)});function PJ(c,g,C){return c=An(c),C=C==null?0:Au(Vt(C),0,c.length),g=go(g),c.slice(C,C+g.length)==g}function TJ(c,g,C){var O=$.templateSettings;C&&vo(c,g,C)&&(g=n),c=An(c),g=F3({},g,O,Ue);var B=F3({},g.imports,O.imports,Ue),V=Ei(B),J=Df(B,V),ne,ce,_e=0,Pe=g.interpolate||sl,Re="__p += '",nt=Bf((g.escape||sl).source+"|"+Pe.source+"|"+(Pe===Sc?V0:sl).source+"|"+(g.evaluate||sl).source+"|$","g"),St="//# sourceURL="+(cn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Bp+"]")+` -`;c.replace(nt,function(Tt,Jt,an,xa,yo,wa){return an||(an=xa),Re+=c.slice(_e,wa).replace(X0,gl),Jt&&(ne=!0,Re+=`' + +`)}function eX(c){return zt(c)||ah(c)||!!(c1&&c&&c[c1])}function Ru(c,g){var C=typeof c;return g=g??U,!!g&&(C=="number"||C!="symbol"&&K0.test(c))&&c>-1&&c%1==0&&c0){if(++g>=te)return arguments[0]}else g=0;return c.apply(n,arguments)}}function I3(c,g){var C=-1,O=c.length,B=O-1;for(g=g===n?O:g;++C1?c[g-1]:n;return C=typeof C=="function"?(c.pop(),C):n,zT(c,C)});function HT(c){var g=F(c);return g.__chain__=!0,g}function dZ(c,g){return g(c),c}function R3(c,g){return g(c)}var fZ=vr(function(c){var g=c.length,C=g?c[0]:0,O=this.__wrapped__,B=function(V){return Jp(V,c)};return g>1||this.__actions__.length||!(O instanceof Qt)||!Ru(C)?this.thru(B):(O=O.slice(C,+C+(g?1:0)),O.__actions__.push({func:R3,args:[B],thisArg:n}),new ho(O,this.__chain__).thru(function(V){return g&&!V.length&&V.push(n),V}))});function hZ(){return HT(this)}function pZ(){return new ho(this.value(),this.__chain__)}function gZ(){this.__values__===n&&(this.__values__=nL(this.value()));var c=this.__index__>=this.__values__.length,g=c?n:this.__values__[this.__index__++];return{done:c,value:g}}function mZ(){return this}function vZ(c){for(var g,C=this;C instanceof qf;){var O=DT(C);O.__index__=0,O.__values__=n,g?B.__wrapped__=O:g=O;var B=O;C=C.__wrapped__}return B.__wrapped__=c,g}function yZ(){var c=this.__wrapped__;if(c instanceof Qt){var g=c;return this.__actions__.length&&(g=new Qt(this)),g=g.reverse(),g.__actions__.push({func:R3,args:[Rw],thisArg:n}),new ho(g,this.__chain__)}return this.thru(Rw)}function bZ(){return _l(this.__wrapped__,this.__actions__)}var SZ=Sg(function(c,g,C){cn.call(c,C)?++c[C]:ga(c,C,1)});function xZ(c,g,C){var O=zt(c)?Wn:_1;return C&&vo(c,g,C)&&(g=n),O(c,Ie(g,3))}function wZ(c,g){var C=zt(c)?jo:va;return C(c,Ie(g,3))}var CZ=B1(NT),_Z=B1(jT);function kZ(c,g){return Ur(D3(c,g),1)}function EZ(c,g){return Ur(D3(c,g),Z)}function PZ(c,g,C){return C=C===n?1:Vt(C),Ur(D3(c,g),C)}function VT(c,g){var C=zt(c)?Xn:ks;return C(c,Ie(g,3))}function WT(c,g){var C=zt(c)?No:ng;return C(c,Ie(g,3))}var TZ=Sg(function(c,g,C){cn.call(c,C)?c[C].push(g):ga(c,C,[g])});function LZ(c,g,C,O){c=Vo(c)?c:kg(c),C=C&&!O?Vt(C):0;var B=c.length;return C<0&&(C=Dr(B+C,0)),F3(c)?C<=B&&c.indexOf(g,C)>-1:!!B&&Oc(c,g,C)>-1}var AZ=Ot(function(c,g,C){var O=-1,B=typeof g=="function",V=Vo(c)?ye(c.length):[];return ks(c,function(J){V[++O]=B?Di(g,J,C):Es(J,g,C)}),V}),OZ=Sg(function(c,g,C){ga(c,C,g)});function D3(c,g){var C=zt(c)?Un:Br;return C(c,Ie(g,3))}function MZ(c,g,C,O){return c==null?[]:(zt(g)||(g=g==null?[]:[g]),C=O?n:C,zt(C)||(C=C==null?[]:[C]),$i(c,g,C))}var IZ=Sg(function(c,g,C){c[C?0:1].push(g)},function(){return[[],[]]});function RZ(c,g,C){var O=zt(c)?Af:Hp,B=arguments.length<3;return O(c,Ie(g,4),C,B,ks)}function DZ(c,g,C){var O=zt(c)?t3:Hp,B=arguments.length<3;return O(c,Ie(g,4),C,B,ng)}function NZ(c,g){var C=zt(c)?jo:va;return C(c,B3(Ie(g,3)))}function jZ(c){var g=zt(c)?Yc:hg;return g(c)}function BZ(c,g,C){(C?vo(c,g,C):g===n)?g=1:g=Vt(g);var O=zt(c)?wi:Qf;return O(c,g)}function $Z(c){var g=zt(c)?kw:ki;return g(c)}function FZ(c){if(c==null)return 0;if(Vo(c))return F3(c)?Va(c):c.length;var g=Ei(c);return g==Le||g==De?c.size:Gr(c).length}function zZ(c,g,C){var O=zt(c)?Lc:zo;return C&&vo(c,g,C)&&(g=n),O(c,Ie(g,3))}var HZ=Ot(function(c,g){if(c==null)return[];var C=g.length;return C>1&&vo(c,g[0],g[1])?g=[]:C>2&&vo(g[0],g[1],g[2])&&(g=[g[0]]),$i(c,Ur(g,1),[])}),N3=f3||function(){return kt.Date.now()};function VZ(c,g){if(typeof g!="function")throw new Ni(a);return c=Vt(c),function(){if(--c<1)return g.apply(this,arguments)}}function UT(c,g,C){return g=C?n:g,g=c&&g==null?c.length:g,ge(c,D,n,n,n,n,g)}function GT(c,g){var C;if(typeof g!="function")throw new Ni(a);return c=Vt(c),function(){return--c>0&&(C=g.apply(this,arguments)),c<=1&&(g=n),C}}var Nw=Ot(function(c,g,C){var O=k;if(C.length){var B=fa(C,tt(Nw));O|=M}return ge(c,O,g,C,B)}),qT=Ot(function(c,g,C){var O=k|E;if(C.length){var B=fa(C,tt(qT));O|=M}return ge(g,O,c,C,B)});function YT(c,g,C){g=C?n:g;var O=ge(c,P,n,n,n,n,n,g);return O.placeholder=YT.placeholder,O}function KT(c,g,C){g=C?n:g;var O=ge(c,A,n,n,n,n,n,g);return O.placeholder=KT.placeholder,O}function XT(c,g,C){var O,B,V,J,ne,ce,_e=0,Pe=!1,Re=!1,nt=!0;if(typeof c!="function")throw new Ni(a);g=Ya(g)||0,Cr(C)&&(Pe=!!C.leading,Re="maxWait"in C,V=Re?Dr(Ya(C.maxWait)||0,g):V,nt="trailing"in C?!!C.trailing:nt);function St(Kr){var Os=O,ju=B;return O=B=n,_e=Kr,J=c.apply(ju,Os),J}function Pt(Kr){return _e=Kr,ne=H1(Jt,g),Pe?St(Kr):J}function qt(Kr){var Os=Kr-ce,ju=Kr-_e,gL=g-Os;return Re?fi(gL,V-ju):gL}function Tt(Kr){var Os=Kr-ce,ju=Kr-_e;return ce===n||Os>=g||Os<0||Re&&ju>=V}function Jt(){var Kr=N3();if(Tt(Kr))return an(Kr);ne=H1(Jt,qt(Kr))}function an(Kr){return ne=n,nt&&O?St(Kr):(O=B=n,J)}function xa(){ne!==n&&I1(ne),_e=0,O=ce=B=ne=n}function yo(){return ne===n?J:an(N3())}function wa(){var Kr=N3(),Os=Tt(Kr);if(O=arguments,B=this,ce=Kr,Os){if(ne===n)return Pt(ce);if(Re)return I1(ne),ne=H1(Jt,g),St(ce)}return ne===n&&(ne=H1(Jt,g)),J}return wa.cancel=xa,wa.flush=yo,wa}var WZ=Ot(function(c,g){return C1(c,1,g)}),UZ=Ot(function(c,g,C){return C1(c,Ya(g)||0,C)});function GZ(c){return ge(c,z)}function j3(c,g){if(typeof c!="function"||g!=null&&typeof g!="function")throw new Ni(a);var C=function(){var O=arguments,B=g?g.apply(this,O):O[0],V=C.cache;if(V.has(B))return V.get(B);var J=c.apply(this,O);return C.cache=V.set(B,J)||V,J};return C.cache=new(j3.Cache||pa),C}j3.Cache=pa;function B3(c){if(typeof c!="function")throw new Ni(a);return function(){var g=arguments;switch(g.length){case 0:return!c.call(this);case 1:return!c.call(this,g[0]);case 2:return!c.call(this,g[0],g[1]);case 3:return!c.call(this,g[0],g[1],g[2])}return!c.apply(this,g)}}function qZ(c){return GT(2,c)}var YZ=Tw(function(c,g){g=g.length==1&&zt(g[0])?Un(g[0],Vr(Ie())):Un(Ur(g,1),Vr(Ie()));var C=g.length;return Ot(function(O){for(var B=-1,V=fi(O.length,C);++B=g}),ah=cg(function(){return arguments}())?cg:function(c){return $r(c)&&cn.call(c,"callee")&&!u1.call(c,"callee")},zt=ye.isArray,uQ=ci?Vr(ci):E1;function Vo(c){return c!=null&&$3(c.length)&&!Du(c)}function Yr(c){return $r(c)&&Vo(c)}function cQ(c){return c===!0||c===!1||$r(c)&&_i(c)==We}var od=h3||Yw,dQ=Do?Vr(Do):P1;function fQ(c){return $r(c)&&c.nodeType===1&&!V1(c)}function hQ(c){if(c==null)return!0;if(Vo(c)&&(zt(c)||typeof c=="string"||typeof c.splice=="function"||od(c)||_g(c)||ah(c)))return!c.length;var g=Ei(c);if(g==Le||g==De)return!c.size;if(z1(c))return!Gr(c).length;for(var C in c)if(cn.call(c,C))return!1;return!0}function pQ(c,g){return Qc(c,g)}function gQ(c,g,C){C=typeof C=="function"?C:n;var O=C?C(c,g):n;return O===n?Qc(c,g,n,C):!!O}function Bw(c){if(!$r(c))return!1;var g=_i(c);return g==$e||g==wt||typeof c.message=="string"&&typeof c.name=="string"&&!V1(c)}function mQ(c){return typeof c=="number"&&Kp(c)}function Du(c){if(!Cr(c))return!1;var g=_i(c);return g==at||g==bt||g==rt||g==un}function QT(c){return typeof c=="number"&&c==Vt(c)}function $3(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=U}function Cr(c){var g=typeof c;return c!=null&&(g=="object"||g=="function")}function $r(c){return c!=null&&typeof c=="object"}var JT=co?Vr(co):Pw;function vQ(c,g){return c===g||Jc(c,g,Rt(g))}function yQ(c,g,C){return C=typeof C=="function"?C:n,Jc(c,g,Rt(g),C)}function bQ(c){return eL(c)&&c!=+c}function SQ(c){if(rX(c))throw new It(o);return dg(c)}function xQ(c){return c===null}function wQ(c){return c==null}function eL(c){return typeof c=="number"||$r(c)&&_i(c)==ut}function V1(c){if(!$r(c)||_i(c)!=ct)return!1;var g=$c(c);if(g===null)return!0;var C=cn.call(g,"constructor")&&g.constructor;return typeof C=="function"&&C instanceof C&&Sr.call(C)==xi}var $w=za?Vr(za):xr;function CQ(c){return QT(c)&&c>=-U&&c<=U}var tL=hl?Vr(hl):Ut;function F3(c){return typeof c=="string"||!zt(c)&&$r(c)&&_i(c)==Ke}function Sa(c){return typeof c=="symbol"||$r(c)&&_i(c)==Xe}var _g=e1?Vr(e1):ei;function _Q(c){return c===n}function kQ(c){return $r(c)&&Ei(c)==Ne}function EQ(c){return $r(c)&&_i(c)==Ct}var PQ=T(Sl),TQ=T(function(c,g){return c<=g});function nL(c){if(!c)return[];if(Vo(c))return F3(c)?Ji(c):zi(c);if(Fc&&c[Fc])return a3(c[Fc]());var g=Ei(c),C=g==Le?Up:g==De?jf:kg;return C(c)}function Nu(c){if(!c)return c===0?c:0;if(c=Ya(c),c===Z||c===-Z){var g=c<0?-1:1;return g*Q}return c===c?c:0}function Vt(c){var g=Nu(c),C=g%1;return g===g?C?g-C:g:0}function rL(c){return c?Au(Vt(c),0,he):0}function Ya(c){if(typeof c=="number")return c;if(Sa(c))return re;if(Cr(c)){var g=typeof c.valueOf=="function"?c.valueOf():c;c=Cr(g)?g+"":g}if(typeof c!="string")return c===0?c:+c;c=fo(c);var C=G0.test(c);return C||Y0.test(c)?st(c.slice(2),C?2:8):U0.test(c)?re:+c}function iL(c){return Ga(c,Wo(c))}function LQ(c){return c?Au(Vt(c),-U,U):c===0?c:0}function An(c){return c==null?"":go(c)}var AQ=mo(function(c,g){if(z1(g)||Vo(g)){Ga(g,Pi(g),c);return}for(var C in g)cn.call(g,C)&&yl(c,C,g[C])}),oL=mo(function(c,g){Ga(g,Wo(g),c)}),z3=mo(function(c,g,C,O){Ga(g,Wo(g),c,O)}),OQ=mo(function(c,g,C,O){Ga(g,Pi(g),c,O)}),MQ=vr(Jp);function IQ(c,g){var C=Lu(c);return g==null?C:dt(C,g)}var RQ=Ot(function(c,g){c=mn(c);var C=-1,O=g.length,B=O>2?g[2]:n;for(B&&vo(g[0],g[1],B)&&(O=1);++C1),V}),Ga(c,ve(c),C),O&&(C=Ci(C,h|m|y,Bt));for(var B=g.length;B--;)yg(C,g[B]);return C});function QQ(c,g){return sL(c,B3(Ie(g)))}var JQ=vr(function(c,g){return c==null?{}:A1(c,g)});function sL(c,g){if(c==null)return{};var C=Un(ve(c),function(O){return[O]});return g=Ie(g),fg(c,C,function(O,B){return g(O,B[0])})}function eJ(c,g,C){g=kl(g,c);var O=-1,B=g.length;for(B||(B=1,c=n);++Og){var O=c;c=g,g=O}if(C||c%1||g%1){var B=f1();return fi(c+B*(g-c+me("1e-"+((B+"").length-1))),g)}return Zf(c,g)}var dJ=Tl(function(c,g,C){return g=g.toLowerCase(),c+(C?cL(g):g)});function cL(c){return Hw(An(c).toLowerCase())}function dL(c){return c=An(c),c&&c.replace(X0,o3).replace(jp,"")}function fJ(c,g,C){c=An(c),g=go(g);var O=c.length;C=C===n?O:Au(Vt(C),0,O);var B=C;return C-=g.length,C>=0&&c.slice(C,B)==g}function hJ(c){return c=An(c),c&&$a.test(c)?c.replace(ol,ws):c}function pJ(c){return c=An(c),c&&$0.test(c)?c.replace(xf,"\\$&"):c}var gJ=Tl(function(c,g,C){return c+(C?"-":"")+g.toLowerCase()}),mJ=Tl(function(c,g,C){return c+(C?" ":"")+g.toLowerCase()}),vJ=wg("toLowerCase");function yJ(c,g,C){c=An(c),g=Vt(g);var O=g?Va(c):0;if(!g||O>=g)return c;var B=(g-O)/2;return f(Tu(B),C)+c+f(Wf(B),C)}function bJ(c,g,C){c=An(c),g=Vt(g);var O=g?Va(c):0;return g&&O>>0,C?(c=An(c),c&&(typeof g=="string"||g!=null&&!$w(g))&&(g=go(g),!g&&Eu(c))?Ts(Ji(c),0,C):c.split(g,C)):[]}var EJ=Tl(function(c,g,C){return c+(C?" ":"")+Hw(g)});function PJ(c,g,C){return c=An(c),C=C==null?0:Au(Vt(C),0,c.length),g=go(g),c.slice(C,C+g.length)==g}function TJ(c,g,C){var O=F.templateSettings;C&&vo(c,g,C)&&(g=n),c=An(c),g=z3({},g,O,Ue);var B=z3({},g.imports,O.imports,Ue),V=Pi(B),J=Nf(B,V),ne,ce,_e=0,Pe=g.interpolate||sl,Re="__p += '",nt=$f((g.escape||sl).source+"|"+Pe.source+"|"+(Pe===Sc?W0:sl).source+"|"+(g.evaluate||sl).source+"|$","g"),St="//# sourceURL="+(cn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$p+"]")+` +`;c.replace(nt,function(Tt,Jt,an,xa,yo,wa){return an||(an=xa),Re+=c.slice(_e,wa).replace(Z0,gl),Jt&&(ne=!0,Re+=`' + __e(`+Jt+`) + '`),yo&&(ce=!0,Re+=`'; `+yo+`; @@ -467,16 +467,16 @@ __p += '`),an&&(Re+=`' + `;var Pt=cn.call(g,"variable")&&g.variable;if(!Pt)Re=`with (obj) { `+Re+` } -`;else if(z0.test(Pt))throw new It(s);Re=(ce?Re.replace(rn,""):Re).replace(gr,"$1").replace(Io,"$1;"),Re="function("+(Pt||"obj")+`) { +`;else if(H0.test(Pt))throw new It(s);Re=(ce?Re.replace(rn,""):Re).replace(gr,"$1").replace(Io,"$1;"),Re="function("+(Pt||"obj")+`) { `+(Pt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(ne?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Re+`return __p -}`;var qt=hL(function(){return on(V,St+"return "+Re).apply(n,J)});if(qt.source=Re,Bw(qt))throw qt;return qt}function LJ(c){return An(c).toLowerCase()}function AJ(c){return An(c).toUpperCase()}function OJ(c,g,C){if(c=An(c),c&&(C||g===n))return fo(c);if(!c||!(g=go(g)))return c;var O=Xi(c),B=Xi(g),V=da(O,B),J=xs(O,B)+1;return Ts(O,V,J).join("")}function MJ(c,g,C){if(c=An(c),c&&(C||g===n))return c.slice(0,i1(c)+1);if(!c||!(g=go(g)))return c;var O=Xi(c),B=xs(O,Xi(g))+1;return Ts(O,0,B).join("")}function IJ(c,g,C){if(c=An(c),c&&(C||g===n))return c.replace(xc,"");if(!c||!(g=go(g)))return c;var O=Xi(c),B=da(O,Xi(g));return Ts(O,B).join("")}function RJ(c,g){var C=H,O=K;if(Cr(g)){var B="separator"in g?g.separator:B;C="length"in g?Vt(g.length):C,O="omission"in g?go(g.omission):O}c=An(c);var V=c.length;if(Eu(c)){var J=Xi(c);V=J.length}if(C>=V)return c;var ne=C-Va(O);if(ne<1)return O;var ce=J?Ts(J,0,ne).join(""):c.slice(0,ne);if(B===n)return ce+O;if(J&&(ne+=ce.length-ne),Fw(B)){if(c.slice(ne).search(B)){var _e,Pe=ce;for(B.global||(B=Bf(B.source,An(vs.exec(B))+"g")),B.lastIndex=0;_e=B.exec(Pe);)var Re=_e.index;ce=ce.slice(0,Re===n?ne:Re)}}else if(c.indexOf(go(B),ne)!=ne){var nt=ce.lastIndexOf(B);nt>-1&&(ce=ce.slice(0,nt))}return ce+O}function DJ(c){return c=An(c),c&&N0.test(c)?c.replace(Mi,s3):c}var NJ=Tl(function(c,g,C){return c+(C?" ":"")+g.toUpperCase()}),Hw=xg("toUpperCase");function fL(c,g,C){return c=An(c),g=C?n:g,g===n?Vp(c)?jf(c):t1(c):c.match(g)||[]}var hL=Ot(function(c,g){try{return Ri(c,n,g)}catch(C){return Bw(C)?C:new It(C)}}),jJ=vr(function(c,g){return Xn(g,function(C){C=Ll(C),ga(c,C,Nw(c[C],c))}),c});function BJ(c){var g=c==null?0:c.length,C=Ie();return c=g?Un(c,function(O){if(typeof O[1]!="function")throw new Di(a);return[C(O[0]),O[1]]}):[],Ot(function(O){for(var B=-1;++BU)return[];var C=fe,O=fi(c,fe);g=Ie(g),c-=fe;for(var B=Rf(O,g);++C0||g<0)?new Qt(C):(c<0?C=C.takeRight(-c):c&&(C=C.drop(c)),g!==n&&(g=Vt(g),C=g<0?C.dropRight(-g):C.take(g-c)),C)},Qt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Qt.prototype.toArray=function(){return this.take(fe)},ya(Qt.prototype,function(c,g){var C=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),B=$[O?"take"+(g=="last"?"Right":""):g],V=O||/^find/.test(g);B&&($.prototype[g]=function(){var J=this.__wrapped__,ne=O?[1]:arguments,ce=J instanceof Qt,_e=ne[0],Pe=ce||$t(J),Re=function(Jt){var an=B.apply($,Ha([Jt],ne));return O&&nt?an[0]:an};Pe&&C&&typeof _e=="function"&&_e.length!=1&&(ce=Pe=!1);var nt=this.__chain__,St=!!this.__actions__.length,Pt=V&&!nt,qt=ce&&!St;if(!V&&Pe){J=qt?J:new Qt(this);var Tt=c.apply(J,ne);return Tt.__actions__.push({func:M3,args:[Re],thisArg:n}),new ho(Tt,nt)}return Pt&&qt?c.apply(this,ne):(Tt=this.thru(Re),Pt?O?Tt.value()[0]:Tt.value():Tt)})}),Xn(["pop","push","shift","sort","splice","unshift"],function(c){var g=Dc[c],C=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",O=/^(?:pop|shift)$/.test(c);$.prototype[c]=function(){var B=arguments;if(O&&!this.__chain__){var V=this.value();return g.apply($t(V)?V:[],B)}return this[C](function(J){return g.apply($t(J)?J:[],B)})}}),ya(Qt.prototype,function(c,g){var C=$[g];if(C){var O=C.name+"";cn.call(Cs,O)||(Cs[O]=[]),Cs[O].push({name:g,func:C})}}),Cs[nh(n,E).name]=[{name:"wrapper",func:n}],Qt.prototype.clone=Zi,Qt.prototype.reverse=ji,Qt.prototype.value=m3,$.prototype.at=fZ,$.prototype.chain=hZ,$.prototype.commit=pZ,$.prototype.next=gZ,$.prototype.plant=vZ,$.prototype.reverse=yZ,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=bZ,$.prototype.first=$.prototype.head,$c&&($.prototype[$c]=mZ),$},Wa=Bo();Zt?((Zt.exports=Wa)._=Wa,Nt._=Wa):kt._=Wa}).call(_o)})(bxe,ke);const Rg=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Dg=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},Sxe=.999,xxe=.1,wxe=20,ov=.95,HI=30,h8=10,VI=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),lh=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Yl(s/o,64)):o<1&&(r.height=s,r.width=Yl(s*o,64)),a=r.width*r.height;return r},Cxe=e=>({width:Yl(e.width,64),height:Yl(e.height,64)}),qW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],_xe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],lP=e=>e.kind==="line"&&e.layer==="mask",kxe=e=>e.kind==="line"&&e.layer==="base",Y5=e=>e.kind==="image"&&e.layer==="base",Exe=e=>e.kind==="fillRect"&&e.layer==="base",Pxe=e=>e.kind==="eraseRect"&&e.layer==="base",Txe=e=>e.kind==="line",Lv={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},Lxe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:Lv,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},YW=pp({name:"canvas",initialState:Lxe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!lP(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Ld(ke.clamp(n.width,64,512),64),height:Ld(ke.clamp(n.height,64,512),64)},o={x:Yl(n.width/2-i.width/2,64),y:Yl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=lh(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState={...Lv,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Dg(r.width,r.height,n.width,n.height,ov),s=Rg(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=Cxe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=lh(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=VI(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...Lv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(Txe);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(ke.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState=Lv,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(Y5),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const d=Dg(i.width,i.height,512,512,ov),h=Rg(i.width,i.height,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=lh(m);e.scaledBoundingBoxDimensions=y}return}const{width:o,height:a}=r,l=Dg(t,n,o,a,.95),u=Rg(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=VI(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(Y5)){const i=Dg(r.width,r.height,512,512,ov),o=Rg(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=lh(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const d=r?1:Dg(i,o,l,u,ov),h=Rg(i,o,a,s,l,u,d);e.stageScale=d,e.stageCoordinates=h}else{const d=Dg(i,o,512,512,ov),h=Rg(i,o,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=lh(m);e.scaledBoundingBoxDimensions=y}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...Lv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Ld(ke.clamp(o,64,512),64),height:Ld(ke.clamp(a,64,512),64)},l={x:Yl(o/2-s.width/2,64),y:Yl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=lh(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=lh(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:KW,addFillRect:XW,addImageToStagingArea:Axe,addLine:Oxe,addPointToCurrentLine:ZW,clearCanvasHistory:QW,clearMask:uP,commitColorPickerColor:Mxe,commitStagingAreaImage:Ixe,discardStagedImages:Rxe,fitBoundingBoxToStage:vze,mouseLeftCanvas:Dxe,nextStagingAreaImage:Nxe,prevStagingAreaImage:jxe,redo:Bxe,resetCanvas:cP,resetCanvasInteractionState:Fxe,resetCanvasView:JW,resizeAndScaleCanvas:Bx,resizeCanvas:$xe,setBoundingBoxCoordinates:CC,setBoundingBoxDimensions:Av,setBoundingBoxPreviewFill:yze,setBoundingBoxScaleMethod:zxe,setBrushColor:$m,setBrushSize:zm,setCanvasContainerDimensions:Hxe,setColorPickerColor:Vxe,setCursorPosition:Wxe,setDoesCanvasNeedScaling:vi,setInitialCanvasImage:Fx,setIsDrawing:eU,setIsMaskEnabled:Fy,setIsMouseOverBoundingBox:Pb,setIsMoveBoundingBoxKeyHeld:bze,setIsMoveStageKeyHeld:Sze,setIsMovingBoundingBox:_C,setIsMovingStage:K5,setIsTransformingBoundingBox:kC,setLayer:X5,setMaskColor:tU,setMergedCanvas:Uxe,setShouldAutoSave:nU,setShouldCropToBoundingBoxOnSave:rU,setShouldDarkenOutsideBoundingBox:iU,setShouldLockBoundingBox:xze,setShouldPreserveMaskedArea:oU,setShouldShowBoundingBox:Gxe,setShouldShowBrush:wze,setShouldShowBrushPreview:Cze,setShouldShowCanvasDebugInfo:aU,setShouldShowCheckboardTransparency:_ze,setShouldShowGrid:sU,setShouldShowIntermediates:lU,setShouldShowStagingImage:qxe,setShouldShowStagingOutline:WI,setShouldSnapToGrid:Z5,setStageCoordinates:uU,setStageScale:Yxe,setTool:ru,toggleShouldLockBoundingBox:kze,toggleTool:Eze,undo:Kxe,setScaledBoundingBoxDimensions:Tb,setShouldRestrictStrokesToBox:cU}=YW.actions,Xxe=YW.reducer,Zxe={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},dU=pp({name:"gallery",initialState:Zxe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=ke.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:dm,clearIntermediateImage:EC,removeImage:fU,setCurrentImage:UI,addGalleryImages:Qxe,setIntermediateImage:Jxe,selectNextImage:dP,selectPrevImage:fP,setShouldPinGallery:ewe,setShouldShowGallery:zd,setGalleryScrollPosition:twe,setGalleryImageMinimumWidth:av,setGalleryImageObjectFit:nwe,setShouldHoldGalleryOpen:hU,setShouldAutoSwitchToNewImages:rwe,setCurrentCategory:Lb,setGalleryWidth:iwe,setShouldUseSingleGalleryColumn:owe}=dU.actions,awe=dU.reducer,swe={isLightboxOpen:!1},lwe=swe,pU=pp({name:"lightbox",initialState:lwe,reducers:{setIsLightboxOpen:(e,t)=>{e.isLightboxOpen=t.payload}}}),{setIsLightboxOpen:Hm}=pU.actions,uwe=pU.reducer,l2=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" ");function hP(e){let t=l2(e),n=null;const r=new RegExp(/\[([^\][]*)]/,"gi"),i=[...t.matchAll(r)].map(o=>o[1]);return i.length&&(n=i.join(" "),i.forEach(o=>{t=t.replace(`[${o}]`,"").replaceAll("[]","").trim()})),[t,n]}const cwe=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return pP(r)?r:!1},pP=e=>Boolean(typeof e=="string"?cwe(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),Q5=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),dwe=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),gU={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512},fwe=gU,mU=pp({name:"generation",initialState:fwe,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=l2(n)},setNegativePrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.negativePrompt=n:e.negativePrompt=l2(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:d,hires_fix:h,width:m,height:y}=t.payload.image;o&&o.length>0?(e.seedWeights=Q5(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=l2(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,typeof u>"u"?e.perlin=0:e.perlin=u,typeof d=="boolean"&&(e.seamless=d),m&&(e.width=m),y&&(e.height=y)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:d,seamless:h,hires_fix:m,width:y,height:b,strength:x,fit:k,init_image_path:E,mask_image_path:_}=t.payload.image;if(n==="img2img"&&(E&&(e.initialImage=E),_&&(e.maskPath=_),x&&(e.img2imgStrength=x),typeof k=="boolean"&&(e.shouldFitToWidthHeight=k)),a&&a.length>0?(e.seedWeights=Q5(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i){const[P,A]=hP(i);P&&(e.prompt=P),A?e.negativePrompt=A:e.negativePrompt=""}r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),typeof u>"u"?e.threshold=0:e.threshold=u,typeof d>"u"?e.perlin=0:e.perlin=d,typeof h=="boolean"&&(e.seamless=h),y&&(e.width=y),b&&(e.height=b)},resetParametersState:e=>({...e,...gU}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload}}}),{clearInitialImage:vU,resetParametersState:Pze,resetSeed:Tze,setAllImageToImageParameters:hwe,setAllParameters:yU,setAllTextToImageParameters:Lze,setCfgScale:bU,setHeight:SU,setImg2imgStrength:p8,setInfillMethod:xU,setInitialImage:T0,setIterations:pwe,setMaskPath:wU,setParameter:Aze,setPerlin:CU,setPrompt:$x,setNegativePrompt:ny,setSampler:_U,setSeamBlur:GI,setSeamless:kU,setSeamSize:qI,setSeamSteps:YI,setSeamStrength:KI,setSeed:$y,setSeedWeights:EU,setShouldFitToWidthHeight:PU,setShouldGenerateVariations:gwe,setShouldRandomizeSeed:mwe,setSteps:TU,setThreshold:LU,setTileSize:XI,setVariationAmount:vwe,setWidth:AU}=mU.actions,ywe=mU.reducer,OU={codeformerFidelity:.75,facetoolStrength:.8,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingDenoising:.75,upscalingStrength:.75},bwe=OU,MU=pp({name:"postprocessing",initialState:bwe,reducers:{setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingDenoising:(e,t)=>{e.upscalingDenoising=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setHiresStrength:(e,t)=>{e.hiresStrength=t.payload},resetPostprocessingState:e=>({...e,...OU}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload}}}),{resetPostprocessingState:Oze,setCodeformerFidelity:IU,setFacetoolStrength:g8,setFacetoolType:j4,setHiresFix:gP,setHiresStrength:ZI,setShouldLoopback:Swe,setShouldRunESRGAN:xwe,setShouldRunFacetool:wwe,setUpscalingLevel:RU,setUpscalingDenoising:m8,setUpscalingStrength:v8}=MU.actions,Cwe=MU.reducer;function Qs(e){return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qs(e)}function gu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _we(e,t){if(Qs(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qs(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DU(e){var t=_we(e,"string");return Qs(t)==="symbol"?t:String(t)}function QI(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};gu(this,e),this.init(t,n)}return mu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||Awe,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function rR(e,t,n){var r=mP(e,t,Object),i=r.obj,o=r.k;i[o]=n}function Iwe(e,t,n,r){var i=mP(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function J5(e,t){var n=mP(e,t),r=n.obj,i=n.k;if(r)return r[i]}function iR(e,t,n){var r=J5(e,n);return r!==void 0?r:J5(t,n)}function NU(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):NU(e[r],t[r],n):e[r]=t[r]);return e}function Ng(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Rwe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Dwe(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return Rwe[t]}):e}var Hx=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Nwe=[" ",",","?","!",";"];function jwe(e,t,n){t=t||"",n=n||"";var r=Nwe.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function oR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ab(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jU(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?jU(l,u,n):void 0}i=i[r[o]]}return i}}var $we=function(e){zx(n,e);var t=Bwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return gu(this,n),i=t.call(this),Hx&&tf.call(Hd(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return mu(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[i,o];a&&typeof a!="string"&&(d=d.concat(a)),a&&typeof a=="string"&&(d=d.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(d=i.split("."));var h=J5(this.data,d);return h||!u||typeof a!="string"?h:jU(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var d=[i,o];a&&(d=d.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(d=i.split("."),s=o,o=d[1]),this.addNamespaces(o),rR(this.data,d,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[i,o];i.indexOf(".")>-1&&(d=i.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);var h=J5(this.data,d)||{};s?NU(h,a,l):h=Ab(Ab({},h),a),rR(this.data,d,h),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Ab(Ab({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(tf),BU={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function aR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var sR={},lR=function(e){zx(n,e);var t=zwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gu(this,n),i=t.call(this),Hx&&tf.call(Hd(i)),Mwe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Hd(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Kl.create("translator"),i}return mu(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!jwe(i,a,s);if(u&&!d){var h=i.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:i,namespaces:l};var m=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),i=m.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(Qs(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,d=this.extractFromKey(i[i.length-1],o),h=d.key,m=d.namespaces,y=m[m.length-1],b=o.lng||this.language,x=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(x){var k=o.nsSeparator||this.options.nsSeparator;return l?(E.res="".concat(y).concat(k).concat(h),E):"".concat(y).concat(k).concat(h)}return l?(E.res=h,E):h}var E=this.resolve(i,o),_=E&&E.res,P=E&&E.usedKey||h,A=E&&E.exactUsedKey||h,M=Object.prototype.toString.apply(_),R=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,z=typeof _!="string"&&typeof _!="boolean"&&typeof _!="number";if(j&&_&&z&&R.indexOf(M)<0&&!(typeof D=="string"&&M==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var H=this.options.returnedObjectHandler?this.options.returnedObjectHandler(P,_,xo(xo({},o),{},{ns:m})):"key '".concat(h," (").concat(this.language,")' returned an object instead of string.");return l?(E.res=H,E):H}if(u){var K=M==="[object Array]",te=K?[]:{},G=K?A:P;for(var F in _)if(Object.prototype.hasOwnProperty.call(_,F)){var W="".concat(G).concat(u).concat(F);te[F]=this.translate(W,xo(xo({},o),{joinArrays:!1,ns:m})),te[F]===W&&(te[F]=_[F])}_=te}}else if(j&&typeof D=="string"&&M==="[object Array]")_=_.join(D),_&&(_=this.extendTranslation(_,i,o,a));else{var X=!1,Z=!1,U=o.count!==void 0&&typeof o.count!="string",Q=n.hasDefaultValue(o),re=U?this.pluralResolver.getSuffix(b,o.count,o):"",fe=o["defaultValue".concat(re)]||o.defaultValue;!this.isValidLookup(_)&&Q&&(X=!0,_=fe),this.isValidLookup(_)||(Z=!0,_=h);var Ee=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,be=Ee&&Z?void 0:_,ye=Q&&fe!==_&&this.options.updateMissing;if(Z||X||ye){if(this.logger.log(ye?"updateKey":"missingKey",b,y,h,ye?fe:_),u){var ze=this.resolve(h,xo(xo({},o),{},{keySeparator:!1}));ze&&ze.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Me=[],rt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&rt&&rt[0])for(var We=0;We1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,d,h;return typeof i=="string"&&(i=[i]),i.forEach(function(m){if(!o.isValidLookup(s)){var y=o.extractFromKey(m,a),b=y.key;l=b;var x=y.namespaces;o.options.fallbackNS&&(x=x.concat(o.options.fallbackNS));var k=a.count!==void 0&&typeof a.count!="string",E=k&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),_=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",P=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);x.forEach(function(A){o.isValidLookup(s)||(h=A,!sR["".concat(P[0],"-").concat(A)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(h)&&(sR["".concat(P[0],"-").concat(A)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(P.join(", "),`" won't get resolved as namespace "`).concat(h,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),P.forEach(function(M){if(!o.isValidLookup(s)){d=M;var R=[b];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(R,b,M,A,a);else{var D;k&&(D=o.pluralResolver.getSuffix(M,a.count,a));var j="".concat(o.options.pluralSeparator,"zero");if(k&&(R.push(b+D),E&&R.push(b+j)),_){var z="".concat(b).concat(o.options.contextSeparator).concat(a.context);R.push(z),k&&(R.push(z+D),E&&R.push(z+j))}}for(var H;H=R.pop();)o.isValidLookup(s)||(u=H,s=o.getResource(M,A,H,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:d,usedNS:h}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(tf);function PC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var uR=function(){function e(t){gu(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kl.create("languageUtils")}return mu(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=PC(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=PC(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=PC(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){u&&(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),Vwe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Wwe={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Uwe=["v1","v2","v3"],cR={zero:0,one:1,two:2,few:3,many:4,other:5};function Gwe(){var e={};return Vwe.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Wwe[t.fc]}})}),e}var qwe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gu(this,e),this.languageUtils=t,this.options=n,this.logger=Kl.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Gwe()}return mu(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return cR[a]-cR[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!Uwe.includes(this.options.compatibilityJSON)}}]),e}();function dR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function js(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};gu(this,e),this.logger=Kl.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return mu(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:Dwe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ng(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ng(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ng(r.nestingPrefix):r.nestingPrefixEscaped||Ng("$t("),this.nestingSuffix=r.nestingSuffix?Ng(r.nestingSuffix):r.nestingSuffixEscaped||Ng(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(k){return k.replace(/\$/g,"$$$$")}var m=function(E){if(E.indexOf(a.formatSeparator)<0){var _=iR(r,d,E);return a.alwaysFormat?a.format(_,void 0,i,js(js(js({},o),r),{},{interpolationkey:E})):_}var P=E.split(a.formatSeparator),A=P.shift().trim(),M=P.join(a.formatSeparator).trim();return a.format(iR(r,d,A),M,i,js(js(js({},o),r),{},{interpolationkey:A}))};this.resetRegExp();var y=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,x=[{regex:this.regexpUnescape,safeValue:function(E){return h(E)}},{regex:this.regexp,safeValue:function(E){return a.escapeValue?h(a.escape(E)):h(E)}}];return x.forEach(function(k){for(u=0;s=k.regex.exec(n);){var E=s[1].trim();if(l=m(E),l===void 0)if(typeof y=="function"){var _=y(n,s,o);l=typeof _=="string"?_:""}else if(o&&o.hasOwnProperty(E))l="";else if(b){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(E," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=nR(l));var P=k.safeValue(l);if(n=n.replace(s[0],P),b?(k.regex.lastIndex+=l.length,k.regex.lastIndex-=s[0].length):k.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(y,b){var x=this.nestingOptionsSeparator;if(y.indexOf(x)<0)return y;var k=y.split(new RegExp("".concat(x,"[ ]*{"))),E="{".concat(k[1]);y=k[0],E=this.interpolate(E,l);var _=E.match(/'/g),P=E.match(/"/g);(_&&_.length%2===0&&!P||P.length%2!==0)&&(E=E.replace(/'/g,'"'));try{l=JSON.parse(E),b&&(l=js(js({},b),l))}catch(A){return this.logger.warn("failed parsing options string in nesting for key ".concat(y),A),"".concat(y).concat(x).concat(E)}return delete l.defaultValue,y}for(;a=this.nestingRegexp.exec(n);){var d=[];l=js({},o),l.applyPostProcessor=!1,delete l.defaultValue;var h=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var m=a[1].split(this.formatSeparator).map(function(y){return y.trim()});a[1]=m.shift(),d=m,h=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=nR(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),h&&(s=d.reduce(function(y,b){return i.format(y,b,o.lng,js(js({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cd(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(a){var s=a.split(":"),l=Lwe(s),u=l[0],d=l.slice(1),h=d.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=h),h==="false"&&(n[u.trim()]=!1),h==="true"&&(n[u.trim()]=!0),isNaN(h)||(n[u.trim()]=parseInt(h,10))}})}}return{formatName:t,formatOptions:n}}function jg(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var Xwe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gu(this,e),this.logger=Kl.create("formatter"),this.options=t,this.formats={number:jg(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:jg(function(n,r){var i=new Intl.NumberFormat(n,cd(cd({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:jg(function(n,r){var i=new Intl.DateTimeFormat(n,cd({},r));return function(o){return i.format(o)}}),relativetime:jg(function(n,r){var i=new Intl.RelativeTimeFormat(n,cd({},r));return function(o){return i.format(o,r.range||"day")}}),list:jg(function(n,r){var i=new Intl.ListFormat(n,cd({},r));return function(o){return i.format(o)}})},this.init(t)}return mu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=jg(r)}},{key:"format",value:function(n,r,i,o){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,d){var h=Kwe(d),m=h.formatName,y=h.formatOptions;if(a.formats[m]){var b=u;try{var x=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},k=x.locale||x.lng||o.locale||o.lng||i;b=a.formats[m](u,k,cd(cd(cd({},y),o),x))}catch(E){a.logger.warn(E)}return b}else a.logger.warn("there was no format function for ".concat(m));return u},n);return l}}]),e}();function hR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pR(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jwe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var e6e=function(e){zx(n,e);var t=Zwe(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return gu(this,n),a=t.call(this),Hx&&tf.call(Hd(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Kl.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return mu(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},d={},h={},m={};return i.forEach(function(y){var b=!0;o.forEach(function(x){var k="".concat(y,"|").concat(x);!a.reload&&l.store.hasResourceBundle(y,x)?l.state[k]=2:l.state[k]<0||(l.state[k]===1?d[k]===void 0&&(d[k]=!0):(l.state[k]=1,b=!1,d[k]===void 0&&(d[k]=!0),u[k]===void 0&&(u[k]=!0),m[x]===void 0&&(m[x]=!0)))}),b||(h[y]=!0)}),(Object.keys(u).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(d),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var d={};this.queue.forEach(function(h){Iwe(h.loaded,[l],u),Jwe(h,i),o&&h.errors.push(o),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(function(m){d[m]||(d[m]={});var y=h.loaded[m];y.length&&y.forEach(function(b){d[m][b]===void 0&&(d[m][b]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(h){return!h.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!i.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:d});return}this.readingCalls++;var h=function(x,k){if(s.readingCalls--,s.waitingReads.length>0){var E=s.waitingReads.shift();s.read(E.lng,E.ns,E.fcName,E.tried,E.wait,E.callback)}if(x&&k&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(d){a.loadOne(d)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(d,h){d&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),d),!d&&h&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),h),o.loaded(i,d,h)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var h=pR(pR({},u),{},{isUpdate:l}),m=this.backend.create.bind(this.backend);if(m.length<6)try{var y;m.length===5?y=m(i,o,a,s,h):y=m(i,o,a,s),y&&typeof y.then=="function"?y.then(function(b){return d(null,b)}).catch(d):d(null,y)}catch(b){d(b)}else m(i,o,a,s,d,h)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(tf);function gR(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Qs(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Qs(t[2])==="object"||Qs(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function mR(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function vR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rl(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ob(){}function r6e(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var eS=function(e){zx(n,e);var t=t6e(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(gu(this,n),r=t.call(this),Hx&&tf.call(Hd(r)),r.options=mR(i),r.services={},r.logger=Kl,r.modules={external:[]},r6e(Hd(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),zy(r,Hd(r));setTimeout(function(){r.init(i,o)},0)}return r}return mu(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=gR();this.options=Rl(Rl(Rl({},s),this.options),mR(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Rl(Rl({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(E){return E?typeof E=="function"?new E:E:null}if(!this.options.isClone){this.modules.logger?Kl.init(l(this.modules.logger),this.options):Kl.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Xwe);var d=new uR(this.options);this.store=new $we(this.options.resources,this.options);var h=this.services;h.logger=Kl,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new qwe(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=l(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Ywe(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new e6e(l(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(E){for(var _=arguments.length,P=new Array(_>1?_-1:0),A=1;A<_;A++)P[A-1]=arguments[A];i.emit.apply(i,[E].concat(P))}),this.modules.languageDetector&&(h.languageDetector=l(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=l(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new lR(this.services,this.options),this.translator.on("*",function(E){for(var _=arguments.length,P=new Array(_>1?_-1:0),A=1;A<_;A++)P[A-1]=arguments[A];i.emit.apply(i,[E].concat(P))}),this.modules.external.forEach(function(E){E.init&&E.init(i)})}if(this.format=this.options.interpolation.format,a||(a=Ob),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var y=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];y.forEach(function(E){i[E]=function(){var _;return(_=i.store)[E].apply(_,arguments)}});var b=["addResource","addResources","addResourceBundle","removeResourceBundle"];b.forEach(function(E){i[E]=function(){var _;return(_=i.store)[E].apply(_,arguments),i}});var x=sv(),k=function(){var _=function(A,M){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),x.resolve(M),a(A,M)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return _(null,i.t.bind(i));i.changeLanguage(i.options.lng,_)};return this.options.resources||!this.options.initImmediate?k():setTimeout(k,0),x}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ob,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],d=function(y){if(y){var b=o.services.languageUtils.toResolveHierarchy(y);b.forEach(function(x){u.indexOf(x)<0&&u.push(x)})}};if(l)d(l);else{var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.forEach(function(m){return d(m)})}this.options.preload&&this.options.preload.forEach(function(m){return d(m)}),this.services.backendConnector.load(u,this.options.ns,function(m){!m&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=sv();return i||(i=this.languages),o||(o=this.options.ns),a||(a=Ob),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&BU.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=sv();this.emit("languageChanging",i);var l=function(m){a.language=m,a.languages=a.services.languageUtils.toResolveHierarchy(m),a.resolvedLanguage=void 0,a.setResolvedLanguage(m)},u=function(m,y){y?(l(y),a.translator.changeLanguage(y),a.isLanguageChangingTo=void 0,a.emit("languageChanged",y),a.logger.log("languageChanged",y)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(m,function(){return a.t.apply(a,arguments)})},d=function(m){!i&&!m&&a.services.languageDetector&&(m=[]);var y=typeof m=="string"?m:a.services.languageUtils.getBestMatchFromCodes(m);y&&(a.language||l(y),a.translator.language||a.translator.changeLanguage(y),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(y)),a.loadResources(y,function(b){u(b,y)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(d,h){var m;if(Qs(h)!=="object"){for(var y=arguments.length,b=new Array(y>2?y-2:0),x=2;x1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var d=function(y,b){var x=o.services.backendConnector.state["".concat(y,"|").concat(b)];return x===-1||x===2};if(a.precheck){var h=a.precheck(this,d);if(h!==void 0)return h}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,i)&&(!l||d(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=sv();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=sv();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new uR(gR());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ob,s=Rl(Rl(Rl({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(d){l[d]=i[d]}),l.services=Rl({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new lR(l.services,l.options),l.translator.on("*",function(d){for(var h=arguments.length,m=new Array(h>1?h-1:0),y=1;y0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new eS(e,t)});var zt=eS.createInstance();zt.createInstance=eS.createInstance;zt.createInstance;zt.dir;zt.init;zt.loadResources;zt.reloadResources;zt.use;zt.changeLanguage;zt.getFixedT;zt.t;zt.exists;zt.setDefaultNamespace;zt.hasLoadedNamespace;zt.loadNamespaces;zt.loadLanguages;function i6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ry(e){return ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ry(e)}function o6e(e,t){if(ry(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ry(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a6e(e){var t=o6e(e,"string");return ry(t)==="symbol"?t:String(t)}function yR(e,t){for(var n=0;n0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!bR.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!bR.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},SR={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=d6e(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},lv=null,xR=function(){if(lv!==null)return lv;try{lv=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{lv=!1}return lv},p6e={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&xR()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&xR()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},uv=null,wR=function(){if(uv!==null)return uv;try{uv=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{uv=!1}return uv},g6e={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&wR()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&wR()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},m6e={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},v6e={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},y6e={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},b6e={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function S6e(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var $U=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i6e(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return s6e(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=c6e(r,this.options||{},S6e()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(f6e),this.addDetector(h6e),this.addDetector(p6e),this.addDetector(g6e),this.addDetector(m6e),this.addDetector(v6e),this.addDetector(y6e),this.addDetector(b6e)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();$U.type="languageDetector";function b8(e){return b8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b8(e)}var zU=[],x6e=zU.forEach,w6e=zU.slice;function S8(e){return x6e.call(w6e.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function HU(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":b8(XMLHttpRequest))==="object"}function C6e(e){return!!e&&typeof e.then=="function"}function _6e(e){return C6e(e)?e:Promise.resolve(e)}function k6e(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var iy={},E6e={get exports(){return iy},set exports(e){iy=e}},u2={},P6e={get exports(){return u2},set exports(e){u2=e}},CR;function T6e(){return CR||(CR=1,function(e,t){var n=typeof self<"u"?self:_o,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(F){return F&&DataView.prototype.isPrototypeOf(F)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(F){return F&&u.indexOf(Object.prototype.toString.call(F))>-1};function h(F){if(typeof F!="string"&&(F=String(F)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(F))throw new TypeError("Invalid character in header field name");return F.toLowerCase()}function m(F){return typeof F!="string"&&(F=String(F)),F}function y(F){var W={next:function(){var X=F.shift();return{done:X===void 0,value:X}}};return s.iterable&&(W[Symbol.iterator]=function(){return W}),W}function b(F){this.map={},F instanceof b?F.forEach(function(W,X){this.append(X,W)},this):Array.isArray(F)?F.forEach(function(W){this.append(W[0],W[1])},this):F&&Object.getOwnPropertyNames(F).forEach(function(W){this.append(W,F[W])},this)}b.prototype.append=function(F,W){F=h(F),W=m(W);var X=this.map[F];this.map[F]=X?X+", "+W:W},b.prototype.delete=function(F){delete this.map[h(F)]},b.prototype.get=function(F){return F=h(F),this.has(F)?this.map[F]:null},b.prototype.has=function(F){return this.map.hasOwnProperty(h(F))},b.prototype.set=function(F,W){this.map[h(F)]=m(W)},b.prototype.forEach=function(F,W){for(var X in this.map)this.map.hasOwnProperty(X)&&F.call(W,this.map[X],X,this)},b.prototype.keys=function(){var F=[];return this.forEach(function(W,X){F.push(X)}),y(F)},b.prototype.values=function(){var F=[];return this.forEach(function(W){F.push(W)}),y(F)},b.prototype.entries=function(){var F=[];return this.forEach(function(W,X){F.push([X,W])}),y(F)},s.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function x(F){if(F.bodyUsed)return Promise.reject(new TypeError("Already read"));F.bodyUsed=!0}function k(F){return new Promise(function(W,X){F.onload=function(){W(F.result)},F.onerror=function(){X(F.error)}})}function E(F){var W=new FileReader,X=k(W);return W.readAsArrayBuffer(F),X}function _(F){var W=new FileReader,X=k(W);return W.readAsText(F),X}function P(F){for(var W=new Uint8Array(F),X=new Array(W.length),Z=0;Z-1?W:F}function j(F,W){W=W||{};var X=W.body;if(F instanceof j){if(F.bodyUsed)throw new TypeError("Already read");this.url=F.url,this.credentials=F.credentials,W.headers||(this.headers=new b(F.headers)),this.method=F.method,this.mode=F.mode,this.signal=F.signal,!X&&F._bodyInit!=null&&(X=F._bodyInit,F.bodyUsed=!0)}else this.url=String(F);if(this.credentials=W.credentials||this.credentials||"same-origin",(W.headers||!this.headers)&&(this.headers=new b(W.headers)),this.method=D(W.method||this.method||"GET"),this.mode=W.mode||this.mode||null,this.signal=W.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function z(F){var W=new FormData;return F.trim().split("&").forEach(function(X){if(X){var Z=X.split("="),U=Z.shift().replace(/\+/g," "),Q=Z.join("=").replace(/\+/g," ");W.append(decodeURIComponent(U),decodeURIComponent(Q))}}),W}function H(F){var W=new b,X=F.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(Z){var U=Z.split(":"),Q=U.shift().trim();if(Q){var re=U.join(":").trim();W.append(Q,re)}}),W}M.call(j.prototype);function K(F,W){W||(W={}),this.type="default",this.status=W.status===void 0?200:W.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in W?W.statusText:"OK",this.headers=new b(W.headers),this.url=W.url||"",this._initBody(F)}M.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},K.error=function(){var F=new K(null,{status:0,statusText:""});return F.type="error",F};var te=[301,302,303,307,308];K.redirect=function(F,W){if(te.indexOf(W)===-1)throw new RangeError("Invalid status code");return new K(null,{status:W,headers:{location:F}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(W,X){this.message=W,this.name=X;var Z=Error(W);this.stack=Z.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function G(F,W){return new Promise(function(X,Z){var U=new j(F,W);if(U.signal&&U.signal.aborted)return Z(new a.DOMException("Aborted","AbortError"));var Q=new XMLHttpRequest;function re(){Q.abort()}Q.onload=function(){var fe={status:Q.status,statusText:Q.statusText,headers:H(Q.getAllResponseHeaders()||"")};fe.url="responseURL"in Q?Q.responseURL:fe.headers.get("X-Request-URL");var Ee="response"in Q?Q.response:Q.responseText;X(new K(Ee,fe))},Q.onerror=function(){Z(new TypeError("Network request failed"))},Q.ontimeout=function(){Z(new TypeError("Network request failed"))},Q.onabort=function(){Z(new a.DOMException("Aborted","AbortError"))},Q.open(U.method,U.url,!0),U.credentials==="include"?Q.withCredentials=!0:U.credentials==="omit"&&(Q.withCredentials=!1),"responseType"in Q&&s.blob&&(Q.responseType="blob"),U.headers.forEach(function(fe,Ee){Q.setRequestHeader(Ee,fe)}),U.signal&&(U.signal.addEventListener("abort",re),Q.onreadystatechange=function(){Q.readyState===4&&U.signal.removeEventListener("abort",re)}),Q.send(typeof U._bodyInit>"u"?null:U._bodyInit)})}return G.polyfill=!0,o.fetch||(o.fetch=G,o.Headers=b,o.Request=j,o.Response=K),a.Headers=b,a.Request=j,a.Response=K,a.fetch=G,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(P6e,u2)),u2}(function(e,t){var n;if(typeof fetch=="function"&&(typeof _o<"u"&&_o.fetch?n=_o.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof k6e<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||T6e();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(E6e,iy);const VU=iy,_R=dj({__proto__:null,default:VU},[iy]);function tS(e){return tS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tS(e)}var Xu;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Xu=global.fetch:typeof window<"u"&&window.fetch?Xu=window.fetch:Xu=fetch);var oy;HU()&&(typeof global<"u"&&global.XMLHttpRequest?oy=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(oy=window.XMLHttpRequest));var nS;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?nS=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(nS=window.ActiveXObject));!Xu&&_R&&!oy&&!nS&&(Xu=VU||_R);typeof Xu!="function"&&(Xu=void 0);var x8=function(t,n){if(n&&tS(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},kR=function(t,n,r){Xu(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},ER=!1,L6e=function(t,n,r,i){t.queryStringParams&&(n=x8(n,t.queryStringParams));var o=S8({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=S8({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},ER?{}:a);try{kR(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),kR(n,s,i),ER=!0}catch(u){i(u)}}},A6e=function(t,n,r,i){r&&tS(r)==="object"&&(r=x8("",r).slice(1)),t.queryStringParams&&(n=x8(n,t.queryStringParams));try{var o;oy?o=new oy:o=new nS("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},O6e=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Xu&&n.indexOf("file:")!==0)return L6e(t,n,r,i);if(HU()||typeof ActiveXObject=="function")return A6e(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function ay(e){return ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ay(e)}function M6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PR(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};M6e(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return I6e(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=S8(i,this.options||{},N6e()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=_6e(l),l.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(d,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,d;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch{d="failed parsing "+n+" to json"}if(d)return r(d,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,d=[],h=[];n.forEach(function(m){var y=s.options.addPath;typeof s.options.addPath=="function"&&(y=s.options.addPath(m,r));var b=s.services.interpolator.interpolate(y,{lng:m,ns:r});s.options.request(s.options,b,l,function(x,k){u+=1,d.push(x),h.push(k),u===n.length&&a&&a(d,h)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(h){var m=o.toResolveHierarchy(h);m.forEach(function(y){l.indexOf(y)<0&&l.push(y)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),l.forEach(function(d){n.allOptions.ns.forEach(function(h){i.read(d,h,"read",null,null,function(m,y){m&&a.warn("loading namespace ".concat(h," for language ").concat(d," failed"),m),!m&&y&&a.log("loaded namespace ".concat(h," for language ").concat(d),y),i.loaded("".concat(d,"|").concat(h),m,y)})})})}}}]),e}();UU.type="backend";function sy(e){return sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sy(e)}function j6e(e,t){if(sy(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sy(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GU(e){var t=j6e(e,"string");return sy(t)==="symbol"?t:String(t)}function qU(e,t,n){return t=GU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B6e(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var d=t.services.backendConnector.state["".concat(l,"|").concat(u)];return d===-1||d===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function $6e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return w8("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):F6e(e,t,n)}var z6e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,H6e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},V6e=function(t){return H6e[t]},W6e=function(t){return t.replace(z6e,V6e)};function AR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OR(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};C8=OR(OR({},C8),e)}function G6e(){return C8}var YU;function q6e(e){YU=e}function Y6e(){return YU}function K6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=w.useContext(Q6e)||{},i=r.i18n,o=r.defaultNS,a=n||i||Y6e();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new J6e),!a){w8("You will need to pass in an i18next instance by using initReactI18next");var s=function(z){return Array.isArray(z)?z[z.length-1]:z},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&w8("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=TC(TC(TC({},G6e()),a.options.react),t),d=u.useSuspense,h=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var y=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(j){return $6e(j,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],h)}var x=w.useState(b),k=iCe(x,2),E=k[0],_=k[1],P=m.join(),A=oCe(P),M=w.useRef(!0);w.useEffect(function(){var j=u.bindI18n,z=u.bindI18nStore;M.current=!0,!y&&!d&&LR(a,m,function(){M.current&&_(b)}),y&&A&&A!==P&&M.current&&_(b);function H(){M.current&&_(b)}return j&&a&&a.on(j,H),z&&a&&a.store.on(z,H),function(){M.current=!1,j&&a&&j.split(" ").forEach(function(K){return a.off(K,H)}),z&&a&&z.split(" ").forEach(function(K){return a.store.off(K,H)})}},[a,P]);var R=w.useRef(!0);w.useEffect(function(){M.current&&!R.current&&_(b),R.current=!1},[a,h]);var D=[E,a,y];if(D.t=E,D.i18n=a,D.ready=y,y||!y&&!d)return D;throw new Promise(function(j){LR(a,m,function(){j()})})}zt.use(UU).use($U).use(Z6e).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","parameters","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const aCe={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:zt.isInitialized?zt.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},KU=pp({name:"system",initialState:aCe,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?zt.t("common:statusConnected"):zt.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=zt.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:sCe,setIsProcessing:ns,addLogEntry:to,setShouldShowLogViewer:LC,setIsConnected:DR,setSocketId:Mze,setShouldConfirmOnDelete:XU,setOpenAccordions:lCe,setSystemStatus:uCe,setCurrentStatus:B4,setSystemConfig:cCe,setShouldDisplayGuides:dCe,processingCanceled:fCe,errorOccurred:NR,errorSeen:ZU,setModelList:Mb,setIsCancelable:fm,modelChangeRequested:hCe,setSaveIntermediatesInterval:pCe,setEnableImageDebugging:gCe,generationRequested:mCe,addToast:Oh,clearToastQueue:vCe,setProcessingIndeterminateTask:yCe,setSearchFolder:QU,setFoundModels:JU,setOpenModel:jR}=KU.actions,bCe=KU.reducer,vP=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],SCe={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,addNewModelUIOption:null},xCe=SCe,eG=pp({name:"ui",initialState:xCe,reducers:{setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=vP.indexOf(t.payload)},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setParametersPanelScrollPosition:(e,t)=>{e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:(e,t)=>{e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:(e,t)=>{e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setAddNewModelUIOption:(e,t)=>{e.addNewModelUIOption=t.payload}}}),{setActiveTab:Yo,setCurrentTheme:wCe,setParametersPanelScrollPosition:CCe,setShouldHoldParametersPanelOpen:_Ce,setShouldPinParametersPanel:kCe,setShouldShowParametersPanel:Zu,setShouldShowDualDisplay:ECe,setShouldShowImageDetails:tG,setShouldUseCanvasBetaLayout:PCe,setShouldShowExistingModelsInSearch:TCe,setAddNewModelUIOption:Wh}=eG.actions,LCe=eG.reducer,cu=Object.create(null);cu.open="0";cu.close="1";cu.ping="2";cu.pong="3";cu.message="4";cu.upgrade="5";cu.noop="6";const F4=Object.create(null);Object.keys(cu).forEach(e=>{F4[cu[e]]=e});const ACe={type:"error",data:"parser error"},OCe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",MCe=typeof ArrayBuffer=="function",ICe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,nG=({type:e,data:t},n,r)=>OCe&&t instanceof Blob?n?r(t):BR(t,r):MCe&&(t instanceof ArrayBuffer||ICe(t))?n?r(t):BR(new Blob([t]),r):r(cu[e]+(t||"")),BR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},FR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ov=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(a&15)<<4|s>>2,d[i++]=(s&3)<<6|l&63;return u},DCe=typeof ArrayBuffer=="function",rG=(e,t)=>{if(typeof e!="string")return{type:"message",data:iG(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:NCe(e.substring(1),t)}:F4[n]?e.length>1?{type:F4[n],data:e.substring(1)}:{type:F4[n]}:ACe},NCe=(e,t)=>{if(DCe){const n=RCe(e);return iG(n,t)}else return{base64:!0,data:e}},iG=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},oG=String.fromCharCode(30),jCe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{nG(o,!1,s=>{r[a]=s,++i===n&&t(r.join(oG))})})},BCe=(e,t)=>{const n=e.split(oG),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function sG(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const $Ce=setTimeout,zCe=clearTimeout;function Vx(e,t){t.useNativeTimers?(e.setTimeoutFn=$Ce.bind(Ad),e.clearTimeoutFn=zCe.bind(Ad)):(e.setTimeoutFn=setTimeout.bind(Ad),e.clearTimeoutFn=clearTimeout.bind(Ad))}const HCe=1.33;function VCe(e){return typeof e=="string"?WCe(e):Math.ceil((e.byteLength||e.size)*HCe)}function WCe(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class UCe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class lG extends si{constructor(t){super(),this.writable=!1,Vx(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new UCe(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=rG(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const uG="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),_8=64,GCe={};let $R=0,Ib=0,zR;function HR(e){let t="";do t=uG[e%_8]+t,e=Math.floor(e/_8);while(e>0);return t}function cG(){const e=HR(+new Date);return e!==zR?($R=0,zR=e):e+"."+HR($R++)}for(;Ib<_8;Ib++)GCe[uG[Ib]]=Ib;function dG(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function qCe(e){let t={},n=e.split("&");for(let r=0,i=n.length;r{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};BCe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,jCe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=cG()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=dG(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new iu(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class iu extends si{constructor(t,n){super(),Vx(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=sG(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new hG(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=iu.requestsCount++,iu.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=KCe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete iu.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}iu.requestsCount=0;iu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",VR);else if(typeof addEventListener=="function"){const e="onpagehide"in Ad?"pagehide":"unload";addEventListener(e,VR,!1)}}function VR(){for(let e in iu.requests)iu.requests.hasOwnProperty(e)&&iu.requests[e].abort()}const pG=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Rb=Ad.WebSocket||Ad.MozWebSocket,WR=!0,QCe="arraybuffer",UR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class JCe extends lG{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=UR?{}:sG(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=WR&&!UR?n?new Rb(t,n):new Rb(t):new Rb(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||QCe,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{WR&&this.ws.send(o)}catch{}i&&pG(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=cG()),this.supportsBinary||(t.b64=1);const i=dG(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Rb}}const e7e={websocket:JCe,polling:ZCe},t7e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n7e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function k8(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=t7e.exec(e||""),o={},a=14;for(;a--;)o[n7e[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=r7e(o,o.path),o.queryKey=i7e(o,o.query),o}function r7e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function i7e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let gG=class Vg extends si{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=k8(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=k8(n.host).host),Vx(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=qCe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=aG,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new e7e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Vg.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Vg.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Vg.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=h=>{const m=new Error("probe error: "+h);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(h){n&&h.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Vg.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Vg.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,mG=Object.prototype.toString,l7e=typeof Blob=="function"||typeof Blob<"u"&&mG.call(Blob)==="[object BlobConstructor]",u7e=typeof File=="function"||typeof File<"u"&&mG.call(File)==="[object FileConstructor]";function yP(e){return a7e&&(e instanceof ArrayBuffer||s7e(e))||l7e&&e instanceof Blob||u7e&&e instanceof File}function $4(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case dn.ACK:case dn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class p7e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=d7e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const g7e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:bP,Encoder:h7e,get PacketType(){return dn},protocol:f7e},Symbol.toStringTag,{value:"Module"}));function zs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const m7e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class vG extends si{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[zs(t,"open",this.onopen.bind(this)),zs(t,"packet",this.onpacket.bind(this)),zs(t,"error",this.onerror.bind(this)),zs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(m7e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:dn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:dn.CONNECT,data:t})}):this.packet({type:dn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case dn.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case dn.EVENT:case dn.BINARY_EVENT:this.onevent(t);break;case dn.ACK:case dn.BINARY_ACK:this.onack(t);break;case dn.DISCONNECT:this.ondisconnect();break;case dn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:dn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:dn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}L0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};L0.prototype.reset=function(){this.attempts=0};L0.prototype.setMin=function(e){this.ms=e};L0.prototype.setMax=function(e){this.max=e};L0.prototype.setJitter=function(e){this.jitter=e};class T8 extends si{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Vx(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new L0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||g7e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new gG(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=zs(n,"open",function(){r.onopen(),t&&t()}),o=zs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(zs(t,"ping",this.onping.bind(this)),zs(t,"data",this.ondata.bind(this)),zs(t,"error",this.onerror.bind(this)),zs(t,"close",this.onclose.bind(this)),zs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){pG(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new vG(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const cv={};function z4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=o7e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=cv[i]&&o in cv[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new T8(r,t):(cv[i]||(cv[i]=new T8(r,t)),l=cv[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(z4,{Manager:T8,Socket:vG,io:z4,connect:z4});const v7e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],y7e=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],b7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],S7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],x7e=[{key:"2x",value:2},{key:"4x",value:4}],SP=0,xP=4294967295,w7e=["gfpgan","codeformer"],C7e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var _7e=Math.PI/180;function k7e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Vm=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},gt={_global:Vm,version:"8.3.14",isBrowser:k7e(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return gt.angleDeg?e*_7e:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return gt.DD.isDragging},isDragReady(){return!!gt.DD.node},releaseCanvasOnDestroy:!0,document:Vm.document,_injectGlobal(e){Vm.Konva=e}},Or=e=>{gt[e.prototype.getClassName()]=e};gt._injectGlobal(gt);class Ea{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new Ea(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var d=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/d):-Math.acos(r/d)),l.scaleX=s/d,l.scaleY=d,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=de._getRotation(l.rotation),l}}var E7e="[object Array]",P7e="[object Number]",T7e="[object String]",L7e="[object Boolean]",A7e=Math.PI/180,O7e=180/Math.PI,AC="#",M7e="",I7e="0",R7e="Konva warning: ",GR="Konva error: ",D7e="rgb(",OC={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},N7e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Db=[];const j7e=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},de={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===E7e},_isNumber(e){return Object.prototype.toString.call(e)===P7e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===T7e},_isBoolean(e){return Object.prototype.toString.call(e)===L7e},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){Db.push(e),Db.length===1&&j7e(function(){const t=Db;Db=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=de.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(AC,M7e);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=I7e+e;return AC+e},getRGB(e){var t;return e in OC?(t=OC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===AC?this._hexToRgb(e.substring(1)):e.substr(0,4)===D7e?(t=N7e.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",de._namedColorToRBA(e)||de._hex3ColorToRGBA(e)||de._hex6ColorToRGBA(e)||de._rgbColorToRGBA(e)||de._rgbaColorToRGBA(e)||de._hslColorToRGBA(e)},_namedColorToRBA(e){var t=OC[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,d=[0,0,0];for(let h=0;h<3;h++)s=r+1/3*-(h-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,d[h]=l*255;return{r:Math.round(d[0]),g:Math.round(d[1]),b:Math.round(d[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+d*(n-e),s=t+d*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=de.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=de._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],d=l[1],h=l[2];ht.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function pf(e){return de._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||de._isBoolean(e)?e:Object.prototype.toString.call(e)}function yG(e){return e>255?255:e<0?0:Math.round(e)}function Ye(){if(gt.isUnminified)return function(e,t){return de._isNumber(e)||de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function bG(e){if(gt.isUnminified)return function(t,n){let r=de._isNumber(t),i=de._isArray(t)&&t.length==e;return!r&&!i&&de.warn(pf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function wP(){if(gt.isUnminified)return function(e,t){var n=de._isNumber(e),r=e==="auto";return n||r||de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function A0(){if(gt.isUnminified)return function(e,t){return de._isString(e)||de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function SG(){if(gt.isUnminified)return function(e,t){const n=de._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function B7e(){if(gt.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(de._isArray(e)?e.forEach(function(r){de._isNumber(r)||de.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function il(){if(gt.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||de.warn(pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function F7e(e){if(gt.isUnminified)return function(t,n){return t==null||de.isObject(t)||de.warn(pf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var dv="get",fv="set";const ee={addGetterSetter(e,t,n,r,i){ee.addGetter(e,t,n),ee.addSetter(e,t,r,i),ee.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=dv+de._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=fv+de._capitalize(t);e.prototype[i]||ee.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=fv+de._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=de._capitalize,s=dv+a(t),l=fv+a(t),u,d;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(x),void 0)}),this._fireChangeEvent(t,y,m),i&&i.call(this),this},ee.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=de._capitalize(t),r=fv+n,i=dv+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){de.error("Adding deprecated "+t);var i=dv+de._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){de.error(o);var a=this.attrs[t];return a===void 0?n:a},ee.addSetter(e,t,r,function(){de.error(o)}),ee.addOverloadedGetterSetter(e,t)},backCompat(e,t){de.each(t,function(n,r){var i=e.prototype[r],o=dv+de._capitalize(n),a=fv+de._capitalize(n);function s(){i.apply(this,arguments),de.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function $7e(e){var t=[],n=e.length,r=de,i,o;for(i=0;itypeof d=="number"?Math.floor(d):d)),o+=z7e+u.join(qR)+H7e)):(o+=s.property,t||(o+=q7e+s.val)),o+=U7e;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=K7e&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var d=arguments,h=this._context;d.length===3?h.drawImage(t,n,r):d.length===5?h.drawImage(t,n,r,i,o):d.length===9&&h.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){return this._context.isPointInPath(t,n)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=YR.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=$7e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return vn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];vn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=de._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];vn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(vn.justDragged=!0,gt._mouseListenClick=!1,gt._touchListenClick=!1,gt._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof gt.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){vn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&vn._dragElements.delete(n)})}};gt.isBrowser&&(window.addEventListener("mouseup",vn._endDragBefore,!0),window.addEventListener("touchend",vn._endDragBefore,!0),window.addEventListener("mousemove",vn._drag),window.addEventListener("touchmove",vn._drag),window.addEventListener("mouseup",vn._endDragAfter,!1),window.addEventListener("touchend",vn._endDragAfter,!1));var H4="absoluteOpacity",jb="allEventListeners",Hu="absoluteTransform",KR="absoluteScale",uh="canvas",J7e="Change",e9e="children",t9e="konva",L8="listening",XR="mouseenter",ZR="mouseleave",QR="set",JR="Shape",V4=" ",eD="stage",pd="transform",n9e="Stage",A8="visible",r9e=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(V4);let i9e=1,Qe=class O8{constructor(t){this._id=i9e++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===pd||t===Hu)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===pd||t===Hu,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(V4);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(uh)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Hu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(uh)){const{scene:t,filter:n,hit:r}=this._cache.get(uh);de.releaseCanvas(t,n,r),this._cache.delete(uh)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,h=n.hitCanvasPixelRatio||1;if(!i||!o){de.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new Wm({pixelRatio:a,width:i,height:o}),y=new Wm({pixelRatio:a,width:0,height:0}),b=new CP({pixelRatio:h,width:i,height:o}),x=m.getContext(),k=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(uh),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),x.save(),k.save(),x.translate(-s,-l),k.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(H4),this._clearSelfAndDescendantCache(KR),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,x.restore(),k.restore(),d&&(x.save(),x.beginPath(),x.rect(0,0,i,o),x.closePath(),x.setAttr("strokeStyle","red"),x.setAttr("lineWidth",5),x.stroke(),x.restore()),this._cache.set(uh,{scene:m,filter:y,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(uh)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=l.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==e9e&&(r=QR+de._capitalize(n),de._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(L8,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(A8,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;vn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!gt.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==n9e&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(pd),this._clearSelfAndDescendantCache(Hu)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new Ea,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(pd);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(pd),this._clearSelfAndDescendantCache(Hu),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return de.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return de.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&de.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(H4,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=de.isObject(i)&&!de._isPlainObject(i)&&!de._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),de._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,de._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():gt.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(r&&!this.isDragging()){var i=!1;vn._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=vn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&vn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return de.haveIntersection(r,this.getClientRect())}static create(t,n){return de._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=O8.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),gt[r]||(de.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=gt[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(arguments.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Qe.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Qe.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const d=r===this;if(u){o.save();var h=this.getAbsoluteTransform(r),m=h.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var y=this.clipX(),b=this.clipY();o.rect(y,b,a,s)}o.clip(),m=h.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var x=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";x&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(k){k[t](n,r)}),x&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(x){if(x.visible()){var k=x.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});k.width===0&&k.height===0||(o===void 0?(o=k.x,a=k.y,s=k.x+k.width,l=k.y+k.height):(o=Math.min(o,k.x),a=Math.min(a,k.y),s=Math.max(s,k.x+k.width),l=Math.max(l,k.y+k.height)))}});for(var h=this.find("Shape"),m=!1,y=0;ye.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",Bg=e=>{const t=Dv(e);if(t==="pointer")return gt.pointerEventsEnabled&&IC.pointer;if(t==="touch")return IC.touch;if(t==="mouse")return IC.mouse};function nD(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&de.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const d9e="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",W4=[];let Gx=class extends Oa{constructor(t){super(nD(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),W4.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{nD(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||de.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===a9e){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t=this.children,n=t.length,r;for(r=0;r-1&&W4.splice(n,1),de.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(de.warn(d9e),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t=t||{},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var n=new Wm({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+tD,this.content.style.height=n+tD),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;ru9e&&de.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),gt.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return wG(t,this)}setPointerCapture(t){CG(t,this)}releaseCapture(t){c2(t)}getLayers(){return this.children}_bindContentEvents(){gt.isBrowser&&c9e.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=Bg(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=Bg(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=Bg(t.type),r=Dv(t.type);if(n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!vn.isDragging||gt.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=Bg(t.type),r=Dv(t.type);if(n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(vn.justDragged=!1,gt["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;gt.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=Bg(t.type),r=Dv(t.type);if(!n)return;vn.isDragging&&vn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!vn.isDragging||gt.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=MC(l.id)||this.getIntersection(l),d=l.id,h={evt:t,pointerId:d};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},h),u),s._fireAndBubble(n.pointerleave,Object.assign({},h),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},h),s),u._fireAndBubble(n.pointerenter,Object.assign({},h),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},h))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=Bg(t.type),r=Dv(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=MC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const d=l.id,h={evt:t,pointerId:d};let m=!1;gt["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):vn.justDragged||(gt["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){gt["_"+r+"InDblClickWindow"]=!1},gt.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},h)),gt["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},h)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},h)))):(this[r+"ClickEndShape"]=null,gt["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:d}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:d}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),gt["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(M8,{evt:t}):this._fire(M8,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(I8,{evt:t}):this._fire(I8,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=MC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(hm,_P(t)),c2(t.pointerId)}_lostpointercapture(t){c2(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}])}_setPointerPosition(t){de.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Wm({width:this.width(),height:this.height()}),this.bufferHitCanvas=new CP({pixelRatio:1,width:this.width(),height:this.height()}),!!gt.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return de.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};Gx.prototype.nodeType=o9e;Or(Gx);ee.addGetterSetter(Gx,"container");var RG="hasShadow",DG="shadowRGBA",NG="patternImage",jG="linearGradient",BG="radialGradient";let Hb;function RC(){return Hb||(Hb=de.createCanvasElement().getContext("2d"),Hb)}const d2={};function f9e(e){e.fill()}function h9e(e){e.stroke()}function p9e(e){e.fill()}function g9e(e){e.stroke()}function m9e(){this._clearCache(RG)}function v9e(){this._clearCache(DG)}function y9e(){this._clearCache(NG)}function b9e(){this._clearCache(jG)}function S9e(){this._clearCache(BG)}class $e extends Qe{constructor(t){super(t);let n;for(;n=de.getRandomColor(),!(n&&!(n in d2)););this.colorKey=n,d2[n]=this}getContext(){return de.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return de.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(RG,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(NG,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=RC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Ea;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(gt.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(jG,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=RC(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return Qe.prototype.destroy.call(this),delete d2[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){de.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),d=u?this.shadowOffsetX():0,h=u?this.shadowOffsetY():0,m=s+Math.abs(d),y=l+Math.abs(h),b=u&&this.shadowBlur()||0,x=m+b*2,k=y+b*2,E={width:x,height:k,x:-(a/2+b)+Math.min(d,0)+i.x,y:-(a/2+b)+Math.min(h,0)+i.y};return n?E:this._transformedRect(E,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,d,h,m=i.isCache,y=n===this;if(!this.isVisible()&&!y)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),d=u.bufferCanvas,h=d.getContext(),h.clear(),h.save(),h._applyLineJoin(this);var x=this.getAbsoluteTransform(n).getMatrix();h.transform(x[0],x[1],x[2],x[3],x[4],x[5]),s.call(this,h,this),h.restore();var k=d.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(d._canvas,0,0,d.width/k,d.height/k)}else{if(o._applyLineJoin(this),!y){var x=this.getAbsoluteTransform(n).getMatrix();o.transform(x[0],x[1],x[2],x[3],x[4],x[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||de.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){a.save();var d=this.getAbsoluteTransform(n).getMatrix();return a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,d,h,m,y;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,d=u.length,h=de._hexToRgb(this.colorKey),m=0;mt?(u[m]=h.r,u[m+1]=h.g,u[m+2]=h.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){de.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return wG(t,this)}setPointerCapture(t){CG(t,this)}releaseCapture(t){c2(t)}}$e.prototype._fillFunc=f9e;$e.prototype._strokeFunc=h9e;$e.prototype._fillFuncHit=p9e;$e.prototype._strokeFuncHit=g9e;$e.prototype._centroid=!1;$e.prototype.nodeType="Shape";Or($e);$e.prototype.eventListeners={};$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m9e);$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",y9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",b9e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",S9e);ee.addGetterSetter($e,"stroke",void 0,SG());ee.addGetterSetter($e,"strokeWidth",2,Ye());ee.addGetterSetter($e,"fillAfterStrokeEnabled",!1);ee.addGetterSetter($e,"hitStrokeWidth","auto",wP());ee.addGetterSetter($e,"strokeHitEnabled",!0,il());ee.addGetterSetter($e,"perfectDrawEnabled",!0,il());ee.addGetterSetter($e,"shadowForStrokeEnabled",!0,il());ee.addGetterSetter($e,"lineJoin");ee.addGetterSetter($e,"lineCap");ee.addGetterSetter($e,"sceneFunc");ee.addGetterSetter($e,"hitFunc");ee.addGetterSetter($e,"dash");ee.addGetterSetter($e,"dashOffset",0,Ye());ee.addGetterSetter($e,"shadowColor",void 0,A0());ee.addGetterSetter($e,"shadowBlur",0,Ye());ee.addGetterSetter($e,"shadowOpacity",1,Ye());ee.addComponentsGetterSetter($e,"shadowOffset",["x","y"]);ee.addGetterSetter($e,"shadowOffsetX",0,Ye());ee.addGetterSetter($e,"shadowOffsetY",0,Ye());ee.addGetterSetter($e,"fillPatternImage");ee.addGetterSetter($e,"fill",void 0,SG());ee.addGetterSetter($e,"fillPatternX",0,Ye());ee.addGetterSetter($e,"fillPatternY",0,Ye());ee.addGetterSetter($e,"fillLinearGradientColorStops");ee.addGetterSetter($e,"strokeLinearGradientColorStops");ee.addGetterSetter($e,"fillRadialGradientStartRadius",0);ee.addGetterSetter($e,"fillRadialGradientEndRadius",0);ee.addGetterSetter($e,"fillRadialGradientColorStops");ee.addGetterSetter($e,"fillPatternRepeat","repeat");ee.addGetterSetter($e,"fillEnabled",!0);ee.addGetterSetter($e,"strokeEnabled",!0);ee.addGetterSetter($e,"shadowEnabled",!0);ee.addGetterSetter($e,"dashEnabled",!0);ee.addGetterSetter($e,"strokeScaleEnabled",!0);ee.addGetterSetter($e,"fillPriority","color");ee.addComponentsGetterSetter($e,"fillPatternOffset",["x","y"]);ee.addGetterSetter($e,"fillPatternOffsetX",0,Ye());ee.addGetterSetter($e,"fillPatternOffsetY",0,Ye());ee.addComponentsGetterSetter($e,"fillPatternScale",["x","y"]);ee.addGetterSetter($e,"fillPatternScaleX",1,Ye());ee.addGetterSetter($e,"fillPatternScaleY",1,Ye());ee.addComponentsGetterSetter($e,"fillLinearGradientStartPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientStartPointX",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointX",0);ee.addGetterSetter($e,"fillLinearGradientStartPointY",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillLinearGradientEndPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientEndPointX",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointX",0);ee.addGetterSetter($e,"fillLinearGradientEndPointY",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientStartPointX",0);ee.addGetterSetter($e,"fillRadialGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientEndPointX",0);ee.addGetterSetter($e,"fillRadialGradientEndPointY",0);ee.addGetterSetter($e,"fillPatternRotation",0);ee.backCompat($e,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var x9e="#",w9e="beforeDraw",C9e="draw",FG=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],_9e=FG.length;let gp=class extends Oa{constructor(t){super(t),this.canvas=new Wm,this.hitCanvas=new CP({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i<_9e;i++){const o=FG[i],a=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),s=a.shape;if(s)return s;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,i=r[3];if(i===255){const o=de._rgbToHex(r[0],r[1],r[2]),a=d2[x9e+o];return a?{shape:a}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(w9e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Oa.prototype.drawScene.call(this,i,n),this._fire(C9e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Oa.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return de.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};gp.prototype.nodeType="Layer";Or(gp);ee.addGetterSetter(gp,"imageSmoothingEnabled",!0);ee.addGetterSetter(gp,"clearBeforeDraw",!0);ee.addGetterSetter(gp,"hitGraphEnabled",!0,il());class kP extends gp{constructor(t){super(t),this.listening(!1),de.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}kP.prototype.nodeType="FastLayer";Or(kP);let l0=class extends Oa{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&de.throw("You may only add groups and shapes to groups.")}};l0.prototype.nodeType="Group";Or(l0);var DC=function(){return Vm.performance&&Vm.performance.now?function(){return Vm.performance.now()}:function(){return new Date().getTime()}}();class rs{constructor(t,n){this.id=rs.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:DC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=rD,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=iD,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;this.state===rD?this.setTime(t):this.state===iD&&this.setTime(this.duration-t)}pause(){this.state=E9e,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Xr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||f2.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=P9e++;var u=r.getLayer()||(r instanceof gt.Stage?r.getLayers():null);u||de.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new rs(function(){n.tween.onEnterFrame()},u),this.tween=new T9e(l,function(d){n._tweenFunc(d)},a,0,1,o*1e3,s),this._addListeners(),Xr.attrs[i]||(Xr.attrs[i]={}),Xr.attrs[i][this._id]||(Xr.attrs[i][this._id]={}),Xr.tweens[i]||(Xr.tweens[i]={});for(l in t)k9e[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,d,h,m;if(s=Xr.tweens[i][t],s&&delete Xr.attrs[i][s][t],o=r.getAttr(t),de._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(h=o,o=de._prepareArrayForTween(o,n,r.closed())):(d=n,n=de._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t=this.node._id,n=this._id,r=Xr.tweens[t],i;this.pause();for(i in r)delete Xr.tweens[t][i];delete Xr.attrs[t][n]}}Xr.attrs={};Xr.tweens={};Qe.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Xr(e);n.play()};const f2={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),d=a*n,h=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:h,width:d-u,height:m-h}}}fc.prototype._centroid=!0;fc.prototype.className="Arc";fc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Or(fc);ee.addGetterSetter(fc,"innerRadius",0,Ye());ee.addGetterSetter(fc,"outerRadius",0,Ye());ee.addGetterSetter(fc,"angle",0,Ye());ee.addGetterSetter(fc,"clockwise",!1,il());function R8(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),d=a*l/(s+l),h=n-u*(i-e),m=r-u*(o-t),y=n+d*(i-e),b=r+d*(o-t);return[h,m,y,b]}function aD(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);ud?u:d,k=u>d?1:u/d,E=u>d?d/u:1;t.translate(s,l),t.rotate(y),t.scale(k,E),t.arc(0,0,x,h,h+m,1-b),t.scale(1/k,1/E),t.rotate(-y),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],h=u.points[5],m=u.points[4]+h,y=Math.PI/180;if(Math.abs(d-m)m;b-=y){const x=zn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(x.x,x.y)}else for(let b=d+y;bthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return zn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return zn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return zn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],d=a[3],h=a[4],m=a[5],y=a[6];return h+=m*t/o.pathLength,zn.getPointOnEllipticalArc(s,l,u,d,h,y)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var _=null,P=[],A=l,M=u,R,D,j,z,H,K,te,G,F,W;switch(y){case"l":l+=b.shift(),u+=b.shift(),_="L",P.push(l,u);break;case"L":l=b.shift(),u=b.shift(),P.push(l,u);break;case"m":var X=b.shift(),Z=b.shift();if(l+=X,u+=Z,_="M",a.length>2&&a[a.length-1].command==="z"){for(var U=a.length-2;U>=0;U--)if(a[U].command==="M"){l=a[U].points[0]+X,u=a[U].points[1]+Z;break}}P.push(l,u),y="l";break;case"M":l=b.shift(),u=b.shift(),_="M",P.push(l,u),y="L";break;case"h":l+=b.shift(),_="L",P.push(l,u);break;case"H":l=b.shift(),_="L",P.push(l,u);break;case"v":u+=b.shift(),_="L",P.push(l,u);break;case"V":u=b.shift(),_="L",P.push(l,u);break;case"C":P.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),P.push(l,u);break;case"c":P.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",P.push(l,u);break;case"S":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),P.push(D,j,b.shift(),b.shift()),l=b.shift(),u=b.shift(),_="C",P.push(l,u);break;case"s":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),P.push(D,j,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",P.push(l,u);break;case"Q":P.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),P.push(l,u);break;case"q":P.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="Q",P.push(l,u);break;case"T":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l=b.shift(),u=b.shift(),_="Q",P.push(D,j,l,u);break;case"t":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l+=b.shift(),u+=b.shift(),_="Q",P.push(D,j,l,u);break;case"A":z=b.shift(),H=b.shift(),K=b.shift(),te=b.shift(),G=b.shift(),F=l,W=u,l=b.shift(),u=b.shift(),_="A",P=this.convertEndpointToCenterParameterization(F,W,l,u,te,G,z,H,K);break;case"a":z=b.shift(),H=b.shift(),K=b.shift(),te=b.shift(),G=b.shift(),F=l,W=u,l+=b.shift(),u+=b.shift(),_="A",P=this.convertEndpointToCenterParameterization(F,W,l,u,te,G,z,H,K);break}a.push({command:_||y,points:P,start:{x:A,y:M},pathLength:this.calcLength(A,M,_||y,P)})}(y==="z"||y==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=zn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var d=i[4],h=i[5],m=i[4]+h,y=Math.PI/180;if(Math.abs(d-m)m;l-=y)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=d+y;l1&&(s*=Math.sqrt(y),l*=Math.sqrt(y));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(h*h))/(s*s*(m*m)+l*l*(h*h)));o===a&&(b*=-1),isNaN(b)&&(b=0);var x=b*s*m/l,k=b*-l*h/s,E=(t+r)/2+Math.cos(d)*x-Math.sin(d)*k,_=(n+i)/2+Math.sin(d)*x+Math.cos(d)*k,P=function(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])},A=function(H,K){return(H[0]*K[0]+H[1]*K[1])/(P(H)*P(K))},M=function(H,K){return(H[0]*K[1]=1&&(z=0),a===0&&z>0&&(z=z-2*Math.PI),a===1&&z<0&&(z=z+2*Math.PI),[E,_,s,l,R,z,d,a]}}zn.prototype.className="Path";zn.prototype._attrsAffectingSize=["data"];Or(zn);ee.addGetterSetter(zn,"data");class mp extends hc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],y=zn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=zn.getPointOnQuadraticBezier(Math.min(1,1-a/y),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var d=(Math.atan2(u,l)+n)%n,h=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}mp.prototype.className="Arrow";Or(mp);ee.addGetterSetter(mp,"pointerLength",10,Ye());ee.addGetterSetter(mp,"pointerWidth",10,Ye());ee.addGetterSetter(mp,"pointerAtBeginning",!1);ee.addGetterSetter(mp,"pointerAtEnding",!0);let O0=class extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};O0.prototype._centroid=!0;O0.prototype.className="Circle";O0.prototype._attrsAffectingSize=["radius"];Or(O0);ee.addGetterSetter(O0,"radius",0,Ye());class gf extends $e{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}gf.prototype.className="Ellipse";gf.prototype._centroid=!0;gf.prototype._attrsAffectingSize=["radiusX","radiusY"];Or(gf);ee.addComponentsGetterSetter(gf,"radius",["x","y"]);ee.addGetterSetter(gf,"radiusX",0,Ye());ee.addGetterSetter(gf,"radiusY",0,Ye());let pc=class $G extends $e{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.attrs.image;let o;if(i){const a=this.attrs.cropWidth,s=this.attrs.cropHeight;a&&s?o=[i,this.cropX(),this.cropY(),a,s,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&t.drawImage.apply(t,o)}_hitFunc(t){var n=this.width(),r=this.height();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=de.createImageElement();i.onload=function(){var o=new $G({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};pc.prototype.className="Image";Or(pc);ee.addGetterSetter(pc,"image");ee.addComponentsGetterSetter(pc,"crop",["x","y","width","height"]);ee.addGetterSetter(pc,"cropX",0,Ye());ee.addGetterSetter(pc,"cropY",0,Ye());ee.addGetterSetter(pc,"cropWidth",0,Ye());ee.addGetterSetter(pc,"cropHeight",0,Ye());var zG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],L9e="Change.konva",A9e="none",D8="up",N8="right",j8="down",B8="left",O9e=zG.length;class EP extends l0{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}yp.prototype.className="RegularPolygon";yp.prototype._centroid=!0;yp.prototype._attrsAffectingSize=["radius"];Or(yp);ee.addGetterSetter(yp,"radius",0,Ye());ee.addGetterSetter(yp,"sides",0,Ye());var sD=Math.PI*2;class bp extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,sD,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),sD,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}bp.prototype.className="Ring";bp.prototype._centroid=!0;bp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Or(bp);ee.addGetterSetter(bp,"innerRadius",0,Ye());ee.addGetterSetter(bp,"outerRadius",0,Ye());class vu extends $e{constructor(t){super(t),this._updated=!0,this.anim=new rs(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],d=o[i+3],h=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,d),t.closePath(),t.fillStrokeShape(this)),h)if(a){var m=a[n],y=r*2;t.drawImage(h,s,l,u,d,m[y+0],m[y+1],u,d)}else t.drawImage(h,s,l,u,d,0,0,u,d)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],d=r*2;t.rect(u[d+0],u[d+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Wb;function jC(){return Wb||(Wb=de.createCanvasElement().getContext(R9e),Wb)}function U9e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function G9e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function q9e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Ar extends $e{constructor(t){super(q9e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(E+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=de._isString(t)?t:t==null?"":t+"";return this._setAttr(D9e,n),this}getWidth(){var t=this.attrs.width===Fg||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Fg||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return de.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=jC(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+Vb+this.fontVariant()+Vb+(this.fontSize()+F9e)+W9e(this.fontFamily())}_addTextLine(t){this.align()===hv&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return jC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` -`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Fg&&o!==void 0,l=a!==Fg&&a!==void 0,u=this.padding(),d=o-u*2,h=a-u*2,m=0,y=this.wrap(),b=y!==cD,x=y!==H9e&&b,k=this.ellipsis();this.textArr=[],jC().font=this._getContextFont();for(var E=k?this._getTextWidth(NC):0,_=0,P=t.length;_d)for(;A.length>0;){for(var R=0,D=A.length,j="",z=0;R>>1,K=A.slice(0,H+1),te=this._getTextWidth(K)+E;te<=d?(R=H+1,j=K,z=te):D=H}if(j){if(x){var G,F=A[j.length],W=F===Vb||F===lD;W&&z<=d?G=j.length:G=Math.max(j.lastIndexOf(Vb),j.lastIndexOf(lD))+1,G>0&&(R=G,j=j.slice(0,R),z=this._getTextWidth(j))}j=j.trimRight(),this._addTextLine(j),r=Math.max(r,z),m+=i;var X=this._shouldHandleEllipsis(m);if(X){this._tryToAddEllipsisToLastLine();break}if(A=A.slice(R),A=A.trimLeft(),A.length>0&&(M=this._getTextWidth(A),M<=d)){this._addTextLine(A),m+=i,r=Math.max(r,M);break}}else break}else this._addTextLine(A),m+=i,r=Math.max(r,M),this._shouldHandleEllipsis(m)&&_h)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Fg&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==cD;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Fg&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+NC)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var d=HG(this.text()),h=this.text().split(" ").length-1,m,y,b,x=-1,k=0,E=function(){k=0;for(var te=t.dataArray,G=x+1;G0)return x=G,te[G];te[G].command==="M"&&(m={x:te[G].points[0],y:te[G].points[1]})}return{}},_=function(te){var G=t._getTextSize(te).width+r;te===" "&&i==="justify"&&(G+=(s-a)/h);var F=0,W=0;for(y=void 0;Math.abs(G-F)/G>.01&&W<20;){W++;for(var X=F;b===void 0;)b=E(),b&&X+b.pathLengthG?y=zn.getPointOnLine(G,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var U=b.points[4],Q=b.points[5],re=b.points[4]+Q;k===0?k=U+1e-8:G>F?k+=Math.PI/180*Q/Math.abs(Q):k-=Math.PI/360*Q/Math.abs(Q),(Q<0&&k=0&&k>re)&&(k=re,Z=!0),y=zn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],k,b.points[6]);break;case"C":k===0?G>b.pathLength?k=1e-8:k=G/b.pathLength:G>F?k+=(G-F)/b.pathLength/2:k=Math.max(k-(F-G)/b.pathLength/2,0),k>1&&(k=1,Z=!0),y=zn.getPointOnCubicBezier(k,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":k===0?k=G/b.pathLength:G>F?k+=(G-F)/b.pathLength:k-=(F-G)/b.pathLength,k>1&&(k=1,Z=!0),y=zn.getPointOnQuadraticBezier(k,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}y!==void 0&&(F=zn.getLineLength(m.x,m.y,y.x,y.y)),Z&&(Z=!1,b=void 0)}},P="C",A=t._getTextSize(P).width+r,M=u/A-1,R=0;Re+`.${KG}`).join(" "),dD="nodesRect",X9e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Z9e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const Q9e="ontouchstart"in gt._global;function J9e(e,t){if(e==="rotater")return"crosshair";t+=de.degToRad(Z9e[e]||0);var n=(de.radToDeg(t)%360+360)%360;return de._inRange(n,315+22.5,360)||de._inRange(n,0,22.5)?"ns-resize":de._inRange(n,45-22.5,45+22.5)?"nesw-resize":de._inRange(n,90-22.5,90+22.5)?"ew-resize":de._inRange(n,135-22.5,135+22.5)?"nwse-resize":de._inRange(n,180-22.5,180+22.5)?"ns-resize":de._inRange(n,225-22.5,225+22.5)?"nesw-resize":de._inRange(n,270-22.5,270+22.5)?"ew-resize":de._inRange(n,315-22.5,315+22.5)?"nwse-resize":(de.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var rS=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],fD=1e8;function e8e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function XG(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function t8e(e,t){const n=e8e(e);return XG(e,t,n)}function n8e(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(X9e.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(dD),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(dD,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(gt.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return XG(d,-gt.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-fD,y:-fD,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const d=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var h=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],m=u.getAbsoluteTransform();h.forEach(function(y){var b=m.point(y);n.push(b)})});const r=new Ea;r.rotate(-gt.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var d=r.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:gt.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),rS.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new Hy({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Q9e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=gt.getAngle(this.rotation()),o=J9e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new $e({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*de._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const d=o.getAbsolutePosition();if(!(u.x===d.x&&u.y===d.y)){if(this._movingAnchorName==="rotater"){var h=this._getNodeRect();n=o.x()-h.width/2,r=-o.y()+h.height/2;let te=Math.atan2(-r,n)+Math.PI/2;h.height<0&&(te-=Math.PI);var m=gt.getAngle(this.rotation());const G=m+te,F=gt.getAngle(this.rotationSnapTolerance()),X=n8e(this.rotationSnaps(),G,F)-h.rotation,Z=t8e(h,X);this._fitNodesInto(Z,t);return}var y=this.keepRatio()||t.shiftKey,_=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var x=this.findOne(".top-left").x()>b.x?-1:1,k=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*x,r=i*this.sin*k,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-b.x,2)+Math.pow(b.y-o.y(),2));var x=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*x,r=i*this.sin*k,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var E=o.position();this.findOne(".top-left").y(E.y),this.findOne(".bottom-right").x(E.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var x=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(de._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(de._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new Ea;if(a.rotate(gt.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const h=a.point({x:-this.padding()*2,y:0});if(t.x+=h.x,t.y+=h.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const h=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const h=a.point({x:0,y:-this.padding()*2});if(t.x+=h.x,t.y+=h.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const h=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const h=this.boundBoxFunc()(r,t);h?t=h:de.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new Ea;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new Ea;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const d=u.multiply(l.invert());this._nodes.forEach(h=>{var m;const y=h.getParent().getAbsoluteTransform(),b=h.getTransform().copy();b.translate(h.offsetX(),h.offsetY());const x=new Ea;x.multiply(y.copy().invert()).multiply(d).multiply(y).multiply(b);const k=x.decompose();h.setAttrs(k),this._fire("transform",{evt:n,target:h}),h._fire("transform",{evt:n,target:h}),(m=h.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(de._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(de._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*de._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),l0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Qe.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function r8e(e){return e instanceof Array||de.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){rS.indexOf(t)===-1&&de.warn("Unknown anchor name: "+t+". Available names are: "+rS.join(", "))}),e||[]}In.prototype.className="Transformer";Or(In);ee.addGetterSetter(In,"enabledAnchors",rS,r8e);ee.addGetterSetter(In,"flipEnabled",!0,il());ee.addGetterSetter(In,"resizeEnabled",!0);ee.addGetterSetter(In,"anchorSize",10,Ye());ee.addGetterSetter(In,"rotateEnabled",!0);ee.addGetterSetter(In,"rotationSnaps",[]);ee.addGetterSetter(In,"rotateAnchorOffset",50,Ye());ee.addGetterSetter(In,"rotationSnapTolerance",5,Ye());ee.addGetterSetter(In,"borderEnabled",!0);ee.addGetterSetter(In,"anchorStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"anchorStrokeWidth",1,Ye());ee.addGetterSetter(In,"anchorFill","white");ee.addGetterSetter(In,"anchorCornerRadius",0,Ye());ee.addGetterSetter(In,"borderStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"borderStrokeWidth",1,Ye());ee.addGetterSetter(In,"borderDash");ee.addGetterSetter(In,"keepRatio",!0);ee.addGetterSetter(In,"centeredScaling",!1);ee.addGetterSetter(In,"ignoreStroke",!1);ee.addGetterSetter(In,"padding",0,Ye());ee.addGetterSetter(In,"node");ee.addGetterSetter(In,"nodes");ee.addGetterSetter(In,"boundBoxFunc");ee.addGetterSetter(In,"anchorDragBoundFunc");ee.addGetterSetter(In,"shouldOverdrawWholeArea",!1);ee.addGetterSetter(In,"useSingleNodeRotation",!0);ee.backCompat(In,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class gc extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,gt.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}gc.prototype.className="Wedge";gc.prototype._centroid=!0;gc.prototype._attrsAffectingSize=["radius"];Or(gc);ee.addGetterSetter(gc,"radius",0,Ye());ee.addGetterSetter(gc,"angle",0,Ye());ee.addGetterSetter(gc,"clockwise",!1);ee.backCompat(gc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function hD(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var i8e=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],o8e=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function a8e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,d,h,m,y,b,x,k,E,_,P,A,M,R,D,j,z,H,K,te,G=t+t+1,F=r-1,W=i-1,X=t+1,Z=X*(X+1)/2,U=new hD,Q=null,re=U,fe=null,Ee=null,be=i8e[t],ye=o8e[t];for(s=1;s>ye,K!==0?(K=255/K,n[d]=(m*be>>ye)*K,n[d+1]=(y*be>>ye)*K,n[d+2]=(b*be>>ye)*K):n[d]=n[d+1]=n[d+2]=0,m-=k,y-=E,b-=_,x-=P,k-=fe.r,E-=fe.g,_-=fe.b,P-=fe.a,l=h+((l=o+t+1)>ye,K>0?(K=255/K,n[l]=(m*be>>ye)*K,n[l+1]=(y*be>>ye)*K,n[l+2]=(b*be>>ye)*K):n[l]=n[l+1]=n[l+2]=0,m-=k,y-=E,b-=_,x-=P,k-=fe.r,E-=fe.g,_-=fe.b,P-=fe.a,l=o+((l=a+X)0&&a8e(t,n)};ee.addGetterSetter(Qe,"blurRadius",0,Ye(),ee.afterSetFilter);const l8e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};ee.addGetterSetter(Qe,"contrast",0,Ye(),ee.afterSetFilter);const c8e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,d=l*4,h=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:de.error("Unknown emboss direction: "+r)}do{var m=(h-1)*d,y=o;h+y<1&&(y=0),h+y>u&&(y=0);var b=(h-1+y)*l*4,x=l;do{var k=m+(x-1)*4,E=a;x+E<1&&(E=0),x+E>l&&(E=0);var _=b+(x-1+E)*4,P=s[k]-s[_],A=s[k+1]-s[_+1],M=s[k+2]-s[_+2],R=P,D=R>0?R:-R,j=A>0?A:-A,z=M>0?M:-M;if(j>D&&(R=A),z>D&&(R=M),R*=t,i){var H=s[k]+R,K=s[k+1]+R,te=s[k+2]+R;s[k]=H>255?255:H<0?0:H,s[k+1]=K>255?255:K<0?0:K,s[k+2]=te>255?255:te<0?0:te}else{var G=n-R;G<0?G=0:G>255&&(G=255),s[k]=s[k+1]=s[k+2]=G}}while(--x)}while(--h)};ee.addGetterSetter(Qe,"embossStrength",.5,Ye(),ee.afterSetFilter);ee.addGetterSetter(Qe,"embossWhiteLevel",.5,Ye(),ee.afterSetFilter);ee.addGetterSetter(Qe,"embossDirection","top-left",null,ee.afterSetFilter);ee.addGetterSetter(Qe,"embossBlend",!1,null,ee.afterSetFilter);function BC(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const d8e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],d=u,h,m,y=this.enhance();if(y!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),h=t[m+2],hd&&(d=h);i===r&&(i=255,r=0),s===a&&(s=255,a=0),d===u&&(d=255,u=0);var b,x,k,E,_,P,A,M,R;for(y>0?(x=i+y*(255-i),k=r-y*(r-0),_=s+y*(255-s),P=a-y*(a-0),M=d+y*(255-d),R=u-y*(u-0)):(b=(i+r)*.5,x=i+y*(i-b),k=r+y*(r-b),E=(s+a)*.5,_=s+y*(s-E),P=a+y*(a-E),A=(d+u)*.5,M=d+y*(d-A),R=u+y*(u-A)),m=0;mE?k:E;var _=a,P=o,A,M,R=360/P*Math.PI/180,D,j;for(M=0;MP?_:P;var A=a,M=o,R,D,j=n.polarRotation||0,z,H;for(d=0;dt&&(A=P,M=0,R=-1),i=0;i=0&&y=0&&b=0&&y=0&&b=255*4?255:0}return a}function _8e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&y=0&&b=n))for(o=x;o=r||(a=(n*o+i)*4,s+=A[a+0],l+=A[a+1],u+=A[a+2],d+=A[a+3],P+=1);for(s=s/P,l=l/P,u=u/P,d=d/P,i=y;i=n))for(o=x;o=r||(a=(n*o+i)*4,A[a+0]=s,A[a+1]=l,A[a+2]=u,A[a+3]=d)}};ee.addGetterSetter(Qe,"pixelSize",8,Ye(),ee.afterSetFilter);const T8e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"blue",0,yG,ee.afterSetFilter);const A8e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"blue",0,yG,ee.afterSetFilter);ee.addGetterSetter(Qe,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const O8e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),d>127&&(d=255-d),h>127&&(h=255-h),t[l]=u,t[l+1]=d,t[l+2]=h}while(--s)}while(--o)},I8e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new Wg.Stage({container:i,width:n,height:r}),a=new Wg.Layer,s=new Wg.Layer;a.add(new Wg.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new Wg.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l};let ZG=null,QG=null;const D8e=e=>{ZG=e},nl=()=>ZG,N8e=e=>{QG=e},JG=()=>QG,j8e=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},eq=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),B8e=e=>{const t=nl(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:o,systemState:a}=e,{codeformerFidelity:s,facetoolStrength:l,facetoolType:u,hiresFix:d,hiresStrength:h,shouldRunESRGAN:m,shouldRunFacetool:y,upscalingLevel:b,upscalingStrength:x,upscalingDenoising:k}=i,{cfgScale:E,height:_,img2imgStrength:P,infillMethod:A,initialImage:M,iterations:R,perlin:D,prompt:j,negativePrompt:z,sampler:H,seamBlur:K,seamless:te,seamSize:G,seamSteps:F,seamStrength:W,seed:X,seedWeights:Z,shouldFitToWidthHeight:U,shouldGenerateVariations:Q,shouldRandomizeSeed:re,steps:fe,threshold:Ee,tileSize:be,variationAmount:ye,width:ze}=r,{shouldDisplayInProgressType:Me,saveIntermediatesInterval:rt,enableImageDebugging:We}=a,Be={prompt:j,iterations:R,steps:fe,cfg_scale:E,threshold:Ee,perlin:D,height:_,width:ze,sampler_name:H,seed:X,progress_images:Me==="full-res",progress_latents:Me==="latents",save_intermediates:rt,generation_mode:n,init_mask:""};let wt=!1,Fe=!1;if(z!==""&&(Be.prompt=`${j} [${z}]`),Be.seed=re?eq(SP,xP):X,["txt2img","img2img"].includes(n)&&(Be.seamless=te,Be.hires_fix=d,d&&(Be.strength=h),m&&(wt={level:b,denoise_str:k,strength:x}),y&&(Fe={type:u,strength:l},u==="codeformer"&&(Fe.codeformer_fidelity=s))),n==="img2img"&&M&&(Be.init_img=typeof M=="string"?M:M.url,Be.strength=P,Be.fit=U),n==="unifiedCanvas"&&t){const{layerState:{objects:at},boundingBoxCoordinates:bt,boundingBoxDimensions:Le,stageScale:ut,isMaskEnabled:Mt,shouldPreserveMaskedArea:ct,boundingBoxScaleMethod:_t,scaledBoundingBoxDimensions:un}=o,ae={...bt,...Le},De=R8e(Mt?at.filter(lP):[],ae);Be.init_mask=De,Be.fit=!1,Be.strength=P,Be.invert_mask=ct,Be.bounding_box=ae;const Ke=t.scale();t.scale({x:1/ut,y:1/ut});const Xe=t.getAbsolutePosition(),xe=t.toDataURL({x:ae.x+Xe.x,y:ae.y+Xe.y,width:ae.width,height:ae.height});We&&j8e([{base64:De,caption:"mask sent as init_mask"},{base64:xe,caption:"image sent as init_img"}]),t.scale(Ke),Be.init_img=xe,Be.progress_images=!1,_t!=="none"&&(Be.inpaint_width=un.width,Be.inpaint_height=un.height),Be.seam_size=G,Be.seam_blur=K,Be.seam_strength=W,Be.seam_steps=F,Be.tile_size=be,Be.infill_method=A,Be.force_outpaint=!1}return Q?(Be.variation_amount=ye,Z&&(Be.with_variations=dwe(Z))):Be.variation_amount=0,We&&(Be.enable_image_debugging=We),{generationParameters:Be,esrganParameters:wt,facetoolParameters:Fe}};var F8e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,$8e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,z8e=/[^-+\dA-Z]/g;function no(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(pD[t]||t||pD.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},d=function(){return e[o()+"Hours"]()},h=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},y=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},x=function(){return H8e(e)},k=function(){return V8e(e)},E={d:function(){return a()},dd:function(){return Ca(a())},ddd:function(){return Go.dayNames[s()]},DDD:function(){return gD({y:u(),m:l(),d:a(),_:o(),dayName:Go.dayNames[s()],short:!0})},dddd:function(){return Go.dayNames[s()+7]},DDDD:function(){return gD({y:u(),m:l(),d:a(),_:o(),dayName:Go.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Ca(l()+1)},mmm:function(){return Go.monthNames[l()]},mmmm:function(){return Go.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return Ca(u(),4)},h:function(){return d()%12||12},hh:function(){return Ca(d()%12||12)},H:function(){return d()},HH:function(){return Ca(d())},M:function(){return h()},MM:function(){return Ca(h())},s:function(){return m()},ss:function(){return Ca(m())},l:function(){return Ca(y(),3)},L:function(){return Ca(Math.floor(y()/10))},t:function(){return d()<12?Go.timeNames[0]:Go.timeNames[1]},tt:function(){return d()<12?Go.timeNames[2]:Go.timeNames[3]},T:function(){return d()<12?Go.timeNames[4]:Go.timeNames[5]},TT:function(){return d()<12?Go.timeNames[6]:Go.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":W8e(e)},o:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60),2)+":"+Ca(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return x()},WW:function(){return Ca(x())},N:function(){return k()}};return t.replace(F8e,function(_){return _ in E?E[_]():_.slice(1,_.length-1)})}var pD={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Go={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Ca=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},gD=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,d=new Date;d.setDate(d[o+"Date"]()-1);var h=new Date;h.setDate(h[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},y=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},x=function(){return d[o+"Date"]()},k=function(){return d[o+"Month"]()},E=function(){return d[o+"FullYear"]()},_=function(){return h[o+"Date"]()},P=function(){return h[o+"Month"]()},A=function(){return h[o+"FullYear"]()};return b()===n&&y()===r&&m()===i?l?"Tdy":"Today":E()===n&&k()===r&&x()===i?l?"Ysd":"Yesterday":A()===n&&P()===r&&_()===i?l?"Tmw":"Tomorrow":a},H8e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},V8e=function(t){var n=t.getDay();return n===0&&(n=7),n},W8e=function(t){return(String(t).match($8e)||[""]).pop().replace(z8e,"").replace(/GMT\+0000/g,"UTC")};const U8e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(ns(!0));const o=r(),{generation:a,postprocessing:s,system:l,canvas:u}=o,d={generationMode:i,generationState:a,postprocessingState:s,canvasState:u,systemState:l};n(mCe());const{generationParameters:h,esrganParameters:m,facetoolParameters:y}=B8e(d);t.emit("generateImage",h,m,y),h.init_mask&&(h.init_mask=h.init_mask.substr(0,64).concat("...")),h.init_img&&(h.init_img=h.init_img.substr(0,64).concat("...")),n(to({timestamp:no(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...h,...m,...y})}`}))},emitRunESRGAN:i=>{n(ns(!0));const{postprocessing:{upscalingLevel:o,upscalingDenoising:a,upscalingStrength:s}}=r(),l={upscale:[o,a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(ns(!0));const{postprocessing:{facetoolType:o,facetoolStrength:a,codeformerFidelity:s}}=r(),l={facetool_strength:a};o==="codeformer"&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",i,{type:o,...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`Face restoration (${o}) requested: ${JSON.stringify({file:i.url,...l})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(fU(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitConvertToDiffusers:i=>{t.emit("convertToDiffusers",i)},emitRequestModelChange:i=>{n(hCe()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}};let Gb;const G8e=new Uint8Array(16);function q8e(){if(!Gb&&(Gb=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gb(G8e)}const Hi=[];for(let e=0;e<256;++e)Hi.push((e+256).toString(16).slice(1));function Y8e(e,t=0){return(Hi[e[t+0]]+Hi[e[t+1]]+Hi[e[t+2]]+Hi[e[t+3]]+"-"+Hi[e[t+4]]+Hi[e[t+5]]+"-"+Hi[e[t+6]]+Hi[e[t+7]]+"-"+Hi[e[t+8]]+Hi[e[t+9]]+"-"+Hi[e[t+10]]+Hi[e[t+11]]+Hi[e[t+12]]+Hi[e[t+13]]+Hi[e[t+14]]+Hi[e[t+15]]).toLowerCase()}const K8e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),mD={randomUUID:K8e};function pm(e,t,n){if(mD.randomUUID&&!t&&!e)return mD.randomUUID();e=e||{};const r=e.random||(e.rng||q8e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Y8e(r)}const F8=Tr("socketio/generateImage"),X8e=Tr("socketio/runESRGAN"),Z8e=Tr("socketio/runFacetool"),Q8e=Tr("socketio/deleteImage"),$8=Tr("socketio/requestImages"),vD=Tr("socketio/requestNewImages"),J8e=Tr("socketio/cancelProcessing"),e_e=Tr("socketio/requestSystemConfig"),yD=Tr("socketio/searchForModels"),Vy=Tr("socketio/addNewModel"),t_e=Tr("socketio/deleteModel"),n_e=Tr("socketio/convertToDiffusers"),tq=Tr("socketio/requestModelChange"),r_e=Tr("socketio/saveStagingAreaImageToGallery"),i_e=Tr("socketio/requestEmptyTempFolder"),o_e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(DR(!0)),t(B4(zt.t("common:statusConnected"))),t(e_e());const r=n().gallery;r.categories.result.latest_mtime?t(vD("result")):t($8("result")),r.categories.user.latest_mtime?t(vD("user")):t($8("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(DR(!1)),t(B4(zt.t("common:statusDisconnected"))),t(to({timestamp:no(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:o}=i.ui,{shouldLoopback:a}=i.postprocessing,{boundingBox:s,generationMode:l,...u}=r,d={uuid:pm(),...u};if(["txt2img","img2img"].includes(l)&&t(dm({category:"result",image:{...d,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:h}=r;t(Axe({image:{...d,category:"temp"},boundingBox:h})),i.canvas.shouldAutoSave&&t(dm({image:{...d,category:"result"},category:"result"}))}if(a)switch(vP[o]){case"img2img":{t(T0(d));break}}t(EC()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(Jxe({uuid:pm(),...r,category:"result"})),r.isBase64||t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(dm({category:"result",image:{uuid:pm(),...r,category:"result"}})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(ns(!0)),t(uCe(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(to({timestamp:no(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(NR()),t(EC())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:pm(),...l}));t(Qxe({images:s,areMoreImagesAvailable:o,category:a})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(fCe());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(dm({category:"result",image:r})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(EC())),t(to({timestamp:no(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(fU(r));const{generation:{initialImage:o,maskPath:a}}=n();(o===i||(o==null?void 0:o.url)===i)&&t(vU()),a===i&&t(wU("")),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(cCe(r)),r.infill_methods.includes("patchmatch")||t(xU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(QU(i)),t(JU(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(Mb(o)),t(ns(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t(Oh({title:a?`${zt.t("modelmanager:modelUpdated")}: ${i}`:`${zt.t("modelmanager:modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(Mb(o)),t(ns(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`${zt.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t(Oh({title:`${zt.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(Mb(o)),t(B4(zt.t("common:statusModelChanged"))),t(ns(!1)),t(fm(!0)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(Mb(o)),t(ns(!1)),t(fm(!0)),t(NR()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Oh({title:zt.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},a_e=()=>{const{origin:e}=new URL(window.location.href),t=z4(e,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:d,onGenerationResult:h,onIntermediateResult:m,onProgressUpdate:y,onGalleryImages:b,onProcessingCanceled:x,onImageDeleted:k,onSystemConfig:E,onModelChanged:_,onFoundModels:P,onNewModelAdded:A,onModelDeleted:M,onModelChangeFailed:R,onTempFolderEmptied:D}=o_e(i),{emitGenerateImage:j,emitRunESRGAN:z,emitRunFacetool:H,emitDeleteImage:K,emitRequestImages:te,emitRequestNewImages:G,emitCancelProcessing:F,emitRequestSystemConfig:W,emitSearchForModels:X,emitAddNewModel:Z,emitDeleteModel:U,emitConvertToDiffusers:Q,emitRequestModelChange:re,emitSaveStagingAreaImageToGallery:fe,emitRequestEmptyTempFolder:Ee}=U8e(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",be=>u(be)),t.on("generationResult",be=>h(be)),t.on("postprocessingResult",be=>d(be)),t.on("intermediateResult",be=>m(be)),t.on("progressUpdate",be=>y(be)),t.on("galleryImages",be=>b(be)),t.on("processingCanceled",()=>{x()}),t.on("imageDeleted",be=>{k(be)}),t.on("systemConfig",be=>{E(be)}),t.on("foundModels",be=>{P(be)}),t.on("newModelAdded",be=>{A(be)}),t.on("modelDeleted",be=>{M(be)}),t.on("modelChanged",be=>{_(be)}),t.on("modelChangeFailed",be=>{R(be)}),t.on("tempFolderEmptied",()=>{D()}),n=!0),a.type){case"socketio/generateImage":{j(a.payload);break}case"socketio/runESRGAN":{z(a.payload);break}case"socketio/runFacetool":{H(a.payload);break}case"socketio/deleteImage":{K(a.payload);break}case"socketio/requestImages":{te(a.payload);break}case"socketio/requestNewImages":{G(a.payload);break}case"socketio/cancelProcessing":{F();break}case"socketio/requestSystemConfig":{W();break}case"socketio/searchForModels":{X(a.payload);break}case"socketio/addNewModel":{Z(a.payload);break}case"socketio/deleteModel":{U(a.payload);break}case"socketio/convertToDiffusers":{Q(a.payload);break}case"socketio/requestModelChange":{re(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{fe(a.payload);break}case"socketio/requestEmptyTempFolder":{Ee();break}}o(a)}},s_e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),l_e=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map(e=>`system.${e}`),u_e=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),nq=RW({generation:ywe,postprocessing:Cwe,gallery:awe,system:bCe,canvas:Xxe,ui:LCe,lightbox:uwe}),c_e=UW.getPersistConfig({key:"root",storage:WW,rootReducer:nq,blacklist:[...s_e,...l_e,...u_e],debounce:300}),d_e=rxe(c_e,nq),rq=ISe({reducer:d_e,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(a_e()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),iq=uxe(rq),PP=w.createContext(null),Oe=q5e,he=N5e;let bD;const TP=()=>({setOpenUploader:e=>{e&&(bD=e)},openUploader:bD}),Mr=lt(e=>e.ui,e=>vP[e.activeTab],{memoizeOptions:{equalityCheck:ke.isEqual}}),f_e=lt(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:ke.isEqual}}),Sp=lt(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),SD=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Mr(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:a})).json(),u={uuid:pm(),category:"user",...l};t(dm({image:u,category:"user"})),o==="unifiedCanvas"?t(Fx(u)):o==="img2img"&&t(T0(u))};function h_e(){const{t:e}=Ge();return v.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[v.jsx("h1",{children:e("common:nodes")}),v.jsx("p",{children:e("common:nodesDesc")})]})}const p_e=()=>{const{t:e}=Ge();return v.jsxs("div",{className:"work-in-progress post-processing-work-in-progress",children:[v.jsx("h1",{children:e("common:postProcessing")}),v.jsx("p",{children:e("common:postProcessDesc1")}),v.jsx("p",{children:e("common:postProcessDesc2")}),v.jsx("p",{children:e("common:postProcessDesc3")})]})};function g_e(){const{t:e}=Ge();return v.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[v.jsx("h1",{children:e("common:training")}),v.jsxs("p",{children:[e("common:trainingDesc1"),v.jsx("br",{}),v.jsx("br",{}),e("common:trainingDesc2")]})]})}function m_e(e){const{i18n:t}=Ge(),n=localStorage.getItem("i18nextLng");N.useEffect(()=>{e()},[e]),N.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const v_e=yt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:v.jsx("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),y_e=yt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),b_e=yt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),S_e=yt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:v.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:v.jsx("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})}),x_e=yt({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),w_e=yt({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})}),Je=Ae((e,t)=>{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return v.jsx(uo,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:v.jsx(us,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})}),nr=Ae((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return v.jsx(uo,{label:r,...i,children:v.jsx(ls,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),Js=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return v.jsxs(BE,{...o,children:[v.jsx(zE,{children:t}),v.jsxs($E,{className:`invokeai__popover-content ${r}`,children:[i&&v.jsx(FE,{className:"invokeai__popover-arrow"}),n]})]})},qx=lt(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),xD=/^-?(0\.)?\.?$/,ia=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:d,min:h,max:m,isInteger:y=!0,formControlProps:b,formLabelProps:x,numberInputFieldProps:k,numberInputStepperProps:E,tooltipProps:_,...P}=e,[A,M]=w.useState(String(u));w.useEffect(()=>{!A.match(xD)&&u!==Number(A)&&M(String(u))},[u,A]);const R=j=>{M(j),j.match(xD)||d(y?Math.floor(Number(j)):Number(j))},D=j=>{const z=ke.clamp(y?Math.floor(Number(j.target.value)):Number(j.target.value),h,m);M(String(z)),d(z)};return v.jsx(uo,{..._,children:v.jsxs(fn,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&v.jsx(En,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...x,children:t}),v.jsxs(RE,{className:"invokeai__number-input-root",value:A,min:h,max:m,keepWithinRange:!0,clampValueOnBlur:!1,onChange:R,onBlur:D,width:a,...P,children:[v.jsx(DE,{className:"invokeai__number-input-field",textAlign:s,...k}),o&&v.jsxs("div",{className:"invokeai__number-input-stepper",children:[v.jsx(jE,{...E,className:"invokeai__number-input-stepper-button"}),v.jsx(NE,{...E,className:"invokeai__number-input-stepper-button"})]})]})]})})},rl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return v.jsxs(fn,{isDisabled:n,className:`invokeai__select ${l}`,onClick:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation(),d.nativeEvent.stopPropagation(),d.nativeEvent.cancelBubble=!0},children:[t&&v.jsx(En,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),v.jsx(uo,{label:i,...o,children:v.jsx(QV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(d=>typeof d=="string"||typeof d=="number"?v.jsx("option",{value:d,className:"invokeai__select-option",children:d},d):v.jsx("option",{value:d.value,className:"invokeai__select-option",children:d.key},d.value))})})]})},Wy=e=>e.postprocessing,or=e=>e.system,C_e=e=>e.system.toastQueue,oq=lt(or,e=>{const{model_list:t}=e,n=ke.reduce(t,(r,i,o)=>(i.status==="active"&&(r=o),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),__e=lt([Wy,or],({facetoolStrength:e,facetoolType:t,codeformerFidelity:n},{isGFPGANAvailable:r})=>({facetoolStrength:e,facetoolType:t,codeformerFidelity:n,isGFPGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),LP=()=>{const e=Oe(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r,isGFPGANAvailable:i}=he(__e),o=u=>e(g8(u)),a=u=>e(IU(u)),s=u=>e(j4(u.target.value)),{t:l}=Ge();return v.jsxs(je,{direction:"column",gap:2,children:[v.jsx(rl,{label:l("parameters:type"),validValues:w7e.concat(),value:n,onChange:s}),v.jsx(ia,{isDisabled:!i,label:l("parameters:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&v.jsx(ia,{isDisabled:!i,label:l("parameters:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};var aq={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},wD=N.createContext&&N.createContext(aq),Vd=globalThis&&globalThis.__assign||function(){return Vd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{Ee(i)},[i]);const be=w.useMemo(()=>W!=null&&W.max?W.max:a,[a,W==null?void 0:W.max]),ye=We=>{l(We)},ze=We=>{We.target.value===""&&(We.target.value=String(o));const Be=ke.clamp(x?Math.floor(Number(We.target.value)):Number(fe),o,be);l(Be)},Me=We=>{Ee(We)},rt=()=>{M&&M()};return v.jsxs(fn,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":h,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...H,children:[v.jsx(En,{className:"invokeai__slider-component-label",...K,children:r}),v.jsxs(Ey,{w:"100%",gap:2,alignItems:"center",children:[v.jsxs(WE,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:ye,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...re,children:[h&&v.jsxs(v.Fragment,{children:[v.jsx(Q9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),v.jsx(Q9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:y,...te,children:a})]}),v.jsx(uW,{className:"invokeai__slider_track",...G,children:v.jsx(cW,{className:"invokeai__slider_track-filled"})}),v.jsx(uo,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${d}`,hidden:P,...U,children:v.jsx(lW,{className:"invokeai__slider-thumb",...F})})]}),b&&v.jsxs(RE,{min:o,max:be,step:s,value:fe,onChange:Me,onBlur:ze,className:"invokeai__slider-number-field",isDisabled:j,...W,children:[v.jsx(DE,{className:"invokeai__slider-number-input",width:k,readOnly:E,minWidth:k,...X}),v.jsxs(WV,{...Z,children:[v.jsx(jE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"}),v.jsx(NE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"})]})]}),_&&v.jsx(Je,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:v.jsx(Yx,{}),onClick:rt,isDisabled:R,...Q})]})]})}const M_e=lt([Wy,or],({upscalingLevel:e,upscalingStrength:t,upscalingDenoising:n},{isESRGANAvailable:r})=>({upscalingLevel:e,upscalingDenoising:n,upscalingStrength:t,isESRGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),AP=()=>{const e=Oe(),{upscalingLevel:t,upscalingStrength:n,upscalingDenoising:r,isESRGANAvailable:i}=he(M_e),{t:o}=Ge(),a=l=>e(RU(Number(l.target.value))),s=l=>e(v8(l));return v.jsxs(je,{flexDir:"column",rowGap:"1rem",minWidth:"20rem",children:[v.jsx(rl,{isDisabled:!i,label:o("parameters:scale"),value:t,onChange:a,validValues:x7e}),v.jsx(so,{label:o("parameters:denoisingStrength"),value:r,min:0,max:1,step:.01,onChange:l=>{e(m8(l))},handleReset:()=>e(m8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i}),v.jsx(so,{label:`${o("parameters:upscale")} ${o("parameters:strength")}`,value:n,min:0,max:1,step:.05,onChange:s,handleReset:()=>e(v8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i})]})};var I_e=Object.create,uq=Object.defineProperty,R_e=Object.getOwnPropertyDescriptor,D_e=Object.getOwnPropertyNames,N_e=Object.getPrototypeOf,j_e=Object.prototype.hasOwnProperty,qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),B_e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of D_e(t))!j_e.call(e,i)&&i!==n&&uq(e,i,{get:()=>t[i],enumerable:!(r=R_e(t,i))||r.enumerable});return e},cq=(e,t,n)=>(n=e!=null?I_e(N_e(e)):{},B_e(t||!e||!e.__esModule?uq(n,"default",{value:e,enumerable:!0}):n,e)),F_e=qe((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),dq=qe((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Kx=qe((e,t)=>{var n=dq();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),$_e=qe((e,t)=>{var n=Kx(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),z_e=qe((e,t)=>{var n=Kx();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),H_e=qe((e,t)=>{var n=Kx();function r(i){return n(this.__data__,i)>-1}t.exports=r}),V_e=qe((e,t)=>{var n=Kx();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Xx=qe((e,t)=>{var n=F_e(),r=$_e(),i=z_e(),o=H_e(),a=V_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Xx();function r(){this.__data__=new n,this.size=0}t.exports=r}),U_e=qe((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),G_e=qe((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),q_e=qe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),fq=qe((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),mc=qe((e,t)=>{var n=fq(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),OP=qe((e,t)=>{var n=mc(),r=n.Symbol;t.exports=r}),Y_e=qe((e,t)=>{var n=OP(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),d=l[a];try{l[a]=void 0;var h=!0}catch{}var m=o.call(l);return h&&(u?l[a]=d:delete l[a]),m}t.exports=s}),K_e=qe((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),Zx=qe((e,t)=>{var n=OP(),r=Y_e(),i=K_e(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),hq=qe((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),pq=qe((e,t)=>{var n=Zx(),r=hq(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var d=n(u);return d==o||d==a||d==i||d==s}t.exports=l}),X_e=qe((e,t)=>{var n=mc(),r=n["__core-js_shared__"];t.exports=r}),Z_e=qe((e,t)=>{var n=X_e(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),gq=qe((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch{}try{return o+""}catch{}}return""}t.exports=i}),Q_e=qe((e,t)=>{var n=pq(),r=Z_e(),i=hq(),o=gq(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,h=u.hasOwnProperty,m=RegExp("^"+d.call(h).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function y(b){if(!i(b)||r(b))return!1;var x=n(b)?m:s;return x.test(o(b))}t.exports=y}),J_e=qe((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),M0=qe((e,t)=>{var n=Q_e(),r=J_e();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),MP=qe((e,t)=>{var n=M0(),r=mc(),i=n(r,"Map");t.exports=i}),Qx=qe((e,t)=>{var n=M0(),r=n(Object,"create");t.exports=r}),eke=qe((e,t)=>{var n=Qx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),tke=qe((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),nke=qe((e,t)=>{var n=Qx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),rke=qe((e,t)=>{var n=Qx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),ike=qe((e,t)=>{var n=Qx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),oke=qe((e,t)=>{var n=eke(),r=tke(),i=nke(),o=rke(),a=ike();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=oke(),r=Xx(),i=MP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),ske=qe((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),Jx=qe((e,t)=>{var n=ske();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),lke=qe((e,t)=>{var n=Jx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),uke=qe((e,t)=>{var n=Jx();function r(i){return n(this,i).get(i)}t.exports=r}),cke=qe((e,t)=>{var n=Jx();function r(i){return n(this,i).has(i)}t.exports=r}),dke=qe((e,t)=>{var n=Jx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),mq=qe((e,t)=>{var n=ake(),r=lke(),i=uke(),o=cke(),a=dke();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Xx(),r=MP(),i=mq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var d=u.__data__;if(!r||d.length{var n=Xx(),r=W_e(),i=U_e(),o=G_e(),a=q_e(),s=fke();function l(u){var d=this.__data__=new n(u);this.size=d.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),pke=qe((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),gke=qe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),mke=qe((e,t)=>{var n=mq(),r=pke(),i=gke();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),vq=qe((e,t)=>{var n=mke(),r=vke(),i=yke(),o=1,a=2;function s(l,u,d,h,m,y){var b=d&o,x=l.length,k=u.length;if(x!=k&&!(b&&k>x))return!1;var E=y.get(l),_=y.get(u);if(E&&_)return E==u&&_==l;var P=-1,A=!0,M=d&a?new n:void 0;for(y.set(l,u),y.set(u,l);++P{var n=mc(),r=n.Uint8Array;t.exports=r}),Ske=qe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),xke=qe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),wke=qe((e,t)=>{var n=OP(),r=bke(),i=dq(),o=vq(),a=Ske(),s=xke(),l=1,u=2,d="[object Boolean]",h="[object Date]",m="[object Error]",y="[object Map]",b="[object Number]",x="[object RegExp]",k="[object Set]",E="[object String]",_="[object Symbol]",P="[object ArrayBuffer]",A="[object DataView]",M=n?n.prototype:void 0,R=M?M.valueOf:void 0;function D(j,z,H,K,te,G,F){switch(H){case A:if(j.byteLength!=z.byteLength||j.byteOffset!=z.byteOffset)return!1;j=j.buffer,z=z.buffer;case P:return!(j.byteLength!=z.byteLength||!G(new r(j),new r(z)));case d:case h:case b:return i(+j,+z);case m:return j.name==z.name&&j.message==z.message;case x:case E:return j==z+"";case y:var W=a;case k:var X=K&l;if(W||(W=s),j.size!=z.size&&!X)return!1;var Z=F.get(j);if(Z)return Z==z;K|=u,F.set(j,z);var U=o(W(j),W(z),K,te,G,F);return F.delete(j),U;case _:if(R)return R.call(j)==R.call(z)}return!1}t.exports=D}),Cke=qe((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),_ke=qe((e,t)=>{var n=Cke(),r=IP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),kke=qe((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),Pke=qe((e,t)=>{var n=kke(),r=Eke(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),Tke=qe((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),Lke=qe((e,t)=>{var n=Zx(),r=ew(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),Ake=qe((e,t)=>{var n=Lke(),r=ew(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),Oke=qe((e,t)=>{function n(){return!1}t.exports=n}),yq=qe((e,t)=>{var n=mc(),r=Oke(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),Mke=qe((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a??n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),Ike=qe((e,t)=>{var n=Zx(),r=bq(),i=ew(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",h="[object Map]",m="[object Number]",y="[object Object]",b="[object RegExp]",x="[object Set]",k="[object String]",E="[object WeakMap]",_="[object ArrayBuffer]",P="[object DataView]",A="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",j="[object Int32Array]",z="[object Uint8Array]",H="[object Uint8ClampedArray]",K="[object Uint16Array]",te="[object Uint32Array]",G={};G[A]=G[M]=G[R]=G[D]=G[j]=G[z]=G[H]=G[K]=G[te]=!0,G[o]=G[a]=G[_]=G[s]=G[P]=G[l]=G[u]=G[d]=G[h]=G[m]=G[y]=G[b]=G[x]=G[k]=G[E]=!1;function F(W){return i(W)&&r(W.length)&&!!G[n(W)]}t.exports=F}),Rke=qe((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),Dke=qe((e,t)=>{var n=fq(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s}),Sq=qe((e,t)=>{var n=Ike(),r=Rke(),i=Dke(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),Nke=qe((e,t)=>{var n=Tke(),r=Ake(),i=IP(),o=yq(),a=Mke(),s=Sq(),l=Object.prototype,u=l.hasOwnProperty;function d(h,m){var y=i(h),b=!y&&r(h),x=!y&&!b&&o(h),k=!y&&!b&&!x&&s(h),E=y||b||x||k,_=E?n(h.length,String):[],P=_.length;for(var A in h)(m||u.call(h,A))&&!(E&&(A=="length"||x&&(A=="offset"||A=="parent")||k&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,P)))&&_.push(A);return _}t.exports=d}),jke=qe((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),Bke=qe((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),Fke=qe((e,t)=>{var n=Bke(),r=n(Object.keys,Object);t.exports=r}),$ke=qe((e,t)=>{var n=jke(),r=Fke(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),zke=qe((e,t)=>{var n=pq(),r=bq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),Hke=qe((e,t)=>{var n=Nke(),r=$ke(),i=zke();function o(a){return i(a)?n(a):r(a)}t.exports=o}),Vke=qe((e,t)=>{var n=_ke(),r=Pke(),i=Hke();function o(a){return n(a,i,r)}t.exports=o}),Wke=qe((e,t)=>{var n=Vke(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,d,h,m){var y=u&r,b=n(s),x=b.length,k=n(l),E=k.length;if(x!=E&&!y)return!1;for(var _=x;_--;){var P=b[_];if(!(y?P in l:o.call(l,P)))return!1}var A=m.get(s),M=m.get(l);if(A&&M)return A==l&&M==s;var R=!0;m.set(s,l),m.set(l,s);for(var D=y;++_{var n=M0(),r=mc(),i=n(r,"DataView");t.exports=i}),Gke=qe((e,t)=>{var n=M0(),r=mc(),i=n(r,"Promise");t.exports=i}),qke=qe((e,t)=>{var n=M0(),r=mc(),i=n(r,"Set");t.exports=i}),Yke=qe((e,t)=>{var n=M0(),r=mc(),i=n(r,"WeakMap");t.exports=i}),Kke=qe((e,t)=>{var n=Uke(),r=MP(),i=Gke(),o=qke(),a=Yke(),s=Zx(),l=gq(),u="[object Map]",d="[object Object]",h="[object Promise]",m="[object Set]",y="[object WeakMap]",b="[object DataView]",x=l(n),k=l(r),E=l(i),_=l(o),P=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=h||o&&A(new o)!=m||a&&A(new a)!=y)&&(A=function(M){var R=s(M),D=R==d?M.constructor:void 0,j=D?l(D):"";if(j)switch(j){case x:return b;case k:return u;case E:return h;case _:return m;case P:return y}return R}),t.exports=A}),Xke=qe((e,t)=>{var n=hke(),r=vq(),i=wke(),o=Wke(),a=Kke(),s=IP(),l=yq(),u=Sq(),d=1,h="[object Arguments]",m="[object Array]",y="[object Object]",b=Object.prototype,x=b.hasOwnProperty;function k(E,_,P,A,M,R){var D=s(E),j=s(_),z=D?m:a(E),H=j?m:a(_);z=z==h?y:z,H=H==h?y:H;var K=z==y,te=H==y,G=z==H;if(G&&l(E)){if(!l(_))return!1;D=!0,K=!1}if(G&&!K)return R||(R=new n),D||u(E)?r(E,_,P,A,M,R):i(E,_,z,P,A,M,R);if(!(P&d)){var F=K&&x.call(E,"__wrapped__"),W=te&&x.call(_,"__wrapped__");if(F||W){var X=F?E.value():E,Z=W?_.value():_;return R||(R=new n),M(X,Z,P,A,R)}}return G?(R||(R=new n),o(E,_,P,A,M,R)):!1}t.exports=k}),Zke=qe((e,t)=>{var n=Xke(),r=ew();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),xq=qe((e,t)=>{var n=Zke();function r(i,o){return n(i,o)}t.exports=r}),Qke=["ctrl","shift","alt","meta","mod"],Jke={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function FC(e,t=","){return typeof e=="string"?e.split(t):e}function h2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>Jke[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!Qke.includes(o));return{...r,keys:i}}function eEe(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function tEe(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function nEe(e){return wq(e,["input","textarea","select"])}function wq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function rEe(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var iEe=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:d,metaKey:h,shiftKey:m,key:y,code:b}=e,x=b.toLowerCase().replace("key",""),k=y.toLowerCase();if(u!==r&&k!=="alt"||m!==s&&k!=="shift")return!1;if(a){if(!h&&!d)return!1}else if(h!==o&&x!=="meta"||d!==i&&x!=="ctrl")return!1;return l&&l.length===1&&(l.includes(k)||l.includes(x))?!0:l?l.every(E=>n.has(E)):!l},oEe=w.createContext(void 0),aEe=()=>w.useContext(oEe),sEe=w.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),lEe=()=>w.useContext(sEe),uEe=cq(xq());function cEe(e){let t=w.useRef(void 0);return(0,uEe.default)(t.current,e)||(t.current=e),t.current}var CD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function et(e,t,n,r){let i=w.useRef(null),{current:o}=w.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=w.useCallback(t,[...s]),u=cEe(a),{enabledScopes:d}=lEe(),h=aEe();return w.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!rEe(d,u==null?void 0:u.scopes))return;let m=x=>{var k;if(!(nEe(x)&&!wq(x,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){CD(x);return}(k=x.target)!=null&&k.isContentEditable&&!(u!=null&&u.enableOnContentEditable)||FC(e,u==null?void 0:u.splitKey).forEach(E=>{var P;let _=h2(E,u==null?void 0:u.combinationKey);if(iEe(x,_,o)||(P=_.keys)!=null&&P.includes("*")){if(eEe(x,_,u==null?void 0:u.preventDefault),!tEe(x,_,u==null?void 0:u.enabled)){CD(x);return}l(x,_)}})}},y=x=>{o.add(x.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||u!=null&&u.keydown)&&m(x)},b=x=>{x.key.toLowerCase()!=="meta"?o.delete(x.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(x)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",y),h&&FC(e,u==null?void 0:u.splitKey).forEach(x=>h.addHotkey(h2(x,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",y),h&&FC(e,u==null?void 0:u.splitKey).forEach(x=>h.removeHotkey(h2(x,u==null?void 0:u.combinationKey)))}},[e,l,u,d]),i}cq(xq());var z8=new Set;function dEe(e){(Array.isArray(e)?e:[e]).forEach(t=>z8.add(h2(t)))}function fEe(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=h2(t);for(let i of z8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&z8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{dEe(e.key)}),document.addEventListener("keyup",e=>{fEe(e.key)})});function hEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function pEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function gEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function Cq(e){return mt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function _q(e){return mt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function mEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function vEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function kq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function yEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function bEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function RP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function Eq(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function u0(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function Pq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function SEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function DP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function Tq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function xEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function wEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function Lq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function CEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function _Ee(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function Aq(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function kEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function EEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function PEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function TEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"}}]})(e)}function Oq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function LEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function AEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function Mq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function OEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function MEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function Uy(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function IEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function REe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function DEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function NP(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function NEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function jEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function _D(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function jP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function BEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function xp(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function FEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function tw(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function $Ee(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function BP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const ln=e=>e.canvas,Ir=lt([ln,Mr,or],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Iq=e=>e.canvas.layerState.objects.find(Y5),wp=e=>e.gallery,zEe=lt([wp,qx,Ir,Mr],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,galleryWidth:b,shouldUseSingleGalleryColumn:x}=e,{isLightboxOpen:k}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,galleryGridTemplateColumns:x?"auto":`repeat(auto-fill, minmax(${d}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightboxOpen:k,isStaging:n,shouldEnableResize:!(k||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:x}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HEe=lt([wp,or,qx,Mr],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VEe=lt(or,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),iS=w.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=qh(),a=Oe(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=he(VEe),d=w.useRef(null),h=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(Q8e(e)),o()};et("delete",()=>{s?i():m()},[e,s,l,u]);const y=b=>a(XU(!b.target.checked));return v.jsxs(v.Fragment,{children:[w.cloneElement(t,{onClick:e?h:void 0,ref:n}),v.jsx(zV,{isOpen:r,leastDestructiveRef:d,onClose:o,children:v.jsx(Qd,{children:v.jsxs(HV,{className:"modal",children:[v.jsx(k0,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),v.jsx(a0,{children:v.jsxs(je,{direction:"column",gap:5,children:[v.jsx(Yt,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),v.jsx(fn,{children:v.jsxs(je,{alignItems:"center",children:[v.jsx(En,{mb:0,children:"Don't ask me again"}),v.jsx(UE,{checked:!s,onChange:y})]})})]})}),v.jsxs(wx,{children:[v.jsx(ls,{ref:d,onClick:o,className:"modal-close-btn",children:"Cancel"}),v.jsx(ls,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})});iS.displayName="DeleteImageModal";const WEe=lt([or,wp,Wy,Sp,qx,Mr],(e,t,n,r,i,o)=>{const{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u}=e,{upscalingLevel:d,facetoolStrength:h}=n,{isLightboxOpen:m}=i,{shouldShowImageDetails:y}=r,{intermediateImage:b,currentImage:x}=t;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:d,facetoolStrength:h,shouldDisableToolbarButtons:Boolean(b)||!x,currentImage:x,shouldShowImageDetails:y,activeTabName:o,isLightboxOpen:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),Rq=()=>{var z,H,K,te,G,F;const e=Oe(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightboxOpen:d,activeTabName:h}=he(WEe),m=By(),{t:y}=Ge(),b=()=>{u&&(d&&e(Hm(!1)),e(T0(u)),e(Yo("img2img")))},x=async()=>{if(!u)return;const W=await fetch(u.url).then(Z=>Z.blob()),X=[new ClipboardItem({[W.type]:W})];await navigator.clipboard.write(X),m({title:y("toast:imageCopied"),status:"success",duration:2500,isClosable:!0})},k=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:y("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};et("shift+i",()=>{u?(b(),m({title:y("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:imageNotLoaded"),description:y("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var W,X;u&&(u.metadata&&e(yU(u.metadata)),((W=u.metadata)==null?void 0:W.image.type)==="img2img"?e(Yo("img2img")):((X=u.metadata)==null?void 0:X.image.type)==="txt2img"&&e(Yo("txt2img")))};et("a",()=>{var W,X;["txt2img","img2img"].includes((X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)==null?void 0:X.type)?(E(),m({title:y("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:parametersNotSet"),description:y("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{u!=null&&u.metadata&&e($y(u.metadata.image.seed))};et("s",()=>{var W,X;(X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.seed?(_(),m({title:y("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:seedNotSet"),description:y("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const P=()=>{var W,X,Z,U;if((X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.prompt){const[Q,re]=hP((U=(Z=u==null?void 0:u.metadata)==null?void 0:Z.image)==null?void 0:U.prompt);Q&&e($x(Q)),e(ny(re||""))}};et("p",()=>{var W,X;(X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.prompt?(P(),m({title:y("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:promptNotSet"),description:y("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const A=()=>{u&&e(X8e(u))};et("Shift+U",()=>{i&&!s&&n&&!t&&o?A():m({title:y("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const M=()=>{u&&e(Z8e(u))};et("Shift+R",()=>{r&&!s&&n&&!t&&a?M():m({title:y("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(tG(!l)),D=()=>{u&&(d&&e(Hm(!1)),e(Fx(u)),e(vi(!0)),h!=="unifiedCanvas"&&e(Yo("unifiedCanvas")),m({title:y("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};et("i",()=>{u?R():m({title:y("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const j=()=>{e(Hm(!d))};return v.jsxs("div",{className:"current-image-options",children:[v.jsxs(oo,{isAttached:!0,children:[v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":`${y("parameters:sendTo")}...`,icon:v.jsx(jEe,{})}),children:v.jsxs("div",{className:"current-image-send-to-popover",children:[v.jsx(nr,{size:"sm",onClick:b,leftIcon:v.jsx(_D,{}),children:y("parameters:sendToImg2Img")}),v.jsx(nr,{size:"sm",onClick:D,leftIcon:v.jsx(_D,{}),children:y("parameters:sendToUnifiedCanvas")}),v.jsx(nr,{size:"sm",onClick:x,leftIcon:v.jsx(u0,{}),children:y("parameters:copyImage")}),v.jsx(nr,{size:"sm",onClick:k,leftIcon:v.jsx(u0,{}),children:y("parameters:copyImageToLink")}),v.jsx(Fh,{download:!0,href:u==null?void 0:u.url,children:v.jsx(nr,{leftIcon:v.jsx(DP,{}),size:"sm",w:"100%",children:y("parameters:downloadImage")})})]})}),v.jsx(Je,{icon:v.jsx(wEe,{}),tooltip:d?`${y("parameters:closeViewer")} (Z)`:`${y("parameters:openInViewer")} (Z)`,"aria-label":d?`${y("parameters:closeViewer")} (Z)`:`${y("parameters:openInViewer")} (Z)`,"data-selected":d,onClick:j})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{icon:v.jsx(IEe,{}),tooltip:`${y("parameters:usePrompt")} (P)`,"aria-label":`${y("parameters:usePrompt")} (P)`,isDisabled:!((H=(z=u==null?void 0:u.metadata)==null?void 0:z.image)!=null&&H.prompt),onClick:P}),v.jsx(Je,{icon:v.jsx(NEe,{}),tooltip:`${y("parameters:useSeed")} (S)`,"aria-label":`${y("parameters:useSeed")} (S)`,isDisabled:!((te=(K=u==null?void 0:u.metadata)==null?void 0:K.image)!=null&&te.seed),onClick:_}),v.jsx(Je,{icon:v.jsx(yEe,{}),tooltip:`${y("parameters:useAll")} (A)`,"aria-label":`${y("parameters:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((F=(G=u==null?void 0:u.metadata)==null?void 0:G.image)==null?void 0:F.type),onClick:E})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{icon:v.jsx(kEe,{}),"aria-label":y("parameters:restoreFaces")}),children:v.jsxs("div",{className:"current-image-postprocessing-popover",children:[v.jsx(LP,{}),v.jsx(nr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:M,children:y("parameters:restoreFaces")})]})}),v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{icon:v.jsx(xEe,{}),"aria-label":y("parameters:upscale")}),children:v.jsxs("div",{className:"current-image-postprocessing-popover",children:[v.jsx(AP,{}),v.jsx(nr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:A,children:y("parameters:upscaleImage")})]})})]}),v.jsx(oo,{isAttached:!0,children:v.jsx(Je,{icon:v.jsx(Eq,{}),tooltip:`${y("parameters:info")} (I)`,"aria-label":`${y("parameters:info")} (I)`,"data-selected":l,onClick:R})}),v.jsx(iS,{image:u,children:v.jsx(Je,{icon:v.jsx(xp,{}),tooltip:`${y("parameters:deleteImage")} (Del)`,"aria-label":`${y("parameters:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};yt({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});yt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});yt({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});yt({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});yt({displayName:"SunIcon",path:N.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},N.createElement("circle",{cx:"12",cy:"12",r:"5"}),N.createElement("path",{d:"M12 1v2"}),N.createElement("path",{d:"M12 21v2"}),N.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),N.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),N.createElement("path",{d:"M1 12h2"}),N.createElement("path",{d:"M21 12h2"}),N.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),N.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))});yt({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});yt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:N.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});yt({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});yt({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});yt({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});yt({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});yt({displayName:"ViewIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),N.createElement("circle",{cx:"12",cy:"12",r:"2"}))});yt({displayName:"ViewOffIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),N.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))});yt({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});var UEe=yt({displayName:"DeleteIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"}))});yt({displayName:"RepeatIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),N.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))});yt({displayName:"RepeatClockIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),N.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))});var GEe=yt({displayName:"EditIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),N.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});yt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});yt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});yt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});yt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});yt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});yt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});yt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});yt({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});yt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var Dq=yt({displayName:"ExternalLinkIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),N.createElement("path",{d:"M15 3h6v6"}),N.createElement("path",{d:"M10 14L21 3"}))});yt({displayName:"LinkIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),N.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))});yt({displayName:"PlusSquareIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),N.createElement("path",{d:"M12 8v8"}),N.createElement("path",{d:"M8 12h8"}))});yt({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});yt({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});yt({displayName:"TimeIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),N.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))});yt({displayName:"ArrowRightIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),N.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))});yt({displayName:"ArrowLeftIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),N.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))});yt({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});yt({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});yt({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});yt({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});yt({displayName:"EmailIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),N.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))});yt({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});yt({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});yt({displayName:"SpinnerIcon",path:N.createElement(N.Fragment,null,N.createElement("defs",null,N.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},N.createElement("stop",{stopColor:"currentColor",offset:"0%"}),N.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),N.createElement("g",{transform:"translate(2)",fill:"none"},N.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),N.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),N.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))});yt({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});yt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:N.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});yt({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});yt({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});yt({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});yt({displayName:"InfoOutlineIcon",path:N.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},N.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),N.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),N.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))});yt({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});yt({displayName:"QuestionOutlineIcon",path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))});yt({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});yt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});yt({viewBox:"0 0 14 14",path:N.createElement("g",{fill:"currentColor"},N.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))});yt({displayName:"MinusIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))});yt({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function qEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Qn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>v.jsxs(je,{gap:2,children:[n&&v.jsx(uo,{label:`Recall ${e}`,children:v.jsx(us,{"aria-label":"Use this parameter",icon:v.jsx(qEe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&v.jsx(uo,{label:`Copy ${e}`,children:v.jsx(us,{"aria-label":`Copy ${e}`,icon:v.jsx(u0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),v.jsxs(je,{direction:i?"column":"row",children:[v.jsxs(Yt,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?v.jsxs(Fh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",v.jsx(Dq,{mx:"2px"})]}):v.jsx(Yt,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),YEe=(e,t)=>e.image.uuid===t.image.uuid,FP=w.memo(({image:e,styleClass:t})=>{var H,K;const n=Oe();et("esc",()=>{n(tG(!1))});const r=((H=e==null?void 0:e.metadata)==null?void 0:H.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:d,orig_path:h,perlin:m,postprocessing:y,prompt:b,sampler:x,seamless:k,seed:E,steps:_,strength:P,denoise_str:A,threshold:M,type:R,variations:D,width:j}=r,z=JSON.stringify(e.metadata,null,2);return v.jsx("div",{className:`image-metadata-viewer ${t}`,children:v.jsxs(je,{gap:1,direction:"column",width:"100%",children:[v.jsxs(je,{gap:2,children:[v.jsx(Yt,{fontWeight:"semibold",children:"File:"}),v.jsxs(Fh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,v.jsx(Dq,{mx:"2px"})]})]}),Object.keys(r).length>0?v.jsxs(v.Fragment,{children:[R&&v.jsx(Qn,{label:"Generation type",value:R}),((K=e.metadata)==null?void 0:K.model_weights)&&v.jsx(Qn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(R)&&v.jsx(Qn,{label:"Original image",value:h}),b&&v.jsx(Qn,{label:"Prompt",labelPosition:"top",value:l2(b),onClick:()=>n($x(b))}),E!==void 0&&v.jsx(Qn,{label:"Seed",value:E,onClick:()=>n($y(E))}),M!==void 0&&v.jsx(Qn,{label:"Noise Threshold",value:M,onClick:()=>n(LU(M))}),m!==void 0&&v.jsx(Qn,{label:"Perlin Noise",value:m,onClick:()=>n(CU(m))}),x&&v.jsx(Qn,{label:"Sampler",value:x,onClick:()=>n(_U(x))}),_&&v.jsx(Qn,{label:"Steps",value:_,onClick:()=>n(TU(_))}),o!==void 0&&v.jsx(Qn,{label:"CFG scale",value:o,onClick:()=>n(bU(o))}),D&&D.length>0&&v.jsx(Qn,{label:"Seed-weight pairs",value:Q5(D),onClick:()=>n(EU(Q5(D)))}),k&&v.jsx(Qn,{label:"Seamless",value:k,onClick:()=>n(kU(k))}),l&&v.jsx(Qn,{label:"High Resolution Optimization",value:l,onClick:()=>n(gP(l))}),j&&v.jsx(Qn,{label:"Width",value:j,onClick:()=>n(AU(j))}),s&&v.jsx(Qn,{label:"Height",value:s,onClick:()=>n(SU(s))}),u&&v.jsx(Qn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(T0(u))}),d&&v.jsx(Qn,{label:"Mask image",value:d,isLink:!0,onClick:()=>n(wU(d))}),R==="img2img"&&P&&v.jsx(Qn,{label:"Image to image strength",value:P,onClick:()=>n(p8(P))}),a&&v.jsx(Qn,{label:"Image to image fit",value:a,onClick:()=>n(PU(a))}),y&&y.length>0&&v.jsxs(v.Fragment,{children:[v.jsx(Bh,{size:"sm",children:"Postprocessing"}),y.map((te,G)=>{if(te.type==="esrgan"){const{scale:F,strength:W,denoise_str:X}=te;return v.jsxs(je,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(Yt,{size:"md",children:`${G+1}: Upscale (ESRGAN)`}),v.jsx(Qn,{label:"Scale",value:F,onClick:()=>n(RU(F))}),v.jsx(Qn,{label:"Strength",value:W,onClick:()=>n(v8(W))}),X!==void 0&&v.jsx(Qn,{label:"Denoising strength",value:X,onClick:()=>n(m8(X))})]},G)}else if(te.type==="gfpgan"){const{strength:F}=te;return v.jsxs(je,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(Yt,{size:"md",children:`${G+1}: Face restoration (GFPGAN)`}),v.jsx(Qn,{label:"Strength",value:F,onClick:()=>{n(g8(F)),n(j4("gfpgan"))}})]},G)}else if(te.type==="codeformer"){const{strength:F,fidelity:W}=te;return v.jsxs(je,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(Yt,{size:"md",children:`${G+1}: Face restoration (Codeformer)`}),v.jsx(Qn,{label:"Strength",value:F,onClick:()=>{n(g8(F)),n(j4("codeformer"))}}),W&&v.jsx(Qn,{label:"Fidelity",value:W,onClick:()=>{n(IU(W)),n(j4("codeformer"))}})]},G)}})]}),i&&v.jsx(Qn,{withCopy:!0,label:"Dream Prompt",value:i}),v.jsxs(je,{gap:2,direction:"column",children:[v.jsxs(je,{gap:2,children:[v.jsx(uo,{label:"Copy metadata JSON",children:v.jsx(us,{"aria-label":"Copy metadata JSON",icon:v.jsx(u0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),v.jsx(Yt,{fontWeight:"semibold",children:"Metadata JSON:"})]}),v.jsx("div",{className:"image-json-viewer",children:v.jsx("pre",{children:z})})]})]}):v.jsx(b$,{width:"100%",pt:10,children:v.jsx(Yt,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},YEe);FP.displayName="ImageMetadataViewer";const Nq=lt([wp,Sp],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var d;return u.uuid===((d=e==null?void 0:e.currentImage)==null?void 0:d.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function KEe(){const e=Oe(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=he(Nq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(fP())},h=()=>{e(dP())};return v.jsxs("div",{className:"current-image-preview",children:[i&&v.jsx(JS,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&v.jsxs("div",{className:"current-image-next-prev-buttons",children:[v.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&v.jsx(us,{"aria-label":"Previous image",icon:v.jsx(Cq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),v.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&v.jsx(us,{"aria-label":"Next image",icon:v.jsx(_q,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),r&&i&&v.jsx(FP,{image:i,styleClass:"current-image-metadata"})]})}var XEe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=globalThis&&globalThis.__assign||function(){return ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},rPe=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],LD="__resizable_base__",jq=function(e){JEe(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(LD):o.className+=LD,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;o&&o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||ePe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),d=u/l[s]*100;return d+"%"}return $C(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?$C(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?$C(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&$g("left",o),s=i&&$g("top",o),l,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=a?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,h=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,y=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,x=u||0;if(s){var k=(m-b)*this.ratio+x,E=(y-b)*this.ratio+x,_=(d-x)/this.ratio+b,P=(h-x)/this.ratio+b,A=Math.max(d,k),M=Math.min(h,E),R=Math.max(m,_),D=Math.min(y,P);n=Yb(n,A,M),r=Yb(r,R,D)}else n=Yb(n,d,h),r=Yb(r,m,y);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&tPe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Kb(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Bl(Bl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(h)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Kb(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Kb(n)?n.touches[0].clientX:n.clientX,d=Kb(n)?n.touches[0].clientY:n.clientY,h=this.state,m=h.direction,y=h.original,b=h.width,x=h.height,k=this.getParentSize(),E=nPe(k,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=E.maxWidth,a=E.maxHeight,s=E.minWidth,l=E.minHeight;var _=this.calculateNewSizeFromDirection(u,d),P=_.newHeight,A=_.newWidth,M=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=TD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(P=TD(P,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(A,P,{width:M.maxWidth,height:M.maxHeight},{width:s,height:l});if(A=R.newWidth,P=R.newHeight,this.props.grid){var D=PD(A,this.props.grid[0]),j=PD(P,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,P=z===0||Math.abs(j-P)<=z?j:P}var H={width:A-y.width,height:P-y.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var K=A/k.width*100;A=K+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var G=A/this.window.innerHeight*100;A=G+"vh"}}if(x&&typeof x=="string"){if(x.endsWith("%")){var K=P/k.height*100;P=K+"%"}else if(x.endsWith("vw")){var te=P/this.window.innerWidth*100;P=te+"vw"}else if(x.endsWith("vh")){var G=P/this.window.innerHeight*100;P=G+"vh"}}var F={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(P,"height")};this.flexDir==="row"?F.flexBasis=F.width:this.flexDir==="column"&&(F.flexBasis=F.height),el.flushSync(function(){r.setState(F)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,H)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Bl(Bl({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(h){return i[h]!==!1?w.createElement(QEe,{key:h,direction:h,onResizeStart:n.onResizeStart,replaceStyles:o&&o[h],className:a&&a[h]},u&&u[h]?u[h]:null):null});return w.createElement("div",{className:l,style:s},d)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return rPe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Bl(Bl(Bl({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return w.createElement(o,Bl({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&w.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(w.PureComponent);const er=e=>{const{label:t,styleClass:n,...r}=e;return v.jsx(l$,{className:`invokeai__checkbox ${n}`,...r,children:t})};function Bq(e){return mt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function Fq(e){return mt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function iPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function oPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function aPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function sPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function $q(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function lPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function uPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function cPe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function dPe(e,t){e.classList?e.classList.add(t):cPe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function AD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function fPe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=AD(e.className,t):e.setAttribute("class",AD(e.className&&e.className.baseVal||"",t))}const OD={disabled:!1},zq=N.createContext(null);var Hq=function(t){return t.scrollTop},Nv="unmounted",vh="exited",yh="entering",Ug="entered",H8="exiting",vc=function(e){_E(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=vh,o.appearStatus=yh):l=Ug:r.unmountOnExit||r.mountOnEnter?l=Nv:l=vh,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Nv?{status:vh}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==yh&&a!==Ug&&(o=yh):(a===yh||a===Ug)&&(o=H8)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===yh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:xb.findDOMNode(this);a&&Hq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===vh&&this.setState({status:Nv})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[xb.findDOMNode(this),s],u=l[0],d=l[1],h=this.getTimeouts(),m=s?h.appear:h.enter;if(!i&&!a||OD.disabled){this.safeSetState({status:Ug},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:yh},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:Ug},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:xb.findDOMNode(this);if(!o||OD.disabled){this.safeSetState({status:vh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:H8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:vh},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:xb.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Nv)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=xE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return N.createElement(zq.Provider,{value:null},typeof a=="function"?a(i,s):N.cloneElement(N.Children.only(a),s))},t}(N.Component);vc.contextType=zq;vc.propTypes={};function zg(){}vc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:zg,onEntering:zg,onEntered:zg,onExit:zg,onExiting:zg,onExited:zg};vc.UNMOUNTED=Nv;vc.EXITED=vh;vc.ENTERING=yh;vc.ENTERED=Ug;vc.EXITING=H8;const hPe=vc;var pPe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return dPe(t,r)})},zC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return fPe(t,r)})},$P=function(e){_E(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ab,Object.values(b));return w.createElement(x.Provider,{value:k},y)}function d(h,m){const y=(m==null?void 0:m[e][l])||s,b=w.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const i=()=>{const o=n.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,gPe(i,...t)]}function gPe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...s,...h}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function mPe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Wq(...e){return t=>e.forEach(n=>mPe(n,t))}function ps(...e){return w.useCallback(Wq(...e),e)}const uy=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),o=i.find(yPe);if(o){const a=o.props.children,s=i.map(l=>l===o?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return w.createElement(V8,bn({},r,{ref:t}),w.isValidElement(a)?w.cloneElement(a,void 0,s):null)}return w.createElement(V8,bn({},r,{ref:t}),n)});uy.displayName="Slot";const V8=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...bPe(r,n.props),ref:Wq(t,n.ref)}):w.Children.count(n)>1?w.Children.only(null):null});V8.displayName="SlotClone";const vPe=({children:e})=>w.createElement(w.Fragment,null,e);function yPe(e){return w.isValidElement(e)&&e.type===vPe}function bPe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const SPe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],lc=SPe.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?uy:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(s,bn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Uq(e,t){e&&el.flushSync(()=>e.dispatchEvent(t))}function Gq(e){const t=e+"CollectionProvider",[n,r]=Gy(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:b,children:x}=y,k=N.useRef(null),E=N.useRef(new Map).current;return N.createElement(i,{scope:b,itemMap:E,collectionRef:k},x)},s=e+"CollectionSlot",l=N.forwardRef((y,b)=>{const{scope:x,children:k}=y,E=o(s,x),_=ps(b,E.collectionRef);return N.createElement(uy,{ref:_},k)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=N.forwardRef((y,b)=>{const{scope:x,children:k,...E}=y,_=N.useRef(null),P=ps(b,_),A=o(u,x);return N.useEffect(()=>(A.itemMap.set(_,{ref:_,...E}),()=>void A.itemMap.delete(_))),N.createElement(uy,{[d]:"",ref:P},k)});function m(y){const b=o(e+"CollectionConsumer",y);return N.useCallback(()=>{const k=b.collectionRef.current;if(!k)return[];const E=Array.from(k.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((A,M)=>E.indexOf(A.ref.current)-E.indexOf(M.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:h},m,r]}const xPe=w.createContext(void 0);function qq(e){const t=w.useContext(xPe);return e||t||"ltr"}function du(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function wPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const W8="dismissableLayer.update",CPe="dismissableLayer.pointerDownOutside",_Pe="dismissableLayer.focusOutside";let MD;const kPe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),EPe=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=w.useContext(kPe),[h,m]=w.useState(null),y=(n=h==null?void 0:h.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=w.useState({}),x=ps(t,j=>m(j)),k=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=k.indexOf(E),P=h?k.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,M=P>=_,R=PPe(j=>{const z=j.target,H=[...d.branches].some(K=>K.contains(z));!M||H||(o==null||o(j),s==null||s(j),j.defaultPrevented||l==null||l())},y),D=TPe(j=>{const z=j.target;[...d.branches].some(K=>K.contains(z))||(a==null||a(j),s==null||s(j),j.defaultPrevented||l==null||l())},y);return wPe(j=>{P===d.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},y),w.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(MD=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),ID(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=MD)}},[h,y,r,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),ID())},[h,d]),w.useEffect(()=>{const j=()=>b({});return document.addEventListener(W8,j),()=>document.removeEventListener(W8,j)},[]),w.createElement(lc.div,bn({},u,{ref:x,style:{pointerEvents:A?M?"auto":"none":void 0,...e.style},onFocusCapture:ir(e.onFocusCapture,D.onFocusCapture),onBlurCapture:ir(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:ir(e.onPointerDownCapture,R.onPointerDownCapture)}))});function PPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){Yq(CPe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function TPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&Yq(_Pe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ID(){const e=new CustomEvent(W8);document.dispatchEvent(e)}function Yq(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Uq(i,o):i.dispatchEvent(o)}let HC=0;function LPe(){w.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:RD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:RD()),HC++,()=>{HC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),HC--}},[])}function RD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const VC="focusScope.autoFocusOnMount",WC="focusScope.autoFocusOnUnmount",DD={bubbles:!1,cancelable:!0},APe=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=w.useState(null),u=du(i),d=du(o),h=w.useRef(null),m=ps(t,x=>l(x)),y=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let x=function(E){if(y.paused||!s)return;const _=E.target;s.contains(_)?h.current=_:bh(h.current,{select:!0})},k=function(E){y.paused||!s||s.contains(E.relatedTarget)||bh(h.current,{select:!0})};return document.addEventListener("focusin",x),document.addEventListener("focusout",k),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",k)}}},[r,s,y.paused]),w.useEffect(()=>{if(s){jD.add(y);const x=document.activeElement;if(!s.contains(x)){const E=new CustomEvent(VC,DD);s.addEventListener(VC,u),s.dispatchEvent(E),E.defaultPrevented||(OPe(NPe(Kq(s)),{select:!0}),document.activeElement===x&&bh(s))}return()=>{s.removeEventListener(VC,u),setTimeout(()=>{const E=new CustomEvent(WC,DD);s.addEventListener(WC,d),s.dispatchEvent(E),E.defaultPrevented||bh(x??document.body,{select:!0}),s.removeEventListener(WC,d),jD.remove(y)},0)}}},[s,u,d,y]);const b=w.useCallback(x=>{if(!n&&!r||y.paused)return;const k=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,E=document.activeElement;if(k&&E){const _=x.currentTarget,[P,A]=MPe(_);P&&A?!x.shiftKey&&E===A?(x.preventDefault(),n&&bh(P,{select:!0})):x.shiftKey&&E===P&&(x.preventDefault(),n&&bh(A,{select:!0})):E===_&&x.preventDefault()}},[n,r,y.paused]);return w.createElement(lc.div,bn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function OPe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bh(r,{select:t}),document.activeElement!==n)return}function MPe(e){const t=Kq(e),n=ND(t,e),r=ND(t.reverse(),e);return[n,r]}function Kq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ND(e,t){for(const n of e)if(!IPe(n,{upTo:t}))return n}function IPe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function RPe(e){return e instanceof HTMLInputElement&&"select"in e}function bh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&RPe(e)&&t&&e.select()}}const jD=DPe();function DPe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=BD(e,t),e.unshift(t)},remove(t){var n;e=BD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function BD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function NPe(e){return e.filter(t=>t.tagName!=="A")}const c0=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:()=>{},jPe=n7["useId".toString()]||(()=>{});let BPe=0;function FPe(e){const[t,n]=w.useState(jPe());return c0(()=>{e||n(r=>r??String(BPe++))},[e]),e||(t?`radix-${t}`:"")}function I0(e){return e.split("-")[0]}function nw(e){return e.split("-")[1]}function R0(e){return["top","bottom"].includes(I0(e))?"x":"y"}function zP(e){return e==="y"?"height":"width"}function FD(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=R0(t),l=zP(s),u=r[l]/2-i[l]/2,d=s==="x";let h;switch(I0(t)){case"top":h={x:o,y:r.y-i.height};break;case"bottom":h={x:o,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:a};break;case"left":h={x:r.x-i.width,y:a};break;default:h={x:r.x,y:r.y}}switch(nw(t)){case"start":h[s]-=u*(n&&d?-1:1);break;case"end":h[s]+=u*(n&&d?-1:1)}return h}const $Pe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=FD(l,r,s),h=r,m={},y=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=Xq(r),d={x:i,y:o},h=R0(a),m=nw(a),y=zP(h),b=await l.getDimensions(n),x=h==="y"?"top":"left",k=h==="y"?"bottom":"right",E=s.reference[y]+s.reference[h]-d[h]-s.floating[y],_=d[h]-s.reference[h],P=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=P?h==="y"?P.clientHeight||0:P.clientWidth||0:0;A===0&&(A=s.floating[y]);const M=E/2-_/2,R=u[x],D=A-b[y]-u[k],j=A/2-b[y]/2+M,z=U8(R,j,D),H=(m==="start"?u[x]:u[k])>0&&j!==z&&s.reference[y]<=s.floating[y];return{[h]:d[h]-(H?jVPe[t])}function WPe(e,t,n){n===void 0&&(n=!1);const r=nw(e),i=R0(e),o=zP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=sS(a)),{main:a,cross:sS(a)}}const UPe={start:"end",end:"start"};function zD(e){return e.replace(/start|end/g,t=>UPe[t])}const Zq=["top","right","bottom","left"];Zq.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const GPe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",flipAlignment:y=!0,...b}=e,x=I0(r),k=h||(x===a||!y?[sS(a)]:function(j){const z=sS(j);return[zD(j),z,zD(z)]}(a)),E=[a,...k],_=await aS(t,b),P=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&P.push(_[x]),d){const{main:j,cross:z}=WPe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));P.push(_[j],_[z])}if(A=[...A,{placement:r,overflows:P}],!P.every(j=>j<=0)){var M,R;const j=((M=(R=i.flip)==null?void 0:R.index)!=null?M:0)+1,z=E[j];if(z)return{data:{index:j,overflows:A},reset:{placement:z}};let H="bottom";switch(m){case"bestFit":{var D;const K=(D=A.map(te=>[te,te.overflows.filter(G=>G>0).reduce((G,F)=>G+F,0)]).sort((te,G)=>te[1]-G[1])[0])==null?void 0:D[0].placement;K&&(H=K);break}case"initialPlacement":H=a}if(r!==H)return{reset:{placement:H}}}return{}}}};function HD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function VD(e){return Zq.some(t=>e[t]>=0)}const qPe=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=HD(await aS(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:VD(o)}}}case"escaped":{const o=HD(await aS(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:o,escaped:VD(o)}}}default:return{}}}}},YPe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),h=I0(s),m=nw(s),y=R0(s)==="x",b=["left","top"].includes(h)?-1:1,x=d&&y?-1:1,k=typeof a=="function"?a(o):a;let{mainAxis:E,crossAxis:_,alignmentAxis:P}=typeof k=="number"?{mainAxis:k,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...k};return m&&typeof P=="number"&&(_=m==="end"?-1*P:P),y?{x:_*x,y:E*b}:{x:E*b,y:_*x}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function Qq(e){return e==="x"?"y":"x"}const KPe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:k=>{let{x:E,y:_}=k;return{x:E,y:_}}},...l}=e,u={x:n,y:r},d=await aS(t,l),h=R0(I0(i)),m=Qq(h);let y=u[h],b=u[m];if(o){const k=h==="y"?"bottom":"right";y=U8(y+d[h==="y"?"top":"left"],y,y-d[k])}if(a){const k=m==="y"?"bottom":"right";b=U8(b+d[m==="y"?"top":"left"],b,b-d[k])}const x=s.fn({...t,[h]:y,[m]:b});return{...x,data:{x:x.x-n,y:x.y-r}}}}},XPe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,d={x:n,y:r},h=R0(i),m=Qq(h);let y=d[h],b=d[m];const x=typeof s=="function"?s({...o,placement:i}):s,k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const M=h==="y"?"height":"width",R=o.reference[h]-o.floating[M]+k.mainAxis,D=o.reference[h]+o.reference[M]-k.mainAxis;yD&&(y=D)}if(u){var E,_,P,A;const M=h==="y"?"width":"height",R=["top","left"].includes(I0(i)),D=o.reference[m]-o.floating[M]+(R&&(E=(_=a.offset)==null?void 0:_[m])!=null?E:0)+(R?0:k.crossAxis),j=o.reference[m]+o.reference[M]+(R?0:(P=(A=a.offset)==null?void 0:A[m])!=null?P:0)-(R?k.crossAxis:0);bj&&(b=j)}return{[h]:y,[m]:b}}}};function Jq(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function yc(e){if(e==null)return window;if(!Jq(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function qy(e){return yc(e).getComputedStyle(e)}function Qu(e){return Jq(e)?"":e?(e.nodeName||"").toLowerCase():""}function eY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function fu(e){return e instanceof yc(e).HTMLElement}function nf(e){return e instanceof yc(e).Element}function HP(e){return typeof ShadowRoot>"u"?!1:e instanceof yc(e).ShadowRoot||e instanceof ShadowRoot}function rw(e){const{overflow:t,overflowX:n,overflowY:r}=qy(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function ZPe(e){return["table","td","th"].includes(Qu(e))}function WD(e){const t=/firefox/i.test(eY()),n=qy(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function tY(){return!/^((?!chrome|android).)*safari/i.test(eY())}const UD=Math.min,p2=Math.max,lS=Math.round;function Ju(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&fu(e)&&(l=e.offsetWidth>0&&lS(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&lS(s.height)/e.offsetHeight||1);const d=nf(e)?yc(e):window,h=!tY()&&n,m=(s.left+(h&&(r=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,y=(s.top+(h&&(o=(a=d.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,x=s.height/u;return{width:b,height:x,top:y,right:m+b,bottom:y+x,left:m,x:m,y}}function Wd(e){return(t=e,(t instanceof yc(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function iw(e){return nf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function nY(e){return Ju(Wd(e)).left+iw(e).scrollLeft}function QPe(e,t,n){const r=fu(t),i=Wd(t),o=Ju(e,r&&function(l){const u=Ju(l);return lS(u.width)!==l.offsetWidth||lS(u.height)!==l.offsetHeight}(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Qu(t)!=="body"||rw(i))&&(a=iw(t)),fu(t)){const l=Ju(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=nY(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function rY(e){return Qu(e)==="html"?e:e.assignedSlot||e.parentNode||(HP(e)?e.host:null)||Wd(e)}function GD(e){return fu(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function G8(e){const t=yc(e);let n=GD(e);for(;n&&ZPe(n)&&getComputedStyle(n).position==="static";)n=GD(n);return n&&(Qu(n)==="html"||Qu(n)==="body"&&getComputedStyle(n).position==="static"&&!WD(n))?t:n||function(r){let i=rY(r);for(HP(i)&&(i=i.host);fu(i)&&!["html","body"].includes(Qu(i));){if(WD(i))return i;i=i.parentNode}return null}(e)||t}function qD(e){if(fu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ju(e);return{width:t.width,height:t.height}}function iY(e){const t=rY(e);return["html","body","#document"].includes(Qu(t))?e.ownerDocument.body:fu(t)&&rw(t)?t:iY(t)}function uS(e,t){var n;t===void 0&&(t=[]);const r=iY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=yc(r),a=i?[o].concat(o.visualViewport||[],rw(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(uS(a))}function YD(e,t,n){return t==="viewport"?oS(function(r,i){const o=yc(r),a=Wd(r),s=o.visualViewport;let l=a.clientWidth,u=a.clientHeight,d=0,h=0;if(s){l=s.width,u=s.height;const m=tY();(m||!m&&i==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}return{width:l,height:u,x:d,y:h}}(e,n)):nf(t)?function(r,i){const o=Ju(r,!1,i==="fixed"),a=o.top+r.clientTop,s=o.left+r.clientLeft;return{top:a,left:s,x:s,y:a,right:s+r.clientWidth,bottom:a+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):oS(function(r){var i;const o=Wd(r),a=iw(r),s=(i=r.ownerDocument)==null?void 0:i.body,l=p2(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=p2(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let d=-a.scrollLeft+nY(r);const h=-a.scrollTop;return qy(s||o).direction==="rtl"&&(d+=p2(o.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:d,y:h}}(Wd(e)))}function JPe(e){const t=uS(e),n=["absolute","fixed"].includes(qy(e).position)&&fu(e)?G8(e):e;return nf(n)?t.filter(r=>nf(r)&&function(i,o){const a=o.getRootNode==null?void 0:o.getRootNode();if(i.contains(o))return!0;if(a&&HP(a)){let s=o;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Qu(r)!=="body"):[]}const eTe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?JPe(t):[].concat(n),r],a=o[0],s=o.reduce((l,u)=>{const d=YD(t,u,i);return l.top=p2(d.top,l.top),l.right=UD(d.right,l.right),l.bottom=UD(d.bottom,l.bottom),l.left=p2(d.left,l.left),l},YD(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=fu(n),o=Wd(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Qu(n)!=="body"||rw(o))&&(a=iw(n)),fu(n))){const l=Ju(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:nf,getDimensions:qD,getOffsetParent:G8,getDocumentElement:Wd,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:QPe(t,G8(n),r),floating:{...qD(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>qy(e).direction==="rtl"};function tTe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,d=l||u?[...nf(e)?uS(e):[],...uS(t)]:[];d.forEach(b=>{l&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});let h,m=null;if(a){let b=!0;m=new ResizeObserver(()=>{b||n(),b=!1}),nf(e)&&!s&&m.observe(e),m.observe(t)}let y=s?Ju(e):null;return s&&function b(){const x=Ju(e);!y||x.x===y.x&&x.y===y.y&&x.width===y.width&&x.height===y.height||n(),y=x,h=requestAnimationFrame(b)}(),n(),()=>{var b;d.forEach(x=>{l&&x.removeEventListener("scroll",n),u&&x.removeEventListener("resize",n)}),(b=m)==null||b.disconnect(),m=null,s&&cancelAnimationFrame(h)}}const nTe=(e,t,n)=>$Pe(e,t,{platform:eTe,...n});var q8=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Y8(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Y8(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Y8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function rTe(e){const t=w.useRef(e);return q8(()=>{t.current=e}),t}function iTe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=w.useRef(null),a=w.useRef(null),s=rTe(i),l=w.useRef(null),[u,d]=w.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,m]=w.useState(t);Y8(h==null?void 0:h.map(P=>{let{options:A}=P;return A}),t==null?void 0:t.map(P=>{let{options:A}=P;return A}))||m(t);const y=w.useCallback(()=>{!o.current||!a.current||nTe(o.current,a.current,{middleware:h,placement:n,strategy:r}).then(P=>{b.current&&el.flushSync(()=>{d(P)})})},[h,n,r]);q8(()=>{b.current&&y()},[y]);const b=w.useRef(!1);q8(()=>(b.current=!0,()=>{b.current=!1}),[]);const x=w.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const P=s.current(o.current,a.current,y);l.current=P}else y()},[y,s]),k=w.useCallback(P=>{o.current=P,x()},[x]),E=w.useCallback(P=>{a.current=P,x()},[x]),_=w.useMemo(()=>({reference:o,floating:a}),[]);return w.useMemo(()=>({...u,update:y,refs:_,reference:k,floating:E}),[u,y,_,k,E])}const oTe=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?$D({element:t.current,padding:n}).fn(i):{}:t?$D({element:t,padding:n}).fn(i):{}}}};function aTe(e){const[t,n]=w.useState(void 0);return c0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const oY="Popper",[VP,aY]=Gy(oY),[sTe,sY]=VP(oY),lTe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return w.createElement(sTe,{scope:t,anchor:r,onAnchorChange:i},n)},uTe="PopperAnchor",cTe=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=sY(uTe,n),a=w.useRef(null),s=ps(t,a);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:w.createElement(lc.div,bn({},i,{ref:s}))}),cS="PopperContent",[dTe,zze]=VP(cS),[fTe,hTe]=VP(cS,{hasParent:!1,positionUpdateFns:new Set}),pTe=w.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:d,side:h="bottom",sideOffset:m=0,align:y="center",alignOffset:b=0,arrowPadding:x=0,collisionBoundary:k=[],collisionPadding:E=0,sticky:_="partial",hideWhenDetached:P=!1,avoidCollisions:A=!0,...M}=e,R=sY(cS,d),[D,j]=w.useState(null),z=ps(t,ae=>j(ae)),[H,K]=w.useState(null),te=aTe(H),G=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,F=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,W=h+(y!=="center"?"-"+y:""),X=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},Z=Array.isArray(k)?k:[k],U=Z.length>0,Q={padding:X,boundary:Z.filter(mTe),altBoundary:U},{reference:re,floating:fe,strategy:Ee,x:be,y:ye,placement:ze,middlewareData:Me,update:rt}=iTe({strategy:"fixed",placement:W,whileElementsMounted:tTe,middleware:[YPe({mainAxis:m+F,alignmentAxis:b}),A?KPe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?XPe():void 0,...Q}):void 0,H?oTe({element:H,padding:x}):void 0,A?GPe({...Q}):void 0,vTe({arrowWidth:G,arrowHeight:F}),P?qPe({strategy:"referenceHidden"}):void 0].filter(gTe)});c0(()=>{re(R.anchor)},[re,R.anchor]);const We=be!==null&&ye!==null,[Be,wt]=lY(ze),Fe=(i=Me.arrow)===null||i===void 0?void 0:i.x,at=(o=Me.arrow)===null||o===void 0?void 0:o.y,bt=((a=Me.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Le,ut]=w.useState();c0(()=>{D&&ut(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Mt,positionUpdateFns:ct}=hTe(cS,d),_t=!Mt;w.useLayoutEffect(()=>{if(!_t)return ct.add(rt),()=>{ct.delete(rt)}},[_t,ct,rt]),w.useLayoutEffect(()=>{_t&&We&&Array.from(ct).reverse().forEach(ae=>requestAnimationFrame(ae))},[_t,We,ct]);const un={"data-side":Be,"data-align":wt,...M,ref:z,style:{...M.style,animation:We?void 0:"none",opacity:(s=Me.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return w.createElement("div",{ref:fe,"data-radix-popper-content-wrapper":"",style:{position:Ee,left:0,top:0,transform:We?`translate3d(${Math.round(be)}px, ${Math.round(ye)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Le,["--radix-popper-transform-origin"]:[(l=Me.transformOrigin)===null||l===void 0?void 0:l.x,(u=Me.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},w.createElement(dTe,{scope:d,placedSide:Be,onArrowChange:K,arrowX:Fe,arrowY:at,shouldHideArrow:bt},_t?w.createElement(fTe,{scope:d,hasParent:!0,positionUpdateFns:ct},w.createElement(lc.div,un)):w.createElement(lc.div,un)))});function gTe(e){return e!==void 0}function mTe(e){return e!==null}const vTe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,h=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=h?0:e.arrowWidth,y=h?0:e.arrowHeight,[b,x]=lY(s),k={start:"0%",center:"50%",end:"100%"}[x],E=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+y/2;let P="",A="";return b==="bottom"?(P=h?k:`${E}px`,A=`${-y}px`):b==="top"?(P=h?k:`${E}px`,A=`${l.floating.height+y}px`):b==="right"?(P=`${-y}px`,A=h?k:`${_}px`):b==="left"&&(P=`${l.floating.width+y}px`,A=h?k:`${_}px`),{data:{x:P,y:A}}}});function lY(e){const[t,n="center"]=e.split("-");return[t,n]}const yTe=lTe,bTe=cTe,STe=pTe;function xTe(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const uY=e=>{const{present:t,children:n}=e,r=wTe(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=ps(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};uY.displayName="Presence";function wTe(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[s,l]=xTe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=Zb(r.current);o.current=s==="mounted"?u:"none"},[s]),c0(()=>{const u=r.current,d=i.current;if(d!==e){const m=o.current,y=Zb(u);e?l("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),c0(()=>{if(t){const u=h=>{const y=Zb(r.current).includes(h.animationName);h.target===t&&y&&el.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(o.current=Zb(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Zb(e){return(e==null?void 0:e.animationName)||"none"}function CTe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=_Te({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=du(n),l=w.useCallback(u=>{if(o){const h=typeof u=="function"?u(e):u;h!==e&&s(h)}else i(u)},[o,e,i,s]);return[a,l]}function _Te({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),o=du(t);return w.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const UC="rovingFocusGroup.onEntryFocus",kTe={bubbles:!1,cancelable:!0},WP="RovingFocusGroup",[K8,cY,ETe]=Gq(WP),[PTe,dY]=Gy(WP,[ETe]),[TTe,LTe]=PTe(WP),ATe=w.forwardRef((e,t)=>w.createElement(K8.Provider,{scope:e.__scopeRovingFocusGroup},w.createElement(K8.Slot,{scope:e.__scopeRovingFocusGroup},w.createElement(OTe,bn({},e,{ref:t}))))),OTe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=w.useRef(null),m=ps(t,h),y=qq(o),[b=null,x]=CTe({prop:a,defaultProp:s,onChange:l}),[k,E]=w.useState(!1),_=du(u),P=cY(n),A=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const D=h.current;if(D)return D.addEventListener(UC,_),()=>D.removeEventListener(UC,_)},[_]),w.createElement(TTe,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:b,onItemFocus:w.useCallback(D=>x(D),[x]),onItemShiftTab:w.useCallback(()=>E(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>R(D=>D-1),[])},w.createElement(lc.div,bn({tabIndex:k||M===0?-1:0,"data-orientation":r},d,{ref:m,style:{outline:"none",...e.style},onMouseDown:ir(e.onMouseDown,()=>{A.current=!0}),onFocus:ir(e.onFocus,D=>{const j=!A.current;if(D.target===D.currentTarget&&j&&!k){const z=new CustomEvent(UC,kTe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=P().filter(W=>W.focusable),K=H.find(W=>W.active),te=H.find(W=>W.id===b),F=[K,te,...H].filter(Boolean).map(W=>W.ref.current);fY(F)}}A.current=!1}),onBlur:ir(e.onBlur,()=>E(!1))})))}),MTe="RovingFocusGroupItem",ITe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=FPe(),s=LTe(MTe,n),l=s.currentTabStopId===a,u=cY(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=s;return w.useEffect(()=>{if(r)return d(),()=>h()},[r,d,h]),w.createElement(K8.ItemSlot,{scope:n,id:a,focusable:r,active:i},w.createElement(lc.span,bn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:ir(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:ir(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:ir(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=NTe(m,s.orientation,s.dir);if(y!==void 0){m.preventDefault();let x=u().filter(k=>k.focusable).map(k=>k.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const k=x.indexOf(m.currentTarget);x=s.loop?jTe(x,k+1):x.slice(k+1)}setTimeout(()=>fY(x))}})})))}),RTe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DTe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NTe(e,t,n){const r=DTe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return RTe[r]}function fY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const BTe=ATe,FTe=ITe,$Te=["Enter"," "],zTe=["ArrowDown","PageUp","Home"],hY=["ArrowUp","PageDown","End"],HTe=[...zTe,...hY],ow="Menu",[X8,VTe,WTe]=Gq(ow),[Cp,pY]=Gy(ow,[WTe,aY,dY]),UP=aY(),gY=dY(),[UTe,aw]=Cp(ow),[GTe,GP]=Cp(ow),qTe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=UP(t),[l,u]=w.useState(null),d=w.useRef(!1),h=du(o),m=qq(i);return w.useEffect(()=>{const y=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),w.createElement(yTe,s,w.createElement(UTe,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u},w.createElement(GTe,{scope:t,onClose:w.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:m,modal:a},r)))},YTe=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=UP(n);return w.createElement(bTe,bn({},i,r,{ref:t}))}),KTe="MenuPortal",[Hze,XTe]=Cp(KTe,{forceMount:void 0}),Ud="MenuContent",[ZTe,mY]=Cp(Ud),QTe=w.forwardRef((e,t)=>{const n=XTe(Ud,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=aw(Ud,e.__scopeMenu),a=GP(Ud,e.__scopeMenu);return w.createElement(X8.Provider,{scope:e.__scopeMenu},w.createElement(uY,{present:r||o.open},w.createElement(X8.Slot,{scope:e.__scopeMenu},a.modal?w.createElement(JTe,bn({},i,{ref:t})):w.createElement(eLe,bn({},i,{ref:t})))))}),JTe=w.forwardRef((e,t)=>{const n=aw(Ud,e.__scopeMenu),r=w.useRef(null),i=ps(t,r);return w.useEffect(()=>{const o=r.current;if(o)return QH(o)},[]),w.createElement(vY,bn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ir(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),eLe=w.forwardRef((e,t)=>{const n=aw(Ud,e.__scopeMenu);return w.createElement(vY,bn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),vY=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m,disableOutsideScroll:y,...b}=e,x=aw(Ud,n),k=GP(Ud,n),E=UP(n),_=gY(n),P=VTe(n),[A,M]=w.useState(null),R=w.useRef(null),D=ps(t,R,x.onContentChange),j=w.useRef(0),z=w.useRef(""),H=w.useRef(0),K=w.useRef(null),te=w.useRef("right"),G=w.useRef(0),F=y?BV:w.Fragment,W=y?{as:uy,allowPinchZoom:!0}:void 0,X=U=>{var Q,re;const fe=z.current+U,Ee=P().filter(We=>!We.disabled),be=document.activeElement,ye=(Q=Ee.find(We=>We.ref.current===be))===null||Q===void 0?void 0:Q.textValue,ze=Ee.map(We=>We.textValue),Me=uLe(ze,fe,ye),rt=(re=Ee.find(We=>We.textValue===Me))===null||re===void 0?void 0:re.ref.current;(function We(Be){z.current=Be,window.clearTimeout(j.current),Be!==""&&(j.current=window.setTimeout(()=>We(""),1e3))})(fe),rt&&setTimeout(()=>rt.focus())};w.useEffect(()=>()=>window.clearTimeout(j.current),[]),LPe();const Z=w.useCallback(U=>{var Q,re;return te.current===((Q=K.current)===null||Q===void 0?void 0:Q.side)&&dLe(U,(re=K.current)===null||re===void 0?void 0:re.area)},[]);return w.createElement(ZTe,{scope:n,searchRef:z,onItemEnter:w.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),onItemLeave:w.useCallback(U=>{var Q;Z(U)||((Q=R.current)===null||Q===void 0||Q.focus(),M(null))},[Z]),onTriggerLeave:w.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),pointerGraceTimerRef:H,onPointerGraceIntentChange:w.useCallback(U=>{K.current=U},[])},w.createElement(F,W,w.createElement(APe,{asChild:!0,trapped:i,onMountAutoFocus:ir(o,U=>{var Q;U.preventDefault(),(Q=R.current)===null||Q===void 0||Q.focus()}),onUnmountAutoFocus:a},w.createElement(EPe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m},w.createElement(BTe,bn({asChild:!0},_,{dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:M,onEntryFocus:U=>{k.isUsingKeyboardRef.current||U.preventDefault()}}),w.createElement(STe,bn({role:"menu","aria-orientation":"vertical","data-state":aLe(x.open),"data-radix-menu-content":"",dir:k.dir},E,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:ir(b.onKeyDown,U=>{const re=U.target.closest("[data-radix-menu-content]")===U.currentTarget,fe=U.ctrlKey||U.altKey||U.metaKey,Ee=U.key.length===1;re&&(U.key==="Tab"&&U.preventDefault(),!fe&&Ee&&X(U.key));const be=R.current;if(U.target!==be||!HTe.includes(U.key))return;U.preventDefault();const ze=P().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);hY.includes(U.key)&&ze.reverse(),sLe(ze)}),onBlur:ir(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(j.current),z.current="")}),onPointerMove:ir(e.onPointerMove,Q8(U=>{const Q=U.target,re=G.current!==U.clientX;if(U.currentTarget.contains(Q)&&re){const fe=U.clientX>G.current?"right":"left";te.current=fe,G.current=U.clientX}}))})))))))}),Z8="MenuItem",KD="menu.itemSelect",tLe=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=w.useRef(null),a=GP(Z8,e.__scopeMenu),s=mY(Z8,e.__scopeMenu),l=ps(t,o),u=w.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const m=new CustomEvent(KD,{bubbles:!0,cancelable:!0});h.addEventListener(KD,y=>r==null?void 0:r(y),{once:!0}),Uq(h,m),m.defaultPrevented?u.current=!1:a.onClose()}};return w.createElement(nLe,bn({},i,{ref:l,disabled:n,onClick:ir(e.onClick,d),onPointerDown:h=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,h),u.current=!0},onPointerUp:ir(e.onPointerUp,h=>{var m;u.current||(m=h.currentTarget)===null||m===void 0||m.click()}),onKeyDown:ir(e.onKeyDown,h=>{const m=s.searchRef.current!=="";n||m&&h.key===" "||$Te.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}))}),nLe=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=mY(Z8,n),s=gY(n),l=w.useRef(null),u=ps(t,l),[d,h]=w.useState(!1),[m,y]=w.useState("");return w.useEffect(()=>{const b=l.current;if(b){var x;y(((x=b.textContent)!==null&&x!==void 0?x:"").trim())}},[o.children]),w.createElement(X8.ItemSlot,{scope:n,disabled:r,textValue:i??m},w.createElement(FTe,bn({asChild:!0},s,{focusable:!r}),w.createElement(lc.div,bn({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:ir(e.onPointerMove,Q8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:ir(e.onPointerLeave,Q8(b=>a.onItemLeave(b))),onFocus:ir(e.onFocus,()=>h(!0)),onBlur:ir(e.onBlur,()=>h(!1))}))))}),rLe="MenuRadioGroup";Cp(rLe,{value:void 0,onValueChange:()=>{}});const iLe="MenuItemIndicator";Cp(iLe,{checked:!1});const oLe="MenuSub";Cp(oLe);function aLe(e){return e?"open":"closed"}function sLe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function lLe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function uLe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=lLe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function cLe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(u-s)*(r-l)/(d-l)+s&&(i=!i)}return i}function dLe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return cLe(n,t)}function Q8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const fLe=qTe,hLe=YTe,pLe=QTe,gLe=tLe,yY="ContextMenu",[mLe,Vze]=Gy(yY,[pY]),sw=pY(),[vLe,bY]=mLe(yY),yLe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=w.useState(!1),l=sw(t),u=du(r),d=w.useCallback(h=>{s(h),u(h)},[u]);return w.createElement(vLe,{scope:t,open:a,onOpenChange:d,modal:o},w.createElement(fLe,bn({},l,{dir:i,open:a,onOpenChange:d,modal:o}),n))},bLe="ContextMenuTrigger",SLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bY(bLe,n),o=sw(n),a=w.useRef({x:0,y:0}),s=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=w.useRef(0),u=w.useCallback(()=>window.clearTimeout(l.current),[]),d=h=>{a.current={x:h.clientX,y:h.clientY},i.onOpenChange(!0)};return w.useEffect(()=>u,[u]),w.createElement(w.Fragment,null,w.createElement(hLe,bn({},o,{virtualRef:s})),w.createElement(lc.span,bn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:ir(e.onContextMenu,h=>{u(),d(h),h.preventDefault()}),onPointerDown:ir(e.onPointerDown,Qb(h=>{u(),l.current=window.setTimeout(()=>d(h),700)})),onPointerMove:ir(e.onPointerMove,Qb(u)),onPointerCancel:ir(e.onPointerCancel,Qb(u)),onPointerUp:ir(e.onPointerUp,Qb(u))})))}),xLe="ContextMenuContent",wLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bY(xLe,n),o=sw(n),a=w.useRef(!1);return w.createElement(pLe,bn({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),CLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=sw(n);return w.createElement(gLe,bn({},i,r,{ref:t}))});function Qb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const _Le=yLe,kLe=SLe,ELe=wLe,dd=CLe,PLe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,SY=w.memo(e=>{var te,G,F,W,X,Z,U,Q;const t=Oe(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,shouldUseSingleGalleryColumn:a}=he(HEe),{image:s,isSelected:l}=e,{url:u,thumbnail:d,uuid:h,metadata:m}=s,[y,b]=w.useState(!1),x=By(),{t:k}=Ge(),E=()=>b(!0),_=()=>b(!1),P=()=>{var re,fe;if(s.metadata){const[Ee,be]=hP((fe=(re=s.metadata)==null?void 0:re.image)==null?void 0:fe.prompt);Ee&&t($x(Ee)),t(ny(be||""))}x({title:k("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},A=()=>{s.metadata&&t($y(s.metadata.image.seed)),x({title:k("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},M=()=>{t(T0(s)),n!=="img2img"&&t(Yo("img2img")),x({title:k("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},R=()=>{t(Fx(s)),t(Bx()),n!=="unifiedCanvas"&&t(Yo("unifiedCanvas")),x({title:k("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},D=()=>{m&&t(yU(m)),x({title:k("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},j=async()=>{var re;if((re=m==null?void 0:m.image)!=null&&re.init_image_path&&(await fetch(m.image.init_image_path)).ok){t(Yo("img2img")),t(hwe(m)),x({title:k("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}x({title:k("toast:initialImageNotSet"),description:k("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},z=()=>t(UI(s)),H=re=>{re.dataTransfer.setData("invokeai/imageUuid",h),re.dataTransfer.effectAllowed="move"},K=()=>{t(UI(s))};return v.jsxs(_Le,{onOpenChange:re=>{t(hU(re))},children:[v.jsx(kLe,{children:v.jsxs(Eo,{position:"relative",className:"hoverable-image",onMouseOver:E,onMouseOut:_,userSelect:"none",draggable:!0,onDragStart:H,children:[v.jsx(JS,{className:"hoverable-image-image",objectFit:a?"contain":r,rounded:"md",src:d||u,loading:"lazy"}),v.jsx("div",{className:"hoverable-image-content",onClick:z,children:l&&v.jsx(Na,{width:"50%",height:"50%",as:RP,className:"hoverable-image-check"})}),y&&i>=64&&v.jsx("div",{className:"hoverable-image-delete-button",children:v.jsx(iS,{image:s,children:v.jsx(us,{"aria-label":k("parameters:deleteImage"),icon:v.jsx(BEe,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},h)}),v.jsxs(ELe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:re=>{re.detail.originalEvent.preventDefault()},children:[v.jsx(dd,{onClickCapture:K,children:k("parameters:openInViewer")}),v.jsx(dd,{onClickCapture:P,disabled:((G=(te=s==null?void 0:s.metadata)==null?void 0:te.image)==null?void 0:G.prompt)===void 0,children:k("parameters:usePrompt")}),v.jsx(dd,{onClickCapture:A,disabled:((W=(F=s==null?void 0:s.metadata)==null?void 0:F.image)==null?void 0:W.seed)===void 0,children:k("parameters:useSeed")}),v.jsx(dd,{onClickCapture:D,disabled:!["txt2img","img2img"].includes((Z=(X=s==null?void 0:s.metadata)==null?void 0:X.image)==null?void 0:Z.type),children:k("parameters:useAll")}),v.jsx(dd,{onClickCapture:j,disabled:((Q=(U=s==null?void 0:s.metadata)==null?void 0:U.image)==null?void 0:Q.type)!=="img2img",children:k("parameters:useInitImg")}),v.jsx(dd,{onClickCapture:M,children:k("parameters:sendToImg2Img")}),v.jsx(dd,{onClickCapture:R,children:k("parameters:sendToUnifiedCanvas")}),v.jsx(dd,{"data-warning":!0,children:v.jsx(iS,{image:s,children:v.jsx("p",{children:k("parameters:deleteImage")})})})]})]})},PLe);SY.displayName="HoverableImage";const Jb=320,XD=40,TLe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},ZD=400;function xY(){const e=Oe(),{t}=Ge(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,areMoreImagesAvailable:b,galleryWidth:x,isLightboxOpen:k,isStaging:E,shouldEnableResize:_,shouldUseSingleGalleryColumn:P}=he(zEe),{galleryMinWidth:A,galleryMaxWidth:M}=k?{galleryMinWidth:ZD,galleryMaxWidth:ZD}:TLe[d],[R,D]=w.useState(x>=Jb),[j,z]=w.useState(!1),[H,K]=w.useState(0),te=w.useRef(null),G=w.useRef(null),F=w.useRef(null);w.useEffect(()=>{x>=Jb&&D(!1)},[x]);const W=()=>{e(ewe(!o)),e(vi(!0))},X=()=>{a?U():Z()},Z=()=>{e(zd(!0)),o&&e(vi(!0))},U=w.useCallback(()=>{e(zd(!1)),e(hU(!1)),e(twe(G.current?G.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),Q=()=>{e($8(r))},re=ye=>{e(av(ye))},fe=()=>{m||(F.current=window.setTimeout(()=>U(),500))},Ee=()=>{F.current&&window.clearTimeout(F.current)};et("g",()=>{X()},[a,o]),et("left",()=>{e(fP())},{enabled:!E||d!=="unifiedCanvas"},[E]),et("right",()=>{e(dP())},{enabled:!E||d!=="unifiedCanvas"},[E]),et("shift+g",()=>{W()},[o]),et("esc",()=>{e(zd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const be=32;return et("shift+up",()=>{if(l<256){const ye=ke.clamp(l+be,32,256);e(av(ye))}},[l]),et("shift+down",()=>{if(l>32){const ye=ke.clamp(l-be,32,256);e(av(ye))}},[l]),w.useEffect(()=>{G.current&&(G.current.scrollTop=s)},[s,a]),w.useEffect(()=>{function ye(ze){!o&&te.current&&!te.current.contains(ze.target)&&U()}return document.addEventListener("mousedown",ye),()=>{document.removeEventListener("mousedown",ye)}},[U,o]),v.jsx(Vq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:v.jsxs("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Ee,onMouseOver:o?void 0:Ee,children:[v.jsxs(jq,{minWidth:A,maxWidth:o?M:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:_},size:{width:x,height:o?"100%":"100vh"},onResizeStart:(ye,ze,Me)=>{K(Me.clientHeight),Me.style.height=`${Me.clientHeight}px`,o&&(Me.style.position="fixed",Me.style.right="1rem",z(!0))},onResizeStop:(ye,ze,Me,rt)=>{const We=o?ke.clamp(Number(x)+rt.width,A,Number(M)):Number(x)+rt.width;e(iwe(We)),Me.removeAttribute("data-resize-alert"),o&&(Me.style.position="relative",Me.style.removeProperty("right"),Me.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(ye,ze,Me,rt)=>{const We=ke.clamp(Number(x)+rt.width,A,Number(o?M:.95*window.innerWidth));We>=Jb&&!R?D(!0):WeWe-XD&&e(av(We-XD)),o&&(We>=M?Me.setAttribute("data-resize-alert","true"):Me.removeAttribute("data-resize-alert")),Me.style.height=`${H}px`},children:[v.jsxs("div",{className:"image-gallery-header",children:[v.jsx(oo,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:R?v.jsxs(v.Fragment,{children:[v.jsx(nr,{size:"sm","data-selected":r==="result",onClick:()=>e(Lb("result")),children:t("gallery:generations")}),v.jsx(nr,{size:"sm","data-selected":r==="user",onClick:()=>e(Lb("user")),children:t("gallery:uploads")})]}):v.jsxs(v.Fragment,{children:[v.jsx(Je,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:v.jsx(EEe,{}),onClick:()=>e(Lb("result"))}),v.jsx(Je,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:v.jsx($Ee,{}),onClick:()=>e(Lb("user"))})]})}),v.jsxs("div",{className:"image-gallery-header-right-icons",children:[v.jsx(Js,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:v.jsx(Je,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:v.jsx(BP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:v.jsxs("div",{className:"image-gallery-settings-popover",children:[v.jsxs("div",{children:[v.jsx(so,{value:l,onChange:re,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),v.jsx(Je,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(av(64)),icon:v.jsx(Yx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:maintainAspectRatio"),isChecked:h==="contain",onChange:()=>e(nwe(h==="contain"?"cover":"contain"))})}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:autoSwitchNewImages"),isChecked:y,onChange:ye=>e(rwe(ye.target.checked))})}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:singleColumnLayout"),isChecked:P,onChange:ye=>e(owe(ye.target.checked))})})]})}),v.jsx(Je,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:W,icon:o?v.jsx(Bq,{}):v.jsx(Fq,{})})]})]}),v.jsx("div",{className:"image-gallery-container",ref:G,children:n.length||b?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(ye=>{const{uuid:ze}=ye,Me=i===ze;return v.jsx(SY,{image:ye,isSelected:Me},ze)})}),v.jsx(ls,{onClick:Q,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):v.jsxs("div",{className:"image-gallery-container-placeholder",children:[v.jsx($q,{}),v.jsx("p",{children:t("gallery:noImagesInGallery")})]})})]}),j&&v.jsx("div",{style:{width:`${x}px`,height:"100%"}})]})})}/*! ***************************************************************************** +}`;var qt=hL(function(){return on(V,St+"return "+Re).apply(n,J)});if(qt.source=Re,Bw(qt))throw qt;return qt}function LJ(c){return An(c).toLowerCase()}function AJ(c){return An(c).toUpperCase()}function OJ(c,g,C){if(c=An(c),c&&(C||g===n))return fo(c);if(!c||!(g=go(g)))return c;var O=Ji(c),B=Ji(g),V=da(O,B),J=xs(O,B)+1;return Ts(O,V,J).join("")}function MJ(c,g,C){if(c=An(c),c&&(C||g===n))return c.slice(0,o1(c)+1);if(!c||!(g=go(g)))return c;var O=Ji(c),B=xs(O,Ji(g))+1;return Ts(O,0,B).join("")}function IJ(c,g,C){if(c=An(c),c&&(C||g===n))return c.replace(xc,"");if(!c||!(g=go(g)))return c;var O=Ji(c),B=da(O,Ji(g));return Ts(O,B).join("")}function RJ(c,g){var C=H,O=K;if(Cr(g)){var B="separator"in g?g.separator:B;C="length"in g?Vt(g.length):C,O="omission"in g?go(g.omission):O}c=An(c);var V=c.length;if(Eu(c)){var J=Ji(c);V=J.length}if(C>=V)return c;var ne=C-Va(O);if(ne<1)return O;var ce=J?Ts(J,0,ne).join(""):c.slice(0,ne);if(B===n)return ce+O;if(J&&(ne+=ce.length-ne),$w(B)){if(c.slice(ne).search(B)){var _e,Pe=ce;for(B.global||(B=$f(B.source,An(vs.exec(B))+"g")),B.lastIndex=0;_e=B.exec(Pe);)var Re=_e.index;ce=ce.slice(0,Re===n?ne:Re)}}else if(c.indexOf(go(B),ne)!=ne){var nt=ce.lastIndexOf(B);nt>-1&&(ce=ce.slice(0,nt))}return ce+O}function DJ(c){return c=An(c),c&&j0.test(c)?c.replace(Ii,u3):c}var NJ=Tl(function(c,g,C){return c+(C?" ":"")+g.toUpperCase()}),Hw=wg("toUpperCase");function fL(c,g,C){return c=An(c),g=C?n:g,g===n?Wp(c)?Bf(c):n1(c):c.match(g)||[]}var hL=Ot(function(c,g){try{return Di(c,n,g)}catch(C){return Bw(C)?C:new It(C)}}),jJ=vr(function(c,g){return Xn(g,function(C){C=Ll(C),ga(c,C,Nw(c[C],c))}),c});function BJ(c){var g=c==null?0:c.length,C=Ie();return c=g?Un(c,function(O){if(typeof O[1]!="function")throw new Ni(a);return[C(O[0]),O[1]]}):[],Ot(function(O){for(var B=-1;++BU)return[];var C=he,O=fi(c,he);g=Ie(g),c-=he;for(var B=Df(O,g);++C0||g<0)?new Qt(C):(c<0?C=C.takeRight(-c):c&&(C=C.drop(c)),g!==n&&(g=Vt(g),C=g<0?C.dropRight(-g):C.take(g-c)),C)},Qt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Qt.prototype.toArray=function(){return this.take(he)},ya(Qt.prototype,function(c,g){var C=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),B=F[O?"take"+(g=="last"?"Right":""):g],V=O||/^find/.test(g);B&&(F.prototype[g]=function(){var J=this.__wrapped__,ne=O?[1]:arguments,ce=J instanceof Qt,_e=ne[0],Pe=ce||zt(J),Re=function(Jt){var an=B.apply(F,Ha([Jt],ne));return O&&nt?an[0]:an};Pe&&C&&typeof _e=="function"&&_e.length!=1&&(ce=Pe=!1);var nt=this.__chain__,St=!!this.__actions__.length,Pt=V&&!nt,qt=ce&&!St;if(!V&&Pe){J=qt?J:new Qt(this);var Tt=c.apply(J,ne);return Tt.__actions__.push({func:R3,args:[Re],thisArg:n}),new ho(Tt,nt)}return Pt&&qt?c.apply(this,ne):(Tt=this.thru(Re),Pt?O?Tt.value()[0]:Tt.value():Tt)})}),Xn(["pop","push","shift","sort","splice","unshift"],function(c){var g=Dc[c],C=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",O=/^(?:pop|shift)$/.test(c);F.prototype[c]=function(){var B=arguments;if(O&&!this.__chain__){var V=this.value();return g.apply(zt(V)?V:[],B)}return this[C](function(J){return g.apply(zt(J)?J:[],B)})}}),ya(Qt.prototype,function(c,g){var C=F[g];if(C){var O=C.name+"";cn.call(Cs,O)||(Cs[O]=[]),Cs[O].push({name:g,func:C})}}),Cs[rh(n,E).name]=[{name:"wrapper",func:n}],Qt.prototype.clone=eo,Qt.prototype.reverse=Bi,Qt.prototype.value=y3,F.prototype.at=fZ,F.prototype.chain=hZ,F.prototype.commit=pZ,F.prototype.next=gZ,F.prototype.plant=vZ,F.prototype.reverse=yZ,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=bZ,F.prototype.first=F.prototype.head,Fc&&(F.prototype[Fc]=mZ),F},Wa=Bo();Zt?((Zt.exports=Wa)._=Wa,jt._=Wa):kt._=Wa}).call(_o)})(bxe,ke);const Dg=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Ng=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},Sxe=.999,xxe=.1,wxe=20,av=.95,HI=30,h8=10,VI=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),uh=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Yl(s/o,64)):o<1&&(r.height=s,r.width=Yl(s*o,64)),a=r.width*r.height;return r},Cxe=e=>({width:Yl(e.width,64),height:Yl(e.height,64)}),qW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],_xe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],lP=e=>e.kind==="line"&&e.layer==="mask",kxe=e=>e.kind==="line"&&e.layer==="base",Y5=e=>e.kind==="image"&&e.layer==="base",Exe=e=>e.kind==="fillRect"&&e.layer==="base",Pxe=e=>e.kind==="eraseRect"&&e.layer==="base",Txe=e=>e.kind==="line",Ov={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},Lxe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:Ov,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},YW=gp({name:"canvas",initialState:Lxe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!lP(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Ld(ke.clamp(n.width,64,512),64),height:Ld(ke.clamp(n.height,64,512),64)},o={x:Yl(n.width/2-i.width/2,64),y:Yl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=uh(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState={...Ov,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Ng(r.width,r.height,n.width,n.height,av),s=Dg(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=Cxe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=uh(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=VI(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...Ov.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(Txe);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(ke.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.layerState=Ov,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(Y5),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const d=Ng(i.width,i.height,512,512,av),h=Dg(i.width,i.height,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=uh(m);e.scaledBoundingBoxDimensions=y}return}const{width:o,height:a}=r,l=Ng(t,n,o,a,.95),u=Dg(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=VI(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(Y5)){const i=Ng(r.width,r.height,512,512,av),o=Dg(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=uh(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const d=r?1:Ng(i,o,l,u,av),h=Dg(i,o,a,s,l,u,d);e.stageScale=d,e.stageCoordinates=h}else{const d=Ng(i,o,512,512,av),h=Dg(i,o,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=uh(m);e.scaledBoundingBoxDimensions=y}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...Ov.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Ld(ke.clamp(o,64,512),64),height:Ld(ke.clamp(a,64,512),64)},l={x:Yl(o/2-s.width/2,64),y:Yl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=uh(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=uh(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(ke.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:KW,addFillRect:XW,addImageToStagingArea:Axe,addLine:Oxe,addPointToCurrentLine:ZW,clearCanvasHistory:QW,clearMask:uP,commitColorPickerColor:Mxe,commitStagingAreaImage:Ixe,discardStagedImages:Rxe,fitBoundingBoxToStage:yze,mouseLeftCanvas:Dxe,nextStagingAreaImage:Nxe,prevStagingAreaImage:jxe,redo:Bxe,resetCanvas:cP,resetCanvasInteractionState:$xe,resetCanvasView:JW,resizeAndScaleCanvas:Bx,resizeCanvas:Fxe,setBoundingBoxCoordinates:CC,setBoundingBoxDimensions:Mv,setBoundingBoxPreviewFill:bze,setBoundingBoxScaleMethod:zxe,setBrushColor:zm,setBrushSize:Hm,setCanvasContainerDimensions:Hxe,setColorPickerColor:Vxe,setCursorPosition:Wxe,setDoesCanvasNeedScaling:vi,setInitialCanvasImage:$x,setIsDrawing:eU,setIsMaskEnabled:zy,setIsMouseOverBoundingBox:Lb,setIsMoveBoundingBoxKeyHeld:Sze,setIsMoveStageKeyHeld:xze,setIsMovingBoundingBox:_C,setIsMovingStage:K5,setIsTransformingBoundingBox:kC,setLayer:X5,setMaskColor:tU,setMergedCanvas:Uxe,setShouldAutoSave:nU,setShouldCropToBoundingBoxOnSave:rU,setShouldDarkenOutsideBoundingBox:iU,setShouldLockBoundingBox:wze,setShouldPreserveMaskedArea:oU,setShouldShowBoundingBox:Gxe,setShouldShowBrush:Cze,setShouldShowBrushPreview:_ze,setShouldShowCanvasDebugInfo:aU,setShouldShowCheckboardTransparency:kze,setShouldShowGrid:sU,setShouldShowIntermediates:lU,setShouldShowStagingImage:qxe,setShouldShowStagingOutline:WI,setShouldSnapToGrid:Z5,setStageCoordinates:uU,setStageScale:Yxe,setTool:ru,toggleShouldLockBoundingBox:Eze,toggleTool:Pze,undo:Kxe,setScaledBoundingBoxDimensions:Ab,setShouldRestrictStrokesToBox:cU}=YW.actions,Xxe=YW.reducer,Zxe={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},dU=gp({name:"gallery",initialState:Zxe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=ke.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:hm,clearIntermediateImage:EC,removeImage:fU,setCurrentImage:UI,addGalleryImages:Qxe,setIntermediateImage:Jxe,selectNextImage:dP,selectPrevImage:fP,setShouldPinGallery:ewe,setShouldShowGallery:Hd,setGalleryScrollPosition:twe,setGalleryImageMinimumWidth:sv,setGalleryImageObjectFit:nwe,setShouldHoldGalleryOpen:hU,setShouldAutoSwitchToNewImages:rwe,setCurrentCategory:Ob,setGalleryWidth:iwe,setShouldUseSingleGalleryColumn:owe}=dU.actions,awe=dU.reducer,swe={isLightboxOpen:!1},lwe=swe,pU=gp({name:"lightbox",initialState:lwe,reducers:{setIsLightboxOpen:(e,t)=>{e.isLightboxOpen=t.payload}}}),{setIsLightboxOpen:Vm}=pU.actions,uwe=pU.reducer,c2=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" ");function hP(e){let t=c2(e),n=null;const r=new RegExp(/\[([^\][]*)]/,"gi"),i=[...t.matchAll(r)].map(o=>o[1]);return i.length&&(n=i.join(" "),i.forEach(o=>{t=t.replace(`[${o}]`,"").replaceAll("[]","").trim()})),[t,n]}const cwe=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return pP(r)?r:!1},pP=e=>Boolean(typeof e=="string"?cwe(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),Q5=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),dwe=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),gU={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512},fwe=gU,mU=gp({name:"generation",initialState:fwe,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=c2(n)},setNegativePrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.negativePrompt=n:e.negativePrompt=c2(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:d,hires_fix:h,width:m,height:y}=t.payload.image;o&&o.length>0?(e.seedWeights=Q5(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=c2(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,typeof u>"u"?e.perlin=0:e.perlin=u,typeof d=="boolean"&&(e.seamless=d),m&&(e.width=m),y&&(e.height=y)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:d,seamless:h,hires_fix:m,width:y,height:b,strength:x,fit:k,init_image_path:E,mask_image_path:_}=t.payload.image;if(n==="img2img"&&(E&&(e.initialImage=E),_&&(e.maskPath=_),x&&(e.img2imgStrength=x),typeof k=="boolean"&&(e.shouldFitToWidthHeight=k)),a&&a.length>0?(e.seedWeights=Q5(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i){const[P,A]=hP(i);P&&(e.prompt=P),A?e.negativePrompt=A:e.negativePrompt=""}r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),typeof u>"u"?e.threshold=0:e.threshold=u,typeof d>"u"?e.perlin=0:e.perlin=d,typeof h=="boolean"&&(e.seamless=h),y&&(e.width=y),b&&(e.height=b)},resetParametersState:e=>({...e,...gU}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload}}}),{clearInitialImage:vU,resetParametersState:Tze,resetSeed:Lze,setAllImageToImageParameters:hwe,setAllParameters:yU,setAllTextToImageParameters:Aze,setCfgScale:bU,setHeight:SU,setImg2imgStrength:p8,setInfillMethod:xU,setInitialImage:L0,setIterations:pwe,setMaskPath:wU,setParameter:Oze,setPerlin:CU,setPrompt:Fx,setNegativePrompt:iy,setSampler:_U,setSeamBlur:GI,setSeamless:kU,setSeamSize:qI,setSeamSteps:YI,setSeamStrength:KI,setSeed:Hy,setSeedWeights:EU,setShouldFitToWidthHeight:PU,setShouldGenerateVariations:gwe,setShouldRandomizeSeed:mwe,setSteps:TU,setThreshold:LU,setTileSize:XI,setVariationAmount:vwe,setWidth:AU}=mU.actions,ywe=mU.reducer,OU={codeformerFidelity:.75,facetoolStrength:.8,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingDenoising:.75,upscalingStrength:.75},bwe=OU,MU=gp({name:"postprocessing",initialState:bwe,reducers:{setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingDenoising:(e,t)=>{e.upscalingDenoising=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setHiresStrength:(e,t)=>{e.hiresStrength=t.payload},resetPostprocessingState:e=>({...e,...OU}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload}}}),{resetPostprocessingState:Mze,setCodeformerFidelity:IU,setFacetoolStrength:g8,setFacetoolType:B4,setHiresFix:gP,setHiresStrength:ZI,setShouldLoopback:Swe,setShouldRunESRGAN:xwe,setShouldRunFacetool:wwe,setUpscalingLevel:RU,setUpscalingDenoising:m8,setUpscalingStrength:v8}=MU.actions,Cwe=MU.reducer;function Qs(e){return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qs(e)}function gu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _we(e,t){if(Qs(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qs(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DU(e){var t=_we(e,"string");return Qs(t)==="symbol"?t:String(t)}function QI(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};gu(this,e),this.init(t,n)}return mu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||Awe,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function rR(e,t,n){var r=mP(e,t,Object),i=r.obj,o=r.k;i[o]=n}function Iwe(e,t,n,r){var i=mP(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function J5(e,t){var n=mP(e,t),r=n.obj,i=n.k;if(r)return r[i]}function iR(e,t,n){var r=J5(e,n);return r!==void 0?r:J5(t,n)}function NU(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):NU(e[r],t[r],n):e[r]=t[r]);return e}function jg(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Rwe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Dwe(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return Rwe[t]}):e}var Hx=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Nwe=[" ",",","?","!",";"];function jwe(e,t,n){t=t||"",n=n||"";var r=Nwe.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function oR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mb(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jU(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?jU(l,u,n):void 0}i=i[r[o]]}return i}}var Fwe=function(e){zx(n,e);var t=Bwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return gu(this,n),i=t.call(this),Hx&&nf.call(Vd(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return mu(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[i,o];a&&typeof a!="string"&&(d=d.concat(a)),a&&typeof a=="string"&&(d=d.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(d=i.split("."));var h=J5(this.data,d);return h||!u||typeof a!="string"?h:jU(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var d=[i,o];a&&(d=d.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(d=i.split("."),s=o,o=d[1]),this.addNamespaces(o),rR(this.data,d,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[i,o];i.indexOf(".")>-1&&(d=i.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);var h=J5(this.data,d)||{};s?NU(h,a,l):h=Mb(Mb({},h),a),rR(this.data,d,h),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Mb(Mb({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(nf),BU={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function aR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var sR={},lR=function(e){zx(n,e);var t=zwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gu(this,n),i=t.call(this),Hx&&nf.call(Vd(i)),Mwe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Vd(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Kl.create("translator"),i}return mu(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!jwe(i,a,s);if(u&&!d){var h=i.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:i,namespaces:l};var m=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),i=m.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(Qs(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,d=this.extractFromKey(i[i.length-1],o),h=d.key,m=d.namespaces,y=m[m.length-1],b=o.lng||this.language,x=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(x){var k=o.nsSeparator||this.options.nsSeparator;return l?(E.res="".concat(y).concat(k).concat(h),E):"".concat(y).concat(k).concat(h)}return l?(E.res=h,E):h}var E=this.resolve(i,o),_=E&&E.res,P=E&&E.usedKey||h,A=E&&E.exactUsedKey||h,M=Object.prototype.toString.apply(_),R=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,z=typeof _!="string"&&typeof _!="boolean"&&typeof _!="number";if(j&&_&&z&&R.indexOf(M)<0&&!(typeof D=="string"&&M==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var H=this.options.returnedObjectHandler?this.options.returnedObjectHandler(P,_,xo(xo({},o),{},{ns:m})):"key '".concat(h," (").concat(this.language,")' returned an object instead of string.");return l?(E.res=H,E):H}if(u){var K=M==="[object Array]",te=K?[]:{},G=K?A:P;for(var $ in _)if(Object.prototype.hasOwnProperty.call(_,$)){var W="".concat(G).concat(u).concat($);te[$]=this.translate(W,xo(xo({},o),{joinArrays:!1,ns:m})),te[$]===W&&(te[$]=_[$])}_=te}}else if(j&&typeof D=="string"&&M==="[object Array]")_=_.join(D),_&&(_=this.extendTranslation(_,i,o,a));else{var X=!1,Z=!1,U=o.count!==void 0&&typeof o.count!="string",Q=n.hasDefaultValue(o),re=U?this.pluralResolver.getSuffix(b,o.count,o):"",he=o["defaultValue".concat(re)]||o.defaultValue;!this.isValidLookup(_)&&Q&&(X=!0,_=he),this.isValidLookup(_)||(Z=!0,_=h);var Ee=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Ce=Ee&&Z?void 0:_,de=Q&&he!==_&&this.options.updateMissing;if(Z||X||de){if(this.logger.log(de?"updateKey":"missingKey",b,y,h,de?he:_),u){var ze=this.resolve(h,xo(xo({},o),{},{keySeparator:!1}));ze&&ze.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Me=[],rt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&rt&&rt[0])for(var We=0;We1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,d,h;return typeof i=="string"&&(i=[i]),i.forEach(function(m){if(!o.isValidLookup(s)){var y=o.extractFromKey(m,a),b=y.key;l=b;var x=y.namespaces;o.options.fallbackNS&&(x=x.concat(o.options.fallbackNS));var k=a.count!==void 0&&typeof a.count!="string",E=k&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),_=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",P=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);x.forEach(function(A){o.isValidLookup(s)||(h=A,!sR["".concat(P[0],"-").concat(A)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(h)&&(sR["".concat(P[0],"-").concat(A)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(P.join(", "),`" won't get resolved as namespace "`).concat(h,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),P.forEach(function(M){if(!o.isValidLookup(s)){d=M;var R=[b];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(R,b,M,A,a);else{var D;k&&(D=o.pluralResolver.getSuffix(M,a.count,a));var j="".concat(o.options.pluralSeparator,"zero");if(k&&(R.push(b+D),E&&R.push(b+j)),_){var z="".concat(b).concat(o.options.contextSeparator).concat(a.context);R.push(z),k&&(R.push(z+D),E&&R.push(z+j))}}for(var H;H=R.pop();)o.isValidLookup(s)||(u=H,s=o.getResource(M,A,H,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:d,usedNS:h}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(nf);function PC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var uR=function(){function e(t){gu(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kl.create("languageUtils")}return mu(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=PC(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=PC(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=PC(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){u&&(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),Vwe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Wwe={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Uwe=["v1","v2","v3"],cR={zero:0,one:1,two:2,few:3,many:4,other:5};function Gwe(){var e={};return Vwe.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Wwe[t.fc]}})}),e}var qwe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gu(this,e),this.languageUtils=t,this.options=n,this.logger=Kl.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Gwe()}return mu(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return cR[a]-cR[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!Uwe.includes(this.options.compatibilityJSON)}}]),e}();function dR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function js(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};gu(this,e),this.logger=Kl.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return mu(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:Dwe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?jg(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?jg(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?jg(r.nestingPrefix):r.nestingPrefixEscaped||jg("$t("),this.nestingSuffix=r.nestingSuffix?jg(r.nestingSuffix):r.nestingSuffixEscaped||jg(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(k){return k.replace(/\$/g,"$$$$")}var m=function(E){if(E.indexOf(a.formatSeparator)<0){var _=iR(r,d,E);return a.alwaysFormat?a.format(_,void 0,i,js(js(js({},o),r),{},{interpolationkey:E})):_}var P=E.split(a.formatSeparator),A=P.shift().trim(),M=P.join(a.formatSeparator).trim();return a.format(iR(r,d,A),M,i,js(js(js({},o),r),{},{interpolationkey:A}))};this.resetRegExp();var y=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,x=[{regex:this.regexpUnescape,safeValue:function(E){return h(E)}},{regex:this.regexp,safeValue:function(E){return a.escapeValue?h(a.escape(E)):h(E)}}];return x.forEach(function(k){for(u=0;s=k.regex.exec(n);){var E=s[1].trim();if(l=m(E),l===void 0)if(typeof y=="function"){var _=y(n,s,o);l=typeof _=="string"?_:""}else if(o&&o.hasOwnProperty(E))l="";else if(b){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(E," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=nR(l));var P=k.safeValue(l);if(n=n.replace(s[0],P),b?(k.regex.lastIndex+=l.length,k.regex.lastIndex-=s[0].length):k.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(y,b){var x=this.nestingOptionsSeparator;if(y.indexOf(x)<0)return y;var k=y.split(new RegExp("".concat(x,"[ ]*{"))),E="{".concat(k[1]);y=k[0],E=this.interpolate(E,l);var _=E.match(/'/g),P=E.match(/"/g);(_&&_.length%2===0&&!P||P.length%2!==0)&&(E=E.replace(/'/g,'"'));try{l=JSON.parse(E),b&&(l=js(js({},b),l))}catch(A){return this.logger.warn("failed parsing options string in nesting for key ".concat(y),A),"".concat(y).concat(x).concat(E)}return delete l.defaultValue,y}for(;a=this.nestingRegexp.exec(n);){var d=[];l=js({},o),l.applyPostProcessor=!1,delete l.defaultValue;var h=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var m=a[1].split(this.formatSeparator).map(function(y){return y.trim()});a[1]=m.shift(),d=m,h=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=nR(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),h&&(s=d.reduce(function(y,b){return i.format(y,b,o.lng,js(js({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cd(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(a){var s=a.split(":"),l=Lwe(s),u=l[0],d=l.slice(1),h=d.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=h),h==="false"&&(n[u.trim()]=!1),h==="true"&&(n[u.trim()]=!0),isNaN(h)||(n[u.trim()]=parseInt(h,10))}})}}return{formatName:t,formatOptions:n}}function Bg(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var Xwe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gu(this,e),this.logger=Kl.create("formatter"),this.options=t,this.formats={number:Bg(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:Bg(function(n,r){var i=new Intl.NumberFormat(n,cd(cd({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:Bg(function(n,r){var i=new Intl.DateTimeFormat(n,cd({},r));return function(o){return i.format(o)}}),relativetime:Bg(function(n,r){var i=new Intl.RelativeTimeFormat(n,cd({},r));return function(o){return i.format(o,r.range||"day")}}),list:Bg(function(n,r){var i=new Intl.ListFormat(n,cd({},r));return function(o){return i.format(o)}})},this.init(t)}return mu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Bg(r)}},{key:"format",value:function(n,r,i,o){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,d){var h=Kwe(d),m=h.formatName,y=h.formatOptions;if(a.formats[m]){var b=u;try{var x=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},k=x.locale||x.lng||o.locale||o.lng||i;b=a.formats[m](u,k,cd(cd(cd({},y),o),x))}catch(E){a.logger.warn(E)}return b}else a.logger.warn("there was no format function for ".concat(m));return u},n);return l}}]),e}();function hR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pR(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jwe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var e6e=function(e){zx(n,e);var t=Zwe(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return gu(this,n),a=t.call(this),Hx&&nf.call(Vd(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Kl.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return mu(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},d={},h={},m={};return i.forEach(function(y){var b=!0;o.forEach(function(x){var k="".concat(y,"|").concat(x);!a.reload&&l.store.hasResourceBundle(y,x)?l.state[k]=2:l.state[k]<0||(l.state[k]===1?d[k]===void 0&&(d[k]=!0):(l.state[k]=1,b=!1,d[k]===void 0&&(d[k]=!0),u[k]===void 0&&(u[k]=!0),m[x]===void 0&&(m[x]=!0)))}),b||(h[y]=!0)}),(Object.keys(u).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(d),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var d={};this.queue.forEach(function(h){Iwe(h.loaded,[l],u),Jwe(h,i),o&&h.errors.push(o),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(function(m){d[m]||(d[m]={});var y=h.loaded[m];y.length&&y.forEach(function(b){d[m][b]===void 0&&(d[m][b]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(h){return!h.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!i.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:d});return}this.readingCalls++;var h=function(x,k){if(s.readingCalls--,s.waitingReads.length>0){var E=s.waitingReads.shift();s.read(E.lng,E.ns,E.fcName,E.tried,E.wait,E.callback)}if(x&&k&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(d){a.loadOne(d)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(d,h){d&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),d),!d&&h&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),h),o.loaded(i,d,h)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var h=pR(pR({},u),{},{isUpdate:l}),m=this.backend.create.bind(this.backend);if(m.length<6)try{var y;m.length===5?y=m(i,o,a,s,h):y=m(i,o,a,s),y&&typeof y.then=="function"?y.then(function(b){return d(null,b)}).catch(d):d(null,y)}catch(b){d(b)}else m(i,o,a,s,d,h)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(nf);function gR(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Qs(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Qs(t[2])==="object"||Qs(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function mR(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function vR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rl(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ib(){}function r6e(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var eS=function(e){zx(n,e);var t=t6e(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(gu(this,n),r=t.call(this),Hx&&nf.call(Vd(r)),r.options=mR(i),r.services={},r.logger=Kl,r.modules={external:[]},r6e(Vd(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),Vy(r,Vd(r));setTimeout(function(){r.init(i,o)},0)}return r}return mu(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=gR();this.options=Rl(Rl(Rl({},s),this.options),mR(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Rl(Rl({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(E){return E?typeof E=="function"?new E:E:null}if(!this.options.isClone){this.modules.logger?Kl.init(l(this.modules.logger),this.options):Kl.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Xwe);var d=new uR(this.options);this.store=new Fwe(this.options.resources,this.options);var h=this.services;h.logger=Kl,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new qwe(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=l(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Ywe(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new e6e(l(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(E){for(var _=arguments.length,P=new Array(_>1?_-1:0),A=1;A<_;A++)P[A-1]=arguments[A];i.emit.apply(i,[E].concat(P))}),this.modules.languageDetector&&(h.languageDetector=l(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=l(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new lR(this.services,this.options),this.translator.on("*",function(E){for(var _=arguments.length,P=new Array(_>1?_-1:0),A=1;A<_;A++)P[A-1]=arguments[A];i.emit.apply(i,[E].concat(P))}),this.modules.external.forEach(function(E){E.init&&E.init(i)})}if(this.format=this.options.interpolation.format,a||(a=Ib),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var y=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];y.forEach(function(E){i[E]=function(){var _;return(_=i.store)[E].apply(_,arguments)}});var b=["addResource","addResources","addResourceBundle","removeResourceBundle"];b.forEach(function(E){i[E]=function(){var _;return(_=i.store)[E].apply(_,arguments),i}});var x=lv(),k=function(){var _=function(A,M){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),x.resolve(M),a(A,M)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return _(null,i.t.bind(i));i.changeLanguage(i.options.lng,_)};return this.options.resources||!this.options.initImmediate?k():setTimeout(k,0),x}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ib,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],d=function(y){if(y){var b=o.services.languageUtils.toResolveHierarchy(y);b.forEach(function(x){u.indexOf(x)<0&&u.push(x)})}};if(l)d(l);else{var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.forEach(function(m){return d(m)})}this.options.preload&&this.options.preload.forEach(function(m){return d(m)}),this.services.backendConnector.load(u,this.options.ns,function(m){!m&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=lv();return i||(i=this.languages),o||(o=this.options.ns),a||(a=Ib),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&BU.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=lv();this.emit("languageChanging",i);var l=function(m){a.language=m,a.languages=a.services.languageUtils.toResolveHierarchy(m),a.resolvedLanguage=void 0,a.setResolvedLanguage(m)},u=function(m,y){y?(l(y),a.translator.changeLanguage(y),a.isLanguageChangingTo=void 0,a.emit("languageChanged",y),a.logger.log("languageChanged",y)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(m,function(){return a.t.apply(a,arguments)})},d=function(m){!i&&!m&&a.services.languageDetector&&(m=[]);var y=typeof m=="string"?m:a.services.languageUtils.getBestMatchFromCodes(m);y&&(a.language||l(y),a.translator.language||a.translator.changeLanguage(y),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(y)),a.loadResources(y,function(b){u(b,y)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(d,h){var m;if(Qs(h)!=="object"){for(var y=arguments.length,b=new Array(y>2?y-2:0),x=2;x1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var d=function(y,b){var x=o.services.backendConnector.state["".concat(y,"|").concat(b)];return x===-1||x===2};if(a.precheck){var h=a.precheck(this,d);if(h!==void 0)return h}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,i)&&(!l||d(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=lv();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=lv();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new uR(gR());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ib,s=Rl(Rl(Rl({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(d){l[d]=i[d]}),l.services=Rl({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new lR(l.services,l.options),l.translator.on("*",function(d){for(var h=arguments.length,m=new Array(h>1?h-1:0),y=1;y0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new eS(e,t)});var Dt=eS.createInstance();Dt.createInstance=eS.createInstance;Dt.createInstance;Dt.dir;Dt.init;Dt.loadResources;Dt.reloadResources;Dt.use;Dt.changeLanguage;Dt.getFixedT;Dt.t;Dt.exists;Dt.setDefaultNamespace;Dt.hasLoadedNamespace;Dt.loadNamespaces;Dt.loadLanguages;function i6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oy(e){return oy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oy(e)}function o6e(e,t){if(oy(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(oy(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a6e(e){var t=o6e(e,"string");return oy(t)==="symbol"?t:String(t)}function yR(e,t){for(var n=0;n0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!bR.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!bR.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},SR={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=d6e(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},uv=null,xR=function(){if(uv!==null)return uv;try{uv=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{uv=!1}return uv},p6e={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&xR()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&xR()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},cv=null,wR=function(){if(cv!==null)return cv;try{cv=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{cv=!1}return cv},g6e={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&wR()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&wR()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},m6e={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},v6e={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},y6e={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},b6e={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function S6e(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var FU=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i6e(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return s6e(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=c6e(r,this.options||{},S6e()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(f6e),this.addDetector(h6e),this.addDetector(p6e),this.addDetector(g6e),this.addDetector(m6e),this.addDetector(v6e),this.addDetector(y6e),this.addDetector(b6e)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();FU.type="languageDetector";function b8(e){return b8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b8(e)}var zU=[],x6e=zU.forEach,w6e=zU.slice;function S8(e){return x6e.call(w6e.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function HU(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":b8(XMLHttpRequest))==="object"}function C6e(e){return!!e&&typeof e.then=="function"}function _6e(e){return C6e(e)?e:Promise.resolve(e)}function k6e(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ay={},E6e={get exports(){return ay},set exports(e){ay=e}},d2={},P6e={get exports(){return d2},set exports(e){d2=e}},CR;function T6e(){return CR||(CR=1,function(e,t){var n=typeof self<"u"?self:_o,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l($){return $&&DataView.prototype.isPrototypeOf($)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function($){return $&&u.indexOf(Object.prototype.toString.call($))>-1};function h($){if(typeof $!="string"&&($=String($)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test($))throw new TypeError("Invalid character in header field name");return $.toLowerCase()}function m($){return typeof $!="string"&&($=String($)),$}function y($){var W={next:function(){var X=$.shift();return{done:X===void 0,value:X}}};return s.iterable&&(W[Symbol.iterator]=function(){return W}),W}function b($){this.map={},$ instanceof b?$.forEach(function(W,X){this.append(X,W)},this):Array.isArray($)?$.forEach(function(W){this.append(W[0],W[1])},this):$&&Object.getOwnPropertyNames($).forEach(function(W){this.append(W,$[W])},this)}b.prototype.append=function($,W){$=h($),W=m(W);var X=this.map[$];this.map[$]=X?X+", "+W:W},b.prototype.delete=function($){delete this.map[h($)]},b.prototype.get=function($){return $=h($),this.has($)?this.map[$]:null},b.prototype.has=function($){return this.map.hasOwnProperty(h($))},b.prototype.set=function($,W){this.map[h($)]=m(W)},b.prototype.forEach=function($,W){for(var X in this.map)this.map.hasOwnProperty(X)&&$.call(W,this.map[X],X,this)},b.prototype.keys=function(){var $=[];return this.forEach(function(W,X){$.push(X)}),y($)},b.prototype.values=function(){var $=[];return this.forEach(function(W){$.push(W)}),y($)},b.prototype.entries=function(){var $=[];return this.forEach(function(W,X){$.push([X,W])}),y($)},s.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function x($){if($.bodyUsed)return Promise.reject(new TypeError("Already read"));$.bodyUsed=!0}function k($){return new Promise(function(W,X){$.onload=function(){W($.result)},$.onerror=function(){X($.error)}})}function E($){var W=new FileReader,X=k(W);return W.readAsArrayBuffer($),X}function _($){var W=new FileReader,X=k(W);return W.readAsText($),X}function P($){for(var W=new Uint8Array($),X=new Array(W.length),Z=0;Z-1?W:$}function j($,W){W=W||{};var X=W.body;if($ instanceof j){if($.bodyUsed)throw new TypeError("Already read");this.url=$.url,this.credentials=$.credentials,W.headers||(this.headers=new b($.headers)),this.method=$.method,this.mode=$.mode,this.signal=$.signal,!X&&$._bodyInit!=null&&(X=$._bodyInit,$.bodyUsed=!0)}else this.url=String($);if(this.credentials=W.credentials||this.credentials||"same-origin",(W.headers||!this.headers)&&(this.headers=new b(W.headers)),this.method=D(W.method||this.method||"GET"),this.mode=W.mode||this.mode||null,this.signal=W.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function z($){var W=new FormData;return $.trim().split("&").forEach(function(X){if(X){var Z=X.split("="),U=Z.shift().replace(/\+/g," "),Q=Z.join("=").replace(/\+/g," ");W.append(decodeURIComponent(U),decodeURIComponent(Q))}}),W}function H($){var W=new b,X=$.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(Z){var U=Z.split(":"),Q=U.shift().trim();if(Q){var re=U.join(":").trim();W.append(Q,re)}}),W}M.call(j.prototype);function K($,W){W||(W={}),this.type="default",this.status=W.status===void 0?200:W.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in W?W.statusText:"OK",this.headers=new b(W.headers),this.url=W.url||"",this._initBody($)}M.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},K.error=function(){var $=new K(null,{status:0,statusText:""});return $.type="error",$};var te=[301,302,303,307,308];K.redirect=function($,W){if(te.indexOf(W)===-1)throw new RangeError("Invalid status code");return new K(null,{status:W,headers:{location:$}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(W,X){this.message=W,this.name=X;var Z=Error(W);this.stack=Z.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function G($,W){return new Promise(function(X,Z){var U=new j($,W);if(U.signal&&U.signal.aborted)return Z(new a.DOMException("Aborted","AbortError"));var Q=new XMLHttpRequest;function re(){Q.abort()}Q.onload=function(){var he={status:Q.status,statusText:Q.statusText,headers:H(Q.getAllResponseHeaders()||"")};he.url="responseURL"in Q?Q.responseURL:he.headers.get("X-Request-URL");var Ee="response"in Q?Q.response:Q.responseText;X(new K(Ee,he))},Q.onerror=function(){Z(new TypeError("Network request failed"))},Q.ontimeout=function(){Z(new TypeError("Network request failed"))},Q.onabort=function(){Z(new a.DOMException("Aborted","AbortError"))},Q.open(U.method,U.url,!0),U.credentials==="include"?Q.withCredentials=!0:U.credentials==="omit"&&(Q.withCredentials=!1),"responseType"in Q&&s.blob&&(Q.responseType="blob"),U.headers.forEach(function(he,Ee){Q.setRequestHeader(Ee,he)}),U.signal&&(U.signal.addEventListener("abort",re),Q.onreadystatechange=function(){Q.readyState===4&&U.signal.removeEventListener("abort",re)}),Q.send(typeof U._bodyInit>"u"?null:U._bodyInit)})}return G.polyfill=!0,o.fetch||(o.fetch=G,o.Headers=b,o.Request=j,o.Response=K),a.Headers=b,a.Request=j,a.Response=K,a.fetch=G,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(P6e,d2)),d2}(function(e,t){var n;if(typeof fetch=="function"&&(typeof _o<"u"&&_o.fetch?n=_o.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof k6e<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||T6e();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(E6e,ay);const VU=ay,_R=dj({__proto__:null,default:VU},[ay]);function tS(e){return tS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tS(e)}var Xu;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Xu=global.fetch:typeof window<"u"&&window.fetch?Xu=window.fetch:Xu=fetch);var sy;HU()&&(typeof global<"u"&&global.XMLHttpRequest?sy=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(sy=window.XMLHttpRequest));var nS;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?nS=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(nS=window.ActiveXObject));!Xu&&_R&&!sy&&!nS&&(Xu=VU||_R);typeof Xu!="function"&&(Xu=void 0);var x8=function(t,n){if(n&&tS(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},kR=function(t,n,r){Xu(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},ER=!1,L6e=function(t,n,r,i){t.queryStringParams&&(n=x8(n,t.queryStringParams));var o=S8({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=S8({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},ER?{}:a);try{kR(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),kR(n,s,i),ER=!0}catch(u){i(u)}}},A6e=function(t,n,r,i){r&&tS(r)==="object"&&(r=x8("",r).slice(1)),t.queryStringParams&&(n=x8(n,t.queryStringParams));try{var o;sy?o=new sy:o=new nS("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},O6e=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Xu&&n.indexOf("file:")!==0)return L6e(t,n,r,i);if(HU()||typeof ActiveXObject=="function")return A6e(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function ly(e){return ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ly(e)}function M6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PR(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};M6e(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return I6e(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=S8(i,this.options||{},N6e()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=_6e(l),l.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(d,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,d;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch{d="failed parsing "+n+" to json"}if(d)return r(d,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,d=[],h=[];n.forEach(function(m){var y=s.options.addPath;typeof s.options.addPath=="function"&&(y=s.options.addPath(m,r));var b=s.services.interpolator.interpolate(y,{lng:m,ns:r});s.options.request(s.options,b,l,function(x,k){u+=1,d.push(x),h.push(k),u===n.length&&a&&a(d,h)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(h){var m=o.toResolveHierarchy(h);m.forEach(function(y){l.indexOf(y)<0&&l.push(y)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),l.forEach(function(d){n.allOptions.ns.forEach(function(h){i.read(d,h,"read",null,null,function(m,y){m&&a.warn("loading namespace ".concat(h," for language ").concat(d," failed"),m),!m&&y&&a.log("loaded namespace ".concat(h," for language ").concat(d),y),i.loaded("".concat(d,"|").concat(h),m,y)})})})}}}]),e}();UU.type="backend";function uy(e){return uy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uy(e)}function j6e(e,t){if(uy(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(uy(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GU(e){var t=j6e(e,"string");return uy(t)==="symbol"?t:String(t)}function qU(e,t,n){return t=GU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B6e(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var d=t.services.backendConnector.state["".concat(l,"|").concat(u)];return d===-1||d===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function F6e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return w8("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):$6e(e,t,n)}var z6e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,H6e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},V6e=function(t){return H6e[t]},W6e=function(t){return t.replace(z6e,V6e)};function AR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OR(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};C8=OR(OR({},C8),e)}function G6e(){return C8}var YU;function q6e(e){YU=e}function Y6e(){return YU}function K6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=w.useContext(Q6e)||{},i=r.i18n,o=r.defaultNS,a=n||i||Y6e();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new J6e),!a){w8("You will need to pass in an i18next instance by using initReactI18next");var s=function(z){return Array.isArray(z)?z[z.length-1]:z},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&w8("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=TC(TC(TC({},G6e()),a.options.react),t),d=u.useSuspense,h=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var y=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(j){return F6e(j,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],h)}var x=w.useState(b),k=iCe(x,2),E=k[0],_=k[1],P=m.join(),A=oCe(P),M=w.useRef(!0);w.useEffect(function(){var j=u.bindI18n,z=u.bindI18nStore;M.current=!0,!y&&!d&&LR(a,m,function(){M.current&&_(b)}),y&&A&&A!==P&&M.current&&_(b);function H(){M.current&&_(b)}return j&&a&&a.on(j,H),z&&a&&a.store.on(z,H),function(){M.current=!1,j&&a&&j.split(" ").forEach(function(K){return a.off(K,H)}),z&&a&&z.split(" ").forEach(function(K){return a.store.off(K,H)})}},[a,P]);var R=w.useRef(!0);w.useEffect(function(){M.current&&!R.current&&_(b),R.current=!1},[a,h]);var D=[E,a,y];if(D.t=E,D.i18n=a,D.ready=y,y||!y&&!d)return D;throw new Promise(function(j){LR(a,m,function(){j()})})}Dt.use(UU).use(FU).use(Z6e).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","parameters","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const aCe={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:Dt.isInitialized?Dt.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},KU=gp({name:"system",initialState:aCe,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Dt.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?Dt.t("common:statusConnected"):Dt.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Dt.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Dt.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=Dt.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},modelConvertRequested:e=>{e.currentStatus=Dt.t("common:statusConvertingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:sCe,setIsProcessing:ts,addLogEntry:Wi,setShouldShowLogViewer:LC,setIsConnected:DR,setSocketId:Ize,setShouldConfirmOnDelete:XU,setOpenAccordions:lCe,setSystemStatus:uCe,setCurrentStatus:Wg,setSystemConfig:cCe,setShouldDisplayGuides:dCe,processingCanceled:fCe,errorOccurred:NR,errorSeen:ZU,setModelList:dv,setIsCancelable:Mh,modelChangeRequested:hCe,modelConvertRequested:pCe,setSaveIntermediatesInterval:gCe,setEnableImageDebugging:mCe,generationRequested:vCe,addToast:Ad,clearToastQueue:yCe,setProcessingIndeterminateTask:bCe,setSearchFolder:QU,setFoundModels:JU,setOpenModel:jR}=KU.actions,SCe=KU.reducer,vP=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],xCe={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,addNewModelUIOption:null},wCe=xCe,eG=gp({name:"ui",initialState:wCe,reducers:{setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=vP.indexOf(t.payload)},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setParametersPanelScrollPosition:(e,t)=>{e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:(e,t)=>{e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:(e,t)=>{e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setAddNewModelUIOption:(e,t)=>{e.addNewModelUIOption=t.payload}}}),{setActiveTab:Yo,setCurrentTheme:CCe,setParametersPanelScrollPosition:_Ce,setShouldHoldParametersPanelOpen:kCe,setShouldPinParametersPanel:ECe,setShouldShowParametersPanel:Zu,setShouldShowDualDisplay:PCe,setShouldShowImageDetails:tG,setShouldUseCanvasBetaLayout:TCe,setShouldShowExistingModelsInSearch:LCe,setAddNewModelUIOption:Uh}=eG.actions,ACe=eG.reducer,cu=Object.create(null);cu.open="0";cu.close="1";cu.ping="2";cu.pong="3";cu.message="4";cu.upgrade="5";cu.noop="6";const $4=Object.create(null);Object.keys(cu).forEach(e=>{$4[cu[e]]=e});const OCe={type:"error",data:"parser error"},MCe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ICe=typeof ArrayBuffer=="function",RCe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,nG=({type:e,data:t},n,r)=>MCe&&t instanceof Blob?n?r(t):BR(t,r):ICe&&(t instanceof ArrayBuffer||RCe(t))?n?r(t):BR(new Blob([t]),r):r(cu[e]+(t||"")),BR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},$R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Iv=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<$R.length;e++)Iv[$R.charCodeAt(e)]=e;const DCe=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(a&15)<<4|s>>2,d[i++]=(s&3)<<6|l&63;return u},NCe=typeof ArrayBuffer=="function",rG=(e,t)=>{if(typeof e!="string")return{type:"message",data:iG(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:jCe(e.substring(1),t)}:$4[n]?e.length>1?{type:$4[n],data:e.substring(1)}:{type:$4[n]}:OCe},jCe=(e,t)=>{if(NCe){const n=DCe(e);return iG(n,t)}else return{base64:!0,data:e}},iG=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},oG=String.fromCharCode(30),BCe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{nG(o,!1,s=>{r[a]=s,++i===n&&t(r.join(oG))})})},$Ce=(e,t)=>{const n=e.split(oG),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function sG(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const zCe=setTimeout,HCe=clearTimeout;function Vx(e,t){t.useNativeTimers?(e.setTimeoutFn=zCe.bind(Od),e.clearTimeoutFn=HCe.bind(Od)):(e.setTimeoutFn=setTimeout.bind(Od),e.clearTimeoutFn=clearTimeout.bind(Od))}const VCe=1.33;function WCe(e){return typeof e=="string"?UCe(e):Math.ceil((e.byteLength||e.size)*VCe)}function UCe(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class GCe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class lG extends si{constructor(t){super(),this.writable=!1,Vx(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new GCe(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=rG(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const uG="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),_8=64,qCe={};let FR=0,Rb=0,zR;function HR(e){let t="";do t=uG[e%_8]+t,e=Math.floor(e/_8);while(e>0);return t}function cG(){const e=HR(+new Date);return e!==zR?(FR=0,zR=e):e+"."+HR(FR++)}for(;Rb<_8;Rb++)qCe[uG[Rb]]=Rb;function dG(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function YCe(e){let t={},n=e.split("&");for(let r=0,i=n.length;r{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};$Ce(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,BCe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=cG()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=dG(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new iu(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class iu extends si{constructor(t,n){super(),Vx(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=sG(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new hG(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=iu.requestsCount++,iu.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=XCe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete iu.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}iu.requestsCount=0;iu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",VR);else if(typeof addEventListener=="function"){const e="onpagehide"in Od?"pagehide":"unload";addEventListener(e,VR,!1)}}function VR(){for(let e in iu.requests)iu.requests.hasOwnProperty(e)&&iu.requests[e].abort()}const pG=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Db=Od.WebSocket||Od.MozWebSocket,WR=!0,JCe="arraybuffer",UR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class e7e extends lG{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=UR?{}:sG(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=WR&&!UR?n?new Db(t,n):new Db(t):new Db(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||JCe,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{WR&&this.ws.send(o)}catch{}i&&pG(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=cG()),this.supportsBinary||(t.b64=1);const i=dG(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Db}}const t7e={websocket:e7e,polling:QCe},n7e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r7e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function k8(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=n7e.exec(e||""),o={},a=14;for(;a--;)o[r7e[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=i7e(o,o.path),o.queryKey=o7e(o,o.query),o}function i7e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function o7e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let gG=class Ug extends si{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=k8(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=k8(n.host).host),Vx(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=YCe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=aG,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new t7e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Ug.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Ug.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ug.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=h=>{const m=new Error("probe error: "+h);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(h){n&&h.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Ug.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Ug.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,mG=Object.prototype.toString,u7e=typeof Blob=="function"||typeof Blob<"u"&&mG.call(Blob)==="[object BlobConstructor]",c7e=typeof File=="function"||typeof File<"u"&&mG.call(File)==="[object FileConstructor]";function yP(e){return s7e&&(e instanceof ArrayBuffer||l7e(e))||u7e&&e instanceof Blob||c7e&&e instanceof File}function F4(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case dn.ACK:case dn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class g7e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=f7e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const m7e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:bP,Encoder:p7e,get PacketType(){return dn},protocol:h7e},Symbol.toStringTag,{value:"Module"}));function zs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const v7e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class vG extends si{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[zs(t,"open",this.onopen.bind(this)),zs(t,"packet",this.onpacket.bind(this)),zs(t,"error",this.onerror.bind(this)),zs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(v7e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:dn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:dn.CONNECT,data:t})}):this.packet({type:dn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case dn.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case dn.EVENT:case dn.BINARY_EVENT:this.onevent(t);break;case dn.ACK:case dn.BINARY_ACK:this.onack(t);break;case dn.DISCONNECT:this.ondisconnect();break;case dn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:dn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:dn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}A0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};A0.prototype.reset=function(){this.attempts=0};A0.prototype.setMin=function(e){this.ms=e};A0.prototype.setMax=function(e){this.max=e};A0.prototype.setJitter=function(e){this.jitter=e};class T8 extends si{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Vx(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new A0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||m7e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new gG(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=zs(n,"open",function(){r.onopen(),t&&t()}),o=zs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(zs(t,"ping",this.onping.bind(this)),zs(t,"data",this.ondata.bind(this)),zs(t,"error",this.onerror.bind(this)),zs(t,"close",this.onclose.bind(this)),zs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){pG(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new vG(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const fv={};function z4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=a7e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=fv[i]&&o in fv[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new T8(r,t):(fv[i]||(fv[i]=new T8(r,t)),l=fv[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(z4,{Manager:T8,Socket:vG,io:z4,connect:z4});const y7e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],b7e=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],S7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],x7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],w7e=[{key:"2x",value:2},{key:"4x",value:4}],SP=0,xP=4294967295,C7e=["gfpgan","codeformer"],_7e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var k7e=Math.PI/180;function E7e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Wm=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},gt={_global:Wm,version:"8.3.14",isBrowser:E7e(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return gt.angleDeg?e*k7e:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return gt.DD.isDragging},isDragReady(){return!!gt.DD.node},releaseCanvasOnDestroy:!0,document:Wm.document,_injectGlobal(e){Wm.Konva=e}},Or=e=>{gt[e.prototype.getClassName()]=e};gt._injectGlobal(gt);class Ea{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new Ea(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var d=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/d):-Math.acos(r/d)),l.scaleX=s/d,l.scaleY=d,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=fe._getRotation(l.rotation),l}}var P7e="[object Array]",T7e="[object Number]",L7e="[object String]",A7e="[object Boolean]",O7e=Math.PI/180,M7e=180/Math.PI,AC="#",I7e="",R7e="0",D7e="Konva warning: ",GR="Konva error: ",N7e="rgb(",OC={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},j7e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Nb=[];const B7e=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},fe={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===P7e},_isNumber(e){return Object.prototype.toString.call(e)===T7e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===L7e},_isBoolean(e){return Object.prototype.toString.call(e)===A7e},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){Nb.push(e),Nb.length===1&&B7e(function(){const t=Nb;Nb=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=fe.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(AC,I7e);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=R7e+e;return AC+e},getRGB(e){var t;return e in OC?(t=OC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===AC?this._hexToRgb(e.substring(1)):e.substr(0,4)===N7e?(t=j7e.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",fe._namedColorToRBA(e)||fe._hex3ColorToRGBA(e)||fe._hex6ColorToRGBA(e)||fe._rgbColorToRGBA(e)||fe._rgbaColorToRGBA(e)||fe._hslColorToRGBA(e)},_namedColorToRBA(e){var t=OC[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,d=[0,0,0];for(let h=0;h<3;h++)s=r+1/3*-(h-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,d[h]=l*255;return{r:Math.round(d[0]),g:Math.round(d[1]),b:Math.round(d[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+d*(n-e),s=t+d*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=fe.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=fe._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],d=l[1],h=l[2];ht.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function gf(e){return fe._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||fe._isBoolean(e)?e:Object.prototype.toString.call(e)}function yG(e){return e>255?255:e<0?0:Math.round(e)}function Ye(){if(gt.isUnminified)return function(e,t){return fe._isNumber(e)||fe.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function bG(e){if(gt.isUnminified)return function(t,n){let r=fe._isNumber(t),i=fe._isArray(t)&&t.length==e;return!r&&!i&&fe.warn(gf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function wP(){if(gt.isUnminified)return function(e,t){var n=fe._isNumber(e),r=e==="auto";return n||r||fe.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function O0(){if(gt.isUnminified)return function(e,t){return fe._isString(e)||fe.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function SG(){if(gt.isUnminified)return function(e,t){const n=fe._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||fe.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function $7e(){if(gt.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(fe._isArray(e)?e.forEach(function(r){fe._isNumber(r)||fe.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):fe.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function il(){if(gt.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||fe.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function F7e(e){if(gt.isUnminified)return function(t,n){return t==null||fe.isObject(t)||fe.warn(gf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var hv="get",pv="set";const ee={addGetterSetter(e,t,n,r,i){ee.addGetter(e,t,n),ee.addSetter(e,t,r,i),ee.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=hv+fe._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=pv+fe._capitalize(t);e.prototype[i]||ee.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=pv+fe._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=fe._capitalize,s=hv+a(t),l=pv+a(t),u,d;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(x),void 0)}),this._fireChangeEvent(t,y,m),i&&i.call(this),this},ee.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=fe._capitalize(t),r=pv+n,i=hv+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){fe.error("Adding deprecated "+t);var i=hv+fe._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){fe.error(o);var a=this.attrs[t];return a===void 0?n:a},ee.addSetter(e,t,r,function(){fe.error(o)}),ee.addOverloadedGetterSetter(e,t)},backCompat(e,t){fe.each(t,function(n,r){var i=e.prototype[r],o=hv+fe._capitalize(n),a=pv+fe._capitalize(n);function s(){i.apply(this,arguments),fe.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function z7e(e){var t=[],n=e.length,r=fe,i,o;for(i=0;itypeof d=="number"?Math.floor(d):d)),o+=H7e+u.join(qR)+V7e)):(o+=s.property,t||(o+=Y7e+s.val)),o+=G7e;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=X7e&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var d=arguments,h=this._context;d.length===3?h.drawImage(t,n,r):d.length===5?h.drawImage(t,n,r,i,o):d.length===9&&h.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){return this._context.isPointInPath(t,n)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=YR.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=z7e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return vn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];vn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=fe._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];vn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(vn.justDragged=!0,gt._mouseListenClick=!1,gt._touchListenClick=!1,gt._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof gt.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){vn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&vn._dragElements.delete(n)})}};gt.isBrowser&&(window.addEventListener("mouseup",vn._endDragBefore,!0),window.addEventListener("touchend",vn._endDragBefore,!0),window.addEventListener("mousemove",vn._drag),window.addEventListener("touchmove",vn._drag),window.addEventListener("mouseup",vn._endDragAfter,!1),window.addEventListener("touchend",vn._endDragAfter,!1));var H4="absoluteOpacity",Bb="allEventListeners",Hu="absoluteTransform",KR="absoluteScale",ch="canvas",e9e="Change",t9e="children",n9e="konva",L8="listening",XR="mouseenter",ZR="mouseleave",QR="set",JR="Shape",V4=" ",eD="stage",pd="transform",r9e="Stage",A8="visible",i9e=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(V4);let o9e=1,Qe=class O8{constructor(t){this._id=o9e++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===pd||t===Hu)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===pd||t===Hu,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(V4);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(ch)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Hu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ch)){const{scene:t,filter:n,hit:r}=this._cache.get(ch);fe.releaseCanvas(t,n,r),this._cache.delete(ch)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,h=n.hitCanvasPixelRatio||1;if(!i||!o){fe.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new Um({pixelRatio:a,width:i,height:o}),y=new Um({pixelRatio:a,width:0,height:0}),b=new CP({pixelRatio:h,width:i,height:o}),x=m.getContext(),k=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(ch),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),x.save(),k.save(),x.translate(-s,-l),k.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(H4),this._clearSelfAndDescendantCache(KR),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,x.restore(),k.restore(),d&&(x.save(),x.beginPath(),x.rect(0,0,i,o),x.closePath(),x.setAttr("strokeStyle","red"),x.setAttr("lineWidth",5),x.stroke(),x.restore()),this._cache.set(ch,{scene:m,filter:y,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(ch)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=l.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==t9e&&(r=QR+fe._capitalize(n),fe._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(L8,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(A8,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;vn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!gt.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==r9e&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(pd),this._clearSelfAndDescendantCache(Hu)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new Ea,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(pd);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(pd),this._clearSelfAndDescendantCache(Hu),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return fe.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return fe.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&fe.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(H4,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=fe.isObject(i)&&!fe._isPlainObject(i)&&!fe._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),fe._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,fe._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():gt.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(r&&!this.isDragging()){var i=!1;vn._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=vn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&vn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return fe.haveIntersection(r,this.getClientRect())}static create(t,n){return fe._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=O8.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),gt[r]||(fe.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=gt[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(arguments.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Qe.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Qe.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const d=r===this;if(u){o.save();var h=this.getAbsoluteTransform(r),m=h.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var y=this.clipX(),b=this.clipY();o.rect(y,b,a,s)}o.clip(),m=h.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var x=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";x&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(k){k[t](n,r)}),x&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(x){if(x.visible()){var k=x.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});k.width===0&&k.height===0||(o===void 0?(o=k.x,a=k.y,s=k.x+k.width,l=k.y+k.height):(o=Math.min(o,k.x),a=Math.min(a,k.y),s=Math.max(s,k.x+k.width),l=Math.max(l,k.y+k.height)))}});for(var h=this.find("Shape"),m=!1,y=0;ye.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",$g=e=>{const t=jv(e);if(t==="pointer")return gt.pointerEventsEnabled&&IC.pointer;if(t==="touch")return IC.touch;if(t==="mouse")return IC.mouse};function nD(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&fe.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const f9e="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",W4=[];let Gx=class extends Oa{constructor(t){super(nD(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),W4.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{nD(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||fe.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===s9e){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t=this.children,n=t.length,r;for(r=0;r-1&&W4.splice(n,1),fe.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(fe.warn(f9e),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t=t||{},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var n=new Um({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+tD,this.content.style.height=n+tD),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;rc9e&&fe.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),gt.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return wG(t,this)}setPointerCapture(t){CG(t,this)}releaseCapture(t){f2(t)}getLayers(){return this.children}_bindContentEvents(){gt.isBrowser&&d9e.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=$g(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=$g(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=$g(t.type),r=jv(t.type);if(n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!vn.isDragging||gt.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=$g(t.type),r=jv(t.type);if(n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(vn.justDragged=!1,gt["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;gt.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=$g(t.type),r=jv(t.type);if(!n)return;vn.isDragging&&vn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!vn.isDragging||gt.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=MC(l.id)||this.getIntersection(l),d=l.id,h={evt:t,pointerId:d};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},h),u),s._fireAndBubble(n.pointerleave,Object.assign({},h),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},h),s),u._fireAndBubble(n.pointerenter,Object.assign({},h),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},h))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=$g(t.type),r=jv(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=MC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const d=l.id,h={evt:t,pointerId:d};let m=!1;gt["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):vn.justDragged||(gt["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){gt["_"+r+"InDblClickWindow"]=!1},gt.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},h)),gt["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},h)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},h)))):(this[r+"ClickEndShape"]=null,gt["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:d}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:d}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),gt["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(M8,{evt:t}):this._fire(M8,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(I8,{evt:t}):this._fire(I8,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=MC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(pm,_P(t)),f2(t.pointerId)}_lostpointercapture(t){f2(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:fe._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:fe._getFirstPointerId(t)}])}_setPointerPosition(t){fe.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Um({width:this.width(),height:this.height()}),this.bufferHitCanvas=new CP({pixelRatio:1,width:this.width(),height:this.height()}),!!gt.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return fe.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};Gx.prototype.nodeType=a9e;Or(Gx);ee.addGetterSetter(Gx,"container");var RG="hasShadow",DG="shadowRGBA",NG="patternImage",jG="linearGradient",BG="radialGradient";let Vb;function RC(){return Vb||(Vb=fe.createCanvasElement().getContext("2d"),Vb)}const h2={};function h9e(e){e.fill()}function p9e(e){e.stroke()}function g9e(e){e.fill()}function m9e(e){e.stroke()}function v9e(){this._clearCache(RG)}function y9e(){this._clearCache(DG)}function b9e(){this._clearCache(NG)}function S9e(){this._clearCache(jG)}function x9e(){this._clearCache(BG)}class Fe extends Qe{constructor(t){super(t);let n;for(;n=fe.getRandomColor(),!(n&&!(n in h2)););this.colorKey=n,h2[n]=this}getContext(){return fe.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return fe.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(RG,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(NG,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=RC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Ea;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(gt.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(jG,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=RC(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return Qe.prototype.destroy.call(this),delete h2[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){fe.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),d=u?this.shadowOffsetX():0,h=u?this.shadowOffsetY():0,m=s+Math.abs(d),y=l+Math.abs(h),b=u&&this.shadowBlur()||0,x=m+b*2,k=y+b*2,E={width:x,height:k,x:-(a/2+b)+Math.min(d,0)+i.x,y:-(a/2+b)+Math.min(h,0)+i.y};return n?E:this._transformedRect(E,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,d,h,m=i.isCache,y=n===this;if(!this.isVisible()&&!y)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),d=u.bufferCanvas,h=d.getContext(),h.clear(),h.save(),h._applyLineJoin(this);var x=this.getAbsoluteTransform(n).getMatrix();h.transform(x[0],x[1],x[2],x[3],x[4],x[5]),s.call(this,h,this),h.restore();var k=d.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(d._canvas,0,0,d.width/k,d.height/k)}else{if(o._applyLineJoin(this),!y){var x=this.getAbsoluteTransform(n).getMatrix();o.transform(x[0],x[1],x[2],x[3],x[4],x[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||fe.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){a.save();var d=this.getAbsoluteTransform(n).getMatrix();return a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,d,h,m,y;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,d=u.length,h=fe._hexToRgb(this.colorKey),m=0;mt?(u[m]=h.r,u[m+1]=h.g,u[m+2]=h.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){fe.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return wG(t,this)}setPointerCapture(t){CG(t,this)}releaseCapture(t){f2(t)}}Fe.prototype._fillFunc=h9e;Fe.prototype._strokeFunc=p9e;Fe.prototype._fillFuncHit=g9e;Fe.prototype._strokeFuncHit=m9e;Fe.prototype._centroid=!1;Fe.prototype.nodeType="Shape";Or(Fe);Fe.prototype.eventListeners={};Fe.prototype.on.call(Fe.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v9e);Fe.prototype.on.call(Fe.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",y9e);Fe.prototype.on.call(Fe.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",b9e);Fe.prototype.on.call(Fe.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",S9e);Fe.prototype.on.call(Fe.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",x9e);ee.addGetterSetter(Fe,"stroke",void 0,SG());ee.addGetterSetter(Fe,"strokeWidth",2,Ye());ee.addGetterSetter(Fe,"fillAfterStrokeEnabled",!1);ee.addGetterSetter(Fe,"hitStrokeWidth","auto",wP());ee.addGetterSetter(Fe,"strokeHitEnabled",!0,il());ee.addGetterSetter(Fe,"perfectDrawEnabled",!0,il());ee.addGetterSetter(Fe,"shadowForStrokeEnabled",!0,il());ee.addGetterSetter(Fe,"lineJoin");ee.addGetterSetter(Fe,"lineCap");ee.addGetterSetter(Fe,"sceneFunc");ee.addGetterSetter(Fe,"hitFunc");ee.addGetterSetter(Fe,"dash");ee.addGetterSetter(Fe,"dashOffset",0,Ye());ee.addGetterSetter(Fe,"shadowColor",void 0,O0());ee.addGetterSetter(Fe,"shadowBlur",0,Ye());ee.addGetterSetter(Fe,"shadowOpacity",1,Ye());ee.addComponentsGetterSetter(Fe,"shadowOffset",["x","y"]);ee.addGetterSetter(Fe,"shadowOffsetX",0,Ye());ee.addGetterSetter(Fe,"shadowOffsetY",0,Ye());ee.addGetterSetter(Fe,"fillPatternImage");ee.addGetterSetter(Fe,"fill",void 0,SG());ee.addGetterSetter(Fe,"fillPatternX",0,Ye());ee.addGetterSetter(Fe,"fillPatternY",0,Ye());ee.addGetterSetter(Fe,"fillLinearGradientColorStops");ee.addGetterSetter(Fe,"strokeLinearGradientColorStops");ee.addGetterSetter(Fe,"fillRadialGradientStartRadius",0);ee.addGetterSetter(Fe,"fillRadialGradientEndRadius",0);ee.addGetterSetter(Fe,"fillRadialGradientColorStops");ee.addGetterSetter(Fe,"fillPatternRepeat","repeat");ee.addGetterSetter(Fe,"fillEnabled",!0);ee.addGetterSetter(Fe,"strokeEnabled",!0);ee.addGetterSetter(Fe,"shadowEnabled",!0);ee.addGetterSetter(Fe,"dashEnabled",!0);ee.addGetterSetter(Fe,"strokeScaleEnabled",!0);ee.addGetterSetter(Fe,"fillPriority","color");ee.addComponentsGetterSetter(Fe,"fillPatternOffset",["x","y"]);ee.addGetterSetter(Fe,"fillPatternOffsetX",0,Ye());ee.addGetterSetter(Fe,"fillPatternOffsetY",0,Ye());ee.addComponentsGetterSetter(Fe,"fillPatternScale",["x","y"]);ee.addGetterSetter(Fe,"fillPatternScaleX",1,Ye());ee.addGetterSetter(Fe,"fillPatternScaleY",1,Ye());ee.addComponentsGetterSetter(Fe,"fillLinearGradientStartPoint",["x","y"]);ee.addComponentsGetterSetter(Fe,"strokeLinearGradientStartPoint",["x","y"]);ee.addGetterSetter(Fe,"fillLinearGradientStartPointX",0);ee.addGetterSetter(Fe,"strokeLinearGradientStartPointX",0);ee.addGetterSetter(Fe,"fillLinearGradientStartPointY",0);ee.addGetterSetter(Fe,"strokeLinearGradientStartPointY",0);ee.addComponentsGetterSetter(Fe,"fillLinearGradientEndPoint",["x","y"]);ee.addComponentsGetterSetter(Fe,"strokeLinearGradientEndPoint",["x","y"]);ee.addGetterSetter(Fe,"fillLinearGradientEndPointX",0);ee.addGetterSetter(Fe,"strokeLinearGradientEndPointX",0);ee.addGetterSetter(Fe,"fillLinearGradientEndPointY",0);ee.addGetterSetter(Fe,"strokeLinearGradientEndPointY",0);ee.addComponentsGetterSetter(Fe,"fillRadialGradientStartPoint",["x","y"]);ee.addGetterSetter(Fe,"fillRadialGradientStartPointX",0);ee.addGetterSetter(Fe,"fillRadialGradientStartPointY",0);ee.addComponentsGetterSetter(Fe,"fillRadialGradientEndPoint",["x","y"]);ee.addGetterSetter(Fe,"fillRadialGradientEndPointX",0);ee.addGetterSetter(Fe,"fillRadialGradientEndPointY",0);ee.addGetterSetter(Fe,"fillPatternRotation",0);ee.backCompat(Fe,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var w9e="#",C9e="beforeDraw",_9e="draw",$G=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],k9e=$G.length;let mp=class extends Oa{constructor(t){super(t),this.canvas=new Um,this.hitCanvas=new CP({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(C9e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Oa.prototype.drawScene.call(this,i,n),this._fire(_9e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Oa.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){fe.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return fe.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return fe.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};mp.prototype.nodeType="Layer";Or(mp);ee.addGetterSetter(mp,"imageSmoothingEnabled",!0);ee.addGetterSetter(mp,"clearBeforeDraw",!0);ee.addGetterSetter(mp,"hitGraphEnabled",!0,il());class kP extends mp{constructor(t){super(t),this.listening(!1),fe.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}kP.prototype.nodeType="FastLayer";Or(kP);let u0=class extends Oa{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&fe.throw("You may only add groups and shapes to groups.")}};u0.prototype.nodeType="Group";Or(u0);var DC=function(){return Wm.performance&&Wm.performance.now?function(){return Wm.performance.now()}:function(){return new Date().getTime()}}();class rs{constructor(t,n){this.id=rs.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:DC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=rD,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=iD,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;this.state===rD?this.setTime(t):this.state===iD&&this.setTime(this.duration-t)}pause(){this.state=P9e,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Xr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||p2.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=T9e++;var u=r.getLayer()||(r instanceof gt.Stage?r.getLayers():null);u||fe.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new rs(function(){n.tween.onEnterFrame()},u),this.tween=new L9e(l,function(d){n._tweenFunc(d)},a,0,1,o*1e3,s),this._addListeners(),Xr.attrs[i]||(Xr.attrs[i]={}),Xr.attrs[i][this._id]||(Xr.attrs[i][this._id]={}),Xr.tweens[i]||(Xr.tweens[i]={});for(l in t)E9e[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,d,h,m;if(s=Xr.tweens[i][t],s&&delete Xr.attrs[i][s][t],o=r.getAttr(t),fe._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(h=o,o=fe._prepareArrayForTween(o,n,r.closed())):(d=n,n=fe._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t=this.node._id,n=this._id,r=Xr.tweens[t],i;this.pause();for(i in r)delete Xr.tweens[t][i];delete Xr.attrs[t][n]}}Xr.attrs={};Xr.tweens={};Qe.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Xr(e);n.play()};const p2={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),d=a*n,h=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:h,width:d-u,height:m-h}}}fc.prototype._centroid=!0;fc.prototype.className="Arc";fc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Or(fc);ee.addGetterSetter(fc,"innerRadius",0,Ye());ee.addGetterSetter(fc,"outerRadius",0,Ye());ee.addGetterSetter(fc,"angle",0,Ye());ee.addGetterSetter(fc,"clockwise",!1,il());function R8(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),d=a*l/(s+l),h=n-u*(i-e),m=r-u*(o-t),y=n+d*(i-e),b=r+d*(o-t);return[h,m,y,b]}function aD(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);ud?u:d,k=u>d?1:u/d,E=u>d?d/u:1;t.translate(s,l),t.rotate(y),t.scale(k,E),t.arc(0,0,x,h,h+m,1-b),t.scale(1/k,1/E),t.rotate(-y),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],h=u.points[5],m=u.points[4]+h,y=Math.PI/180;if(Math.abs(d-m)m;b-=y){const x=zn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(x.x,x.y)}else for(let b=d+y;bthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return zn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return zn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return zn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],d=a[3],h=a[4],m=a[5],y=a[6];return h+=m*t/o.pathLength,zn.getPointOnEllipticalArc(s,l,u,d,h,y)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var _=null,P=[],A=l,M=u,R,D,j,z,H,K,te,G,$,W;switch(y){case"l":l+=b.shift(),u+=b.shift(),_="L",P.push(l,u);break;case"L":l=b.shift(),u=b.shift(),P.push(l,u);break;case"m":var X=b.shift(),Z=b.shift();if(l+=X,u+=Z,_="M",a.length>2&&a[a.length-1].command==="z"){for(var U=a.length-2;U>=0;U--)if(a[U].command==="M"){l=a[U].points[0]+X,u=a[U].points[1]+Z;break}}P.push(l,u),y="l";break;case"M":l=b.shift(),u=b.shift(),_="M",P.push(l,u),y="L";break;case"h":l+=b.shift(),_="L",P.push(l,u);break;case"H":l=b.shift(),_="L",P.push(l,u);break;case"v":u+=b.shift(),_="L",P.push(l,u);break;case"V":u=b.shift(),_="L",P.push(l,u);break;case"C":P.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),P.push(l,u);break;case"c":P.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",P.push(l,u);break;case"S":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),P.push(D,j,b.shift(),b.shift()),l=b.shift(),u=b.shift(),_="C",P.push(l,u);break;case"s":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),P.push(D,j,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",P.push(l,u);break;case"Q":P.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),P.push(l,u);break;case"q":P.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="Q",P.push(l,u);break;case"T":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l=b.shift(),u=b.shift(),_="Q",P.push(D,j,l,u);break;case"t":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l+=b.shift(),u+=b.shift(),_="Q",P.push(D,j,l,u);break;case"A":z=b.shift(),H=b.shift(),K=b.shift(),te=b.shift(),G=b.shift(),$=l,W=u,l=b.shift(),u=b.shift(),_="A",P=this.convertEndpointToCenterParameterization($,W,l,u,te,G,z,H,K);break;case"a":z=b.shift(),H=b.shift(),K=b.shift(),te=b.shift(),G=b.shift(),$=l,W=u,l+=b.shift(),u+=b.shift(),_="A",P=this.convertEndpointToCenterParameterization($,W,l,u,te,G,z,H,K);break}a.push({command:_||y,points:P,start:{x:A,y:M},pathLength:this.calcLength(A,M,_||y,P)})}(y==="z"||y==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=zn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var d=i[4],h=i[5],m=i[4]+h,y=Math.PI/180;if(Math.abs(d-m)m;l-=y)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=d+y;l1&&(s*=Math.sqrt(y),l*=Math.sqrt(y));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(h*h))/(s*s*(m*m)+l*l*(h*h)));o===a&&(b*=-1),isNaN(b)&&(b=0);var x=b*s*m/l,k=b*-l*h/s,E=(t+r)/2+Math.cos(d)*x-Math.sin(d)*k,_=(n+i)/2+Math.sin(d)*x+Math.cos(d)*k,P=function(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])},A=function(H,K){return(H[0]*K[0]+H[1]*K[1])/(P(H)*P(K))},M=function(H,K){return(H[0]*K[1]=1&&(z=0),a===0&&z>0&&(z=z-2*Math.PI),a===1&&z<0&&(z=z+2*Math.PI),[E,_,s,l,R,z,d,a]}}zn.prototype.className="Path";zn.prototype._attrsAffectingSize=["data"];Or(zn);ee.addGetterSetter(zn,"data");class vp extends hc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],y=zn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=zn.getPointOnQuadraticBezier(Math.min(1,1-a/y),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var d=(Math.atan2(u,l)+n)%n,h=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}vp.prototype.className="Arrow";Or(vp);ee.addGetterSetter(vp,"pointerLength",10,Ye());ee.addGetterSetter(vp,"pointerWidth",10,Ye());ee.addGetterSetter(vp,"pointerAtBeginning",!1);ee.addGetterSetter(vp,"pointerAtEnding",!0);let M0=class extends Fe{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};M0.prototype._centroid=!0;M0.prototype.className="Circle";M0.prototype._attrsAffectingSize=["radius"];Or(M0);ee.addGetterSetter(M0,"radius",0,Ye());class mf extends Fe{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}mf.prototype.className="Ellipse";mf.prototype._centroid=!0;mf.prototype._attrsAffectingSize=["radiusX","radiusY"];Or(mf);ee.addComponentsGetterSetter(mf,"radius",["x","y"]);ee.addGetterSetter(mf,"radiusX",0,Ye());ee.addGetterSetter(mf,"radiusY",0,Ye());let pc=class FG extends Fe{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.attrs.image;let o;if(i){const a=this.attrs.cropWidth,s=this.attrs.cropHeight;a&&s?o=[i,this.cropX(),this.cropY(),a,s,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&t.drawImage.apply(t,o)}_hitFunc(t){var n=this.width(),r=this.height();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=fe.createImageElement();i.onload=function(){var o=new FG({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};pc.prototype.className="Image";Or(pc);ee.addGetterSetter(pc,"image");ee.addComponentsGetterSetter(pc,"crop",["x","y","width","height"]);ee.addGetterSetter(pc,"cropX",0,Ye());ee.addGetterSetter(pc,"cropY",0,Ye());ee.addGetterSetter(pc,"cropWidth",0,Ye());ee.addGetterSetter(pc,"cropHeight",0,Ye());var zG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],A9e="Change.konva",O9e="none",D8="up",N8="right",j8="down",B8="left",M9e=zG.length;class EP extends u0{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}bp.prototype.className="RegularPolygon";bp.prototype._centroid=!0;bp.prototype._attrsAffectingSize=["radius"];Or(bp);ee.addGetterSetter(bp,"radius",0,Ye());ee.addGetterSetter(bp,"sides",0,Ye());var sD=Math.PI*2;class Sp extends Fe{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,sD,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),sD,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Sp.prototype.className="Ring";Sp.prototype._centroid=!0;Sp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Or(Sp);ee.addGetterSetter(Sp,"innerRadius",0,Ye());ee.addGetterSetter(Sp,"outerRadius",0,Ye());class vu extends Fe{constructor(t){super(t),this._updated=!0,this.anim=new rs(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],d=o[i+3],h=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,d),t.closePath(),t.fillStrokeShape(this)),h)if(a){var m=a[n],y=r*2;t.drawImage(h,s,l,u,d,m[y+0],m[y+1],u,d)}else t.drawImage(h,s,l,u,d,0,0,u,d)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],d=r*2;t.rect(u[d+0],u[d+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Ub;function jC(){return Ub||(Ub=fe.createCanvasElement().getContext(D9e),Ub)}function G9e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function q9e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Y9e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Ar extends Fe{constructor(t){super(Y9e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(E+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=fe._isString(t)?t:t==null?"":t+"";return this._setAttr(N9e,n),this}getWidth(){var t=this.attrs.width===Fg||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Fg||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return fe.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=jC(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+Wb+this.fontVariant()+Wb+(this.fontSize()+F9e)+U9e(this.fontFamily())}_addTextLine(t){this.align()===gv&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return jC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` +`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Fg&&o!==void 0,l=a!==Fg&&a!==void 0,u=this.padding(),d=o-u*2,h=a-u*2,m=0,y=this.wrap(),b=y!==cD,x=y!==V9e&&b,k=this.ellipsis();this.textArr=[],jC().font=this._getContextFont();for(var E=k?this._getTextWidth(NC):0,_=0,P=t.length;_d)for(;A.length>0;){for(var R=0,D=A.length,j="",z=0;R>>1,K=A.slice(0,H+1),te=this._getTextWidth(K)+E;te<=d?(R=H+1,j=K,z=te):D=H}if(j){if(x){var G,$=A[j.length],W=$===Wb||$===lD;W&&z<=d?G=j.length:G=Math.max(j.lastIndexOf(Wb),j.lastIndexOf(lD))+1,G>0&&(R=G,j=j.slice(0,R),z=this._getTextWidth(j))}j=j.trimRight(),this._addTextLine(j),r=Math.max(r,z),m+=i;var X=this._shouldHandleEllipsis(m);if(X){this._tryToAddEllipsisToLastLine();break}if(A=A.slice(R),A=A.trimLeft(),A.length>0&&(M=this._getTextWidth(A),M<=d)){this._addTextLine(A),m+=i,r=Math.max(r,M);break}}else break}else this._addTextLine(A),m+=i,r=Math.max(r,M),this._shouldHandleEllipsis(m)&&_h)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Fg&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==cD;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Fg&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+NC)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var d=HG(this.text()),h=this.text().split(" ").length-1,m,y,b,x=-1,k=0,E=function(){k=0;for(var te=t.dataArray,G=x+1;G0)return x=G,te[G];te[G].command==="M"&&(m={x:te[G].points[0],y:te[G].points[1]})}return{}},_=function(te){var G=t._getTextSize(te).width+r;te===" "&&i==="justify"&&(G+=(s-a)/h);var $=0,W=0;for(y=void 0;Math.abs(G-$)/G>.01&&W<20;){W++;for(var X=$;b===void 0;)b=E(),b&&X+b.pathLengthG?y=zn.getPointOnLine(G,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var U=b.points[4],Q=b.points[5],re=b.points[4]+Q;k===0?k=U+1e-8:G>$?k+=Math.PI/180*Q/Math.abs(Q):k-=Math.PI/360*Q/Math.abs(Q),(Q<0&&k=0&&k>re)&&(k=re,Z=!0),y=zn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],k,b.points[6]);break;case"C":k===0?G>b.pathLength?k=1e-8:k=G/b.pathLength:G>$?k+=(G-$)/b.pathLength/2:k=Math.max(k-($-G)/b.pathLength/2,0),k>1&&(k=1,Z=!0),y=zn.getPointOnCubicBezier(k,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":k===0?k=G/b.pathLength:G>$?k+=(G-$)/b.pathLength:k-=($-G)/b.pathLength,k>1&&(k=1,Z=!0),y=zn.getPointOnQuadraticBezier(k,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}y!==void 0&&($=zn.getLineLength(m.x,m.y,y.x,y.y)),Z&&(Z=!1,b=void 0)}},P="C",A=t._getTextSize(P).width+r,M=u/A-1,R=0;Re+`.${KG}`).join(" "),dD="nodesRect",Z9e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Q9e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const J9e="ontouchstart"in gt._global;function e8e(e,t){if(e==="rotater")return"crosshair";t+=fe.degToRad(Q9e[e]||0);var n=(fe.radToDeg(t)%360+360)%360;return fe._inRange(n,315+22.5,360)||fe._inRange(n,0,22.5)?"ns-resize":fe._inRange(n,45-22.5,45+22.5)?"nesw-resize":fe._inRange(n,90-22.5,90+22.5)?"ew-resize":fe._inRange(n,135-22.5,135+22.5)?"nwse-resize":fe._inRange(n,180-22.5,180+22.5)?"ns-resize":fe._inRange(n,225-22.5,225+22.5)?"nesw-resize":fe._inRange(n,270-22.5,270+22.5)?"ew-resize":fe._inRange(n,315-22.5,315+22.5)?"nwse-resize":(fe.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var rS=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],fD=1e8;function t8e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function XG(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function n8e(e,t){const n=t8e(e);return XG(e,t,n)}function r8e(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(Z9e.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(dD),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(dD,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(gt.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return XG(d,-gt.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-fD,y:-fD,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const d=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var h=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],m=u.getAbsoluteTransform();h.forEach(function(y){var b=m.point(y);n.push(b)})});const r=new Ea;r.rotate(-gt.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var d=r.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:gt.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),rS.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new Wy({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:J9e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=gt.getAngle(this.rotation()),o=e8e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new Fe({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*fe._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const d=o.getAbsolutePosition();if(!(u.x===d.x&&u.y===d.y)){if(this._movingAnchorName==="rotater"){var h=this._getNodeRect();n=o.x()-h.width/2,r=-o.y()+h.height/2;let te=Math.atan2(-r,n)+Math.PI/2;h.height<0&&(te-=Math.PI);var m=gt.getAngle(this.rotation());const G=m+te,$=gt.getAngle(this.rotationSnapTolerance()),X=r8e(this.rotationSnaps(),G,$)-h.rotation,Z=n8e(h,X);this._fitNodesInto(Z,t);return}var y=this.keepRatio()||t.shiftKey,_=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var x=this.findOne(".top-left").x()>b.x?-1:1,k=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*x,r=i*this.sin*k,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-b.x,2)+Math.pow(b.y-o.y(),2));var x=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*x,r=i*this.sin*k,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var E=o.position();this.findOne(".top-left").y(E.y),this.findOne(".bottom-right").x(E.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var x=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(fe._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(fe._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new Ea;if(a.rotate(gt.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const h=a.point({x:-this.padding()*2,y:0});if(t.x+=h.x,t.y+=h.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const h=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const h=a.point({x:0,y:-this.padding()*2});if(t.x+=h.x,t.y+=h.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const h=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const h=this.boundBoxFunc()(r,t);h?t=h:fe.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new Ea;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new Ea;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const d=u.multiply(l.invert());this._nodes.forEach(h=>{var m;const y=h.getParent().getAbsoluteTransform(),b=h.getTransform().copy();b.translate(h.offsetX(),h.offsetY());const x=new Ea;x.multiply(y.copy().invert()).multiply(d).multiply(y).multiply(b);const k=x.decompose();h.setAttrs(k),this._fire("transform",{evt:n,target:h}),h._fire("transform",{evt:n,target:h}),(m=h.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(fe._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(fe._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*fe._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),u0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Qe.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function i8e(e){return e instanceof Array||fe.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){rS.indexOf(t)===-1&&fe.warn("Unknown anchor name: "+t+". Available names are: "+rS.join(", "))}),e||[]}In.prototype.className="Transformer";Or(In);ee.addGetterSetter(In,"enabledAnchors",rS,i8e);ee.addGetterSetter(In,"flipEnabled",!0,il());ee.addGetterSetter(In,"resizeEnabled",!0);ee.addGetterSetter(In,"anchorSize",10,Ye());ee.addGetterSetter(In,"rotateEnabled",!0);ee.addGetterSetter(In,"rotationSnaps",[]);ee.addGetterSetter(In,"rotateAnchorOffset",50,Ye());ee.addGetterSetter(In,"rotationSnapTolerance",5,Ye());ee.addGetterSetter(In,"borderEnabled",!0);ee.addGetterSetter(In,"anchorStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"anchorStrokeWidth",1,Ye());ee.addGetterSetter(In,"anchorFill","white");ee.addGetterSetter(In,"anchorCornerRadius",0,Ye());ee.addGetterSetter(In,"borderStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"borderStrokeWidth",1,Ye());ee.addGetterSetter(In,"borderDash");ee.addGetterSetter(In,"keepRatio",!0);ee.addGetterSetter(In,"centeredScaling",!1);ee.addGetterSetter(In,"ignoreStroke",!1);ee.addGetterSetter(In,"padding",0,Ye());ee.addGetterSetter(In,"node");ee.addGetterSetter(In,"nodes");ee.addGetterSetter(In,"boundBoxFunc");ee.addGetterSetter(In,"anchorDragBoundFunc");ee.addGetterSetter(In,"shouldOverdrawWholeArea",!1);ee.addGetterSetter(In,"useSingleNodeRotation",!0);ee.backCompat(In,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class gc extends Fe{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,gt.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}gc.prototype.className="Wedge";gc.prototype._centroid=!0;gc.prototype._attrsAffectingSize=["radius"];Or(gc);ee.addGetterSetter(gc,"radius",0,Ye());ee.addGetterSetter(gc,"angle",0,Ye());ee.addGetterSetter(gc,"clockwise",!1);ee.backCompat(gc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function hD(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var o8e=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],a8e=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function s8e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,d,h,m,y,b,x,k,E,_,P,A,M,R,D,j,z,H,K,te,G=t+t+1,$=r-1,W=i-1,X=t+1,Z=X*(X+1)/2,U=new hD,Q=null,re=U,he=null,Ee=null,Ce=o8e[t],de=a8e[t];for(s=1;s>de,K!==0?(K=255/K,n[d]=(m*Ce>>de)*K,n[d+1]=(y*Ce>>de)*K,n[d+2]=(b*Ce>>de)*K):n[d]=n[d+1]=n[d+2]=0,m-=k,y-=E,b-=_,x-=P,k-=he.r,E-=he.g,_-=he.b,P-=he.a,l=h+((l=o+t+1)<$?l:$)<<2,A+=he.r=n[l],M+=he.g=n[l+1],R+=he.b=n[l+2],D+=he.a=n[l+3],m+=A,y+=M,b+=R,x+=D,he=he.next,k+=j=Ee.r,E+=z=Ee.g,_+=H=Ee.b,P+=K=Ee.a,A-=j,M-=z,R-=H,D-=K,Ee=Ee.next,d+=4;h+=r}for(o=0;o>de,K>0?(K=255/K,n[l]=(m*Ce>>de)*K,n[l+1]=(y*Ce>>de)*K,n[l+2]=(b*Ce>>de)*K):n[l]=n[l+1]=n[l+2]=0,m-=k,y-=E,b-=_,x-=P,k-=he.r,E-=he.g,_-=he.b,P-=he.a,l=o+((l=a+X)0&&s8e(t,n)};ee.addGetterSetter(Qe,"blurRadius",0,Ye(),ee.afterSetFilter);const u8e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};ee.addGetterSetter(Qe,"contrast",0,Ye(),ee.afterSetFilter);const d8e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,d=l*4,h=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:fe.error("Unknown emboss direction: "+r)}do{var m=(h-1)*d,y=o;h+y<1&&(y=0),h+y>u&&(y=0);var b=(h-1+y)*l*4,x=l;do{var k=m+(x-1)*4,E=a;x+E<1&&(E=0),x+E>l&&(E=0);var _=b+(x-1+E)*4,P=s[k]-s[_],A=s[k+1]-s[_+1],M=s[k+2]-s[_+2],R=P,D=R>0?R:-R,j=A>0?A:-A,z=M>0?M:-M;if(j>D&&(R=A),z>D&&(R=M),R*=t,i){var H=s[k]+R,K=s[k+1]+R,te=s[k+2]+R;s[k]=H>255?255:H<0?0:H,s[k+1]=K>255?255:K<0?0:K,s[k+2]=te>255?255:te<0?0:te}else{var G=n-R;G<0?G=0:G>255&&(G=255),s[k]=s[k+1]=s[k+2]=G}}while(--x)}while(--h)};ee.addGetterSetter(Qe,"embossStrength",.5,Ye(),ee.afterSetFilter);ee.addGetterSetter(Qe,"embossWhiteLevel",.5,Ye(),ee.afterSetFilter);ee.addGetterSetter(Qe,"embossDirection","top-left",null,ee.afterSetFilter);ee.addGetterSetter(Qe,"embossBlend",!1,null,ee.afterSetFilter);function BC(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const f8e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],d=u,h,m,y=this.enhance();if(y!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),h=t[m+2],hd&&(d=h);i===r&&(i=255,r=0),s===a&&(s=255,a=0),d===u&&(d=255,u=0);var b,x,k,E,_,P,A,M,R;for(y>0?(x=i+y*(255-i),k=r-y*(r-0),_=s+y*(255-s),P=a-y*(a-0),M=d+y*(255-d),R=u-y*(u-0)):(b=(i+r)*.5,x=i+y*(i-b),k=r+y*(r-b),E=(s+a)*.5,_=s+y*(s-E),P=a+y*(a-E),A=(d+u)*.5,M=d+y*(d-A),R=u+y*(u-A)),m=0;mE?k:E;var _=a,P=o,A,M,R=360/P*Math.PI/180,D,j;for(M=0;MP?_:P;var A=a,M=o,R,D,j=n.polarRotation||0,z,H;for(d=0;dt&&(A=P,M=0,R=-1),i=0;i=0&&y=0&&b=0&&y=0&&b=255*4?255:0}return a}function k8e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&y=0&&b=n))for(o=x;o=r||(a=(n*o+i)*4,s+=A[a+0],l+=A[a+1],u+=A[a+2],d+=A[a+3],P+=1);for(s=s/P,l=l/P,u=u/P,d=d/P,i=y;i=n))for(o=x;o=r||(a=(n*o+i)*4,A[a+0]=s,A[a+1]=l,A[a+2]=u,A[a+3]=d)}};ee.addGetterSetter(Qe,"pixelSize",8,Ye(),ee.afterSetFilter);const L8e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"blue",0,yG,ee.afterSetFilter);const O8e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Qe,"blue",0,yG,ee.afterSetFilter);ee.addGetterSetter(Qe,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const M8e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),d>127&&(d=255-d),h>127&&(h=255-h),t[l]=u,t[l+1]=d,t[l+2]=h}while(--s)}while(--o)},R8e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new Gg.Stage({container:i,width:n,height:r}),a=new Gg.Layer,s=new Gg.Layer;a.add(new Gg.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new Gg.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l};let ZG=null,QG=null;const N8e=e=>{ZG=e},nl=()=>ZG,j8e=e=>{QG=e},JG=()=>QG,B8e=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},eq=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),$8e=e=>{const t=nl(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:o,systemState:a}=e,{codeformerFidelity:s,facetoolStrength:l,facetoolType:u,hiresFix:d,hiresStrength:h,shouldRunESRGAN:m,shouldRunFacetool:y,upscalingLevel:b,upscalingStrength:x,upscalingDenoising:k}=i,{cfgScale:E,height:_,img2imgStrength:P,infillMethod:A,initialImage:M,iterations:R,perlin:D,prompt:j,negativePrompt:z,sampler:H,seamBlur:K,seamless:te,seamSize:G,seamSteps:$,seamStrength:W,seed:X,seedWeights:Z,shouldFitToWidthHeight:U,shouldGenerateVariations:Q,shouldRandomizeSeed:re,steps:he,threshold:Ee,tileSize:Ce,variationAmount:de,width:ze}=r,{shouldDisplayInProgressType:Me,saveIntermediatesInterval:rt,enableImageDebugging:We}=a,Be={prompt:j,iterations:R,steps:he,cfg_scale:E,threshold:Ee,perlin:D,height:_,width:ze,sampler_name:H,seed:X,progress_images:Me==="full-res",progress_latents:Me==="latents",save_intermediates:rt,generation_mode:n,init_mask:""};let wt=!1,$e=!1;if(z!==""&&(Be.prompt=`${j} [${z}]`),Be.seed=re?eq(SP,xP):X,["txt2img","img2img"].includes(n)&&(Be.seamless=te,Be.hires_fix=d,d&&(Be.strength=h),m&&(wt={level:b,denoise_str:k,strength:x}),y&&($e={type:u,strength:l},u==="codeformer"&&($e.codeformer_fidelity=s))),n==="img2img"&&M&&(Be.init_img=typeof M=="string"?M:M.url,Be.strength=P,Be.fit=U),n==="unifiedCanvas"&&t){const{layerState:{objects:at},boundingBoxCoordinates:bt,boundingBoxDimensions:Le,stageScale:ut,isMaskEnabled:Mt,shouldPreserveMaskedArea:ct,boundingBoxScaleMethod:_t,scaledBoundingBoxDimensions:un}=o,ae={...bt,...Le},De=D8e(Mt?at.filter(lP):[],ae);Be.init_mask=De,Be.fit=!1,Be.strength=P,Be.invert_mask=ct,Be.bounding_box=ae;const Ke=t.scale();t.scale({x:1/ut,y:1/ut});const Xe=t.getAbsolutePosition(),Se=t.toDataURL({x:ae.x+Xe.x,y:ae.y+Xe.y,width:ae.width,height:ae.height});We&&B8e([{base64:De,caption:"mask sent as init_mask"},{base64:Se,caption:"image sent as init_img"}]),t.scale(Ke),Be.init_img=Se,Be.progress_images=!1,_t!=="none"&&(Be.inpaint_width=un.width,Be.inpaint_height=un.height),Be.seam_size=G,Be.seam_blur=K,Be.seam_strength=W,Be.seam_steps=$,Be.tile_size=Ce,Be.infill_method=A,Be.force_outpaint=!1}return Q?(Be.variation_amount=de,Z&&(Be.with_variations=dwe(Z))):Be.variation_amount=0,We&&(Be.enable_image_debugging=We),{generationParameters:Be,esrganParameters:wt,facetoolParameters:$e}};var F8e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,z8e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,H8e=/[^-+\dA-Z]/g;function Ui(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(pD[t]||t||pD.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},d=function(){return e[o()+"Hours"]()},h=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},y=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},x=function(){return V8e(e)},k=function(){return W8e(e)},E={d:function(){return a()},dd:function(){return Ca(a())},ddd:function(){return Go.dayNames[s()]},DDD:function(){return gD({y:u(),m:l(),d:a(),_:o(),dayName:Go.dayNames[s()],short:!0})},dddd:function(){return Go.dayNames[s()+7]},DDDD:function(){return gD({y:u(),m:l(),d:a(),_:o(),dayName:Go.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Ca(l()+1)},mmm:function(){return Go.monthNames[l()]},mmmm:function(){return Go.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return Ca(u(),4)},h:function(){return d()%12||12},hh:function(){return Ca(d()%12||12)},H:function(){return d()},HH:function(){return Ca(d())},M:function(){return h()},MM:function(){return Ca(h())},s:function(){return m()},ss:function(){return Ca(m())},l:function(){return Ca(y(),3)},L:function(){return Ca(Math.floor(y()/10))},t:function(){return d()<12?Go.timeNames[0]:Go.timeNames[1]},tt:function(){return d()<12?Go.timeNames[2]:Go.timeNames[3]},T:function(){return d()<12?Go.timeNames[4]:Go.timeNames[5]},TT:function(){return d()<12?Go.timeNames[6]:Go.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":U8e(e)},o:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60),2)+":"+Ca(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return x()},WW:function(){return Ca(x())},N:function(){return k()}};return t.replace(F8e,function(_){return _ in E?E[_]():_.slice(1,_.length-1)})}var pD={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Go={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Ca=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},gD=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,d=new Date;d.setDate(d[o+"Date"]()-1);var h=new Date;h.setDate(h[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},y=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},x=function(){return d[o+"Date"]()},k=function(){return d[o+"Month"]()},E=function(){return d[o+"FullYear"]()},_=function(){return h[o+"Date"]()},P=function(){return h[o+"Month"]()},A=function(){return h[o+"FullYear"]()};return b()===n&&y()===r&&m()===i?l?"Tdy":"Today":E()===n&&k()===r&&x()===i?l?"Ysd":"Yesterday":A()===n&&P()===r&&_()===i?l?"Tmw":"Tomorrow":a},V8e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},W8e=function(t){var n=t.getDay();return n===0&&(n=7),n},U8e=function(t){return(String(t).match(z8e)||[""]).pop().replace(H8e,"").replace(/GMT\+0000/g,"UTC")};const G8e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(ts(!0));const o=r(),{generation:a,postprocessing:s,system:l,canvas:u}=o,d={generationMode:i,generationState:a,postprocessingState:s,canvasState:u,systemState:l};n(vCe());const{generationParameters:h,esrganParameters:m,facetoolParameters:y}=$8e(d);t.emit("generateImage",h,m,y),h.init_mask&&(h.init_mask=h.init_mask.substr(0,64).concat("...")),h.init_img&&(h.init_img=h.init_img.substr(0,64).concat("...")),n(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...h,...m,...y})}`}))},emitRunESRGAN:i=>{n(ts(!0));const{postprocessing:{upscalingLevel:o,upscalingDenoising:a,upscalingStrength:s}}=r(),l={upscale:[o,a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(ts(!0));const{postprocessing:{facetoolType:o,facetoolStrength:a,codeformerFidelity:s}}=r(),l={facetool_strength:a};o==="codeformer"&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",i,{type:o,...l}),n(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Face restoration (${o}) requested: ${JSON.stringify({file:i.url,...l})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(fU(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitConvertToDiffusers:i=>{n(pCe()),t.emit("convertToDiffusers",i)},emitRequestModelChange:i=>{n(hCe()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}};let qb;const q8e=new Uint8Array(16);function Y8e(){if(!qb&&(qb=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qb(q8e)}const Vi=[];for(let e=0;e<256;++e)Vi.push((e+256).toString(16).slice(1));function K8e(e,t=0){return(Vi[e[t+0]]+Vi[e[t+1]]+Vi[e[t+2]]+Vi[e[t+3]]+"-"+Vi[e[t+4]]+Vi[e[t+5]]+"-"+Vi[e[t+6]]+Vi[e[t+7]]+"-"+Vi[e[t+8]]+Vi[e[t+9]]+"-"+Vi[e[t+10]]+Vi[e[t+11]]+Vi[e[t+12]]+Vi[e[t+13]]+Vi[e[t+14]]+Vi[e[t+15]]).toLowerCase()}const X8e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),mD={randomUUID:X8e};function gm(e,t,n){if(mD.randomUUID&&!t&&!e)return mD.randomUUID();e=e||{};const r=e.random||(e.rng||Y8e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return K8e(r)}const $8=Tr("socketio/generateImage"),Z8e=Tr("socketio/runESRGAN"),Q8e=Tr("socketio/runFacetool"),J8e=Tr("socketio/deleteImage"),F8=Tr("socketio/requestImages"),vD=Tr("socketio/requestNewImages"),e_e=Tr("socketio/cancelProcessing"),t_e=Tr("socketio/requestSystemConfig"),yD=Tr("socketio/searchForModels"),Uy=Tr("socketio/addNewModel"),n_e=Tr("socketio/deleteModel"),r_e=Tr("socketio/convertToDiffusers"),tq=Tr("socketio/requestModelChange"),i_e=Tr("socketio/saveStagingAreaImageToGallery"),o_e=Tr("socketio/requestEmptyTempFolder"),a_e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(DR(!0)),t(Wg(Dt.t("common:statusConnected"))),t(t_e());const r=n().gallery;r.categories.result.latest_mtime?t(vD("result")):t(F8("result")),r.categories.user.latest_mtime?t(vD("user")):t(F8("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(DR(!1)),t(Wg(Dt.t("common:statusDisconnected"))),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:o}=i.ui,{shouldLoopback:a}=i.postprocessing,{boundingBox:s,generationMode:l,...u}=r,d={uuid:gm(),...u};if(["txt2img","img2img"].includes(l)&&t(hm({category:"result",image:{...d,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:h}=r;t(Axe({image:{...d,category:"temp"},boundingBox:h})),i.canvas.shouldAutoSave&&t(hm({image:{...d,category:"result"},category:"result"}))}if(a)switch(vP[o]){case"img2img":{t(L0(d));break}}t(EC()),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(Jxe({uuid:gm(),...r,category:"result"})),r.isBase64||t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(hm({category:"result",image:{uuid:gm(),...r,category:"result"}})),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(ts(!0)),t(uCe(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(NR()),t(EC())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:gm(),...l}));t(Qxe({images:s,areMoreImagesAvailable:o,category:a})),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(fCe());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(hm({category:"result",image:r})),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(EC())),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(fU(r));const{generation:{initialImage:o,maskPath:a}}=n();(o===i||(o==null?void 0:o.url)===i)&&t(vU()),a===i&&t(wU("")),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(cCe(r)),r.infill_methods.includes("patchmatch")||t(xU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(QU(i)),t(JU(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(dv(o)),t(ts(!1)),t(Wg(Dt.t("modelmanager:modelAdded"))),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t(Ad({title:a?`${Dt.t("modelmanager:modelUpdated")}: ${i}`:`${Dt.t("modelmanager:modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(dv(o)),t(ts(!1)),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`${Dt.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t(Ad({title:`${Dt.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelConverted:r=>{const{converted_model_name:i,model_list:o}=r;t(dv(o)),t(Wg(Dt.t("common:statusModelConverted"))),t(ts(!1)),t(Mh(!0)),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Model converted: ${i}`,level:"info"})),t(Ad({title:`${Dt.t("modelmanager:modelConverted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(dv(o)),t(Wg(Dt.t("common:statusModelChanged"))),t(ts(!1)),t(Mh(!0)),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(dv(o)),t(ts(!1)),t(Mh(!0)),t(NR()),t(Wi({timestamp:Ui(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Ad({title:Dt.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},s_e=()=>{const{origin:e}=new URL(window.location.href),t=z4(e,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:d,onGenerationResult:h,onIntermediateResult:m,onProgressUpdate:y,onGalleryImages:b,onProcessingCanceled:x,onImageDeleted:k,onSystemConfig:E,onModelChanged:_,onFoundModels:P,onNewModelAdded:A,onModelDeleted:M,onModelConverted:R,onModelChangeFailed:D,onTempFolderEmptied:j}=a_e(i),{emitGenerateImage:z,emitRunESRGAN:H,emitRunFacetool:K,emitDeleteImage:te,emitRequestImages:G,emitRequestNewImages:$,emitCancelProcessing:W,emitRequestSystemConfig:X,emitSearchForModels:Z,emitAddNewModel:U,emitDeleteModel:Q,emitConvertToDiffusers:re,emitRequestModelChange:he,emitSaveStagingAreaImageToGallery:Ee,emitRequestEmptyTempFolder:Ce}=G8e(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",de=>u(de)),t.on("generationResult",de=>h(de)),t.on("postprocessingResult",de=>d(de)),t.on("intermediateResult",de=>m(de)),t.on("progressUpdate",de=>y(de)),t.on("galleryImages",de=>b(de)),t.on("processingCanceled",()=>{x()}),t.on("imageDeleted",de=>{k(de)}),t.on("systemConfig",de=>{E(de)}),t.on("foundModels",de=>{P(de)}),t.on("newModelAdded",de=>{A(de)}),t.on("modelDeleted",de=>{M(de)}),t.on("modelConverted",de=>{R(de)}),t.on("modelChanged",de=>{_(de)}),t.on("modelChangeFailed",de=>{D(de)}),t.on("tempFolderEmptied",()=>{j()}),n=!0),a.type){case"socketio/generateImage":{z(a.payload);break}case"socketio/runESRGAN":{H(a.payload);break}case"socketio/runFacetool":{K(a.payload);break}case"socketio/deleteImage":{te(a.payload);break}case"socketio/requestImages":{G(a.payload);break}case"socketio/requestNewImages":{$(a.payload);break}case"socketio/cancelProcessing":{W();break}case"socketio/requestSystemConfig":{X();break}case"socketio/searchForModels":{Z(a.payload);break}case"socketio/addNewModel":{U(a.payload);break}case"socketio/deleteModel":{Q(a.payload);break}case"socketio/convertToDiffusers":{re(a.payload);break}case"socketio/requestModelChange":{he(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{Ee(a.payload);break}case"socketio/requestEmptyTempFolder":{Ce();break}}o(a)}},l_e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),u_e=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map(e=>`system.${e}`),c_e=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),nq=RW({generation:ywe,postprocessing:Cwe,gallery:awe,system:SCe,canvas:Xxe,ui:ACe,lightbox:uwe}),d_e=UW.getPersistConfig({key:"root",storage:WW,rootReducer:nq,blacklist:[...l_e,...u_e,...c_e],debounce:300}),f_e=rxe(d_e,nq),rq=ISe({reducer:f_e,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(s_e()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),iq=uxe(rq),PP=w.createContext(null),Oe=q5e,pe=N5e;let bD;const TP=()=>({setOpenUploader:e=>{e&&(bD=e)},openUploader:bD}),Mr=lt(e=>e.ui,e=>vP[e.activeTab],{memoizeOptions:{equalityCheck:ke.isEqual}}),h_e=lt(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:ke.isEqual}}),xp=lt(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),SD=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Mr(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:a})).json(),u={uuid:gm(),category:"user",...l};t(hm({image:u,category:"user"})),o==="unifiedCanvas"?t($x(u)):o==="img2img"&&t(L0(u))};function p_e(){const{t:e}=Ge();return v.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[v.jsx("h1",{children:e("common:nodes")}),v.jsx("p",{children:e("common:nodesDesc")})]})}const g_e=()=>{const{t:e}=Ge();return v.jsxs("div",{className:"work-in-progress post-processing-work-in-progress",children:[v.jsx("h1",{children:e("common:postProcessing")}),v.jsx("p",{children:e("common:postProcessDesc1")}),v.jsx("p",{children:e("common:postProcessDesc2")}),v.jsx("p",{children:e("common:postProcessDesc3")})]})};function m_e(){const{t:e}=Ge();return v.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[v.jsx("h1",{children:e("common:training")}),v.jsxs("p",{children:[e("common:trainingDesc1"),v.jsx("br",{}),v.jsx("br",{}),e("common:trainingDesc2")]})]})}function v_e(e){const{i18n:t}=Ge(),n=localStorage.getItem("i18nextLng");N.useEffect(()=>{e()},[e]),N.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const y_e=yt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:v.jsx("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),b_e=yt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),S_e=yt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),x_e=yt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:v.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:v.jsx("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})}),w_e=yt({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),C_e=yt({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})}),Je=Ae((e,t)=>{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return v.jsx(yi,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:v.jsx(us,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})}),nr=Ae((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return v.jsx(yi,{label:r,...i,children:v.jsx(ls,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),Js=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return v.jsxs(BE,{...o,children:[v.jsx(zE,{children:t}),v.jsxs(FE,{className:`invokeai__popover-content ${r}`,children:[i&&v.jsx($E,{className:"invokeai__popover-arrow"}),n]})]})},qx=lt(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:ke.isEqual}}),xD=/^-?(0\.)?\.?$/,ia=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:d,min:h,max:m,isInteger:y=!0,formControlProps:b,formLabelProps:x,numberInputFieldProps:k,numberInputStepperProps:E,tooltipProps:_,...P}=e,[A,M]=w.useState(String(u));w.useEffect(()=>{!A.match(xD)&&u!==Number(A)&&M(String(u))},[u,A]);const R=j=>{M(j),j.match(xD)||d(y?Math.floor(Number(j)):Number(j))},D=j=>{const z=ke.clamp(y?Math.floor(Number(j.target.value)):Number(j.target.value),h,m);M(String(z)),d(z)};return v.jsx(yi,{..._,children:v.jsxs(fn,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&v.jsx(En,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...x,children:t}),v.jsxs(RE,{className:"invokeai__number-input-root",value:A,min:h,max:m,keepWithinRange:!0,clampValueOnBlur:!1,onChange:R,onBlur:D,width:a,...P,children:[v.jsx(DE,{className:"invokeai__number-input-field",textAlign:s,...k}),o&&v.jsxs("div",{className:"invokeai__number-input-stepper",children:[v.jsx(jE,{...E,className:"invokeai__number-input-stepper-button"}),v.jsx(NE,{...E,className:"invokeai__number-input-stepper-button"})]})]})]})})},rl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return v.jsxs(fn,{isDisabled:n,className:`invokeai__select ${l}`,onClick:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation(),d.nativeEvent.stopPropagation(),d.nativeEvent.cancelBubble=!0},children:[t&&v.jsx(En,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),v.jsx(yi,{label:i,...o,children:v.jsx(QV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(d=>typeof d=="string"||typeof d=="number"?v.jsx("option",{value:d,className:"invokeai__select-option",children:d},d):v.jsx("option",{value:d.value,className:"invokeai__select-option",children:d.key},d.value))})})]})},Gy=e=>e.postprocessing,or=e=>e.system,__e=e=>e.system.toastQueue,oq=lt(or,e=>{const{model_list:t}=e,n=ke.reduce(t,(r,i,o)=>(i.status==="active"&&(r=o),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),k_e=lt([Gy,or],({facetoolStrength:e,facetoolType:t,codeformerFidelity:n},{isGFPGANAvailable:r})=>({facetoolStrength:e,facetoolType:t,codeformerFidelity:n,isGFPGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),LP=()=>{const e=Oe(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r,isGFPGANAvailable:i}=pe(k_e),o=u=>e(g8(u)),a=u=>e(IU(u)),s=u=>e(B4(u.target.value)),{t:l}=Ge();return v.jsxs(je,{direction:"column",gap:2,children:[v.jsx(rl,{label:l("parameters:type"),validValues:C7e.concat(),value:n,onChange:s}),v.jsx(ia,{isDisabled:!i,label:l("parameters:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&v.jsx(ia,{isDisabled:!i,label:l("parameters:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};var aq={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},wD=N.createContext&&N.createContext(aq),Wd=globalThis&&globalThis.__assign||function(){return Wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{Ee(i)},[i]);const Ce=w.useMemo(()=>W!=null&&W.max?W.max:a,[a,W==null?void 0:W.max]),de=We=>{l(We)},ze=We=>{We.target.value===""&&(We.target.value=String(o));const Be=ke.clamp(x?Math.floor(Number(We.target.value)):Number(he),o,Ce);l(Be)},Me=We=>{Ee(We)},rt=()=>{M&&M()};return v.jsxs(fn,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":h,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...H,children:[v.jsx(En,{className:"invokeai__slider-component-label",...K,children:r}),v.jsxs(Ty,{w:"100%",gap:2,alignItems:"center",children:[v.jsxs(WE,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:de,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...re,children:[h&&v.jsxs(v.Fragment,{children:[v.jsx(Q9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),v.jsx(Q9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:y,...te,children:a})]}),v.jsx(uW,{className:"invokeai__slider_track",...G,children:v.jsx(cW,{className:"invokeai__slider_track-filled"})}),v.jsx(yi,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${d}`,hidden:P,...U,children:v.jsx(lW,{className:"invokeai__slider-thumb",...$})})]}),b&&v.jsxs(RE,{min:o,max:Ce,step:s,value:he,onChange:Me,onBlur:ze,className:"invokeai__slider-number-field",isDisabled:j,...W,children:[v.jsx(DE,{className:"invokeai__slider-number-input",width:k,readOnly:E,minWidth:k,...X}),v.jsxs(WV,{...Z,children:[v.jsx(jE,{onClick:()=>l(Number(he)),className:"invokeai__slider-number-stepper"}),v.jsx(NE,{onClick:()=>l(Number(he)),className:"invokeai__slider-number-stepper"})]})]}),_&&v.jsx(Je,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:v.jsx(Yx,{}),onClick:rt,isDisabled:R,...Q})]})]})}const I_e=lt([Gy,or],({upscalingLevel:e,upscalingStrength:t,upscalingDenoising:n},{isESRGANAvailable:r})=>({upscalingLevel:e,upscalingDenoising:n,upscalingStrength:t,isESRGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),AP=()=>{const e=Oe(),{upscalingLevel:t,upscalingStrength:n,upscalingDenoising:r,isESRGANAvailable:i}=pe(I_e),{t:o}=Ge(),a=l=>e(RU(Number(l.target.value))),s=l=>e(v8(l));return v.jsxs(je,{flexDir:"column",rowGap:"1rem",minWidth:"20rem",children:[v.jsx(rl,{isDisabled:!i,label:o("parameters:scale"),value:t,onChange:a,validValues:w7e}),v.jsx(lo,{label:o("parameters:denoisingStrength"),value:r,min:0,max:1,step:.01,onChange:l=>{e(m8(l))},handleReset:()=>e(m8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i}),v.jsx(lo,{label:`${o("parameters:upscale")} ${o("parameters:strength")}`,value:n,min:0,max:1,step:.05,onChange:s,handleReset:()=>e(v8(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!i,isInputDisabled:!i,isResetDisabled:!i})]})};var R_e=Object.create,uq=Object.defineProperty,D_e=Object.getOwnPropertyDescriptor,N_e=Object.getOwnPropertyNames,j_e=Object.getPrototypeOf,B_e=Object.prototype.hasOwnProperty,qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$_e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of N_e(t))!B_e.call(e,i)&&i!==n&&uq(e,i,{get:()=>t[i],enumerable:!(r=D_e(t,i))||r.enumerable});return e},cq=(e,t,n)=>(n=e!=null?R_e(j_e(e)):{},$_e(t||!e||!e.__esModule?uq(n,"default",{value:e,enumerable:!0}):n,e)),F_e=qe((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),dq=qe((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Kx=qe((e,t)=>{var n=dq();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),z_e=qe((e,t)=>{var n=Kx(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),H_e=qe((e,t)=>{var n=Kx();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),V_e=qe((e,t)=>{var n=Kx();function r(i){return n(this.__data__,i)>-1}t.exports=r}),W_e=qe((e,t)=>{var n=Kx();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Xx=qe((e,t)=>{var n=F_e(),r=z_e(),i=H_e(),o=V_e(),a=W_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Xx();function r(){this.__data__=new n,this.size=0}t.exports=r}),G_e=qe((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),q_e=qe((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),Y_e=qe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),fq=qe((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),mc=qe((e,t)=>{var n=fq(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),OP=qe((e,t)=>{var n=mc(),r=n.Symbol;t.exports=r}),K_e=qe((e,t)=>{var n=OP(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),d=l[a];try{l[a]=void 0;var h=!0}catch{}var m=o.call(l);return h&&(u?l[a]=d:delete l[a]),m}t.exports=s}),X_e=qe((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),Zx=qe((e,t)=>{var n=OP(),r=K_e(),i=X_e(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),hq=qe((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),pq=qe((e,t)=>{var n=Zx(),r=hq(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var d=n(u);return d==o||d==a||d==i||d==s}t.exports=l}),Z_e=qe((e,t)=>{var n=mc(),r=n["__core-js_shared__"];t.exports=r}),Q_e=qe((e,t)=>{var n=Z_e(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),gq=qe((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch{}try{return o+""}catch{}}return""}t.exports=i}),J_e=qe((e,t)=>{var n=pq(),r=Q_e(),i=hq(),o=gq(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,h=u.hasOwnProperty,m=RegExp("^"+d.call(h).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function y(b){if(!i(b)||r(b))return!1;var x=n(b)?m:s;return x.test(o(b))}t.exports=y}),eke=qe((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),I0=qe((e,t)=>{var n=J_e(),r=eke();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),MP=qe((e,t)=>{var n=I0(),r=mc(),i=n(r,"Map");t.exports=i}),Qx=qe((e,t)=>{var n=I0(),r=n(Object,"create");t.exports=r}),tke=qe((e,t)=>{var n=Qx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),nke=qe((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),rke=qe((e,t)=>{var n=Qx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),ike=qe((e,t)=>{var n=Qx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),oke=qe((e,t)=>{var n=Qx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),ake=qe((e,t)=>{var n=tke(),r=nke(),i=rke(),o=ike(),a=oke();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=ake(),r=Xx(),i=MP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),lke=qe((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),Jx=qe((e,t)=>{var n=lke();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),uke=qe((e,t)=>{var n=Jx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),cke=qe((e,t)=>{var n=Jx();function r(i){return n(this,i).get(i)}t.exports=r}),dke=qe((e,t)=>{var n=Jx();function r(i){return n(this,i).has(i)}t.exports=r}),fke=qe((e,t)=>{var n=Jx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),mq=qe((e,t)=>{var n=ske(),r=uke(),i=cke(),o=dke(),a=fke();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Xx(),r=MP(),i=mq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var d=u.__data__;if(!r||d.length{var n=Xx(),r=U_e(),i=G_e(),o=q_e(),a=Y_e(),s=hke();function l(u){var d=this.__data__=new n(u);this.size=d.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),gke=qe((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),mke=qe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),vke=qe((e,t)=>{var n=mq(),r=gke(),i=mke();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),vq=qe((e,t)=>{var n=vke(),r=yke(),i=bke(),o=1,a=2;function s(l,u,d,h,m,y){var b=d&o,x=l.length,k=u.length;if(x!=k&&!(b&&k>x))return!1;var E=y.get(l),_=y.get(u);if(E&&_)return E==u&&_==l;var P=-1,A=!0,M=d&a?new n:void 0;for(y.set(l,u),y.set(u,l);++P{var n=mc(),r=n.Uint8Array;t.exports=r}),xke=qe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),wke=qe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),Cke=qe((e,t)=>{var n=OP(),r=Ske(),i=dq(),o=vq(),a=xke(),s=wke(),l=1,u=2,d="[object Boolean]",h="[object Date]",m="[object Error]",y="[object Map]",b="[object Number]",x="[object RegExp]",k="[object Set]",E="[object String]",_="[object Symbol]",P="[object ArrayBuffer]",A="[object DataView]",M=n?n.prototype:void 0,R=M?M.valueOf:void 0;function D(j,z,H,K,te,G,$){switch(H){case A:if(j.byteLength!=z.byteLength||j.byteOffset!=z.byteOffset)return!1;j=j.buffer,z=z.buffer;case P:return!(j.byteLength!=z.byteLength||!G(new r(j),new r(z)));case d:case h:case b:return i(+j,+z);case m:return j.name==z.name&&j.message==z.message;case x:case E:return j==z+"";case y:var W=a;case k:var X=K&l;if(W||(W=s),j.size!=z.size&&!X)return!1;var Z=$.get(j);if(Z)return Z==z;K|=u,$.set(j,z);var U=o(W(j),W(z),K,te,G,$);return $.delete(j),U;case _:if(R)return R.call(j)==R.call(z)}return!1}t.exports=D}),_ke=qe((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),kke=qe((e,t)=>{var n=_ke(),r=IP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),Eke=qe((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),Tke=qe((e,t)=>{var n=Eke(),r=Pke(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),Lke=qe((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),Ake=qe((e,t)=>{var n=Zx(),r=ew(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),Oke=qe((e,t)=>{var n=Ake(),r=ew(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),Mke=qe((e,t)=>{function n(){return!1}t.exports=n}),yq=qe((e,t)=>{var n=mc(),r=Mke(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),Ike=qe((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a??n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),Rke=qe((e,t)=>{var n=Zx(),r=bq(),i=ew(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",h="[object Map]",m="[object Number]",y="[object Object]",b="[object RegExp]",x="[object Set]",k="[object String]",E="[object WeakMap]",_="[object ArrayBuffer]",P="[object DataView]",A="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",j="[object Int32Array]",z="[object Uint8Array]",H="[object Uint8ClampedArray]",K="[object Uint16Array]",te="[object Uint32Array]",G={};G[A]=G[M]=G[R]=G[D]=G[j]=G[z]=G[H]=G[K]=G[te]=!0,G[o]=G[a]=G[_]=G[s]=G[P]=G[l]=G[u]=G[d]=G[h]=G[m]=G[y]=G[b]=G[x]=G[k]=G[E]=!1;function $(W){return i(W)&&r(W.length)&&!!G[n(W)]}t.exports=$}),Dke=qe((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),Nke=qe((e,t)=>{var n=fq(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s}),Sq=qe((e,t)=>{var n=Rke(),r=Dke(),i=Nke(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),jke=qe((e,t)=>{var n=Lke(),r=Oke(),i=IP(),o=yq(),a=Ike(),s=Sq(),l=Object.prototype,u=l.hasOwnProperty;function d(h,m){var y=i(h),b=!y&&r(h),x=!y&&!b&&o(h),k=!y&&!b&&!x&&s(h),E=y||b||x||k,_=E?n(h.length,String):[],P=_.length;for(var A in h)(m||u.call(h,A))&&!(E&&(A=="length"||x&&(A=="offset"||A=="parent")||k&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,P)))&&_.push(A);return _}t.exports=d}),Bke=qe((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),$ke=qe((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),Fke=qe((e,t)=>{var n=$ke(),r=n(Object.keys,Object);t.exports=r}),zke=qe((e,t)=>{var n=Bke(),r=Fke(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),Hke=qe((e,t)=>{var n=pq(),r=bq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),Vke=qe((e,t)=>{var n=jke(),r=zke(),i=Hke();function o(a){return i(a)?n(a):r(a)}t.exports=o}),Wke=qe((e,t)=>{var n=kke(),r=Tke(),i=Vke();function o(a){return n(a,i,r)}t.exports=o}),Uke=qe((e,t)=>{var n=Wke(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,d,h,m){var y=u&r,b=n(s),x=b.length,k=n(l),E=k.length;if(x!=E&&!y)return!1;for(var _=x;_--;){var P=b[_];if(!(y?P in l:o.call(l,P)))return!1}var A=m.get(s),M=m.get(l);if(A&&M)return A==l&&M==s;var R=!0;m.set(s,l),m.set(l,s);for(var D=y;++_{var n=I0(),r=mc(),i=n(r,"DataView");t.exports=i}),qke=qe((e,t)=>{var n=I0(),r=mc(),i=n(r,"Promise");t.exports=i}),Yke=qe((e,t)=>{var n=I0(),r=mc(),i=n(r,"Set");t.exports=i}),Kke=qe((e,t)=>{var n=I0(),r=mc(),i=n(r,"WeakMap");t.exports=i}),Xke=qe((e,t)=>{var n=Gke(),r=MP(),i=qke(),o=Yke(),a=Kke(),s=Zx(),l=gq(),u="[object Map]",d="[object Object]",h="[object Promise]",m="[object Set]",y="[object WeakMap]",b="[object DataView]",x=l(n),k=l(r),E=l(i),_=l(o),P=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=h||o&&A(new o)!=m||a&&A(new a)!=y)&&(A=function(M){var R=s(M),D=R==d?M.constructor:void 0,j=D?l(D):"";if(j)switch(j){case x:return b;case k:return u;case E:return h;case _:return m;case P:return y}return R}),t.exports=A}),Zke=qe((e,t)=>{var n=pke(),r=vq(),i=Cke(),o=Uke(),a=Xke(),s=IP(),l=yq(),u=Sq(),d=1,h="[object Arguments]",m="[object Array]",y="[object Object]",b=Object.prototype,x=b.hasOwnProperty;function k(E,_,P,A,M,R){var D=s(E),j=s(_),z=D?m:a(E),H=j?m:a(_);z=z==h?y:z,H=H==h?y:H;var K=z==y,te=H==y,G=z==H;if(G&&l(E)){if(!l(_))return!1;D=!0,K=!1}if(G&&!K)return R||(R=new n),D||u(E)?r(E,_,P,A,M,R):i(E,_,z,P,A,M,R);if(!(P&d)){var $=K&&x.call(E,"__wrapped__"),W=te&&x.call(_,"__wrapped__");if($||W){var X=$?E.value():E,Z=W?_.value():_;return R||(R=new n),M(X,Z,P,A,R)}}return G?(R||(R=new n),o(E,_,P,A,M,R)):!1}t.exports=k}),Qke=qe((e,t)=>{var n=Zke(),r=ew();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),xq=qe((e,t)=>{var n=Qke();function r(i,o){return n(i,o)}t.exports=r}),Jke=["ctrl","shift","alt","meta","mod"],eEe={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function $C(e,t=","){return typeof e=="string"?e.split(t):e}function g2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>eEe[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!Jke.includes(o));return{...r,keys:i}}function tEe(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function nEe(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function rEe(e){return wq(e,["input","textarea","select"])}function wq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function iEe(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var oEe=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:d,metaKey:h,shiftKey:m,key:y,code:b}=e,x=b.toLowerCase().replace("key",""),k=y.toLowerCase();if(u!==r&&k!=="alt"||m!==s&&k!=="shift")return!1;if(a){if(!h&&!d)return!1}else if(h!==o&&x!=="meta"||d!==i&&x!=="ctrl")return!1;return l&&l.length===1&&(l.includes(k)||l.includes(x))?!0:l?l.every(E=>n.has(E)):!l},aEe=w.createContext(void 0),sEe=()=>w.useContext(aEe),lEe=w.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),uEe=()=>w.useContext(lEe),cEe=cq(xq());function dEe(e){let t=w.useRef(void 0);return(0,cEe.default)(t.current,e)||(t.current=e),t.current}var CD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function et(e,t,n,r){let i=w.useRef(null),{current:o}=w.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=w.useCallback(t,[...s]),u=dEe(a),{enabledScopes:d}=uEe(),h=sEe();return w.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!iEe(d,u==null?void 0:u.scopes))return;let m=x=>{var k;if(!(rEe(x)&&!wq(x,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){CD(x);return}(k=x.target)!=null&&k.isContentEditable&&!(u!=null&&u.enableOnContentEditable)||$C(e,u==null?void 0:u.splitKey).forEach(E=>{var P;let _=g2(E,u==null?void 0:u.combinationKey);if(oEe(x,_,o)||(P=_.keys)!=null&&P.includes("*")){if(tEe(x,_,u==null?void 0:u.preventDefault),!nEe(x,_,u==null?void 0:u.enabled)){CD(x);return}l(x,_)}})}},y=x=>{o.add(x.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||u!=null&&u.keydown)&&m(x)},b=x=>{x.key.toLowerCase()!=="meta"?o.delete(x.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(x)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",y),h&&$C(e,u==null?void 0:u.splitKey).forEach(x=>h.addHotkey(g2(x,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",y),h&&$C(e,u==null?void 0:u.splitKey).forEach(x=>h.removeHotkey(g2(x,u==null?void 0:u.combinationKey)))}},[e,l,u,d]),i}cq(xq());var z8=new Set;function fEe(e){(Array.isArray(e)?e:[e]).forEach(t=>z8.add(g2(t)))}function hEe(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=g2(t);for(let i of z8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&z8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{fEe(e.key)}),document.addEventListener("keyup",e=>{hEe(e.key)})});function pEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function gEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function mEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function Cq(e){return mt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function _q(e){return mt({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function vEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function yEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function kq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function bEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function SEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function RP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function Eq(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function c0(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function Pq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function xEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function DP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function Tq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function wEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function CEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function Lq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function _Ee(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function kEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function Aq(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function EEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function PEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function TEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function LEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"}}]})(e)}function Oq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function AEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function OEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function Mq(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function MEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function IEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function qy(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function REe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function DEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function NEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function NP(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function jEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function BEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function _D(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function jP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function $Ee(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function wp(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function FEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function tw(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function zEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function BP(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const ln=e=>e.canvas,Ir=lt([ln,Mr,or],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Iq=e=>e.canvas.layerState.objects.find(Y5),Cp=e=>e.gallery,HEe=lt([Cp,qx,Ir,Mr],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,galleryWidth:b,shouldUseSingleGalleryColumn:x}=e,{isLightboxOpen:k}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,galleryGridTemplateColumns:x?"auto":`repeat(auto-fill, minmax(${d}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightboxOpen:k,isStaging:n,shouldEnableResize:!(k||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:x}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VEe=lt([Cp,or,qx,Mr],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WEe=lt(or,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),iS=w.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Yh(),a=Oe(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=pe(WEe),d=w.useRef(null),h=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(J8e(e)),o()};et("delete",()=>{s?i():m()},[e,s,l,u]);const y=b=>a(XU(!b.target.checked));return v.jsxs(v.Fragment,{children:[w.cloneElement(t,{onClick:e?h:void 0,ref:n}),v.jsx(zV,{isOpen:r,leastDestructiveRef:d,onClose:o,children:v.jsx(Jd,{children:v.jsxs(HV,{className:"modal",children:[v.jsx(E0,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),v.jsx(s0,{children:v.jsxs(je,{direction:"column",gap:5,children:[v.jsx(Yt,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),v.jsx(fn,{children:v.jsxs(je,{alignItems:"center",children:[v.jsx(En,{mb:0,children:"Don't ask me again"}),v.jsx(UE,{checked:!s,onChange:y})]})})]})}),v.jsxs(wx,{children:[v.jsx(ls,{ref:d,onClick:o,className:"modal-close-btn",children:"Cancel"}),v.jsx(ls,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})});iS.displayName="DeleteImageModal";const UEe=lt([or,Cp,Gy,xp,qx,Mr],(e,t,n,r,i,o)=>{const{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u}=e,{upscalingLevel:d,facetoolStrength:h}=n,{isLightboxOpen:m}=i,{shouldShowImageDetails:y}=r,{intermediateImage:b,currentImage:x}=t;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:d,facetoolStrength:h,shouldDisableToolbarButtons:Boolean(b)||!x,currentImage:x,shouldShowImageDetails:y,activeTabName:o,isLightboxOpen:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),Rq=()=>{var z,H,K,te,G,$;const e=Oe(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightboxOpen:d,activeTabName:h}=pe(UEe),m=Fy(),{t:y}=Ge(),b=()=>{u&&(d&&e(Vm(!1)),e(L0(u)),e(Yo("img2img")))},x=async()=>{if(!u)return;const W=await fetch(u.url).then(Z=>Z.blob()),X=[new ClipboardItem({[W.type]:W})];await navigator.clipboard.write(X),m({title:y("toast:imageCopied"),status:"success",duration:2500,isClosable:!0})},k=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:y("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};et("shift+i",()=>{u?(b(),m({title:y("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:imageNotLoaded"),description:y("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var W,X;u&&(u.metadata&&e(yU(u.metadata)),((W=u.metadata)==null?void 0:W.image.type)==="img2img"?e(Yo("img2img")):((X=u.metadata)==null?void 0:X.image.type)==="txt2img"&&e(Yo("txt2img")))};et("a",()=>{var W,X;["txt2img","img2img"].includes((X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)==null?void 0:X.type)?(E(),m({title:y("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:parametersNotSet"),description:y("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{u!=null&&u.metadata&&e(Hy(u.metadata.image.seed))};et("s",()=>{var W,X;(X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.seed?(_(),m({title:y("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:seedNotSet"),description:y("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const P=()=>{var W,X,Z,U;if((X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.prompt){const[Q,re]=hP((U=(Z=u==null?void 0:u.metadata)==null?void 0:Z.image)==null?void 0:U.prompt);Q&&e(Fx(Q)),e(iy(re||""))}};et("p",()=>{var W,X;(X=(W=u==null?void 0:u.metadata)==null?void 0:W.image)!=null&&X.prompt?(P(),m({title:y("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:promptNotSet"),description:y("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const A=()=>{u&&e(Z8e(u))};et("Shift+U",()=>{i&&!s&&n&&!t&&o?A():m({title:y("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const M=()=>{u&&e(Q8e(u))};et("Shift+R",()=>{r&&!s&&n&&!t&&a?M():m({title:y("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(tG(!l)),D=()=>{u&&(d&&e(Vm(!1)),e($x(u)),e(vi(!0)),h!=="unifiedCanvas"&&e(Yo("unifiedCanvas")),m({title:y("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};et("i",()=>{u?R():m({title:y("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const j=()=>{e(Vm(!d))};return v.jsxs("div",{className:"current-image-options",children:[v.jsxs(ao,{isAttached:!0,children:[v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":`${y("parameters:sendTo")}...`,icon:v.jsx(BEe,{})}),children:v.jsxs("div",{className:"current-image-send-to-popover",children:[v.jsx(nr,{size:"sm",onClick:b,leftIcon:v.jsx(_D,{}),children:y("parameters:sendToImg2Img")}),v.jsx(nr,{size:"sm",onClick:D,leftIcon:v.jsx(_D,{}),children:y("parameters:sendToUnifiedCanvas")}),v.jsx(nr,{size:"sm",onClick:x,leftIcon:v.jsx(c0,{}),children:y("parameters:copyImage")}),v.jsx(nr,{size:"sm",onClick:k,leftIcon:v.jsx(c0,{}),children:y("parameters:copyImageToLink")}),v.jsx(Fh,{download:!0,href:u==null?void 0:u.url,children:v.jsx(nr,{leftIcon:v.jsx(DP,{}),size:"sm",w:"100%",children:y("parameters:downloadImage")})})]})}),v.jsx(Je,{icon:v.jsx(CEe,{}),tooltip:d?`${y("parameters:closeViewer")} (Z)`:`${y("parameters:openInViewer")} (Z)`,"aria-label":d?`${y("parameters:closeViewer")} (Z)`:`${y("parameters:openInViewer")} (Z)`,"data-selected":d,onClick:j})]}),v.jsxs(ao,{isAttached:!0,children:[v.jsx(Je,{icon:v.jsx(REe,{}),tooltip:`${y("parameters:usePrompt")} (P)`,"aria-label":`${y("parameters:usePrompt")} (P)`,isDisabled:!((H=(z=u==null?void 0:u.metadata)==null?void 0:z.image)!=null&&H.prompt),onClick:P}),v.jsx(Je,{icon:v.jsx(jEe,{}),tooltip:`${y("parameters:useSeed")} (S)`,"aria-label":`${y("parameters:useSeed")} (S)`,isDisabled:!((te=(K=u==null?void 0:u.metadata)==null?void 0:K.image)!=null&&te.seed),onClick:_}),v.jsx(Je,{icon:v.jsx(bEe,{}),tooltip:`${y("parameters:useAll")} (A)`,"aria-label":`${y("parameters:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes(($=(G=u==null?void 0:u.metadata)==null?void 0:G.image)==null?void 0:$.type),onClick:E})]}),v.jsxs(ao,{isAttached:!0,children:[v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{icon:v.jsx(EEe,{}),"aria-label":y("parameters:restoreFaces")}),children:v.jsxs("div",{className:"current-image-postprocessing-popover",children:[v.jsx(LP,{}),v.jsx(nr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:M,children:y("parameters:restoreFaces")})]})}),v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{icon:v.jsx(wEe,{}),"aria-label":y("parameters:upscale")}),children:v.jsxs("div",{className:"current-image-postprocessing-popover",children:[v.jsx(AP,{}),v.jsx(nr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:A,children:y("parameters:upscaleImage")})]})})]}),v.jsx(ao,{isAttached:!0,children:v.jsx(Je,{icon:v.jsx(Eq,{}),tooltip:`${y("parameters:info")} (I)`,"aria-label":`${y("parameters:info")} (I)`,"data-selected":l,onClick:R})}),v.jsx(iS,{image:u,children:v.jsx(Je,{icon:v.jsx(wp,{}),tooltip:`${y("parameters:deleteImage")} (Del)`,"aria-label":`${y("parameters:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};yt({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});yt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});yt({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});yt({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});yt({displayName:"SunIcon",path:N.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},N.createElement("circle",{cx:"12",cy:"12",r:"5"}),N.createElement("path",{d:"M12 1v2"}),N.createElement("path",{d:"M12 21v2"}),N.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),N.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),N.createElement("path",{d:"M1 12h2"}),N.createElement("path",{d:"M21 12h2"}),N.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),N.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))});yt({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});yt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:N.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});yt({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});yt({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});yt({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});yt({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});yt({displayName:"ViewIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),N.createElement("circle",{cx:"12",cy:"12",r:"2"}))});yt({displayName:"ViewOffIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),N.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))});yt({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});var GEe=yt({displayName:"DeleteIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"}))});yt({displayName:"RepeatIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),N.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))});yt({displayName:"RepeatClockIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),N.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))});var qEe=yt({displayName:"EditIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),N.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});yt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});yt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});yt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});yt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});yt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});yt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});yt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});yt({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});yt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var Dq=yt({displayName:"ExternalLinkIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),N.createElement("path",{d:"M15 3h6v6"}),N.createElement("path",{d:"M10 14L21 3"}))});yt({displayName:"LinkIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),N.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))});yt({displayName:"PlusSquareIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),N.createElement("path",{d:"M12 8v8"}),N.createElement("path",{d:"M8 12h8"}))});yt({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});yt({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});yt({displayName:"TimeIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),N.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))});yt({displayName:"ArrowRightIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),N.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))});yt({displayName:"ArrowLeftIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),N.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))});yt({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});yt({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});yt({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});yt({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});yt({displayName:"EmailIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),N.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))});yt({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});yt({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});yt({displayName:"SpinnerIcon",path:N.createElement(N.Fragment,null,N.createElement("defs",null,N.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},N.createElement("stop",{stopColor:"currentColor",offset:"0%"}),N.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),N.createElement("g",{transform:"translate(2)",fill:"none"},N.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),N.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),N.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))});yt({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});yt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:N.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});yt({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});yt({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});yt({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});yt({displayName:"InfoOutlineIcon",path:N.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},N.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),N.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),N.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))});yt({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});yt({displayName:"QuestionOutlineIcon",path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))});yt({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});yt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});yt({viewBox:"0 0 14 14",path:N.createElement("g",{fill:"currentColor"},N.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))});yt({displayName:"MinusIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))});yt({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function YEe(e){return mt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Qn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>v.jsxs(je,{gap:2,children:[n&&v.jsx(yi,{label:`Recall ${e}`,children:v.jsx(us,{"aria-label":"Use this parameter",icon:v.jsx(YEe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&v.jsx(yi,{label:`Copy ${e}`,children:v.jsx(us,{"aria-label":`Copy ${e}`,icon:v.jsx(c0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),v.jsxs(je,{direction:i?"column":"row",children:[v.jsxs(Yt,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?v.jsxs(Fh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",v.jsx(Dq,{mx:"2px"})]}):v.jsx(Yt,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),KEe=(e,t)=>e.image.uuid===t.image.uuid,$P=w.memo(({image:e,styleClass:t})=>{var H,K;const n=Oe();et("esc",()=>{n(tG(!1))});const r=((H=e==null?void 0:e.metadata)==null?void 0:H.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:d,orig_path:h,perlin:m,postprocessing:y,prompt:b,sampler:x,seamless:k,seed:E,steps:_,strength:P,denoise_str:A,threshold:M,type:R,variations:D,width:j}=r,z=JSON.stringify(e.metadata,null,2);return v.jsx("div",{className:`image-metadata-viewer ${t}`,children:v.jsxs(je,{gap:1,direction:"column",width:"100%",children:[v.jsxs(je,{gap:2,children:[v.jsx(Yt,{fontWeight:"semibold",children:"File:"}),v.jsxs(Fh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,v.jsx(Dq,{mx:"2px"})]})]}),Object.keys(r).length>0?v.jsxs(v.Fragment,{children:[R&&v.jsx(Qn,{label:"Generation type",value:R}),((K=e.metadata)==null?void 0:K.model_weights)&&v.jsx(Qn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(R)&&v.jsx(Qn,{label:"Original image",value:h}),b&&v.jsx(Qn,{label:"Prompt",labelPosition:"top",value:c2(b),onClick:()=>n(Fx(b))}),E!==void 0&&v.jsx(Qn,{label:"Seed",value:E,onClick:()=>n(Hy(E))}),M!==void 0&&v.jsx(Qn,{label:"Noise Threshold",value:M,onClick:()=>n(LU(M))}),m!==void 0&&v.jsx(Qn,{label:"Perlin Noise",value:m,onClick:()=>n(CU(m))}),x&&v.jsx(Qn,{label:"Sampler",value:x,onClick:()=>n(_U(x))}),_&&v.jsx(Qn,{label:"Steps",value:_,onClick:()=>n(TU(_))}),o!==void 0&&v.jsx(Qn,{label:"CFG scale",value:o,onClick:()=>n(bU(o))}),D&&D.length>0&&v.jsx(Qn,{label:"Seed-weight pairs",value:Q5(D),onClick:()=>n(EU(Q5(D)))}),k&&v.jsx(Qn,{label:"Seamless",value:k,onClick:()=>n(kU(k))}),l&&v.jsx(Qn,{label:"High Resolution Optimization",value:l,onClick:()=>n(gP(l))}),j&&v.jsx(Qn,{label:"Width",value:j,onClick:()=>n(AU(j))}),s&&v.jsx(Qn,{label:"Height",value:s,onClick:()=>n(SU(s))}),u&&v.jsx(Qn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(L0(u))}),d&&v.jsx(Qn,{label:"Mask image",value:d,isLink:!0,onClick:()=>n(wU(d))}),R==="img2img"&&P&&v.jsx(Qn,{label:"Image to image strength",value:P,onClick:()=>n(p8(P))}),a&&v.jsx(Qn,{label:"Image to image fit",value:a,onClick:()=>n(PU(a))}),y&&y.length>0&&v.jsxs(v.Fragment,{children:[v.jsx($h,{size:"sm",children:"Postprocessing"}),y.map((te,G)=>{if(te.type==="esrgan"){const{scale:$,strength:W,denoise_str:X}=te;return v.jsxs(je,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(Yt,{size:"md",children:`${G+1}: Upscale (ESRGAN)`}),v.jsx(Qn,{label:"Scale",value:$,onClick:()=>n(RU($))}),v.jsx(Qn,{label:"Strength",value:W,onClick:()=>n(v8(W))}),X!==void 0&&v.jsx(Qn,{label:"Denoising strength",value:X,onClick:()=>n(m8(X))})]},G)}else if(te.type==="gfpgan"){const{strength:$}=te;return v.jsxs(je,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(Yt,{size:"md",children:`${G+1}: Face restoration (GFPGAN)`}),v.jsx(Qn,{label:"Strength",value:$,onClick:()=>{n(g8($)),n(B4("gfpgan"))}})]},G)}else if(te.type==="codeformer"){const{strength:$,fidelity:W}=te;return v.jsxs(je,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(Yt,{size:"md",children:`${G+1}: Face restoration (Codeformer)`}),v.jsx(Qn,{label:"Strength",value:$,onClick:()=>{n(g8($)),n(B4("codeformer"))}}),W&&v.jsx(Qn,{label:"Fidelity",value:W,onClick:()=>{n(IU(W)),n(B4("codeformer"))}})]},G)}})]}),i&&v.jsx(Qn,{withCopy:!0,label:"Dream Prompt",value:i}),v.jsxs(je,{gap:2,direction:"column",children:[v.jsxs(je,{gap:2,children:[v.jsx(yi,{label:"Copy metadata JSON",children:v.jsx(us,{"aria-label":"Copy metadata JSON",icon:v.jsx(c0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),v.jsx(Yt,{fontWeight:"semibold",children:"Metadata JSON:"})]}),v.jsx("div",{className:"image-json-viewer",children:v.jsx("pre",{children:z})})]})]}):v.jsx(bF,{width:"100%",pt:10,children:v.jsx(Yt,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},KEe);$P.displayName="ImageMetadataViewer";const Nq=lt([Cp,xp],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var d;return u.uuid===((d=e==null?void 0:e.currentImage)==null?void 0:d.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function XEe(){const e=Oe(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=pe(Nq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(fP())},h=()=>{e(dP())};return v.jsxs("div",{className:"current-image-preview",children:[i&&v.jsx(JS,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&v.jsxs("div",{className:"current-image-next-prev-buttons",children:[v.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&v.jsx(us,{"aria-label":"Previous image",icon:v.jsx(Cq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),v.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&v.jsx(us,{"aria-label":"Next image",icon:v.jsx(_q,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),r&&i&&v.jsx($P,{image:i,styleClass:"current-image-metadata"})]})}var ZEe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=globalThis&&globalThis.__assign||function(){return ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},iPe=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],LD="__resizable_base__",jq=function(e){ePe(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(LD):o.className+=LD,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;o&&o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||tPe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),d=u/l[s]*100;return d+"%"}return FC(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?FC(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?FC(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&zg("left",o),s=i&&zg("top",o),l,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=a?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,h=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,y=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,x=u||0;if(s){var k=(m-b)*this.ratio+x,E=(y-b)*this.ratio+x,_=(d-x)/this.ratio+b,P=(h-x)/this.ratio+b,A=Math.max(d,k),M=Math.min(h,E),R=Math.max(m,_),D=Math.min(y,P);n=Kb(n,A,M),r=Kb(r,R,D)}else n=Kb(n,d,h),r=Kb(r,m,y);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&nPe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Xb(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Bl(Bl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(h)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Xb(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Xb(n)?n.touches[0].clientX:n.clientX,d=Xb(n)?n.touches[0].clientY:n.clientY,h=this.state,m=h.direction,y=h.original,b=h.width,x=h.height,k=this.getParentSize(),E=rPe(k,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=E.maxWidth,a=E.maxHeight,s=E.minWidth,l=E.minHeight;var _=this.calculateNewSizeFromDirection(u,d),P=_.newHeight,A=_.newWidth,M=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=TD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(P=TD(P,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(A,P,{width:M.maxWidth,height:M.maxHeight},{width:s,height:l});if(A=R.newWidth,P=R.newHeight,this.props.grid){var D=PD(A,this.props.grid[0]),j=PD(P,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,P=z===0||Math.abs(j-P)<=z?j:P}var H={width:A-y.width,height:P-y.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var K=A/k.width*100;A=K+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var G=A/this.window.innerHeight*100;A=G+"vh"}}if(x&&typeof x=="string"){if(x.endsWith("%")){var K=P/k.height*100;P=K+"%"}else if(x.endsWith("vw")){var te=P/this.window.innerWidth*100;P=te+"vw"}else if(x.endsWith("vh")){var G=P/this.window.innerHeight*100;P=G+"vh"}}var $={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(P,"height")};this.flexDir==="row"?$.flexBasis=$.width:this.flexDir==="column"&&($.flexBasis=$.height),el.flushSync(function(){r.setState($)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,H)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Bl(Bl({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(h){return i[h]!==!1?w.createElement(JEe,{key:h,direction:h,onResizeStart:n.onResizeStart,replaceStyles:o&&o[h],className:a&&a[h]},u&&u[h]?u[h]:null):null});return w.createElement("div",{className:l,style:s},d)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return iPe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Bl(Bl(Bl({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return w.createElement(o,Bl({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&w.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(w.PureComponent);const er=e=>{const{label:t,styleClass:n,...r}=e;return v.jsx(lF,{className:`invokeai__checkbox ${n}`,...r,children:t})};function Bq(e){return mt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function $q(e){return mt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function oPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function aPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function sPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function lPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function Fq(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function uPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function cPe(e){return mt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function dPe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function fPe(e,t){e.classList?e.classList.add(t):dPe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function AD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function hPe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=AD(e.className,t):e.setAttribute("class",AD(e.className&&e.className.baseVal||"",t))}const OD={disabled:!1},zq=N.createContext(null);var Hq=function(t){return t.scrollTop},Bv="unmounted",yh="exited",bh="entering",qg="entered",H8="exiting",vc=function(e){_E(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=yh,o.appearStatus=bh):l=qg:r.unmountOnExit||r.mountOnEnter?l=Bv:l=yh,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Bv?{status:yh}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==bh&&a!==qg&&(o=bh):(a===bh||a===qg)&&(o=H8)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===bh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Cb.findDOMNode(this);a&&Hq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===yh&&this.setState({status:Bv})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Cb.findDOMNode(this),s],u=l[0],d=l[1],h=this.getTimeouts(),m=s?h.appear:h.enter;if(!i&&!a||OD.disabled){this.safeSetState({status:qg},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:bh},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:qg},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Cb.findDOMNode(this);if(!o||OD.disabled){this.safeSetState({status:yh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:H8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:yh},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Cb.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Bv)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=xE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return N.createElement(zq.Provider,{value:null},typeof a=="function"?a(i,s):N.cloneElement(N.Children.only(a),s))},t}(N.Component);vc.contextType=zq;vc.propTypes={};function Hg(){}vc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Hg,onEntering:Hg,onEntered:Hg,onExit:Hg,onExiting:Hg,onExited:Hg};vc.UNMOUNTED=Bv;vc.EXITED=yh;vc.ENTERING=bh;vc.ENTERED=qg;vc.EXITING=H8;const pPe=vc;var gPe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return fPe(t,r)})},zC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return hPe(t,r)})},FP=function(e){_E(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ab,Object.values(b));return w.createElement(x.Provider,{value:k},y)}function d(h,m){const y=(m==null?void 0:m[e][l])||s,b=w.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const i=()=>{const o=n.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,mPe(i,...t)]}function mPe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...s,...h}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function vPe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Wq(...e){return t=>e.forEach(n=>vPe(n,t))}function ps(...e){return w.useCallback(Wq(...e),e)}const dy=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),o=i.find(bPe);if(o){const a=o.props.children,s=i.map(l=>l===o?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return w.createElement(V8,bn({},r,{ref:t}),w.isValidElement(a)?w.cloneElement(a,void 0,s):null)}return w.createElement(V8,bn({},r,{ref:t}),n)});dy.displayName="Slot";const V8=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...SPe(r,n.props),ref:Wq(t,n.ref)}):w.Children.count(n)>1?w.Children.only(null):null});V8.displayName="SlotClone";const yPe=({children:e})=>w.createElement(w.Fragment,null,e);function bPe(e){return w.isValidElement(e)&&e.type===yPe}function SPe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const xPe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],lc=xPe.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?dy:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(s,bn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Uq(e,t){e&&el.flushSync(()=>e.dispatchEvent(t))}function Gq(e){const t=e+"CollectionProvider",[n,r]=Yy(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:b,children:x}=y,k=N.useRef(null),E=N.useRef(new Map).current;return N.createElement(i,{scope:b,itemMap:E,collectionRef:k},x)},s=e+"CollectionSlot",l=N.forwardRef((y,b)=>{const{scope:x,children:k}=y,E=o(s,x),_=ps(b,E.collectionRef);return N.createElement(dy,{ref:_},k)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=N.forwardRef((y,b)=>{const{scope:x,children:k,...E}=y,_=N.useRef(null),P=ps(b,_),A=o(u,x);return N.useEffect(()=>(A.itemMap.set(_,{ref:_,...E}),()=>void A.itemMap.delete(_))),N.createElement(dy,{[d]:"",ref:P},k)});function m(y){const b=o(e+"CollectionConsumer",y);return N.useCallback(()=>{const k=b.collectionRef.current;if(!k)return[];const E=Array.from(k.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((A,M)=>E.indexOf(A.ref.current)-E.indexOf(M.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:h},m,r]}const wPe=w.createContext(void 0);function qq(e){const t=w.useContext(wPe);return e||t||"ltr"}function du(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function CPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const W8="dismissableLayer.update",_Pe="dismissableLayer.pointerDownOutside",kPe="dismissableLayer.focusOutside";let MD;const EPe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),PPe=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=w.useContext(EPe),[h,m]=w.useState(null),y=(n=h==null?void 0:h.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=w.useState({}),x=ps(t,j=>m(j)),k=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=k.indexOf(E),P=h?k.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,M=P>=_,R=TPe(j=>{const z=j.target,H=[...d.branches].some(K=>K.contains(z));!M||H||(o==null||o(j),s==null||s(j),j.defaultPrevented||l==null||l())},y),D=LPe(j=>{const z=j.target;[...d.branches].some(K=>K.contains(z))||(a==null||a(j),s==null||s(j),j.defaultPrevented||l==null||l())},y);return CPe(j=>{P===d.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},y),w.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(MD=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),ID(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=MD)}},[h,y,r,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),ID())},[h,d]),w.useEffect(()=>{const j=()=>b({});return document.addEventListener(W8,j),()=>document.removeEventListener(W8,j)},[]),w.createElement(lc.div,bn({},u,{ref:x,style:{pointerEvents:A?M?"auto":"none":void 0,...e.style},onFocusCapture:ir(e.onFocusCapture,D.onFocusCapture),onBlurCapture:ir(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:ir(e.onPointerDownCapture,R.onPointerDownCapture)}))});function TPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){Yq(_Pe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function LPe(e,t=globalThis==null?void 0:globalThis.document){const n=du(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&Yq(kPe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ID(){const e=new CustomEvent(W8);document.dispatchEvent(e)}function Yq(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Uq(i,o):i.dispatchEvent(o)}let HC=0;function APe(){w.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:RD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:RD()),HC++,()=>{HC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),HC--}},[])}function RD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const VC="focusScope.autoFocusOnMount",WC="focusScope.autoFocusOnUnmount",DD={bubbles:!1,cancelable:!0},OPe=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=w.useState(null),u=du(i),d=du(o),h=w.useRef(null),m=ps(t,x=>l(x)),y=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let x=function(E){if(y.paused||!s)return;const _=E.target;s.contains(_)?h.current=_:Sh(h.current,{select:!0})},k=function(E){y.paused||!s||s.contains(E.relatedTarget)||Sh(h.current,{select:!0})};return document.addEventListener("focusin",x),document.addEventListener("focusout",k),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",k)}}},[r,s,y.paused]),w.useEffect(()=>{if(s){jD.add(y);const x=document.activeElement;if(!s.contains(x)){const E=new CustomEvent(VC,DD);s.addEventListener(VC,u),s.dispatchEvent(E),E.defaultPrevented||(MPe(jPe(Kq(s)),{select:!0}),document.activeElement===x&&Sh(s))}return()=>{s.removeEventListener(VC,u),setTimeout(()=>{const E=new CustomEvent(WC,DD);s.addEventListener(WC,d),s.dispatchEvent(E),E.defaultPrevented||Sh(x??document.body,{select:!0}),s.removeEventListener(WC,d),jD.remove(y)},0)}}},[s,u,d,y]);const b=w.useCallback(x=>{if(!n&&!r||y.paused)return;const k=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,E=document.activeElement;if(k&&E){const _=x.currentTarget,[P,A]=IPe(_);P&&A?!x.shiftKey&&E===A?(x.preventDefault(),n&&Sh(P,{select:!0})):x.shiftKey&&E===P&&(x.preventDefault(),n&&Sh(A,{select:!0})):E===_&&x.preventDefault()}},[n,r,y.paused]);return w.createElement(lc.div,bn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function MPe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Sh(r,{select:t}),document.activeElement!==n)return}function IPe(e){const t=Kq(e),n=ND(t,e),r=ND(t.reverse(),e);return[n,r]}function Kq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ND(e,t){for(const n of e)if(!RPe(n,{upTo:t}))return n}function RPe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function DPe(e){return e instanceof HTMLInputElement&&"select"in e}function Sh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&DPe(e)&&t&&e.select()}}const jD=NPe();function NPe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=BD(e,t),e.unshift(t)},remove(t){var n;e=BD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function BD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jPe(e){return e.filter(t=>t.tagName!=="A")}const d0=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:()=>{},BPe=n7["useId".toString()]||(()=>{});let $Pe=0;function FPe(e){const[t,n]=w.useState(BPe());return d0(()=>{e||n(r=>r??String($Pe++))},[e]),e||(t?`radix-${t}`:"")}function R0(e){return e.split("-")[0]}function nw(e){return e.split("-")[1]}function D0(e){return["top","bottom"].includes(R0(e))?"x":"y"}function zP(e){return e==="y"?"height":"width"}function $D(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=D0(t),l=zP(s),u=r[l]/2-i[l]/2,d=s==="x";let h;switch(R0(t)){case"top":h={x:o,y:r.y-i.height};break;case"bottom":h={x:o,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:a};break;case"left":h={x:r.x-i.width,y:a};break;default:h={x:r.x,y:r.y}}switch(nw(t)){case"start":h[s]-=u*(n&&d?-1:1);break;case"end":h[s]+=u*(n&&d?-1:1)}return h}const zPe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=$D(l,r,s),h=r,m={},y=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=Xq(r),d={x:i,y:o},h=D0(a),m=nw(a),y=zP(h),b=await l.getDimensions(n),x=h==="y"?"top":"left",k=h==="y"?"bottom":"right",E=s.reference[y]+s.reference[h]-d[h]-s.floating[y],_=d[h]-s.reference[h],P=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=P?h==="y"?P.clientHeight||0:P.clientWidth||0:0;A===0&&(A=s.floating[y]);const M=E/2-_/2,R=u[x],D=A-b[y]-u[k],j=A/2-b[y]/2+M,z=U8(R,j,D),H=(m==="start"?u[x]:u[k])>0&&j!==z&&s.reference[y]<=s.floating[y];return{[h]:d[h]-(H?jWPe[t])}function UPe(e,t,n){n===void 0&&(n=!1);const r=nw(e),i=D0(e),o=zP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=sS(a)),{main:a,cross:sS(a)}}const GPe={start:"end",end:"start"};function zD(e){return e.replace(/start|end/g,t=>GPe[t])}const Zq=["top","right","bottom","left"];Zq.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const qPe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",flipAlignment:y=!0,...b}=e,x=R0(r),k=h||(x===a||!y?[sS(a)]:function(j){const z=sS(j);return[zD(j),z,zD(z)]}(a)),E=[a,...k],_=await aS(t,b),P=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&P.push(_[x]),d){const{main:j,cross:z}=UPe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));P.push(_[j],_[z])}if(A=[...A,{placement:r,overflows:P}],!P.every(j=>j<=0)){var M,R;const j=((M=(R=i.flip)==null?void 0:R.index)!=null?M:0)+1,z=E[j];if(z)return{data:{index:j,overflows:A},reset:{placement:z}};let H="bottom";switch(m){case"bestFit":{var D;const K=(D=A.map(te=>[te,te.overflows.filter(G=>G>0).reduce((G,$)=>G+$,0)]).sort((te,G)=>te[1]-G[1])[0])==null?void 0:D[0].placement;K&&(H=K);break}case"initialPlacement":H=a}if(r!==H)return{reset:{placement:H}}}return{}}}};function HD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function VD(e){return Zq.some(t=>e[t]>=0)}const YPe=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=HD(await aS(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:VD(o)}}}case"escaped":{const o=HD(await aS(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:o,escaped:VD(o)}}}default:return{}}}}},KPe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),h=R0(s),m=nw(s),y=D0(s)==="x",b=["left","top"].includes(h)?-1:1,x=d&&y?-1:1,k=typeof a=="function"?a(o):a;let{mainAxis:E,crossAxis:_,alignmentAxis:P}=typeof k=="number"?{mainAxis:k,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...k};return m&&typeof P=="number"&&(_=m==="end"?-1*P:P),y?{x:_*x,y:E*b}:{x:E*b,y:_*x}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function Qq(e){return e==="x"?"y":"x"}const XPe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:k=>{let{x:E,y:_}=k;return{x:E,y:_}}},...l}=e,u={x:n,y:r},d=await aS(t,l),h=D0(R0(i)),m=Qq(h);let y=u[h],b=u[m];if(o){const k=h==="y"?"bottom":"right";y=U8(y+d[h==="y"?"top":"left"],y,y-d[k])}if(a){const k=m==="y"?"bottom":"right";b=U8(b+d[m==="y"?"top":"left"],b,b-d[k])}const x=s.fn({...t,[h]:y,[m]:b});return{...x,data:{x:x.x-n,y:x.y-r}}}}},ZPe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,d={x:n,y:r},h=D0(i),m=Qq(h);let y=d[h],b=d[m];const x=typeof s=="function"?s({...o,placement:i}):s,k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const M=h==="y"?"height":"width",R=o.reference[h]-o.floating[M]+k.mainAxis,D=o.reference[h]+o.reference[M]-k.mainAxis;yD&&(y=D)}if(u){var E,_,P,A;const M=h==="y"?"width":"height",R=["top","left"].includes(R0(i)),D=o.reference[m]-o.floating[M]+(R&&(E=(_=a.offset)==null?void 0:_[m])!=null?E:0)+(R?0:k.crossAxis),j=o.reference[m]+o.reference[M]+(R?0:(P=(A=a.offset)==null?void 0:A[m])!=null?P:0)-(R?k.crossAxis:0);bj&&(b=j)}return{[h]:y,[m]:b}}}};function Jq(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function yc(e){if(e==null)return window;if(!Jq(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ky(e){return yc(e).getComputedStyle(e)}function Qu(e){return Jq(e)?"":e?(e.nodeName||"").toLowerCase():""}function eY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function fu(e){return e instanceof yc(e).HTMLElement}function rf(e){return e instanceof yc(e).Element}function HP(e){return typeof ShadowRoot>"u"?!1:e instanceof yc(e).ShadowRoot||e instanceof ShadowRoot}function rw(e){const{overflow:t,overflowX:n,overflowY:r}=Ky(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function QPe(e){return["table","td","th"].includes(Qu(e))}function WD(e){const t=/firefox/i.test(eY()),n=Ky(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function tY(){return!/^((?!chrome|android).)*safari/i.test(eY())}const UD=Math.min,m2=Math.max,lS=Math.round;function Ju(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&fu(e)&&(l=e.offsetWidth>0&&lS(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&lS(s.height)/e.offsetHeight||1);const d=rf(e)?yc(e):window,h=!tY()&&n,m=(s.left+(h&&(r=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,y=(s.top+(h&&(o=(a=d.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,x=s.height/u;return{width:b,height:x,top:y,right:m+b,bottom:y+x,left:m,x:m,y}}function Ud(e){return(t=e,(t instanceof yc(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function iw(e){return rf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function nY(e){return Ju(Ud(e)).left+iw(e).scrollLeft}function JPe(e,t,n){const r=fu(t),i=Ud(t),o=Ju(e,r&&function(l){const u=Ju(l);return lS(u.width)!==l.offsetWidth||lS(u.height)!==l.offsetHeight}(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Qu(t)!=="body"||rw(i))&&(a=iw(t)),fu(t)){const l=Ju(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=nY(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function rY(e){return Qu(e)==="html"?e:e.assignedSlot||e.parentNode||(HP(e)?e.host:null)||Ud(e)}function GD(e){return fu(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function G8(e){const t=yc(e);let n=GD(e);for(;n&&QPe(n)&&getComputedStyle(n).position==="static";)n=GD(n);return n&&(Qu(n)==="html"||Qu(n)==="body"&&getComputedStyle(n).position==="static"&&!WD(n))?t:n||function(r){let i=rY(r);for(HP(i)&&(i=i.host);fu(i)&&!["html","body"].includes(Qu(i));){if(WD(i))return i;i=i.parentNode}return null}(e)||t}function qD(e){if(fu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ju(e);return{width:t.width,height:t.height}}function iY(e){const t=rY(e);return["html","body","#document"].includes(Qu(t))?e.ownerDocument.body:fu(t)&&rw(t)?t:iY(t)}function uS(e,t){var n;t===void 0&&(t=[]);const r=iY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=yc(r),a=i?[o].concat(o.visualViewport||[],rw(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(uS(a))}function YD(e,t,n){return t==="viewport"?oS(function(r,i){const o=yc(r),a=Ud(r),s=o.visualViewport;let l=a.clientWidth,u=a.clientHeight,d=0,h=0;if(s){l=s.width,u=s.height;const m=tY();(m||!m&&i==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}return{width:l,height:u,x:d,y:h}}(e,n)):rf(t)?function(r,i){const o=Ju(r,!1,i==="fixed"),a=o.top+r.clientTop,s=o.left+r.clientLeft;return{top:a,left:s,x:s,y:a,right:s+r.clientWidth,bottom:a+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):oS(function(r){var i;const o=Ud(r),a=iw(r),s=(i=r.ownerDocument)==null?void 0:i.body,l=m2(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=m2(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let d=-a.scrollLeft+nY(r);const h=-a.scrollTop;return Ky(s||o).direction==="rtl"&&(d+=m2(o.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:d,y:h}}(Ud(e)))}function eTe(e){const t=uS(e),n=["absolute","fixed"].includes(Ky(e).position)&&fu(e)?G8(e):e;return rf(n)?t.filter(r=>rf(r)&&function(i,o){const a=o.getRootNode==null?void 0:o.getRootNode();if(i.contains(o))return!0;if(a&&HP(a)){let s=o;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Qu(r)!=="body"):[]}const tTe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?eTe(t):[].concat(n),r],a=o[0],s=o.reduce((l,u)=>{const d=YD(t,u,i);return l.top=m2(d.top,l.top),l.right=UD(d.right,l.right),l.bottom=UD(d.bottom,l.bottom),l.left=m2(d.left,l.left),l},YD(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=fu(n),o=Ud(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Qu(n)!=="body"||rw(o))&&(a=iw(n)),fu(n))){const l=Ju(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:rf,getDimensions:qD,getOffsetParent:G8,getDocumentElement:Ud,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:JPe(t,G8(n),r),floating:{...qD(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Ky(e).direction==="rtl"};function nTe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,d=l||u?[...rf(e)?uS(e):[],...uS(t)]:[];d.forEach(b=>{l&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});let h,m=null;if(a){let b=!0;m=new ResizeObserver(()=>{b||n(),b=!1}),rf(e)&&!s&&m.observe(e),m.observe(t)}let y=s?Ju(e):null;return s&&function b(){const x=Ju(e);!y||x.x===y.x&&x.y===y.y&&x.width===y.width&&x.height===y.height||n(),y=x,h=requestAnimationFrame(b)}(),n(),()=>{var b;d.forEach(x=>{l&&x.removeEventListener("scroll",n),u&&x.removeEventListener("resize",n)}),(b=m)==null||b.disconnect(),m=null,s&&cancelAnimationFrame(h)}}const rTe=(e,t,n)=>zPe(e,t,{platform:tTe,...n});var q8=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Y8(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Y8(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Y8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function iTe(e){const t=w.useRef(e);return q8(()=>{t.current=e}),t}function oTe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=w.useRef(null),a=w.useRef(null),s=iTe(i),l=w.useRef(null),[u,d]=w.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,m]=w.useState(t);Y8(h==null?void 0:h.map(P=>{let{options:A}=P;return A}),t==null?void 0:t.map(P=>{let{options:A}=P;return A}))||m(t);const y=w.useCallback(()=>{!o.current||!a.current||rTe(o.current,a.current,{middleware:h,placement:n,strategy:r}).then(P=>{b.current&&el.flushSync(()=>{d(P)})})},[h,n,r]);q8(()=>{b.current&&y()},[y]);const b=w.useRef(!1);q8(()=>(b.current=!0,()=>{b.current=!1}),[]);const x=w.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const P=s.current(o.current,a.current,y);l.current=P}else y()},[y,s]),k=w.useCallback(P=>{o.current=P,x()},[x]),E=w.useCallback(P=>{a.current=P,x()},[x]),_=w.useMemo(()=>({reference:o,floating:a}),[]);return w.useMemo(()=>({...u,update:y,refs:_,reference:k,floating:E}),[u,y,_,k,E])}const aTe=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?FD({element:t.current,padding:n}).fn(i):{}:t?FD({element:t,padding:n}).fn(i):{}}}};function sTe(e){const[t,n]=w.useState(void 0);return d0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const oY="Popper",[VP,aY]=Yy(oY),[lTe,sY]=VP(oY),uTe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return w.createElement(lTe,{scope:t,anchor:r,onAnchorChange:i},n)},cTe="PopperAnchor",dTe=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=sY(cTe,n),a=w.useRef(null),s=ps(t,a);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:w.createElement(lc.div,bn({},i,{ref:s}))}),cS="PopperContent",[fTe,Hze]=VP(cS),[hTe,pTe]=VP(cS,{hasParent:!1,positionUpdateFns:new Set}),gTe=w.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:d,side:h="bottom",sideOffset:m=0,align:y="center",alignOffset:b=0,arrowPadding:x=0,collisionBoundary:k=[],collisionPadding:E=0,sticky:_="partial",hideWhenDetached:P=!1,avoidCollisions:A=!0,...M}=e,R=sY(cS,d),[D,j]=w.useState(null),z=ps(t,ae=>j(ae)),[H,K]=w.useState(null),te=sTe(H),G=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,$=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,W=h+(y!=="center"?"-"+y:""),X=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},Z=Array.isArray(k)?k:[k],U=Z.length>0,Q={padding:X,boundary:Z.filter(vTe),altBoundary:U},{reference:re,floating:he,strategy:Ee,x:Ce,y:de,placement:ze,middlewareData:Me,update:rt}=oTe({strategy:"fixed",placement:W,whileElementsMounted:nTe,middleware:[KPe({mainAxis:m+$,alignmentAxis:b}),A?XPe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?ZPe():void 0,...Q}):void 0,H?aTe({element:H,padding:x}):void 0,A?qPe({...Q}):void 0,yTe({arrowWidth:G,arrowHeight:$}),P?YPe({strategy:"referenceHidden"}):void 0].filter(mTe)});d0(()=>{re(R.anchor)},[re,R.anchor]);const We=Ce!==null&&de!==null,[Be,wt]=lY(ze),$e=(i=Me.arrow)===null||i===void 0?void 0:i.x,at=(o=Me.arrow)===null||o===void 0?void 0:o.y,bt=((a=Me.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Le,ut]=w.useState();d0(()=>{D&&ut(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Mt,positionUpdateFns:ct}=pTe(cS,d),_t=!Mt;w.useLayoutEffect(()=>{if(!_t)return ct.add(rt),()=>{ct.delete(rt)}},[_t,ct,rt]),w.useLayoutEffect(()=>{_t&&We&&Array.from(ct).reverse().forEach(ae=>requestAnimationFrame(ae))},[_t,We,ct]);const un={"data-side":Be,"data-align":wt,...M,ref:z,style:{...M.style,animation:We?void 0:"none",opacity:(s=Me.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return w.createElement("div",{ref:he,"data-radix-popper-content-wrapper":"",style:{position:Ee,left:0,top:0,transform:We?`translate3d(${Math.round(Ce)}px, ${Math.round(de)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Le,["--radix-popper-transform-origin"]:[(l=Me.transformOrigin)===null||l===void 0?void 0:l.x,(u=Me.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},w.createElement(fTe,{scope:d,placedSide:Be,onArrowChange:K,arrowX:$e,arrowY:at,shouldHideArrow:bt},_t?w.createElement(hTe,{scope:d,hasParent:!0,positionUpdateFns:ct},w.createElement(lc.div,un)):w.createElement(lc.div,un)))});function mTe(e){return e!==void 0}function vTe(e){return e!==null}const yTe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,h=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=h?0:e.arrowWidth,y=h?0:e.arrowHeight,[b,x]=lY(s),k={start:"0%",center:"50%",end:"100%"}[x],E=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+y/2;let P="",A="";return b==="bottom"?(P=h?k:`${E}px`,A=`${-y}px`):b==="top"?(P=h?k:`${E}px`,A=`${l.floating.height+y}px`):b==="right"?(P=`${-y}px`,A=h?k:`${_}px`):b==="left"&&(P=`${l.floating.width+y}px`,A=h?k:`${_}px`),{data:{x:P,y:A}}}});function lY(e){const[t,n="center"]=e.split("-");return[t,n]}const bTe=uTe,STe=dTe,xTe=gTe;function wTe(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const uY=e=>{const{present:t,children:n}=e,r=CTe(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=ps(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};uY.displayName="Presence";function CTe(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[s,l]=wTe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=Qb(r.current);o.current=s==="mounted"?u:"none"},[s]),d0(()=>{const u=r.current,d=i.current;if(d!==e){const m=o.current,y=Qb(u);e?l("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),d0(()=>{if(t){const u=h=>{const y=Qb(r.current).includes(h.animationName);h.target===t&&y&&el.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(o.current=Qb(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Qb(e){return(e==null?void 0:e.animationName)||"none"}function _Te({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=kTe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=du(n),l=w.useCallback(u=>{if(o){const h=typeof u=="function"?u(e):u;h!==e&&s(h)}else i(u)},[o,e,i,s]);return[a,l]}function kTe({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),o=du(t);return w.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const UC="rovingFocusGroup.onEntryFocus",ETe={bubbles:!1,cancelable:!0},WP="RovingFocusGroup",[K8,cY,PTe]=Gq(WP),[TTe,dY]=Yy(WP,[PTe]),[LTe,ATe]=TTe(WP),OTe=w.forwardRef((e,t)=>w.createElement(K8.Provider,{scope:e.__scopeRovingFocusGroup},w.createElement(K8.Slot,{scope:e.__scopeRovingFocusGroup},w.createElement(MTe,bn({},e,{ref:t}))))),MTe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=w.useRef(null),m=ps(t,h),y=qq(o),[b=null,x]=_Te({prop:a,defaultProp:s,onChange:l}),[k,E]=w.useState(!1),_=du(u),P=cY(n),A=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const D=h.current;if(D)return D.addEventListener(UC,_),()=>D.removeEventListener(UC,_)},[_]),w.createElement(LTe,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:b,onItemFocus:w.useCallback(D=>x(D),[x]),onItemShiftTab:w.useCallback(()=>E(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>R(D=>D-1),[])},w.createElement(lc.div,bn({tabIndex:k||M===0?-1:0,"data-orientation":r},d,{ref:m,style:{outline:"none",...e.style},onMouseDown:ir(e.onMouseDown,()=>{A.current=!0}),onFocus:ir(e.onFocus,D=>{const j=!A.current;if(D.target===D.currentTarget&&j&&!k){const z=new CustomEvent(UC,ETe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=P().filter(W=>W.focusable),K=H.find(W=>W.active),te=H.find(W=>W.id===b),$=[K,te,...H].filter(Boolean).map(W=>W.ref.current);fY($)}}A.current=!1}),onBlur:ir(e.onBlur,()=>E(!1))})))}),ITe="RovingFocusGroupItem",RTe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=FPe(),s=ATe(ITe,n),l=s.currentTabStopId===a,u=cY(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=s;return w.useEffect(()=>{if(r)return d(),()=>h()},[r,d,h]),w.createElement(K8.ItemSlot,{scope:n,id:a,focusable:r,active:i},w.createElement(lc.span,bn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:ir(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:ir(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:ir(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=jTe(m,s.orientation,s.dir);if(y!==void 0){m.preventDefault();let x=u().filter(k=>k.focusable).map(k=>k.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const k=x.indexOf(m.currentTarget);x=s.loop?BTe(x,k+1):x.slice(k+1)}setTimeout(()=>fY(x))}})})))}),DTe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function NTe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function jTe(e,t,n){const r=NTe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return DTe[r]}function fY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function BTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const $Te=OTe,FTe=RTe,zTe=["Enter"," "],HTe=["ArrowDown","PageUp","Home"],hY=["ArrowUp","PageDown","End"],VTe=[...HTe,...hY],ow="Menu",[X8,WTe,UTe]=Gq(ow),[_p,pY]=Yy(ow,[UTe,aY,dY]),UP=aY(),gY=dY(),[GTe,aw]=_p(ow),[qTe,GP]=_p(ow),YTe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=UP(t),[l,u]=w.useState(null),d=w.useRef(!1),h=du(o),m=qq(i);return w.useEffect(()=>{const y=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),w.createElement(bTe,s,w.createElement(GTe,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u},w.createElement(qTe,{scope:t,onClose:w.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:m,modal:a},r)))},KTe=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=UP(n);return w.createElement(STe,bn({},i,r,{ref:t}))}),XTe="MenuPortal",[Vze,ZTe]=_p(XTe,{forceMount:void 0}),Gd="MenuContent",[QTe,mY]=_p(Gd),JTe=w.forwardRef((e,t)=>{const n=ZTe(Gd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=aw(Gd,e.__scopeMenu),a=GP(Gd,e.__scopeMenu);return w.createElement(X8.Provider,{scope:e.__scopeMenu},w.createElement(uY,{present:r||o.open},w.createElement(X8.Slot,{scope:e.__scopeMenu},a.modal?w.createElement(eLe,bn({},i,{ref:t})):w.createElement(tLe,bn({},i,{ref:t})))))}),eLe=w.forwardRef((e,t)=>{const n=aw(Gd,e.__scopeMenu),r=w.useRef(null),i=ps(t,r);return w.useEffect(()=>{const o=r.current;if(o)return QH(o)},[]),w.createElement(vY,bn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ir(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),tLe=w.forwardRef((e,t)=>{const n=aw(Gd,e.__scopeMenu);return w.createElement(vY,bn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),vY=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m,disableOutsideScroll:y,...b}=e,x=aw(Gd,n),k=GP(Gd,n),E=UP(n),_=gY(n),P=WTe(n),[A,M]=w.useState(null),R=w.useRef(null),D=ps(t,R,x.onContentChange),j=w.useRef(0),z=w.useRef(""),H=w.useRef(0),K=w.useRef(null),te=w.useRef("right"),G=w.useRef(0),$=y?BV:w.Fragment,W=y?{as:dy,allowPinchZoom:!0}:void 0,X=U=>{var Q,re;const he=z.current+U,Ee=P().filter(We=>!We.disabled),Ce=document.activeElement,de=(Q=Ee.find(We=>We.ref.current===Ce))===null||Q===void 0?void 0:Q.textValue,ze=Ee.map(We=>We.textValue),Me=cLe(ze,he,de),rt=(re=Ee.find(We=>We.textValue===Me))===null||re===void 0?void 0:re.ref.current;(function We(Be){z.current=Be,window.clearTimeout(j.current),Be!==""&&(j.current=window.setTimeout(()=>We(""),1e3))})(he),rt&&setTimeout(()=>rt.focus())};w.useEffect(()=>()=>window.clearTimeout(j.current),[]),APe();const Z=w.useCallback(U=>{var Q,re;return te.current===((Q=K.current)===null||Q===void 0?void 0:Q.side)&&fLe(U,(re=K.current)===null||re===void 0?void 0:re.area)},[]);return w.createElement(QTe,{scope:n,searchRef:z,onItemEnter:w.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),onItemLeave:w.useCallback(U=>{var Q;Z(U)||((Q=R.current)===null||Q===void 0||Q.focus(),M(null))},[Z]),onTriggerLeave:w.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),pointerGraceTimerRef:H,onPointerGraceIntentChange:w.useCallback(U=>{K.current=U},[])},w.createElement($,W,w.createElement(OPe,{asChild:!0,trapped:i,onMountAutoFocus:ir(o,U=>{var Q;U.preventDefault(),(Q=R.current)===null||Q===void 0||Q.focus()}),onUnmountAutoFocus:a},w.createElement(PPe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m},w.createElement($Te,bn({asChild:!0},_,{dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:M,onEntryFocus:U=>{k.isUsingKeyboardRef.current||U.preventDefault()}}),w.createElement(xTe,bn({role:"menu","aria-orientation":"vertical","data-state":sLe(x.open),"data-radix-menu-content":"",dir:k.dir},E,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:ir(b.onKeyDown,U=>{const re=U.target.closest("[data-radix-menu-content]")===U.currentTarget,he=U.ctrlKey||U.altKey||U.metaKey,Ee=U.key.length===1;re&&(U.key==="Tab"&&U.preventDefault(),!he&&Ee&&X(U.key));const Ce=R.current;if(U.target!==Ce||!VTe.includes(U.key))return;U.preventDefault();const ze=P().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);hY.includes(U.key)&&ze.reverse(),lLe(ze)}),onBlur:ir(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(j.current),z.current="")}),onPointerMove:ir(e.onPointerMove,Q8(U=>{const Q=U.target,re=G.current!==U.clientX;if(U.currentTarget.contains(Q)&&re){const he=U.clientX>G.current?"right":"left";te.current=he,G.current=U.clientX}}))})))))))}),Z8="MenuItem",KD="menu.itemSelect",nLe=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=w.useRef(null),a=GP(Z8,e.__scopeMenu),s=mY(Z8,e.__scopeMenu),l=ps(t,o),u=w.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const m=new CustomEvent(KD,{bubbles:!0,cancelable:!0});h.addEventListener(KD,y=>r==null?void 0:r(y),{once:!0}),Uq(h,m),m.defaultPrevented?u.current=!1:a.onClose()}};return w.createElement(rLe,bn({},i,{ref:l,disabled:n,onClick:ir(e.onClick,d),onPointerDown:h=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,h),u.current=!0},onPointerUp:ir(e.onPointerUp,h=>{var m;u.current||(m=h.currentTarget)===null||m===void 0||m.click()}),onKeyDown:ir(e.onKeyDown,h=>{const m=s.searchRef.current!=="";n||m&&h.key===" "||zTe.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}))}),rLe=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=mY(Z8,n),s=gY(n),l=w.useRef(null),u=ps(t,l),[d,h]=w.useState(!1),[m,y]=w.useState("");return w.useEffect(()=>{const b=l.current;if(b){var x;y(((x=b.textContent)!==null&&x!==void 0?x:"").trim())}},[o.children]),w.createElement(X8.ItemSlot,{scope:n,disabled:r,textValue:i??m},w.createElement(FTe,bn({asChild:!0},s,{focusable:!r}),w.createElement(lc.div,bn({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:ir(e.onPointerMove,Q8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:ir(e.onPointerLeave,Q8(b=>a.onItemLeave(b))),onFocus:ir(e.onFocus,()=>h(!0)),onBlur:ir(e.onBlur,()=>h(!1))}))))}),iLe="MenuRadioGroup";_p(iLe,{value:void 0,onValueChange:()=>{}});const oLe="MenuItemIndicator";_p(oLe,{checked:!1});const aLe="MenuSub";_p(aLe);function sLe(e){return e?"open":"closed"}function lLe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function uLe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function cLe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=uLe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function dLe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(u-s)*(r-l)/(d-l)+s&&(i=!i)}return i}function fLe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return dLe(n,t)}function Q8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const hLe=YTe,pLe=KTe,gLe=JTe,mLe=nLe,yY="ContextMenu",[vLe,Wze]=Yy(yY,[pY]),sw=pY(),[yLe,bY]=vLe(yY),bLe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=w.useState(!1),l=sw(t),u=du(r),d=w.useCallback(h=>{s(h),u(h)},[u]);return w.createElement(yLe,{scope:t,open:a,onOpenChange:d,modal:o},w.createElement(hLe,bn({},l,{dir:i,open:a,onOpenChange:d,modal:o}),n))},SLe="ContextMenuTrigger",xLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bY(SLe,n),o=sw(n),a=w.useRef({x:0,y:0}),s=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=w.useRef(0),u=w.useCallback(()=>window.clearTimeout(l.current),[]),d=h=>{a.current={x:h.clientX,y:h.clientY},i.onOpenChange(!0)};return w.useEffect(()=>u,[u]),w.createElement(w.Fragment,null,w.createElement(pLe,bn({},o,{virtualRef:s})),w.createElement(lc.span,bn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:ir(e.onContextMenu,h=>{u(),d(h),h.preventDefault()}),onPointerDown:ir(e.onPointerDown,Jb(h=>{u(),l.current=window.setTimeout(()=>d(h),700)})),onPointerMove:ir(e.onPointerMove,Jb(u)),onPointerCancel:ir(e.onPointerCancel,Jb(u)),onPointerUp:ir(e.onPointerUp,Jb(u))})))}),wLe="ContextMenuContent",CLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bY(wLe,n),o=sw(n),a=w.useRef(!1);return w.createElement(gLe,bn({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),_Le=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=sw(n);return w.createElement(mLe,bn({},i,r,{ref:t}))});function Jb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const kLe=bLe,ELe=xLe,PLe=CLe,dd=_Le,TLe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,SY=w.memo(e=>{var te,G,$,W,X,Z,U,Q;const t=Oe(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,shouldUseSingleGalleryColumn:a}=pe(VEe),{image:s,isSelected:l}=e,{url:u,thumbnail:d,uuid:h,metadata:m}=s,[y,b]=w.useState(!1),x=Fy(),{t:k}=Ge(),E=()=>b(!0),_=()=>b(!1),P=()=>{var re,he;if(s.metadata){const[Ee,Ce]=hP((he=(re=s.metadata)==null?void 0:re.image)==null?void 0:he.prompt);Ee&&t(Fx(Ee)),t(iy(Ce||""))}x({title:k("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},A=()=>{s.metadata&&t(Hy(s.metadata.image.seed)),x({title:k("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},M=()=>{t(L0(s)),n!=="img2img"&&t(Yo("img2img")),x({title:k("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},R=()=>{t($x(s)),t(Bx()),n!=="unifiedCanvas"&&t(Yo("unifiedCanvas")),x({title:k("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},D=()=>{m&&t(yU(m)),x({title:k("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},j=async()=>{var re;if((re=m==null?void 0:m.image)!=null&&re.init_image_path&&(await fetch(m.image.init_image_path)).ok){t(Yo("img2img")),t(hwe(m)),x({title:k("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}x({title:k("toast:initialImageNotSet"),description:k("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},z=()=>t(UI(s)),H=re=>{re.dataTransfer.setData("invokeai/imageUuid",h),re.dataTransfer.effectAllowed="move"},K=()=>{t(UI(s))};return v.jsxs(kLe,{onOpenChange:re=>{t(hU(re))},children:[v.jsx(ELe,{children:v.jsxs(Eo,{position:"relative",className:"hoverable-image",onMouseOver:E,onMouseOut:_,userSelect:"none",draggable:!0,onDragStart:H,children:[v.jsx(JS,{className:"hoverable-image-image",objectFit:a?"contain":r,rounded:"md",src:d||u,loading:"lazy"}),v.jsx("div",{className:"hoverable-image-content",onClick:z,children:l&&v.jsx(Na,{width:"50%",height:"50%",as:RP,className:"hoverable-image-check"})}),y&&i>=64&&v.jsx("div",{className:"hoverable-image-delete-button",children:v.jsx(iS,{image:s,children:v.jsx(us,{"aria-label":k("parameters:deleteImage"),icon:v.jsx($Ee,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},h)}),v.jsxs(PLe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:re=>{re.detail.originalEvent.preventDefault()},children:[v.jsx(dd,{onClickCapture:K,children:k("parameters:openInViewer")}),v.jsx(dd,{onClickCapture:P,disabled:((G=(te=s==null?void 0:s.metadata)==null?void 0:te.image)==null?void 0:G.prompt)===void 0,children:k("parameters:usePrompt")}),v.jsx(dd,{onClickCapture:A,disabled:((W=($=s==null?void 0:s.metadata)==null?void 0:$.image)==null?void 0:W.seed)===void 0,children:k("parameters:useSeed")}),v.jsx(dd,{onClickCapture:D,disabled:!["txt2img","img2img"].includes((Z=(X=s==null?void 0:s.metadata)==null?void 0:X.image)==null?void 0:Z.type),children:k("parameters:useAll")}),v.jsx(dd,{onClickCapture:j,disabled:((Q=(U=s==null?void 0:s.metadata)==null?void 0:U.image)==null?void 0:Q.type)!=="img2img",children:k("parameters:useInitImg")}),v.jsx(dd,{onClickCapture:M,children:k("parameters:sendToImg2Img")}),v.jsx(dd,{onClickCapture:R,children:k("parameters:sendToUnifiedCanvas")}),v.jsx(dd,{"data-warning":!0,children:v.jsx(iS,{image:s,children:v.jsx("p",{children:k("parameters:deleteImage")})})})]})]})},TLe);SY.displayName="HoverableImage";const e4=320,XD=40,LLe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},ZD=400;function xY(){const e=Oe(),{t}=Ge(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,areMoreImagesAvailable:b,galleryWidth:x,isLightboxOpen:k,isStaging:E,shouldEnableResize:_,shouldUseSingleGalleryColumn:P}=pe(HEe),{galleryMinWidth:A,galleryMaxWidth:M}=k?{galleryMinWidth:ZD,galleryMaxWidth:ZD}:LLe[d],[R,D]=w.useState(x>=e4),[j,z]=w.useState(!1),[H,K]=w.useState(0),te=w.useRef(null),G=w.useRef(null),$=w.useRef(null);w.useEffect(()=>{x>=e4&&D(!1)},[x]);const W=()=>{e(ewe(!o)),e(vi(!0))},X=()=>{a?U():Z()},Z=()=>{e(Hd(!0)),o&&e(vi(!0))},U=w.useCallback(()=>{e(Hd(!1)),e(hU(!1)),e(twe(G.current?G.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),Q=()=>{e(F8(r))},re=de=>{e(sv(de))},he=()=>{m||($.current=window.setTimeout(()=>U(),500))},Ee=()=>{$.current&&window.clearTimeout($.current)};et("g",()=>{X()},[a,o]),et("left",()=>{e(fP())},{enabled:!E||d!=="unifiedCanvas"},[E]),et("right",()=>{e(dP())},{enabled:!E||d!=="unifiedCanvas"},[E]),et("shift+g",()=>{W()},[o]),et("esc",()=>{e(Hd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const Ce=32;return et("shift+up",()=>{if(l<256){const de=ke.clamp(l+Ce,32,256);e(sv(de))}},[l]),et("shift+down",()=>{if(l>32){const de=ke.clamp(l-Ce,32,256);e(sv(de))}},[l]),w.useEffect(()=>{G.current&&(G.current.scrollTop=s)},[s,a]),w.useEffect(()=>{function de(ze){!o&&te.current&&!te.current.contains(ze.target)&&U()}return document.addEventListener("mousedown",de),()=>{document.removeEventListener("mousedown",de)}},[U,o]),v.jsx(Vq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:v.jsxs("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:he,onMouseEnter:o?void 0:Ee,onMouseOver:o?void 0:Ee,children:[v.jsxs(jq,{minWidth:A,maxWidth:o?M:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:_},size:{width:x,height:o?"100%":"100vh"},onResizeStart:(de,ze,Me)=>{K(Me.clientHeight),Me.style.height=`${Me.clientHeight}px`,o&&(Me.style.position="fixed",Me.style.right="1rem",z(!0))},onResizeStop:(de,ze,Me,rt)=>{const We=o?ke.clamp(Number(x)+rt.width,A,Number(M)):Number(x)+rt.width;e(iwe(We)),Me.removeAttribute("data-resize-alert"),o&&(Me.style.position="relative",Me.style.removeProperty("right"),Me.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(de,ze,Me,rt)=>{const We=ke.clamp(Number(x)+rt.width,A,Number(o?M:.95*window.innerWidth));We>=e4&&!R?D(!0):WeWe-XD&&e(sv(We-XD)),o&&(We>=M?Me.setAttribute("data-resize-alert","true"):Me.removeAttribute("data-resize-alert")),Me.style.height=`${H}px`},children:[v.jsxs("div",{className:"image-gallery-header",children:[v.jsx(ao,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:R?v.jsxs(v.Fragment,{children:[v.jsx(nr,{size:"sm","data-selected":r==="result",onClick:()=>e(Ob("result")),children:t("gallery:generations")}),v.jsx(nr,{size:"sm","data-selected":r==="user",onClick:()=>e(Ob("user")),children:t("gallery:uploads")})]}):v.jsxs(v.Fragment,{children:[v.jsx(Je,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:v.jsx(PEe,{}),onClick:()=>e(Ob("result"))}),v.jsx(Je,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:v.jsx(zEe,{}),onClick:()=>e(Ob("user"))})]})}),v.jsxs("div",{className:"image-gallery-header-right-icons",children:[v.jsx(Js,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:v.jsx(Je,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:v.jsx(BP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:v.jsxs("div",{className:"image-gallery-settings-popover",children:[v.jsxs("div",{children:[v.jsx(lo,{value:l,onChange:re,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),v.jsx(Je,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(sv(64)),icon:v.jsx(Yx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:maintainAspectRatio"),isChecked:h==="contain",onChange:()=>e(nwe(h==="contain"?"cover":"contain"))})}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:autoSwitchNewImages"),isChecked:y,onChange:de=>e(rwe(de.target.checked))})}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:singleColumnLayout"),isChecked:P,onChange:de=>e(owe(de.target.checked))})})]})}),v.jsx(Je,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:W,icon:o?v.jsx(Bq,{}):v.jsx($q,{})})]})]}),v.jsx("div",{className:"image-gallery-container",ref:G,children:n.length||b?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(de=>{const{uuid:ze}=de,Me=i===ze;return v.jsx(SY,{image:de,isSelected:Me},ze)})}),v.jsx(ls,{onClick:Q,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):v.jsxs("div",{className:"image-gallery-container-placeholder",children:[v.jsx(Fq,{}),v.jsx("p",{children:t("gallery:noImagesInGallery")})]})})]}),j&&v.jsx("div",{style:{width:`${x}px`,height:"100%"}})]})})}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -489,7 +489,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var J8=function(e,t){return J8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},J8(e,t)};function LLe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");J8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ou=function(){return ou=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function vf(e,t,n,r){var i=ULe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=t.scale-s,h=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):_Y(e,r,n,function(y){var b=s+d*y,x=l+h*y,k=u+m*y;o(b,x,k)})}}function ULe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function GLe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,d=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:d}}var qLe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,d=s,h=r-i-l,m=l;return{minPositionX:u,maxPositionX:d,minPositionY:h,maxPositionY:m}},qP=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=GLe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,d=o.newContentHeight,h=o.newDiffHeight,m=qLe(a,l,u,s,d,h,Boolean(i));return m},d0=function(e,t){var n=qP(e,t);return e.bounds=n,n};function lw(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,d=n.maxPositionY,h=0,m=0;a&&(h=i,m=o);var y=e_(e,s-h,u+h,r),b=e_(t,l-m,d+m,r);return{x:y,y:b}}var e_=function(e,t,n,r){return r?en?os(n,2):os(e,2):os(e,2)};function uw(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var h=l-t*d,m=u-n*d,y=lw(h,m,i,o,0,0,null);return y}function Yy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var JD=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=cw(o,n);return!l},eN=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},YLe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},KLe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function XLe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var d=e.bounds,h=d.maxPositionX,m=d.minPositionX,y=d.maxPositionY,b=d.minPositionY,x=n>h||ny||rh?u.offsetWidth:e.setup.minPositionX||0,_=r>y?u.offsetHeight:e.setup.minPositionY||0,P=uw(e,E,_,i,e.bounds,s||l),A=P.x,M=P.y;return{scale:i,positionX:x?A:n,positionY:k?M:r}}}function ZLe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,d=l.positionX,h=l.positionY,m=t!==d,y=n!==h,b=!m||!y;if(!(!a||b||!s)){var x=lw(t,n,s,o,r,i,a),k=x.x,E=x.y;e.setTransformState(u,k,E)}}var QLe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var d=t-r.x,h=n-r.y,m=a?l:d,y=s?u:h;return{x:m,y}},dS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},JLe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},eAe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function tAe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function tN(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var d=a+(e-a)*u;return d>l?l:do?o:d}}return r?t:e_(e,o,a,i)}function nAe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function rAe(e,t){var n=JLe(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=nAe(a,s),d=t.x-r.x,h=t.y-r.y,m=d/u,y=h/u,b=l-i,x=d*d+h*h,k=Math.sqrt(x)/b;e.velocity={velocityX:m,velocityY:y,total:k}}e.lastMousePosition=t,e.velocityTime=l}}function iAe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=eAe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,d=n.minPositionX,h=n.maxPositionY,m=n.minPositionY,y=r.limitToBounds,b=r.alignmentAnimation,x=r.zoomAnimation,k=r.panning,E=k.lockAxisY,_=k.lockAxisX,P=x.animationType,A=b.sizeX,M=b.sizeY,R=b.velocityAlignmentTime,D=R,j=tAe(e,l),z=Math.max(j,D),H=dS(e,A),K=dS(e,M),te=H*i.offsetWidth/100,G=K*i.offsetHeight/100,F=u+te,W=d-te,X=h+G,Z=m-G,U=e.transformState,Q=new Date().getTime();_Y(e,P,z,function(re){var fe=e.transformState,Ee=fe.scale,be=fe.positionX,ye=fe.positionY,ze=new Date().getTime()-Q,Me=ze/D,rt=wY[b.animationType],We=1-rt(Math.min(1,Me)),Be=1-re,wt=be+a*Be,Fe=ye+s*Be,at=tN(wt,U.positionX,be,_,y,d,u,W,F,We),bt=tN(Fe,U.positionY,ye,E,y,m,h,Z,X,We);(be!==wt||ye!==Fe)&&e.setTransformState(Ee,at,bt)})}}function nN(e,t){var n=e.transformState.scale;Ul(e),d0(e,n),t.touches?KLe(e,t):YLe(e,t)}function rN(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(r){var l=QLe(e,t,n),u=l.x,d=l.y,h=dS(e,a),m=dS(e,s);rAe(e,{x:u,y:d}),ZLe(e,u,d,h,m)}}function oAe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,d=(a==null?void 0:a.height)||0,h=s.1&&h;m?iAe(e):kY(e)}}function kY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,d=o||t=a;if((r>=1||s)&&kY(e),!(m||!i||!e.mounted)){var y=t||i.offsetWidth/2,b=n||i.offsetHeight/2,x=YP(e,a,y,b);x&&vf(e,x,d,h)}}function YP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Yy(os(t,2),o,a,0,!1),u=d0(e,l),d=uw(e,n,r,l,u,s),h=d.x,m=d.y;return{scale:l,positionX:h,positionY:m}}var gm={previousScale:1,scale:1,positionX:0,positionY:0},aAe=ou(ou({},gm),{setComponents:function(){},contextInstance:null}),gv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},PY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:gm.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:gm.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:gm.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:gm.positionY}},iN=function(e){var t=ou({},gv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof gv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(gv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=ou(ou({},gv[n]),e[n]):s?t[n]=QD(QD([],gv[n]),e[n]):t[n]=e[n]}}),t},TY=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var d=r*Math.exp(t*n),h=Yy(os(d,3),s,a,u,!1);return h};function LY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var d=o.offsetWidth,h=o.offsetHeight,m=(d/2-l)/s,y=(h/2-u)/s,b=TY(e,t,n),x=YP(e,b,m,y);if(!x)return console.error("Error during zoom event. New transformation state was not calculated.");vf(e,x,r,i)}function AY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=PY(e.props),s=e.transformState,l=s.scale,u=s.positionX,d=s.positionY;if(i){var h=qP(e,a.scale),m=lw(a.positionX,a.positionY,h,o,0,0,i),y={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&d===a.positionY||vf(e,y,t,n)}}function sAe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return gm;var l=r.getBoundingClientRect(),u=lAe(t),d=u.x,h=u.y,m=t.offsetWidth,y=t.offsetHeight,b=r.offsetWidth/m,x=r.offsetHeight/y,k=Yy(n||Math.min(b,x),a,s,0,!1),E=(l.width-m*k)/2,_=(l.height-y*k)/2,P=(l.left-d)*k+E,A=(l.top-h)*k+_,M=qP(e,k),R=lw(P,A,M,o,0,0,r),D=R.x,j=R.y;return{positionX:D,positionY:j,scale:k}}function lAe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function uAe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var cAe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),LY(e,1,t,n,r)}},dAe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),LY(e,-1,t,n,r)}},fAe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,d=e.wrapperComponent,h=e.contentComponent,m=e.setup.disabled;if(!(m||!d||!h)){var y={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};vf(e,y,i,o)}}},hAe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),AY(e,t,n)}},pAe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=OY(t||i.scale,o,a);vf(e,s,n,r)}}},gAe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Ul(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&uAe(a)&&a&&o.contains(a)){var s=sAe(e,a,n);vf(e,s,r,i)}}},ri=function(e){return{instance:e,state:e.transformState,zoomIn:cAe(e),zoomOut:dAe(e),setTransform:fAe(e),resetTransform:hAe(e),centerView:pAe(e),zoomToElement:gAe(e)}},GC=!1;function qC(){try{var e={get passive(){return GC=!0,!1}};return e}catch{return GC=!1,GC}}var cw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},oN=function(e){e&&clearTimeout(e)},mAe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},OY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},vAe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,d=s&&!l&&!r&&u;if(!d||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var h=cw(u,a);return!h};function yAe(e,t){var n=e?e.deltaY<0?1:-1:0,r=ALe(t,n);return r}function MY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var bAe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,d=s.zoomAnimation,h=d.size,m=d.disabled;if(!a)throw new Error("Wrapper is not mounted");var y=o+t*(o-o*n)*n;if(i)return y;var b=r?!1:!m,x=Yy(os(y,3),u,l,h,b);return x},SAe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},xAe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=cw(a,i);return!l},wAe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},CAe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=os(i[0].clientX-r.left,5),a=os(i[0].clientY-r.top,5),s=os(i[1].clientX-r.left,5),l=os(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},IY=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},_Ae=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var d=t/r,h=d*n;return Yy(os(h,2),a,o,l,!u)},kAe=160,EAe=100,PAe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Ul(e),Pi(ri(e),t,r),Pi(ri(e),t,i))},TAe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,d=a.centerZoomedOut,h=a.zoomAnimation,m=a.wheel,y=h.size,b=h.disabled,x=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var k=yAe(t,null),E=bAe(e,k,x,!t.ctrlKey);if(l!==E){var _=d0(e,E),P=MY(t,o,l),A=b||y===0||d,M=u&&A,R=uw(e,P.x,P.y,E,_,M),D=R.x,j=R.y;e.previousWheelEvent=t,e.setTransformState(E,D,j),Pi(ri(e),t,r),Pi(ri(e),t,i)}},LAe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;oN(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(EY(e,t.x,t.y),e.wheelAnimationTimer=null)},EAe);var o=SAe(e,t);o&&(oN(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Pi(ri(e),t,r),Pi(ri(e),t,i))},kAe))},AAe=function(e,t){var n=IY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Ul(e)},OAe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,d=l.size;if(!(r===null||!n)){var h=CAe(t,i,n);if(!(!isFinite(h.x)||!isFinite(h.y))){var m=IY(t),y=_Ae(e,m);if(y!==i){var b=d0(e,y),x=u||d===0||s,k=a&&x,E=uw(e,h.x,h.y,y,b,k),_=E.x,P=E.y;e.pinchMidpoint=h,e.lastDistance=m,e.setTransformState(y,_,P)}}}},MAe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,EY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function IAe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return AY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var d=i==="zoomOut"?-1:1,h=TY(e,d,o),m=MY(t,u,l),y=YP(e,h,m.x,m.y);if(!y)return console.error("Error during zoom event. New transformation state was not calculated.");vf(e,y,a,s)}}var RAe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),d=n&&l&&u&&!a;if(!d)return!1;var h=cw(l,s);return!(h||!d)},RY=N.createContext(aAe),DAe=function(e){LLe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=PY(n.props),n.setup=iN(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=qC();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=vAe(n,r);if(o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(PAe(n,r),TAe(n,r),LAe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=JD(n,r);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),Ul(n),nN(n,r),Pi(ri(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=eN(n);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),rN(n,r.clientX,r.clientY),Pi(ri(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(oAe(n),Pi(ri(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=xAe(n,r);l&&(AAe(n,r),Ul(n),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=wAe(n);l&&(r.preventDefault(),r.stopPropagation(),OAe(n,r),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(MAe(n),Pi(ri(n),r,o),Pi(ri(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=JD(n,r);if(a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Ul(n);var l=r.touches,u=l.length===1,d=l.length===2;u&&(Ul(n),nN(n,r),Pi(ri(n),r,o)),d&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=eN(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];rN(n,s.clientX,s.clientY),Pi(ri(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=RAe(n,r);o&&IAe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,d0(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Pi(ri(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=OY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=mAe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ri(n))},n}return t.prototype.componentDidMount=function(){var n=qC();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=qC();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Ul(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(d0(this,this.transformState.scale),this.setup=iN(this.props))},t.prototype.render=function(){var n=ri(this),r=this.props.children,i=typeof r=="function"?r(n):r;return N.createElement(RY.Provider,{value:ou(ou({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},i)},t}(w.Component),NAe=N.forwardRef(function(e,t){var n=w.useState(null),r=n[0],i=n[1];return w.useImperativeHandle(t,function(){return r},[r]),N.createElement(DAe,ou({},e,{setRef:i}))});function jAe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var BAe=`.transform-component-module_wrapper__1_Fgj { +***************************************************************************** */var J8=function(e,t){return J8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},J8(e,t)};function ALe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");J8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ou=function(){return ou=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function yf(e,t,n,r){var i=GLe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=t.scale-s,h=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):_Y(e,r,n,function(y){var b=s+d*y,x=l+h*y,k=u+m*y;o(b,x,k)})}}function GLe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function qLe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,d=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:d}}var YLe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,d=s,h=r-i-l,m=l;return{minPositionX:u,maxPositionX:d,minPositionY:h,maxPositionY:m}},qP=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=qLe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,d=o.newContentHeight,h=o.newDiffHeight,m=YLe(a,l,u,s,d,h,Boolean(i));return m},f0=function(e,t){var n=qP(e,t);return e.bounds=n,n};function lw(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,d=n.maxPositionY,h=0,m=0;a&&(h=i,m=o);var y=e_(e,s-h,u+h,r),b=e_(t,l-m,d+m,r);return{x:y,y:b}}var e_=function(e,t,n,r){return r?en?os(n,2):os(e,2):os(e,2)};function uw(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var h=l-t*d,m=u-n*d,y=lw(h,m,i,o,0,0,null);return y}function Xy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var JD=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=cw(o,n);return!l},eN=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},KLe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},XLe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function ZLe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var d=e.bounds,h=d.maxPositionX,m=d.minPositionX,y=d.maxPositionY,b=d.minPositionY,x=n>h||ny||rh?u.offsetWidth:e.setup.minPositionX||0,_=r>y?u.offsetHeight:e.setup.minPositionY||0,P=uw(e,E,_,i,e.bounds,s||l),A=P.x,M=P.y;return{scale:i,positionX:x?A:n,positionY:k?M:r}}}function QLe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,d=l.positionX,h=l.positionY,m=t!==d,y=n!==h,b=!m||!y;if(!(!a||b||!s)){var x=lw(t,n,s,o,r,i,a),k=x.x,E=x.y;e.setTransformState(u,k,E)}}var JLe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var d=t-r.x,h=n-r.y,m=a?l:d,y=s?u:h;return{x:m,y}},dS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},eAe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},tAe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function nAe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function tN(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var d=a+(e-a)*u;return d>l?l:do?o:d}}return r?t:e_(e,o,a,i)}function rAe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function iAe(e,t){var n=eAe(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=rAe(a,s),d=t.x-r.x,h=t.y-r.y,m=d/u,y=h/u,b=l-i,x=d*d+h*h,k=Math.sqrt(x)/b;e.velocity={velocityX:m,velocityY:y,total:k}}e.lastMousePosition=t,e.velocityTime=l}}function oAe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=tAe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,d=n.minPositionX,h=n.maxPositionY,m=n.minPositionY,y=r.limitToBounds,b=r.alignmentAnimation,x=r.zoomAnimation,k=r.panning,E=k.lockAxisY,_=k.lockAxisX,P=x.animationType,A=b.sizeX,M=b.sizeY,R=b.velocityAlignmentTime,D=R,j=nAe(e,l),z=Math.max(j,D),H=dS(e,A),K=dS(e,M),te=H*i.offsetWidth/100,G=K*i.offsetHeight/100,$=u+te,W=d-te,X=h+G,Z=m-G,U=e.transformState,Q=new Date().getTime();_Y(e,P,z,function(re){var he=e.transformState,Ee=he.scale,Ce=he.positionX,de=he.positionY,ze=new Date().getTime()-Q,Me=ze/D,rt=wY[b.animationType],We=1-rt(Math.min(1,Me)),Be=1-re,wt=Ce+a*Be,$e=de+s*Be,at=tN(wt,U.positionX,Ce,_,y,d,u,W,$,We),bt=tN($e,U.positionY,de,E,y,m,h,Z,X,We);(Ce!==wt||de!==$e)&&e.setTransformState(Ee,at,bt)})}}function nN(e,t){var n=e.transformState.scale;Ul(e),f0(e,n),t.touches?XLe(e,t):KLe(e,t)}function rN(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(r){var l=JLe(e,t,n),u=l.x,d=l.y,h=dS(e,a),m=dS(e,s);iAe(e,{x:u,y:d}),QLe(e,u,d,h,m)}}function aAe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,d=(a==null?void 0:a.height)||0,h=s.1&&h;m?oAe(e):kY(e)}}function kY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,d=o||t=a;if((r>=1||s)&&kY(e),!(m||!i||!e.mounted)){var y=t||i.offsetWidth/2,b=n||i.offsetHeight/2,x=YP(e,a,y,b);x&&yf(e,x,d,h)}}function YP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Xy(os(t,2),o,a,0,!1),u=f0(e,l),d=uw(e,n,r,l,u,s),h=d.x,m=d.y;return{scale:l,positionX:h,positionY:m}}var mm={previousScale:1,scale:1,positionX:0,positionY:0},sAe=ou(ou({},mm),{setComponents:function(){},contextInstance:null}),vv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},PY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:mm.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:mm.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:mm.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:mm.positionY}},iN=function(e){var t=ou({},vv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof vv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(vv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=ou(ou({},vv[n]),e[n]):s?t[n]=QD(QD([],vv[n]),e[n]):t[n]=e[n]}}),t},TY=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var d=r*Math.exp(t*n),h=Xy(os(d,3),s,a,u,!1);return h};function LY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var d=o.offsetWidth,h=o.offsetHeight,m=(d/2-l)/s,y=(h/2-u)/s,b=TY(e,t,n),x=YP(e,b,m,y);if(!x)return console.error("Error during zoom event. New transformation state was not calculated.");yf(e,x,r,i)}function AY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=PY(e.props),s=e.transformState,l=s.scale,u=s.positionX,d=s.positionY;if(i){var h=qP(e,a.scale),m=lw(a.positionX,a.positionY,h,o,0,0,i),y={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&d===a.positionY||yf(e,y,t,n)}}function lAe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return mm;var l=r.getBoundingClientRect(),u=uAe(t),d=u.x,h=u.y,m=t.offsetWidth,y=t.offsetHeight,b=r.offsetWidth/m,x=r.offsetHeight/y,k=Xy(n||Math.min(b,x),a,s,0,!1),E=(l.width-m*k)/2,_=(l.height-y*k)/2,P=(l.left-d)*k+E,A=(l.top-h)*k+_,M=qP(e,k),R=lw(P,A,M,o,0,0,r),D=R.x,j=R.y;return{positionX:D,positionY:j,scale:k}}function uAe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function cAe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var dAe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),LY(e,1,t,n,r)}},fAe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),LY(e,-1,t,n,r)}},hAe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,d=e.wrapperComponent,h=e.contentComponent,m=e.setup.disabled;if(!(m||!d||!h)){var y={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};yf(e,y,i,o)}}},pAe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),AY(e,t,n)}},gAe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=OY(t||i.scale,o,a);yf(e,s,n,r)}}},mAe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Ul(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&cAe(a)&&a&&o.contains(a)){var s=lAe(e,a,n);yf(e,s,r,i)}}},ri=function(e){return{instance:e,state:e.transformState,zoomIn:dAe(e),zoomOut:fAe(e),setTransform:hAe(e),resetTransform:pAe(e),centerView:gAe(e),zoomToElement:mAe(e)}},GC=!1;function qC(){try{var e={get passive(){return GC=!0,!1}};return e}catch{return GC=!1,GC}}var cw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},oN=function(e){e&&clearTimeout(e)},vAe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},OY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},yAe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,d=s&&!l&&!r&&u;if(!d||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var h=cw(u,a);return!h};function bAe(e,t){var n=e?e.deltaY<0?1:-1:0,r=OLe(t,n);return r}function MY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var SAe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,d=s.zoomAnimation,h=d.size,m=d.disabled;if(!a)throw new Error("Wrapper is not mounted");var y=o+t*(o-o*n)*n;if(i)return y;var b=r?!1:!m,x=Xy(os(y,3),u,l,h,b);return x},xAe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},wAe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=cw(a,i);return!l},CAe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},_Ae=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=os(i[0].clientX-r.left,5),a=os(i[0].clientY-r.top,5),s=os(i[1].clientX-r.left,5),l=os(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},IY=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},kAe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var d=t/r,h=d*n;return Xy(os(h,2),a,o,l,!u)},EAe=160,PAe=100,TAe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Ul(e),Ti(ri(e),t,r),Ti(ri(e),t,i))},LAe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,d=a.centerZoomedOut,h=a.zoomAnimation,m=a.wheel,y=h.size,b=h.disabled,x=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var k=bAe(t,null),E=SAe(e,k,x,!t.ctrlKey);if(l!==E){var _=f0(e,E),P=MY(t,o,l),A=b||y===0||d,M=u&&A,R=uw(e,P.x,P.y,E,_,M),D=R.x,j=R.y;e.previousWheelEvent=t,e.setTransformState(E,D,j),Ti(ri(e),t,r),Ti(ri(e),t,i)}},AAe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;oN(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(EY(e,t.x,t.y),e.wheelAnimationTimer=null)},PAe);var o=xAe(e,t);o&&(oN(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Ti(ri(e),t,r),Ti(ri(e),t,i))},EAe))},OAe=function(e,t){var n=IY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Ul(e)},MAe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,d=l.size;if(!(r===null||!n)){var h=_Ae(t,i,n);if(!(!isFinite(h.x)||!isFinite(h.y))){var m=IY(t),y=kAe(e,m);if(y!==i){var b=f0(e,y),x=u||d===0||s,k=a&&x,E=uw(e,h.x,h.y,y,b,k),_=E.x,P=E.y;e.pinchMidpoint=h,e.lastDistance=m,e.setTransformState(y,_,P)}}}},IAe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,EY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function RAe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return AY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var d=i==="zoomOut"?-1:1,h=TY(e,d,o),m=MY(t,u,l),y=YP(e,h,m.x,m.y);if(!y)return console.error("Error during zoom event. New transformation state was not calculated.");yf(e,y,a,s)}}var DAe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),d=n&&l&&u&&!a;if(!d)return!1;var h=cw(l,s);return!(h||!d)},RY=N.createContext(sAe),NAe=function(e){ALe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=PY(n.props),n.setup=iN(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=qC();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=yAe(n,r);if(o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(TAe(n,r),LAe(n,r),AAe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=JD(n,r);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),Ul(n),nN(n,r),Ti(ri(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=eN(n);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),rN(n,r.clientX,r.clientY),Ti(ri(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(aAe(n),Ti(ri(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=wAe(n,r);l&&(OAe(n,r),Ul(n),Ti(ri(n),r,a),Ti(ri(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=CAe(n);l&&(r.preventDefault(),r.stopPropagation(),MAe(n,r),Ti(ri(n),r,a),Ti(ri(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(IAe(n),Ti(ri(n),r,o),Ti(ri(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=JD(n,r);if(a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Ul(n);var l=r.touches,u=l.length===1,d=l.length===2;u&&(Ul(n),nN(n,r),Ti(ri(n),r,o)),d&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=eN(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];rN(n,s.clientX,s.clientY),Ti(ri(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=DAe(n,r);o&&RAe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,f0(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Ti(ri(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=OY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=vAe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ri(n))},n}return t.prototype.componentDidMount=function(){var n=qC();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=qC();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Ul(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(f0(this,this.transformState.scale),this.setup=iN(this.props))},t.prototype.render=function(){var n=ri(this),r=this.props.children,i=typeof r=="function"?r(n):r;return N.createElement(RY.Provider,{value:ou(ou({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},i)},t}(w.Component),jAe=N.forwardRef(function(e,t){var n=w.useState(null),r=n[0],i=n[1];return w.useImperativeHandle(t,function(){return r},[r]),N.createElement(NAe,ou({},e,{setRef:i}))});function BAe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var $Ae=`.transform-component-module_wrapper__1_Fgj { position: relative; width: -moz-fit-content; width: fit-content; @@ -519,7 +519,7 @@ PERFORMANCE OF THIS SOFTWARE. .transform-component-module_content__2jYgh img { pointer-events: none; } -`,aN={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};jAe(BAe);var FAe=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=w.useContext(RY).setComponents,u=w.useRef(null),d=w.useRef(null);return w.useEffect(function(){var h=u.current,m=d.current;h!==null&&m!==null&&l&&l(h,m)},[]),N.createElement("div",{ref:u,className:"react-transform-wrapper "+aN.wrapper+" "+r,style:a},N.createElement("div",{ref:d,className:"react-transform-component "+aN.content+" "+o,style:s},t))};function $Ae({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=w.useState(0),[a,s]=w.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},d=()=>{s(!a)};return v.jsx(NAe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:h,zoomOut:m,resetTransform:y,centerView:b})=>v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"lightbox-image-options",children:[v.jsx(Je,{icon:v.jsx(A_e,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>h(),fontSize:20}),v.jsx(Je,{icon:v.jsx(O_e,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),v.jsx(Je,{icon:v.jsx(T_e,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),v.jsx(Je,{icon:v.jsx(L_e,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),v.jsx(Je,{icon:v.jsx(sPe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),v.jsx(Je,{icon:v.jsx(Yx,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{y(),o(0),s(!1)},fontSize:20})]}),v.jsx(FAe,{wrapperStyle:{width:"100%",height:"100%"},children:v.jsx("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function zAe(){const e=Oe(),t=he(m=>m.lightbox.isLightboxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=he(Nq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(fP())},h=()=>{e(dP())};return et("Esc",()=>{t&&e(Hm(!1))},[t]),v.jsxs("div",{className:"lightbox-container",children:[v.jsx(Je,{icon:v.jsx(P_e,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Hm(!1))},fontSize:20}),v.jsxs("div",{className:"lightbox-display-container",children:[v.jsxs("div",{className:"lightbox-preview-wrapper",children:[v.jsx(Rq,{}),!r&&v.jsxs("div",{className:"current-image-next-prev-buttons",children:[v.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&v.jsx(us,{"aria-label":"Previous image",icon:v.jsx(Cq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),v.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&v.jsx(us,{"aria-label":"Next image",icon:v.jsx(_q,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),n&&v.jsxs(v.Fragment,{children:[v.jsx($Ae,{image:n.url,styleClass:"lightbox-image"}),r&&v.jsx(FP,{image:n})]})]}),v.jsx(xY,{})]})]})}function HAe(e){return mt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}const VAe=lt(wp,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),WAe=()=>{const{resultImages:e,userImages:t}=he(VAe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},UAe=lt([Sp,qx,Mr],(e,t,n)=>{const{shouldShowDualDisplay:r,shouldPinParametersPanel:i}=e,{isLightboxOpen:o}=t;return{shouldShowDualDisplay:r,shouldPinParametersPanel:i,isLightboxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KP=e=>{const t=Oe(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,shouldShowDualDisplay:a,isLightboxOpen:s,shouldShowDualDisplayButton:l}=he(UAe),u=WAe(),d=()=>{t(ECe(!a)),t(vi(!0))},h=m=>{const y=m.dataTransfer.getData("invokeai/imageUuid"),b=u(y);b&&(o==="img2img"?t(T0(b)):o==="unifiedCanvas"&&t(Fx(b)))};return v.jsx("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:v.jsxs("div",{className:"workarea-main",children:[n,v.jsxs("div",{className:"workarea-children-wrapper",onDrop:h,children:[r,l&&v.jsx(uo,{label:"Toggle Split View",children:v.jsx("div",{className:"workarea-split-button","data-selected":a,onClick:d,children:v.jsx(HAe,{})})})]}),!s&&v.jsx(xY,{})]})})},GAe=e=>{const{styleClass:t}=e,n=w.useContext(PP),r=()=>{n&&n()};return v.jsx("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:v.jsxs("div",{className:"image-upload-button",children:[v.jsx(tw,{}),v.jsx(Bh,{size:"lg",children:"Click or Drag and Drop"})]})})},qAe=lt([wp,Sp,Mr],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),DY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=he(qAe);return v.jsx("div",{className:"current-image-area","data-tab-name":t,children:e?v.jsxs(v.Fragment,{children:[v.jsx(Rq,{}),v.jsx(KEe,{})]}):v.jsx("div",{className:"current-image-display-placeholder",children:v.jsx(lPe,{})})})},YAe=()=>{const e=w.useContext(PP);return v.jsx(Je,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:v.jsx(tw,{}),onClick:e||void 0})};function KAe(){const e=he(o=>o.generation.initialImage),{t}=Ge(),n=Oe(),r=By(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(vU())};return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"init-image-preview-header",children:[v.jsx("h2",{children:t("parameters:initialImage")}),v.jsx(YAe,{})]}),e&&v.jsx("div",{className:"init-image-preview",children:v.jsx(JS,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const XAe=()=>{const e=he(r=>r.generation.initialImage),{currentImage:t}=he(r=>r.gallery),n=e?v.jsx("div",{className:"image-to-image-area",children:v.jsx(KAe,{})}):v.jsx(GAe,{});return v.jsxs("div",{className:"workarea-split-view",children:[v.jsx("div",{className:"workarea-split-view-left",children:n}),t&&v.jsx("div",{className:"workarea-split-view-right",children:v.jsx(DY,{})})]})};var ao=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(ao||{});const ZAe=()=>{const{t:e}=Ge();return w.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},QAe=e=>ZAe()[e],Us=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return v.jsxs(fn,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[v.jsx(En,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),v.jsx(UE,{className:"invokeai__switch-root",...s})]})};function NY(){const e=he(i=>i.system.isGFPGANAvailable),t=he(i=>i.postprocessing.shouldRunFacetool),n=Oe(),r=i=>n(wwe(i.target.checked));return v.jsx(Us,{isDisabled:!e,isChecked:t,onChange:r})}function JAe(){const e=Oe(),t=he(i=>i.generation.shouldFitToWidthHeight),n=i=>e(PU(i.target.checked)),{t:r}=Ge();return v.jsx(Us,{label:r("parameters:imageFit"),isChecked:t,onChange:n})}function jY(e){const{t}=Ge(),{label:n=`${t("parameters:strength")}`,styleClass:r}=e,i=he(l=>l.generation.img2imgStrength),o=Oe(),a=l=>o(p8(l)),s=()=>{o(p8(.75))};return v.jsx(so,{label:n,step:.01,min:.01,max:1,onChange:a,value:i,isInteger:!1,styleClass:r,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:s})}const BY=()=>{const e=Oe(),t=he(i=>i.generation.seamless),n=i=>e(kU(i.target.checked)),{t:r}=Ge();return v.jsx(je,{gap:2,direction:"column",children:v.jsx(Us,{label:r("parameters:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},eOe=()=>v.jsx(je,{gap:2,direction:"column",children:v.jsx(BY,{})});function tOe(){const e=Oe(),t=he(i=>i.generation.perlin),{t:n}=Ge(),r=i=>e(CU(i));return v.jsx(ia,{label:n("parameters:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}function nOe(){const e=Oe(),{t}=Ge(),n=he(i=>i.generation.shouldRandomizeSeed),r=i=>e(mwe(i.target.checked));return v.jsx(Us,{label:t("parameters:randomizeSeed"),isChecked:n,onChange:r})}function rOe(){const e=he(a=>a.generation.seed),t=he(a=>a.generation.shouldRandomizeSeed),n=he(a=>a.generation.shouldGenerateVariations),{t:r}=Ge(),i=Oe(),o=a=>i($y(a));return v.jsx(ia,{label:r("parameters:seed"),step:1,precision:0,flexGrow:1,min:SP,max:xP,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function iOe(){const e=Oe(),t=he(i=>i.generation.shouldRandomizeSeed),{t:n}=Ge(),r=()=>e($y(eq(SP,xP)));return v.jsx(ls,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:v.jsx("p",{children:n("parameters:shuffle")})})}function oOe(){const e=Oe(),t=he(i=>i.generation.threshold),{t:n}=Ge(),r=i=>e(LU(i));return v.jsx(ia,{label:n("parameters:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}const XP=()=>v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(nOe,{}),v.jsxs(je,{gap:2,children:[v.jsx(rOe,{}),v.jsx(iOe,{})]}),v.jsx(je,{gap:2,children:v.jsx(oOe,{})}),v.jsx(je,{gap:2,children:v.jsx(tOe,{})})]});function FY(){const e=he(i=>i.system.isESRGANAvailable),t=he(i=>i.postprocessing.shouldRunESRGAN),n=Oe(),r=i=>n(xwe(i.target.checked));return v.jsx(Us,{isDisabled:!e,isChecked:t,onChange:r})}function ZP(){const e=he(r=>r.generation.shouldGenerateVariations),t=Oe(),n=r=>t(gwe(r.target.checked));return v.jsx(Us,{isChecked:e,width:"auto",onChange:n})}function fr(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return v.jsxs(fn,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&v.jsx(En,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),v.jsx(bk,{...l,className:"input-entry",size:a,width:o})]})}function aOe(){const e=he(o=>o.generation.seedWeights),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ge(),r=Oe(),i=o=>r(EU(o.target.value));return v.jsx(fr,{label:n("parameters:seedWeights"),value:e,isInvalid:t&&!(pP(e)||e===""),isDisabled:!t,onChange:i})}function sOe(){const e=he(o=>o.generation.variationAmount),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ge(),r=Oe(),i=o=>r(vwe(o));return v.jsx(ia,{label:n("parameters:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const QP=()=>v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(sOe,{}),v.jsx(aOe,{})]});function lOe(){const e=Oe(),t=he(i=>i.generation.cfgScale),{t:n}=Ge(),r=i=>e(bU(i));return v.jsx(ia,{label:n("parameters:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function uOe(){const e=he(o=>o.generation.height),t=he(Mr),n=Oe(),{t:r}=Ge(),i=o=>n(SU(Number(o.target.value)));return v.jsx(rl,{isDisabled:t==="unifiedCanvas",label:r("parameters:height"),value:e,flexGrow:1,onChange:i,validValues:S7e,styleClass:"main-settings-block"})}const cOe=lt([e=>e.generation],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function dOe(){const e=Oe(),{iterations:t}=he(cOe),{t:n}=Ge(),r=i=>e(pwe(i));return v.jsx(ia,{label:n("parameters:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function fOe(){const e=he(o=>o.generation.sampler),t=he(oq),n=Oe(),{t:r}=Ge(),i=o=>n(_U(o.target.value));return v.jsx(rl,{label:r("parameters:sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?y7e:v7e,styleClass:"main-settings-block"})}function hOe(){const e=Oe(),t=he(i=>i.generation.steps),{t:n}=Ge(),r=i=>e(TU(i));return v.jsx(ia,{label:n("parameters:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function pOe(){const e=he(o=>o.generation.width),t=he(Mr),{t:n}=Ge(),r=Oe(),i=o=>r(AU(Number(o.target.value)));return v.jsx(rl,{isDisabled:t==="unifiedCanvas",label:n("parameters:width"),value:e,flexGrow:1,onChange:i,validValues:b7e,styleClass:"main-settings-block"})}function JP(){return v.jsx("div",{className:"main-settings",children:v.jsxs("div",{className:"main-settings-list",children:[v.jsxs("div",{className:"main-settings-row",children:[v.jsx(dOe,{}),v.jsx(hOe,{}),v.jsx(lOe,{})]}),v.jsxs("div",{className:"main-settings-row",children:[v.jsx(pOe,{}),v.jsx(uOe,{}),v.jsx(fOe,{})]})]})})}const gOe=lt(or,e=>e.shouldDisplayGuides),mOe=({children:e,feature:t})=>{const n=he(gOe),{text:r}=QAe(t);return n?v.jsxs(BE,{trigger:"hover",children:[v.jsx(zE,{children:v.jsx(Eo,{children:e})}),v.jsxs($E,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[v.jsx(FE,{className:"guide-popover-arrow"}),v.jsx("div",{className:"guide-popover-guide-content",children:r})]})]}):null},vOe=Ae(({feature:e,icon:t=oPe},n)=>v.jsx(mOe,{feature:e,children:v.jsx(Eo,{ref:n,children:v.jsx(Na,{marginBottom:"-.15rem",as:t})})}));function yOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return v.jsxs(Xg,{className:"advanced-parameters-item",children:[v.jsx(Yg,{className:"advanced-parameters-header",children:v.jsxs(je,{width:"100%",gap:"0.5rem",align:"center",children:[v.jsx(Eo,{flexGrow:1,textAlign:"left",children:t}),i,n&&v.jsx(vOe,{feature:n}),v.jsx(Kg,{})]})}),v.jsx(Zg,{className:"advanced-parameters-panel",children:r})]})}const eT=e=>{const{accordionInfo:t}=e,n=he(a=>a.system.openAccordions),r=Oe(),i=a=>r(lCe(a)),o=()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:d,additionalHeaderComponents:h}=t[s];a.push(v.jsx(yOe,{header:l,feature:u,content:d,additionalHeaderComponents:h},s))}),a};return v.jsx(dk,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:i,className:"advanced-parameters",children:o()})},bOe=lt(or,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function tT(e){const{...t}=e,n=Oe(),{isProcessing:r,isConnected:i,isCancelable:o}=he(bOe),a=()=>n(J8e()),{t:s}=Ge();return et("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),v.jsx(Je,{icon:v.jsx(uPe,{}),tooltip:s("parameters:cancel"),"aria-label":s("parameters:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const nT=e=>e.generation;lt(nT,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:ke.isEqual}});const $Y=lt([nT,or,Iq,Mr],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:d}=t;let h=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(h=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(h=!1,m.push("No initial image selected")),u&&(h=!1,m.push("System Busy")),d||(h=!1,m.push("System Disconnected")),o&&(!(pP(a)||a==="")||l===-1)&&(h=!1,m.push("Seed-Weights badly formatted.")),{isReady:h,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:ke.isEqual,resultEqualityCheck:ke.isEqual}});function rT(e){const{iconButton:t=!1,...n}=e,r=Oe(),{isReady:i}=he($Y),o=he(Mr),a=()=>{r(F8(o))},{t:s}=Ge();return et(["ctrl+enter","meta+enter"],()=>{r(F8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),v.jsx("div",{style:{flexGrow:4},children:t?v.jsx(Je,{"aria-label":s("parameters:invoke"),type:"submit",icon:v.jsx(MEe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("parameters:invoke"),tooltipProps:{placement:"bottom"},...n}):v.jsx(nr,{"aria-label":s("parameters:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const SOe=lt(Wy,({shouldLoopback:e})=>e),xOe=()=>{const e=Oe(),t=he(SOe),{t:n}=Ge();return v.jsx(Je,{"aria-label":n("parameters:toggleLoopback"),tooltip:n("parameters:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:v.jsx(REe,{}),onClick:()=>{e(Swe(!t))}})},iT=()=>{const e=he(Mr);return v.jsxs("div",{className:"process-buttons",children:[v.jsx(rT,{}),e==="img2img"&&v.jsx(xOe,{}),v.jsx(tT,{})]})},oT=()=>{const e=he(r=>r.generation.negativePrompt),t=Oe(),{t:n}=Ge();return v.jsx(fn,{children:v.jsx(GE,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(ny(r.target.value)),background:"var(--prompt-bg-color)",placeholder:n("parameters:negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},wOe=lt([e=>e.generation,Mr],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),aT=()=>{const e=Oe(),{prompt:t,activeTabName:n}=he(wOe),{isReady:r}=he($Y),i=w.useRef(null),{t:o}=Ge(),a=l=>{e($x(l.target.value))};et("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(F8(n)))};return v.jsx("div",{className:"prompt-bar",children:v.jsx(fn,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:v.jsx(GE,{id:"prompt",name:"prompt",placeholder:o("parameters:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},zY=""+new URL("logo-13003d72.png",import.meta.url).href,COe=lt(Sp,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),sT=e=>{const t=Oe(),{shouldShowParametersPanel:n,shouldHoldParametersPanelOpen:r,shouldPinParametersPanel:i}=he(COe),o=w.useRef(null),a=w.useRef(null),s=w.useRef(null),{children:l}=e;et("o",()=>{t(Zu(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),et("esc",()=>{t(Zu(!1))},{enabled:()=>!i,preventDefault:!0},[i]),et("shift+o",()=>{m(),t(vi(!0))},[i]);const u=w.useCallback(()=>{i||(t(CCe(a.current?a.current.scrollTop:0)),t(Zu(!1)),t(_Ce(!1)))},[t,i]),d=()=>{s.current=window.setTimeout(()=>u(),500)},h=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(kCe(!i)),t(vi(!0))};return w.useEffect(()=>{function y(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[u]),v.jsx(Vq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:v.jsx("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:h,onMouseOver:i?void 0:h,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:v.jsx("div",{className:"parameters-panel-margin",children:v.jsxs("div",{className:"parameters-panel",ref:a,onMouseLeave:y=>{y.target!==a.current?h():!i&&d()},children:[v.jsx(uo,{label:"Pin Options Panel",children:v.jsx("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:m,children:i?v.jsx(Bq,{}):v.jsx(Fq,{})})}),!i&&v.jsxs("div",{className:"invoke-ai-logo-wrapper",children:[v.jsx("img",{src:zY,alt:"invoke-ai-logo"}),v.jsxs("h1",{children:["invoke ",v.jsx("strong",{children:"ai"})]})]}),l]})})})})};function _Oe(){const{t:e}=Ge(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:v.jsx(XP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:v.jsx(QP,{}),additionalHeaderComponents:v.jsx(ZP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:v.jsx(LP,{}),additionalHeaderComponents:v.jsx(NY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:v.jsx(AP,{}),additionalHeaderComponents:v.jsx(FY,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:v.jsx(eOe,{})}},n=Oe(),r=he(Mr);return w.useEffect(()=>{r==="img2img"&&n(gP(!1))},[r,n]),v.jsxs(sT,{children:[v.jsxs(je,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(aT,{}),v.jsx(oT,{})]}),v.jsx(iT,{}),v.jsx(JP,{}),v.jsx(jY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),v.jsx(JAe,{}),v.jsx(eT,{accordionInfo:t})]})}function kOe(){return v.jsx(KP,{optionsPanel:v.jsx(_Oe,{}),children:v.jsx(XAe,{})})}const EOe=()=>v.jsx("div",{className:"workarea-single-view",children:v.jsx("div",{className:"text-to-image-area",children:v.jsx(DY,{})})}),POe=lt([Wy],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),TOe=()=>{const{hiresFix:e,hiresStrength:t}=he(POe),n=Oe(),{t:r}=Ge(),i=a=>{n(ZI(a))},o=()=>{n(ZI(.75))};return v.jsx(so,{label:r("parameters:hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:o,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},LOe=()=>{const e=Oe(),t=he(i=>i.postprocessing.hiresFix),{t:n}=Ge(),r=i=>e(gP(i.target.checked));return v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(Us,{label:n("parameters:hiresOptim"),fontSize:"md",isChecked:t,onChange:r}),v.jsx(TOe,{})]})},AOe=()=>v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(BY,{}),v.jsx(LOe,{})]});function OOe(){const{t:e}=Ge(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:v.jsx(XP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:v.jsx(QP,{}),additionalHeaderComponents:v.jsx(ZP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:v.jsx(LP,{}),additionalHeaderComponents:v.jsx(NY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:v.jsx(AP,{}),additionalHeaderComponents:v.jsx(FY,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:v.jsx(AOe,{})}};return v.jsxs(sT,{children:[v.jsxs(je,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(aT,{}),v.jsx(oT,{})]}),v.jsx(iT,{}),v.jsx(JP,{}),v.jsx(eT,{accordionInfo:t})]})}function MOe(){return v.jsx(KP,{optionsPanel:v.jsx(OOe,{}),children:v.jsx(EOe,{})})}var t_={},IOe={get exports(){return t_},set exports(e){t_=e}};/** +`,aN={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};BAe($Ae);var FAe=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=w.useContext(RY).setComponents,u=w.useRef(null),d=w.useRef(null);return w.useEffect(function(){var h=u.current,m=d.current;h!==null&&m!==null&&l&&l(h,m)},[]),N.createElement("div",{ref:u,className:"react-transform-wrapper "+aN.wrapper+" "+r,style:a},N.createElement("div",{ref:d,className:"react-transform-component "+aN.content+" "+o,style:s},t))};function zAe({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=w.useState(0),[a,s]=w.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},d=()=>{s(!a)};return v.jsx(jAe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:h,zoomOut:m,resetTransform:y,centerView:b})=>v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"lightbox-image-options",children:[v.jsx(Je,{icon:v.jsx(O_e,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>h(),fontSize:20}),v.jsx(Je,{icon:v.jsx(M_e,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),v.jsx(Je,{icon:v.jsx(L_e,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),v.jsx(Je,{icon:v.jsx(A_e,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),v.jsx(Je,{icon:v.jsx(lPe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),v.jsx(Je,{icon:v.jsx(Yx,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{y(),o(0),s(!1)},fontSize:20})]}),v.jsx(FAe,{wrapperStyle:{width:"100%",height:"100%"},children:v.jsx("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function HAe(){const e=Oe(),t=pe(m=>m.lightbox.isLightboxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=pe(Nq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(fP())},h=()=>{e(dP())};return et("Esc",()=>{t&&e(Vm(!1))},[t]),v.jsxs("div",{className:"lightbox-container",children:[v.jsx(Je,{icon:v.jsx(T_e,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Vm(!1))},fontSize:20}),v.jsxs("div",{className:"lightbox-display-container",children:[v.jsxs("div",{className:"lightbox-preview-wrapper",children:[v.jsx(Rq,{}),!r&&v.jsxs("div",{className:"current-image-next-prev-buttons",children:[v.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&v.jsx(us,{"aria-label":"Previous image",icon:v.jsx(Cq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),v.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&v.jsx(us,{"aria-label":"Next image",icon:v.jsx(_q,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),n&&v.jsxs(v.Fragment,{children:[v.jsx(zAe,{image:n.url,styleClass:"lightbox-image"}),r&&v.jsx($P,{image:n})]})]}),v.jsx(xY,{})]})]})}function VAe(e){return mt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}const WAe=lt(Cp,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),UAe=()=>{const{resultImages:e,userImages:t}=pe(WAe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},GAe=lt([xp,qx,Mr],(e,t,n)=>{const{shouldShowDualDisplay:r,shouldPinParametersPanel:i}=e,{isLightboxOpen:o}=t;return{shouldShowDualDisplay:r,shouldPinParametersPanel:i,isLightboxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KP=e=>{const t=Oe(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,shouldShowDualDisplay:a,isLightboxOpen:s,shouldShowDualDisplayButton:l}=pe(GAe),u=UAe(),d=()=>{t(PCe(!a)),t(vi(!0))},h=m=>{const y=m.dataTransfer.getData("invokeai/imageUuid"),b=u(y);b&&(o==="img2img"?t(L0(b)):o==="unifiedCanvas"&&t($x(b)))};return v.jsx("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:v.jsxs("div",{className:"workarea-main",children:[n,v.jsxs("div",{className:"workarea-children-wrapper",onDrop:h,children:[r,l&&v.jsx(yi,{label:"Toggle Split View",children:v.jsx("div",{className:"workarea-split-button","data-selected":a,onClick:d,children:v.jsx(VAe,{})})})]}),!s&&v.jsx(xY,{})]})})},qAe=e=>{const{styleClass:t}=e,n=w.useContext(PP),r=()=>{n&&n()};return v.jsx("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:v.jsxs("div",{className:"image-upload-button",children:[v.jsx(tw,{}),v.jsx($h,{size:"lg",children:"Click or Drag and Drop"})]})})},YAe=lt([Cp,xp,Mr],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),DY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=pe(YAe);return v.jsx("div",{className:"current-image-area","data-tab-name":t,children:e?v.jsxs(v.Fragment,{children:[v.jsx(Rq,{}),v.jsx(XEe,{})]}):v.jsx("div",{className:"current-image-display-placeholder",children:v.jsx(uPe,{})})})},KAe=()=>{const e=w.useContext(PP);return v.jsx(Je,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:v.jsx(tw,{}),onClick:e||void 0})};function XAe(){const e=pe(o=>o.generation.initialImage),{t}=Ge(),n=Oe(),r=Fy(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(vU())};return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"init-image-preview-header",children:[v.jsx("h2",{children:t("parameters:initialImage")}),v.jsx(KAe,{})]}),e&&v.jsx("div",{className:"init-image-preview",children:v.jsx(JS,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const ZAe=()=>{const e=pe(r=>r.generation.initialImage),{currentImage:t}=pe(r=>r.gallery),n=e?v.jsx("div",{className:"image-to-image-area",children:v.jsx(XAe,{})}):v.jsx(qAe,{});return v.jsxs("div",{className:"workarea-split-view",children:[v.jsx("div",{className:"workarea-split-view-left",children:n}),t&&v.jsx("div",{className:"workarea-split-view-right",children:v.jsx(DY,{})})]})};var so=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(so||{});const QAe=()=>{const{t:e}=Ge();return w.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},JAe=e=>QAe()[e],Us=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return v.jsxs(fn,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[v.jsx(En,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),v.jsx(UE,{className:"invokeai__switch-root",...s})]})};function NY(){const e=pe(i=>i.system.isGFPGANAvailable),t=pe(i=>i.postprocessing.shouldRunFacetool),n=Oe(),r=i=>n(wwe(i.target.checked));return v.jsx(Us,{isDisabled:!e,isChecked:t,onChange:r})}function eOe(){const e=Oe(),t=pe(i=>i.generation.shouldFitToWidthHeight),n=i=>e(PU(i.target.checked)),{t:r}=Ge();return v.jsx(Us,{label:r("parameters:imageFit"),isChecked:t,onChange:n})}function jY(e){const{t}=Ge(),{label:n=`${t("parameters:strength")}`,styleClass:r}=e,i=pe(l=>l.generation.img2imgStrength),o=Oe(),a=l=>o(p8(l)),s=()=>{o(p8(.75))};return v.jsx(lo,{label:n,step:.01,min:.01,max:1,onChange:a,value:i,isInteger:!1,styleClass:r,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:s})}const BY=()=>{const e=Oe(),t=pe(i=>i.generation.seamless),n=i=>e(kU(i.target.checked)),{t:r}=Ge();return v.jsx(je,{gap:2,direction:"column",children:v.jsx(Us,{label:r("parameters:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},tOe=()=>v.jsx(je,{gap:2,direction:"column",children:v.jsx(BY,{})});function nOe(){const e=Oe(),t=pe(i=>i.generation.perlin),{t:n}=Ge(),r=i=>e(CU(i));return v.jsx(ia,{label:n("parameters:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}function rOe(){const e=Oe(),{t}=Ge(),n=pe(i=>i.generation.shouldRandomizeSeed),r=i=>e(mwe(i.target.checked));return v.jsx(Us,{label:t("parameters:randomizeSeed"),isChecked:n,onChange:r})}function iOe(){const e=pe(a=>a.generation.seed),t=pe(a=>a.generation.shouldRandomizeSeed),n=pe(a=>a.generation.shouldGenerateVariations),{t:r}=Ge(),i=Oe(),o=a=>i(Hy(a));return v.jsx(ia,{label:r("parameters:seed"),step:1,precision:0,flexGrow:1,min:SP,max:xP,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function oOe(){const e=Oe(),t=pe(i=>i.generation.shouldRandomizeSeed),{t:n}=Ge(),r=()=>e(Hy(eq(SP,xP)));return v.jsx(ls,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:v.jsx("p",{children:n("parameters:shuffle")})})}function aOe(){const e=Oe(),t=pe(i=>i.generation.threshold),{t:n}=Ge(),r=i=>e(LU(i));return v.jsx(ia,{label:n("parameters:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}const XP=()=>v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(rOe,{}),v.jsxs(je,{gap:2,children:[v.jsx(iOe,{}),v.jsx(oOe,{})]}),v.jsx(je,{gap:2,children:v.jsx(aOe,{})}),v.jsx(je,{gap:2,children:v.jsx(nOe,{})})]});function $Y(){const e=pe(i=>i.system.isESRGANAvailable),t=pe(i=>i.postprocessing.shouldRunESRGAN),n=Oe(),r=i=>n(xwe(i.target.checked));return v.jsx(Us,{isDisabled:!e,isChecked:t,onChange:r})}function ZP(){const e=pe(r=>r.generation.shouldGenerateVariations),t=Oe(),n=r=>t(gwe(r.target.checked));return v.jsx(Us,{isChecked:e,width:"auto",onChange:n})}function fr(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return v.jsxs(fn,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&v.jsx(En,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),v.jsx(bk,{...l,className:"input-entry",size:a,width:o})]})}function sOe(){const e=pe(o=>o.generation.seedWeights),t=pe(o=>o.generation.shouldGenerateVariations),{t:n}=Ge(),r=Oe(),i=o=>r(EU(o.target.value));return v.jsx(fr,{label:n("parameters:seedWeights"),value:e,isInvalid:t&&!(pP(e)||e===""),isDisabled:!t,onChange:i})}function lOe(){const e=pe(o=>o.generation.variationAmount),t=pe(o=>o.generation.shouldGenerateVariations),{t:n}=Ge(),r=Oe(),i=o=>r(vwe(o));return v.jsx(ia,{label:n("parameters:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const QP=()=>v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(lOe,{}),v.jsx(sOe,{})]});function uOe(){const e=Oe(),t=pe(i=>i.generation.cfgScale),{t:n}=Ge(),r=i=>e(bU(i));return v.jsx(ia,{label:n("parameters:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function cOe(){const e=pe(o=>o.generation.height),t=pe(Mr),n=Oe(),{t:r}=Ge(),i=o=>n(SU(Number(o.target.value)));return v.jsx(rl,{isDisabled:t==="unifiedCanvas",label:r("parameters:height"),value:e,flexGrow:1,onChange:i,validValues:x7e,styleClass:"main-settings-block"})}const dOe=lt([e=>e.generation],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function fOe(){const e=Oe(),{iterations:t}=pe(dOe),{t:n}=Ge(),r=i=>e(pwe(i));return v.jsx(ia,{label:n("parameters:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function hOe(){const e=pe(o=>o.generation.sampler),t=pe(oq),n=Oe(),{t:r}=Ge(),i=o=>n(_U(o.target.value));return v.jsx(rl,{label:r("parameters:sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?b7e:y7e,styleClass:"main-settings-block"})}function pOe(){const e=Oe(),t=pe(i=>i.generation.steps),{t:n}=Ge(),r=i=>e(TU(i));return v.jsx(ia,{label:n("parameters:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function gOe(){const e=pe(o=>o.generation.width),t=pe(Mr),{t:n}=Ge(),r=Oe(),i=o=>r(AU(Number(o.target.value)));return v.jsx(rl,{isDisabled:t==="unifiedCanvas",label:n("parameters:width"),value:e,flexGrow:1,onChange:i,validValues:S7e,styleClass:"main-settings-block"})}function JP(){return v.jsx("div",{className:"main-settings",children:v.jsxs("div",{className:"main-settings-list",children:[v.jsxs("div",{className:"main-settings-row",children:[v.jsx(fOe,{}),v.jsx(pOe,{}),v.jsx(uOe,{})]}),v.jsxs("div",{className:"main-settings-row",children:[v.jsx(gOe,{}),v.jsx(cOe,{}),v.jsx(hOe,{})]})]})})}const mOe=lt(or,e=>e.shouldDisplayGuides),vOe=({children:e,feature:t})=>{const n=pe(mOe),{text:r}=JAe(t);return n?v.jsxs(BE,{trigger:"hover",children:[v.jsx(zE,{children:v.jsx(Eo,{children:e})}),v.jsxs(FE,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[v.jsx($E,{className:"guide-popover-arrow"}),v.jsx("div",{className:"guide-popover-guide-content",children:r})]})]}):null},yOe=Ae(({feature:e,icon:t=aPe},n)=>v.jsx(vOe,{feature:e,children:v.jsx(Eo,{ref:n,children:v.jsx(Na,{marginBottom:"-.15rem",as:t})})}));function bOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return v.jsxs(Qg,{className:"advanced-parameters-item",children:[v.jsx(Xg,{className:"advanced-parameters-header",children:v.jsxs(je,{width:"100%",gap:"0.5rem",align:"center",children:[v.jsx(Eo,{flexGrow:1,textAlign:"left",children:t}),i,n&&v.jsx(yOe,{feature:n}),v.jsx(Zg,{})]})}),v.jsx(Jg,{className:"advanced-parameters-panel",children:r})]})}const eT=e=>{const{accordionInfo:t}=e,n=pe(a=>a.system.openAccordions),r=Oe(),i=a=>r(lCe(a)),o=()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:d,additionalHeaderComponents:h}=t[s];a.push(v.jsx(bOe,{header:l,feature:u,content:d,additionalHeaderComponents:h},s))}),a};return v.jsx(dk,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:i,className:"advanced-parameters",children:o()})},SOe=lt(or,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function tT(e){const{...t}=e,n=Oe(),{isProcessing:r,isConnected:i,isCancelable:o}=pe(SOe),a=()=>n(e_e()),{t:s}=Ge();return et("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),v.jsx(Je,{icon:v.jsx(cPe,{}),tooltip:s("parameters:cancel"),"aria-label":s("parameters:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const nT=e=>e.generation;lt(nT,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:ke.isEqual}});const FY=lt([nT,or,Iq,Mr],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:d}=t;let h=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(h=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(h=!1,m.push("No initial image selected")),u&&(h=!1,m.push("System Busy")),d||(h=!1,m.push("System Disconnected")),o&&(!(pP(a)||a==="")||l===-1)&&(h=!1,m.push("Seed-Weights badly formatted.")),{isReady:h,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:ke.isEqual,resultEqualityCheck:ke.isEqual}});function rT(e){const{iconButton:t=!1,...n}=e,r=Oe(),{isReady:i}=pe(FY),o=pe(Mr),a=()=>{r($8(o))},{t:s}=Ge();return et(["ctrl+enter","meta+enter"],()=>{r($8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),v.jsx("div",{style:{flexGrow:4},children:t?v.jsx(Je,{"aria-label":s("parameters:invoke"),type:"submit",icon:v.jsx(IEe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("parameters:invoke"),tooltipProps:{placement:"bottom"},...n}):v.jsx(nr,{"aria-label":s("parameters:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const xOe=lt(Gy,({shouldLoopback:e})=>e),wOe=()=>{const e=Oe(),t=pe(xOe),{t:n}=Ge();return v.jsx(Je,{"aria-label":n("parameters:toggleLoopback"),tooltip:n("parameters:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:v.jsx(DEe,{}),onClick:()=>{e(Swe(!t))}})},iT=()=>{const e=pe(Mr);return v.jsxs("div",{className:"process-buttons",children:[v.jsx(rT,{}),e==="img2img"&&v.jsx(wOe,{}),v.jsx(tT,{})]})},oT=()=>{const e=pe(r=>r.generation.negativePrompt),t=Oe(),{t:n}=Ge();return v.jsx(fn,{children:v.jsx(GE,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(iy(r.target.value)),background:"var(--prompt-bg-color)",placeholder:n("parameters:negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},COe=lt([e=>e.generation,Mr],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),aT=()=>{const e=Oe(),{prompt:t,activeTabName:n}=pe(COe),{isReady:r}=pe(FY),i=w.useRef(null),{t:o}=Ge(),a=l=>{e(Fx(l.target.value))};et("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e($8(n)))};return v.jsx("div",{className:"prompt-bar",children:v.jsx(fn,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:v.jsx(GE,{id:"prompt",name:"prompt",placeholder:o("parameters:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},zY=""+new URL("logo-13003d72.png",import.meta.url).href,_Oe=lt(xp,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),sT=e=>{const t=Oe(),{shouldShowParametersPanel:n,shouldHoldParametersPanelOpen:r,shouldPinParametersPanel:i}=pe(_Oe),o=w.useRef(null),a=w.useRef(null),s=w.useRef(null),{children:l}=e;et("o",()=>{t(Zu(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),et("esc",()=>{t(Zu(!1))},{enabled:()=>!i,preventDefault:!0},[i]),et("shift+o",()=>{m(),t(vi(!0))},[i]);const u=w.useCallback(()=>{i||(t(_Ce(a.current?a.current.scrollTop:0)),t(Zu(!1)),t(kCe(!1)))},[t,i]),d=()=>{s.current=window.setTimeout(()=>u(),500)},h=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(ECe(!i)),t(vi(!0))};return w.useEffect(()=>{function y(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[u]),v.jsx(Vq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:v.jsx("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:h,onMouseOver:i?void 0:h,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:v.jsx("div",{className:"parameters-panel-margin",children:v.jsxs("div",{className:"parameters-panel",ref:a,onMouseLeave:y=>{y.target!==a.current?h():!i&&d()},children:[v.jsx(yi,{label:"Pin Options Panel",children:v.jsx("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:m,children:i?v.jsx(Bq,{}):v.jsx($q,{})})}),!i&&v.jsxs("div",{className:"invoke-ai-logo-wrapper",children:[v.jsx("img",{src:zY,alt:"invoke-ai-logo"}),v.jsxs("h1",{children:["invoke ",v.jsx("strong",{children:"ai"})]})]}),l]})})})})};function kOe(){const{t:e}=Ge(),t={seed:{header:`${e("parameters:seed")}`,feature:so.SEED,content:v.jsx(XP,{})},variations:{header:`${e("parameters:variations")}`,feature:so.VARIATIONS,content:v.jsx(QP,{}),additionalHeaderComponents:v.jsx(ZP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:so.FACE_CORRECTION,content:v.jsx(LP,{}),additionalHeaderComponents:v.jsx(NY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:so.UPSCALE,content:v.jsx(AP,{}),additionalHeaderComponents:v.jsx($Y,{})},other:{header:`${e("parameters:otherOptions")}`,feature:so.OTHER,content:v.jsx(tOe,{})}},n=Oe(),r=pe(Mr);return w.useEffect(()=>{r==="img2img"&&n(gP(!1))},[r,n]),v.jsxs(sT,{children:[v.jsxs(je,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(aT,{}),v.jsx(oT,{})]}),v.jsx(iT,{}),v.jsx(JP,{}),v.jsx(jY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),v.jsx(eOe,{}),v.jsx(eT,{accordionInfo:t})]})}function EOe(){return v.jsx(KP,{optionsPanel:v.jsx(kOe,{}),children:v.jsx(ZAe,{})})}const POe=()=>v.jsx("div",{className:"workarea-single-view",children:v.jsx("div",{className:"text-to-image-area",children:v.jsx(DY,{})})}),TOe=lt([Gy],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),LOe=()=>{const{hiresFix:e,hiresStrength:t}=pe(TOe),n=Oe(),{t:r}=Ge(),i=a=>{n(ZI(a))},o=()=>{n(ZI(.75))};return v.jsx(lo,{label:r("parameters:hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:o,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},AOe=()=>{const e=Oe(),t=pe(i=>i.postprocessing.hiresFix),{t:n}=Ge(),r=i=>e(gP(i.target.checked));return v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(Us,{label:n("parameters:hiresOptim"),fontSize:"md",isChecked:t,onChange:r}),v.jsx(LOe,{})]})},OOe=()=>v.jsxs(je,{gap:2,direction:"column",children:[v.jsx(BY,{}),v.jsx(AOe,{})]});function MOe(){const{t:e}=Ge(),t={seed:{header:`${e("parameters:seed")}`,feature:so.SEED,content:v.jsx(XP,{})},variations:{header:`${e("parameters:variations")}`,feature:so.VARIATIONS,content:v.jsx(QP,{}),additionalHeaderComponents:v.jsx(ZP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:so.FACE_CORRECTION,content:v.jsx(LP,{}),additionalHeaderComponents:v.jsx(NY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:so.UPSCALE,content:v.jsx(AP,{}),additionalHeaderComponents:v.jsx($Y,{})},other:{header:`${e("parameters:otherOptions")}`,feature:so.OTHER,content:v.jsx(OOe,{})}};return v.jsxs(sT,{children:[v.jsxs(je,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(aT,{}),v.jsx(oT,{})]}),v.jsx(iT,{}),v.jsx(JP,{}),v.jsx(eT,{accordionInfo:t})]})}function IOe(){return v.jsx(KP,{optionsPanel:v.jsx(MOe,{}),children:v.jsx(POe,{})})}var t_={},ROe={get exports(){return t_},set exports(e){t_=e}};/** * @license React * react-reconciler.production.min.js * @@ -527,17 +527,17 @@ PERFORMANCE OF THIS SOFTWARE. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ROe=function(t){var n={},r=w,i=zh,o=Object.assign;function a(f){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+f,S=1;Sle||L[q]!==I[le]){var pe=` -`+L[q].replace(" at new "," at ");return f.displayName&&pe.includes("")&&(pe=pe.replace("",f.displayName)),pe}while(1<=q&&0<=le);break}}}finally{ll=!1,Error.prepareStackTrace=S}return(f=f?f.displayName||f.name:"")?Su(f):""}var Mp=Object.prototype.hasOwnProperty,Cc=[],ul=-1;function aa(f){return{current:f}}function Dn(f){0>ul||(f.current=Cc[ul],Cc[ul]=null,ul--)}function Tn(f,p){ul++,Cc[ul]=f.current,f.current=p}var sa={},Hr=aa(sa),li=aa(!1),la=sa;function cl(f,p){var S=f.type.contextTypes;if(!S)return sa;var T=f.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===p)return T.__reactInternalMemoizedMaskedChildContext;var L={},I;for(I in S)L[I]=p[I];return T&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=p,f.__reactInternalMemoizedMaskedChildContext=L),L}function ui(f){return f=f.childContextTypes,f!=null}function bs(){Dn(li),Dn(Hr)}function wf(f,p,S){if(Hr.current!==sa)throw Error(a(168));Tn(Hr,p),Tn(li,S)}function wu(f,p,S){var T=f.stateNode;if(p=p.childContextTypes,typeof T.getChildContext!="function")return S;T=T.getChildContext();for(var L in T)if(!(L in p))throw Error(a(108,j(f)||"Unknown",L));return o({},S,T)}function Ss(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||sa,la=Hr.current,Tn(Hr,f),Tn(li,li.current),!0}function Cf(f,p,S){var T=f.stateNode;if(!T)throw Error(a(169));S?(f=wu(f,p,la),T.__reactInternalMemoizedMergedChildContext=f,Dn(li),Dn(Hr),Tn(Hr,f)):Dn(li),Tn(li,S)}var Ii=Math.clz32?Math.clz32:_f,Ip=Math.log,Rp=Math.LN2;function _f(f){return f>>>=0,f===0?32:31-(Ip(f)/Rp|0)|0}var dl=64,Ro=4194304;function fl(f){switch(f&-f){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function Cu(f,p){var S=f.pendingLanes;if(S===0)return 0;var T=0,L=f.suspendedLanes,I=f.pingedLanes,q=S&268435455;if(q!==0){var le=q&~L;le!==0?T=fl(le):(I&=q,I!==0&&(T=fl(I)))}else q=S&~L,q!==0?T=fl(q):I!==0&&(T=fl(I));if(T===0)return 0;if(p!==0&&p!==T&&!(p&L)&&(L=T&-T,I=p&-p,L>=I||L===16&&(I&4194240)!==0))return p;if(T&4&&(T|=S&16),p=f.entangledLanes,p!==0)for(f=f.entanglements,p&=T;0S;S++)p.push(f);return p}function $a(f,p,S){f.pendingLanes|=p,p!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,p=31-Ii(p),f[p]=S}function Ef(f,p){var S=f.pendingLanes&~p;f.pendingLanes=p,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=p,f.mutableReadLanes&=p,f.entangledLanes&=p,p=f.entanglements;var T=f.eventTimes;for(f=f.expirationTimes;0>=q,L-=q,co=1<<32-Ii(p)+L|S<Gt?(ti=Rt,Rt=null):ti=Rt.sibling;var en=ot(me,Rt,Se[Gt],tt);if(en===null){Rt===null&&(Rt=ti);break}f&&Rt&&en.alternate===null&&p(me,Rt),ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en,Rt=ti}if(Gt===Se.length)return S(me,Rt),Wn&&hl(me,Gt),Ie;if(Rt===null){for(;GtGt?(ti=Rt,Rt=null):ti=Rt.sibling;var Ls=ot(me,Rt,en.value,tt);if(Ls===null){Rt===null&&(Rt=ti);break}f&&Rt&&Ls.alternate===null&&p(me,Rt),ue=I(Ls,ue,Gt),Bt===null?Ie=Ls:Bt.sibling=Ls,Bt=Ls,Rt=ti}if(en.done)return S(me,Rt),Wn&&hl(me,Gt),Ie;if(Rt===null){for(;!en.done;Gt++,en=Se.next())en=jt(me,en.value,tt),en!==null&&(ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en);return Wn&&hl(me,Gt),Ie}for(Rt=T(me,Rt);!en.done;Gt++,en=Se.next())en=Gn(Rt,me,Gt,en.value,tt),en!==null&&(f&&en.alternate!==null&&Rt.delete(en.key===null?Gt:en.key),ue=I(en,ue,Gt),Bt===null?Ie=en:Bt.sibling=en,Bt=en);return f&&Rt.forEach(function(ki){return p(me,ki)}),Wn&&hl(me,Gt),Ie}function ba(me,ue,Se,tt){if(typeof Se=="object"&&Se!==null&&Se.type===d&&Se.key===null&&(Se=Se.props.children),typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case l:e:{for(var Ie=Se.key,Bt=ue;Bt!==null;){if(Bt.key===Ie){if(Ie=Se.type,Ie===d){if(Bt.tag===7){S(me,Bt.sibling),ue=L(Bt,Se.props.children),ue.return=me,me=ue;break e}}else if(Bt.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===P&&i1(Ie)===Bt.type){S(me,Bt.sibling),ue=L(Bt,Se.props),ue.ref=Va(me,Bt,Se),ue.return=me,me=ue;break e}S(me,Bt);break}else p(me,Bt);Bt=Bt.sibling}Se.type===d?(ue=Pl(Se.props.children,me.mode,tt,Se.key),ue.return=me,me=ue):(tt=eh(Se.type,Se.key,Se.props,null,me.mode,tt),tt.ref=Va(me,ue,Se),tt.return=me,me=tt)}return q(me);case u:e:{for(Bt=Se.key;ue!==null;){if(ue.key===Bt)if(ue.tag===4&&ue.stateNode.containerInfo===Se.containerInfo&&ue.stateNode.implementation===Se.implementation){S(me,ue.sibling),ue=L(ue,Se.children||[]),ue.return=me,me=ue;break e}else{S(me,ue);break}else p(me,ue);ue=ue.sibling}ue=Tl(Se,me.mode,tt),ue.return=me,me=ue}return q(me);case P:return Bt=Se._init,ba(me,ue,Bt(Se._payload),tt)}if(W(Se))return Nn(me,ue,Se,tt);if(R(Se))return vr(me,ue,Se,tt);Xi(me,Se)}return typeof Se=="string"&&Se!==""||typeof Se=="number"?(Se=""+Se,ue!==null&&ue.tag===6?(S(me,ue.sibling),ue=L(ue,Se),ue.return=me,me=ue):(S(me,ue),ue=xg(Se,me.mode,tt),ue.return=me,me=ue),q(me)):S(me,ue)}return ba}var Rc=s3(!0),l3=s3(!1),jf={},Bo=aa(jf),Wa=aa(jf),oe=aa(jf);function we(f){if(f===jf)throw Error(a(174));return f}function ve(f,p){Tn(oe,p),Tn(Wa,f),Tn(Bo,jf),f=Z(p),Dn(Bo),Tn(Bo,f)}function it(){Dn(Bo),Dn(Wa),Dn(oe)}function It(f){var p=we(oe.current),S=we(Bo.current);p=U(S,f.type,p),S!==p&&(Tn(Wa,f),Tn(Bo,p))}function on(f){Wa.current===f&&(Dn(Bo),Dn(Wa))}var Ft=aa(0);function mn(f){for(var p=f;p!==null;){if(p.tag===13){var S=p.memoizedState;if(S!==null&&(S=S.dehydrated,S===null||xc(S)||xf(S)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if(p.flags&128)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var Bf=[];function o1(){for(var f=0;fS?S:4,f(!0);var T=Dc.transition;Dc.transition={};try{f(!1),p()}finally{Kt=S,Dc.transition=T}}function Hc(){return Ni().memoizedState}function h1(f,p,S){var T=qr(f);if(S={lane:T,action:S,hasEagerState:!1,eagerState:null,next:null},Wc(f))Uc(p,S);else if(S=Ic(f,p,S,T),S!==null){var L=_i();zo(S,f,T,L),Wf(S,p,T)}}function Vc(f,p,S){var T=qr(f),L={lane:T,action:S,hasEagerState:!1,eagerState:null,next:null};if(Wc(f))Uc(p,L);else{var I=f.alternate;if(f.lanes===0&&(I===null||I.lanes===0)&&(I=p.lastRenderedReducer,I!==null))try{var q=p.lastRenderedState,le=I(q,S);if(L.hasEagerState=!0,L.eagerState=le,Y(le,q)){var pe=p.interleaved;pe===null?(L.next=L,Df(p)):(L.next=pe.next,pe.next=L),p.interleaved=L;return}}catch{}finally{}S=Ic(f,p,L,T),S!==null&&(L=_i(),zo(S,f,T,L),Wf(S,p,T))}}function Wc(f){var p=f.alternate;return f===Ln||p!==null&&p===Ln}function Uc(f,p){Ff=cn=!0;var S=f.pending;S===null?p.next=p:(p.next=S.next,S.next=p),f.pending=p}function Wf(f,p,S){if(S&4194240){var T=p.lanes;T&=f.pendingLanes,S|=T,p.lanes=S,_u(f,S)}}var Cs={readContext:fo,useCallback:Si,useContext:Si,useEffect:Si,useImperativeHandle:Si,useInsertionEffect:Si,useLayoutEffect:Si,useMemo:Si,useReducer:Si,useRef:Si,useState:Si,useDebugValue:Si,useDeferredValue:Si,useTransition:Si,useMutableSource:Si,useSyncExternalStore:Si,useId:Si,unstable_isNewReconciler:!1},Sw={readContext:fo,useCallback:function(f,p){return di().memoizedState=[f,p===void 0?null:p],f},useContext:fo,useEffect:d3,useImperativeHandle:function(f,p,S){return S=S!=null?S.concat([f]):null,Tu(4194308,4,Dr.bind(null,p,f),S)},useLayoutEffect:function(f,p){return Tu(4194308,4,f,p)},useInsertionEffect:function(f,p){return Tu(4,2,f,p)},useMemo:function(f,p){var S=di();return p=p===void 0?null:p,f=f(),S.memoizedState=[f,p],f},useReducer:function(f,p,S){var T=di();return p=S!==void 0?S(p):p,T.memoizedState=T.baseState=p,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:p},T.queue=f,f=f.dispatch=h1.bind(null,Ln,f),[T.memoizedState,f]},useRef:function(f){var p=di();return f={current:f},p.memoizedState=f},useState:c3,useDebugValue:c1,useDeferredValue:function(f){return di().memoizedState=f},useTransition:function(){var f=c3(!1),p=f[0];return f=f1.bind(null,f[1]),di().memoizedState=f,[p,f]},useMutableSource:function(){},useSyncExternalStore:function(f,p,S){var T=Ln,L=di();if(Wn){if(S===void 0)throw Error(a(407));S=S()}else{if(S=p(),ei===null)throw Error(a(349));Pu&30||u1(T,p,S)}L.memoizedState=S;var I={value:S,getSnapshot:p};return L.queue=I,d3(ml.bind(null,T,I,f),[f]),T.flags|=2048,Hf(9,$c.bind(null,T,I,S,p),void 0,null),S},useId:function(){var f=di(),p=ei.identifierPrefix;if(Wn){var S=za,T=co;S=(T&~(1<<32-Ii(T)-1)).toString(32)+S,p=":"+p+"R"+S,S=Nc++,0le||L[q]!==I[le]){var ge=` +`+L[q].replace(" at new "," at ");return f.displayName&&ge.includes("")&&(ge=ge.replace("",f.displayName)),ge}while(1<=q&&0<=le);break}}}finally{ll=!1,Error.prepareStackTrace=S}return(f=f?f.displayName||f.name:"")?Su(f):""}var Ip=Object.prototype.hasOwnProperty,Cc=[],ul=-1;function aa(f){return{current:f}}function Dn(f){0>ul||(f.current=Cc[ul],Cc[ul]=null,ul--)}function Tn(f,p){ul++,Cc[ul]=f.current,f.current=p}var sa={},Hr=aa(sa),li=aa(!1),la=sa;function cl(f,p){var S=f.type.contextTypes;if(!S)return sa;var T=f.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===p)return T.__reactInternalMemoizedMaskedChildContext;var L={},I;for(I in S)L[I]=p[I];return T&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=p,f.__reactInternalMemoizedMaskedChildContext=L),L}function ui(f){return f=f.childContextTypes,f!=null}function bs(){Dn(li),Dn(Hr)}function Cf(f,p,S){if(Hr.current!==sa)throw Error(a(168));Tn(Hr,p),Tn(li,S)}function wu(f,p,S){var T=f.stateNode;if(p=p.childContextTypes,typeof T.getChildContext!="function")return S;T=T.getChildContext();for(var L in T)if(!(L in p))throw Error(a(108,j(f)||"Unknown",L));return o({},S,T)}function Ss(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||sa,la=Hr.current,Tn(Hr,f),Tn(li,li.current),!0}function _f(f,p,S){var T=f.stateNode;if(!T)throw Error(a(169));S?(f=wu(f,p,la),T.__reactInternalMemoizedMergedChildContext=f,Dn(li),Dn(Hr),Tn(Hr,f)):Dn(li),Tn(li,S)}var Ri=Math.clz32?Math.clz32:kf,Rp=Math.log,Dp=Math.LN2;function kf(f){return f>>>=0,f===0?32:31-(Rp(f)/Dp|0)|0}var dl=64,Ro=4194304;function fl(f){switch(f&-f){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function Cu(f,p){var S=f.pendingLanes;if(S===0)return 0;var T=0,L=f.suspendedLanes,I=f.pingedLanes,q=S&268435455;if(q!==0){var le=q&~L;le!==0?T=fl(le):(I&=q,I!==0&&(T=fl(I)))}else q=S&~L,q!==0?T=fl(q):I!==0&&(T=fl(I));if(T===0)return 0;if(p!==0&&p!==T&&!(p&L)&&(L=T&-T,I=p&-p,L>=I||L===16&&(I&4194240)!==0))return p;if(T&4&&(T|=S&16),p=f.entangledLanes,p!==0)for(f=f.entanglements,p&=T;0S;S++)p.push(f);return p}function Fa(f,p,S){f.pendingLanes|=p,p!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,p=31-Ri(p),f[p]=S}function Pf(f,p){var S=f.pendingLanes&~p;f.pendingLanes=p,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=p,f.mutableReadLanes&=p,f.entangledLanes&=p,p=f.entanglements;var T=f.eventTimes;for(f=f.expirationTimes;0>=q,L-=q,co=1<<32-Ri(p)+L|S<Gt?(ti=Rt,Rt=null):ti=Rt.sibling;var en=ot(ve,Rt,be[Gt],tt);if(en===null){Rt===null&&(Rt=ti);break}f&&Rt&&en.alternate===null&&p(ve,Rt),ue=I(en,ue,Gt),$t===null?Ie=en:$t.sibling=en,$t=en,Rt=ti}if(Gt===be.length)return S(ve,Rt),Wn&&hl(ve,Gt),Ie;if(Rt===null){for(;GtGt?(ti=Rt,Rt=null):ti=Rt.sibling;var Ls=ot(ve,Rt,en.value,tt);if(Ls===null){Rt===null&&(Rt=ti);break}f&&Rt&&Ls.alternate===null&&p(ve,Rt),ue=I(Ls,ue,Gt),$t===null?Ie=Ls:$t.sibling=Ls,$t=Ls,Rt=ti}if(en.done)return S(ve,Rt),Wn&&hl(ve,Gt),Ie;if(Rt===null){for(;!en.done;Gt++,en=be.next())en=Bt(ve,en.value,tt),en!==null&&(ue=I(en,ue,Gt),$t===null?Ie=en:$t.sibling=en,$t=en);return Wn&&hl(ve,Gt),Ie}for(Rt=T(ve,Rt);!en.done;Gt++,en=be.next())en=Gn(Rt,ve,Gt,en.value,tt),en!==null&&(f&&en.alternate!==null&&Rt.delete(en.key===null?Gt:en.key),ue=I(en,ue,Gt),$t===null?Ie=en:$t.sibling=en,$t=en);return f&&Rt.forEach(function(Ei){return p(ve,Ei)}),Wn&&hl(ve,Gt),Ie}function ba(ve,ue,be,tt){if(typeof be=="object"&&be!==null&&be.type===d&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case l:e:{for(var Ie=be.key,$t=ue;$t!==null;){if($t.key===Ie){if(Ie=be.type,Ie===d){if($t.tag===7){S(ve,$t.sibling),ue=L($t,be.props.children),ue.return=ve,ve=ue;break e}}else if($t.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===P&&o1(Ie)===$t.type){S(ve,$t.sibling),ue=L($t,be.props),ue.ref=Va(ve,$t,be),ue.return=ve,ve=ue;break e}S(ve,$t);break}else p(ve,$t);$t=$t.sibling}be.type===d?(ue=Pl(be.props.children,ve.mode,tt,be.key),ue.return=ve,ve=ue):(tt=th(be.type,be.key,be.props,null,ve.mode,tt),tt.ref=Va(ve,ue,be),tt.return=ve,ve=tt)}return q(ve);case u:e:{for($t=be.key;ue!==null;){if(ue.key===$t)if(ue.tag===4&&ue.stateNode.containerInfo===be.containerInfo&&ue.stateNode.implementation===be.implementation){S(ve,ue.sibling),ue=L(ue,be.children||[]),ue.return=ve,ve=ue;break e}else{S(ve,ue);break}else p(ve,ue);ue=ue.sibling}ue=Tl(be,ve.mode,tt),ue.return=ve,ve=ue}return q(ve);case P:return $t=be._init,ba(ve,ue,$t(be._payload),tt)}if(W(be))return Nn(ve,ue,be,tt);if(R(be))return vr(ve,ue,be,tt);Ji(ve,be)}return typeof be=="string"&&be!==""||typeof be=="number"?(be=""+be,ue!==null&&ue.tag===6?(S(ve,ue.sibling),ue=L(ue,be),ue.return=ve,ve=ue):(S(ve,ue),ue=wg(be,ve.mode,tt),ue.return=ve,ve=ue),q(ve)):S(ve,ue)}return ba}var Rc=u3(!0),c3=u3(!1),Bf={},Bo=aa(Bf),Wa=aa(Bf),oe=aa(Bf);function xe(f){if(f===Bf)throw Error(a(174));return f}function ye(f,p){Tn(oe,p),Tn(Wa,f),Tn(Bo,Bf),f=Z(p),Dn(Bo),Tn(Bo,f)}function it(){Dn(Bo),Dn(Wa),Dn(oe)}function It(f){var p=xe(oe.current),S=xe(Bo.current);p=U(S,f.type,p),S!==p&&(Tn(Wa,f),Tn(Bo,p))}function on(f){Wa.current===f&&(Dn(Bo),Dn(Wa))}var Ft=aa(0);function mn(f){for(var p=f;p!==null;){if(p.tag===13){var S=p.memoizedState;if(S!==null&&(S=S.dehydrated,S===null||xc(S)||wf(S)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if(p.flags&128)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var $f=[];function a1(){for(var f=0;f<$f.length;f++){var p=$f[f];wt?p._workInProgressVersionPrimary=null:p._workInProgressVersionSecondary=null}$f.length=0}var Ni=s.ReactCurrentDispatcher,Dc=s.ReactCurrentBatchConfig,Pu=0,Ln=null,mr=null,Sr=null,cn=!1,Ff=!1,Nc=0,qp=0;function xi(){throw Error(a(321))}function s1(f,p){if(p===null)return!1;for(var S=0;SS?S:4,f(!0);var T=Dc.transition;Dc.transition={};try{f(!1),p()}finally{Kt=S,Dc.transition=T}}function Hc(){return ji().memoizedState}function p1(f,p,S){var T=qr(f);if(S={lane:T,action:S,hasEagerState:!1,eagerState:null,next:null},Wc(f))Uc(p,S);else if(S=Ic(f,p,S,T),S!==null){var L=ki();zo(S,f,T,L),Uf(S,p,T)}}function Vc(f,p,S){var T=qr(f),L={lane:T,action:S,hasEagerState:!1,eagerState:null,next:null};if(Wc(f))Uc(p,L);else{var I=f.alternate;if(f.lanes===0&&(I===null||I.lanes===0)&&(I=p.lastRenderedReducer,I!==null))try{var q=p.lastRenderedState,le=I(q,S);if(L.hasEagerState=!0,L.eagerState=le,Y(le,q)){var ge=p.interleaved;ge===null?(L.next=L,Nf(p)):(L.next=ge.next,ge.next=L),p.interleaved=L;return}}catch{}finally{}S=Ic(f,p,L,T),S!==null&&(L=ki(),zo(S,f,T,L),Uf(S,p,T))}}function Wc(f){var p=f.alternate;return f===Ln||p!==null&&p===Ln}function Uc(f,p){Ff=cn=!0;var S=f.pending;S===null?p.next=p:(p.next=S.next,S.next=p),f.pending=p}function Uf(f,p,S){if(S&4194240){var T=p.lanes;T&=f.pendingLanes,S|=T,p.lanes=S,_u(f,S)}}var Cs={readContext:fo,useCallback:xi,useContext:xi,useEffect:xi,useImperativeHandle:xi,useInsertionEffect:xi,useLayoutEffect:xi,useMemo:xi,useReducer:xi,useRef:xi,useState:xi,useDebugValue:xi,useDeferredValue:xi,useTransition:xi,useMutableSource:xi,useSyncExternalStore:xi,useId:xi,unstable_isNewReconciler:!1},Sw={readContext:fo,useCallback:function(f,p){return di().memoizedState=[f,p===void 0?null:p],f},useContext:fo,useEffect:h3,useImperativeHandle:function(f,p,S){return S=S!=null?S.concat([f]):null,Tu(4194308,4,Dr.bind(null,p,f),S)},useLayoutEffect:function(f,p){return Tu(4194308,4,f,p)},useInsertionEffect:function(f,p){return Tu(4,2,f,p)},useMemo:function(f,p){var S=di();return p=p===void 0?null:p,f=f(),S.memoizedState=[f,p],f},useReducer:function(f,p,S){var T=di();return p=S!==void 0?S(p):p,T.memoizedState=T.baseState=p,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:p},T.queue=f,f=f.dispatch=p1.bind(null,Ln,f),[T.memoizedState,f]},useRef:function(f){var p=di();return f={current:f},p.memoizedState=f},useState:f3,useDebugValue:d1,useDeferredValue:function(f){return di().memoizedState=f},useTransition:function(){var f=f3(!1),p=f[0];return f=h1.bind(null,f[1]),di().memoizedState=f,[p,f]},useMutableSource:function(){},useSyncExternalStore:function(f,p,S){var T=Ln,L=di();if(Wn){if(S===void 0)throw Error(a(407));S=S()}else{if(S=p(),ei===null)throw Error(a(349));Pu&30||c1(T,p,S)}L.memoizedState=S;var I={value:S,getSnapshot:p};return L.queue=I,h3(ml.bind(null,T,I,f),[f]),T.flags|=2048,Vf(9,Fc.bind(null,T,I,S,p),void 0,null),S},useId:function(){var f=di(),p=ei.identifierPrefix;if(Wn){var S=za,T=co;S=(T&~(1<<32-Ri(T)-1)).toString(32)+S,p=":"+p+"R"+S,S=Nc++,0dg&&(p.flags|=128,T=!0,Yc(L,!1),p.lanes=4194304)}else{if(!T)if(f=mn(I),f!==null){if(p.flags|=128,T=!0,f=f.updateQueue,f!==null&&(p.updateQueue=f,p.flags|=4),Yc(L,!0),L.tail===null&&L.tailMode==="hidden"&&!I.alternate&&!Wn)return xi(p),null}else 2*Kn()-L.renderingStartTime>dg&&S!==1073741824&&(p.flags|=128,T=!0,Yc(L,!1),p.lanes=4194304);L.isBackwards?(I.sibling=p.child,p.child=I):(f=L.last,f!==null?f.sibling=I:p.child=I,L.last=I)}return L.tail!==null?(p=L.tail,L.rendering=p,L.tail=p.sibling,L.renderingStartTime=Kn(),p.sibling=null,f=Ft.current,Tn(Ft,T?f&1|2:f&1),p):(xi(p),null);case 22:case 23:return rd(),S=p.memoizedState!==null,f!==null&&f.memoizedState!==null!==S&&(p.flags|=8192),S&&p.mode&1?po&1073741824&&(xi(p),Fe&&p.subtreeFlags&6&&(p.flags|=8192)):xi(p),null;case 24:return null;case 25:return null}throw Error(a(156,p.tag))}function x1(f,p){switch(e1(p),p.tag){case 1:return ui(p.type)&&bs(),f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 3:return it(),Dn(li),Dn(Hr),o1(),f=p.flags,f&65536&&!(f&128)?(p.flags=f&-65537|128,p):null;case 5:return on(p),null;case 13:if(Dn(Ft),f=p.memoizedState,f!==null&&f.dehydrated!==null){if(p.alternate===null)throw Error(a(340));Ac()}return f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 19:return Dn(Ft),null;case 4:return it(),null;case 10:return If(p.type._context),null;case 22:case 23:return rd(),null;case 24:return null;default:return null}}var yl=!1,Wr=!1,Ew=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Kc(f,p){var S=f.ref;if(S!==null)if(typeof S=="function")try{S(null)}catch(T){Zn(f,p,T)}else S.current=null}function ga(f,p,S){try{S()}catch(T){Zn(f,p,T)}}var Qp=!1;function Au(f,p){for(Q(f.containerInfo),dt=p;dt!==null;)if(f=dt,p=f.child,(f.subtreeFlags&1028)!==0&&p!==null)p.return=f,dt=p;else for(;dt!==null;){f=dt;try{var S=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var T=S.memoizedProps,L=S.memoizedState,I=f.stateNode,q=I.getSnapshotBeforeUpdate(f.elementType===f.type?T:ca(f.type,T),L);I.__reactInternalSnapshotBeforeUpdate=q}break;case 3:Fe&&ol(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(le){Zn(f,f.return,le)}if(p=f.sibling,p!==null){p.return=f.return,dt=p;break}dt=f.return}return S=Qp,Qp=!1,S}function wi(f,p,S){var T=p.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var L=T=T.next;do{if((L.tag&f)===f){var I=L.destroy;L.destroy=void 0,I!==void 0&&ga(p,S,I)}L=L.next}while(L!==T)}}function Jp(f,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var S=p=p.next;do{if((S.tag&f)===f){var T=S.create;S.destroy=T()}S=S.next}while(S!==p)}}function eg(f){var p=f.ref;if(p!==null){var S=f.stateNode;switch(f.tag){case 5:f=X(S);break;default:f=S}typeof p=="function"?p(f):p.current=f}}function w1(f){var p=f.alternate;p!==null&&(f.alternate=null,w1(p)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(p=f.stateNode,p!==null&&ct(p)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Xc(f){return f.tag===5||f.tag===3||f.tag===4}function ks(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Xc(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function tg(f,p,S){var T=f.tag;if(T===5||T===6)f=f.stateNode,p?Ze(S,f,p):At(S,f);else if(T!==4&&(f=f.child,f!==null))for(tg(f,p,S),f=f.sibling;f!==null;)tg(f,p,S),f=f.sibling}function C1(f,p,S){var T=f.tag;if(T===5||T===6)f=f.stateNode,p?Rn(S,f,p):Te(S,f);else if(T!==4&&(f=f.child,f!==null))for(C1(f,p,S),f=f.sibling;f!==null;)C1(f,p,S),f=f.sibling}var jr=null,ma=!1;function va(f,p,S){for(S=S.child;S!==null;)Ur(f,p,S),S=S.sibling}function Ur(f,p,S){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(gn,S)}catch{}switch(S.tag){case 5:Wr||Kc(S,p);case 6:if(Fe){var T=jr,L=ma;jr=null,va(f,p,S),jr=T,ma=L,jr!==null&&(ma?ht(jr,S.stateNode):xt(jr,S.stateNode))}else va(f,p,S);break;case 18:Fe&&jr!==null&&(ma?K0(jr,S.stateNode):Y0(jr,S.stateNode));break;case 4:Fe?(T=jr,L=ma,jr=S.stateNode.containerInfo,ma=!0,va(f,p,S),jr=T,ma=L):(at&&(T=S.stateNode.containerInfo,L=Fa(T),Sc(T,L)),va(f,p,S));break;case 0:case 11:case 14:case 15:if(!Wr&&(T=S.updateQueue,T!==null&&(T=T.lastEffect,T!==null))){L=T=T.next;do{var I=L,q=I.destroy;I=I.tag,q!==void 0&&(I&2||I&4)&&ga(S,p,q),L=L.next}while(L!==T)}va(f,p,S);break;case 1:if(!Wr&&(Kc(S,p),T=S.stateNode,typeof T.componentWillUnmount=="function"))try{T.props=S.memoizedProps,T.state=S.memoizedState,T.componentWillUnmount()}catch(le){Zn(S,p,le)}va(f,p,S);break;case 21:va(f,p,S);break;case 22:S.mode&1?(Wr=(T=Wr)||S.memoizedState!==null,va(f,p,S),Wr=T):va(f,p,S);break;default:va(f,p,S)}}function ng(f){var p=f.updateQueue;if(p!==null){f.updateQueue=null;var S=f.stateNode;S===null&&(S=f.stateNode=new Ew),p.forEach(function(T){var L=L3.bind(null,f,T);S.has(T)||(S.add(T),T.then(L,L))})}}function Fo(f,p){var S=p.deletions;if(S!==null)for(var T=0;T";case ag:return":has("+(E1(f)||"")+")";case sg:return'[role="'+f.value+'"]';case lg:return'"'+f.value+'"';case Zc:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Qc(f,p){var S=[];f=[f,0];for(var T=0;TL&&(L=q),T&=~I}if(T=L,T=Kn()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*Pw(T/1960))-T,10f?16:f,Ot===null)var T=!1;else{if(f=Ot,Ot=null,fg=0,Ut&6)throw Error(a(331));var L=Ut;for(Ut|=4,dt=f.current;dt!==null;){var I=dt,q=I.child;if(dt.flags&16){var le=I.deletions;if(le!==null){for(var pe=0;peKn()-L1?_l(f,0):T1|=S),hi(f,p)}function R1(f,p){p===0&&(f.mode&1?(p=Ro,Ro<<=1,!(Ro&130023424)&&(Ro=4194304)):p=1);var S=_i();f=da(f,p),f!==null&&($a(f,p,S),hi(f,S))}function Lw(f){var p=f.memoizedState,S=0;p!==null&&(S=p.retryLane),R1(f,S)}function L3(f,p){var S=0;switch(f.tag){case 13:var T=f.stateNode,L=f.memoizedState;L!==null&&(S=L.retryLane);break;case 19:T=f.stateNode;break;default:throw Error(a(314))}T!==null&&T.delete(p),R1(f,S)}var D1;D1=function(f,p,S){if(f!==null)if(f.memoizedProps!==p.pendingProps||li.current)Zi=!0;else{if(!(f.lanes&S)&&!(p.flags&128))return Zi=!1,_w(f,p,S);Zi=!!(f.flags&131072)}else Zi=!1,Wn&&p.flags&1048576&&J0(p,Rr,p.index);switch(p.lanes=0,p.tag){case 2:var T=p.type;Ua(f,p),f=p.pendingProps;var L=cl(p,Hr.current);Mc(p,S),L=s1(null,p,T,f,L,S);var I=jc();return p.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,ui(T)?(I=!0,Ss(p)):I=!1,p.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,n1(p),L.updater=fa,p.stateNode=L,L._reactInternals=p,r1(p,T,f,S),p=ha(null,p,T,!0,I,S)):(p.tag=0,Wn&&I&&Ri(p),ji(null,p,L,S),p=p.child),p;case 16:T=p.elementType;e:{switch(Ua(f,p),f=p.pendingProps,L=T._init,T=L(T._payload),p.type=T,L=p.tag=bg(T),f=ca(T,f),L){case 0:p=m1(null,p,T,f,S);break e;case 1:p=S3(null,p,T,f,S);break e;case 11:p=m3(null,p,T,f,S);break e;case 14:p=vl(null,p,T,ca(T.type,f),S);break e}throw Error(a(306,T,""))}return p;case 0:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),m1(f,p,T,L,S);case 1:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),S3(f,p,T,L,S);case 3:e:{if(x3(p),f===null)throw Error(a(387));T=p.pendingProps,I=p.memoizedState,L=I.element,r3(f,p),Vp(p,T,null,S);var q=p.memoizedState;if(T=q.element,bt&&I.isDehydrated)if(I={element:T,isDehydrated:!1,cache:q.cache,pendingSuspenseBoundaries:q.pendingSuspenseBoundaries,transitions:q.transitions},p.updateQueue.baseState=I,p.memoizedState=I,p.flags&256){L=Gc(Error(a(423)),p),p=w3(f,p,T,S,L);break e}else if(T!==L){L=Gc(Error(a(424)),p),p=w3(f,p,T,S,L);break e}else for(bt&&(No=z0(p.stateNode.containerInfo),Xn=p,Wn=!0,Ki=null,jo=!1),S=l3(p,null,T,S),p.child=S;S;)S.flags=S.flags&-3|4096,S=S.sibling;else{if(Ac(),T===L){p=_s(f,p,S);break e}ji(f,p,T,S)}p=p.child}return p;case 5:return It(p),f===null&&Lf(p),T=p.type,L=p.pendingProps,I=f!==null?f.memoizedProps:null,q=L.children,ze(T,L)?q=null:I!==null&&ze(T,I)&&(p.flags|=32),b3(f,p),ji(f,p,q,S),p.child;case 6:return f===null&&Lf(p),null;case 13:return C3(f,p,S);case 4:return ve(p,p.stateNode.containerInfo),T=p.pendingProps,f===null?p.child=Rc(p,null,T,S):ji(f,p,T,S),p.child;case 11:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),m3(f,p,T,L,S);case 7:return ji(f,p,p.pendingProps,S),p.child;case 8:return ji(f,p,p.pendingProps.children,S),p.child;case 12:return ji(f,p,p.pendingProps.children,S),p.child;case 10:e:{if(T=p.type._context,L=p.pendingProps,I=p.memoizedProps,q=L.value,n3(p,T,q),I!==null)if(Y(I.value,q)){if(I.children===L.children&&!li.current){p=_s(f,p,S);break e}}else for(I=p.child,I!==null&&(I.return=p);I!==null;){var le=I.dependencies;if(le!==null){q=I.child;for(var pe=le.firstContext;pe!==null;){if(pe.context===T){if(I.tag===1){pe=ws(-1,S&-S),pe.tag=2;var Ue=I.updateQueue;if(Ue!==null){Ue=Ue.shared;var ft=Ue.pending;ft===null?pe.next=pe:(pe.next=ft.next,ft.next=pe),Ue.pending=pe}}I.lanes|=S,pe=I.alternate,pe!==null&&(pe.lanes|=S),Rf(I.return,S,p),le.lanes|=S;break}pe=pe.next}}else if(I.tag===10)q=I.type===p.type?null:I.child;else if(I.tag===18){if(q=I.return,q===null)throw Error(a(341));q.lanes|=S,le=q.alternate,le!==null&&(le.lanes|=S),Rf(q,S,p),q=I.sibling}else q=I.child;if(q!==null)q.return=I;else for(q=I;q!==null;){if(q===p){q=null;break}if(I=q.sibling,I!==null){I.return=q.return,q=I;break}q=q.return}I=q}ji(f,p,L.children,S),p=p.child}return p;case 9:return L=p.type,T=p.pendingProps.children,Mc(p,S),L=fo(L),T=T(L),p.flags|=1,ji(f,p,T,S),p.child;case 14:return T=p.type,L=ca(T,p.pendingProps),L=ca(T.type,L),vl(f,p,T,L,S);case 15:return v3(f,p,p.type,p.pendingProps,S);case 17:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),Ua(f,p),p.tag=1,ui(T)?(f=!0,Ss(p)):f=!1,Mc(p,S),o3(p,T,L),r1(p,T,L,S),ha(null,p,T,!0,f,S);case 19:return k3(f,p,S);case 22:return y3(f,p,S)}throw Error(a(156,p.tag))};function $i(f,p){return Pc(f,p)}function Ga(f,p,S,T){this.tag=f,this.key=S,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ho(f,p,S,T){return new Ga(f,p,S,T)}function N1(f){return f=f.prototype,!(!f||!f.isReactComponent)}function bg(f){if(typeof f=="function")return N1(f)?1:0;if(f!=null){if(f=f.$$typeof,f===x)return 11;if(f===_)return 14}return 2}function mo(f,p){var S=f.alternate;return S===null?(S=Ho(f.tag,p,f.key,f.mode),S.elementType=f.elementType,S.type=f.type,S.stateNode=f.stateNode,S.alternate=f,f.alternate=S):(S.pendingProps=p,S.type=f.type,S.flags=0,S.subtreeFlags=0,S.deletions=null),S.flags=f.flags&14680064,S.childLanes=f.childLanes,S.lanes=f.lanes,S.child=f.child,S.memoizedProps=f.memoizedProps,S.memoizedState=f.memoizedState,S.updateQueue=f.updateQueue,p=f.dependencies,S.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},S.sibling=f.sibling,S.index=f.index,S.ref=f.ref,S}function eh(f,p,S,T,L,I){var q=2;if(T=f,typeof f=="function")N1(f)&&(q=1);else if(typeof f=="string")q=5;else e:switch(f){case d:return Pl(S.children,L,I,p);case h:q=8,L|=8;break;case m:return f=Ho(12,S,p,L|2),f.elementType=m,f.lanes=I,f;case k:return f=Ho(13,S,p,L),f.elementType=k,f.lanes=I,f;case E:return f=Ho(19,S,p,L),f.elementType=E,f.lanes=I,f;case A:return Sg(S,L,I,p);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case y:q=10;break e;case b:q=9;break e;case x:q=11;break e;case _:q=14;break e;case P:q=16,T=null;break e}throw Error(a(130,f==null?f:typeof f,""))}return p=Ho(q,S,p,L),p.elementType=f,p.type=T,p.lanes=I,p}function Pl(f,p,S,T){return f=Ho(7,f,T,p),f.lanes=S,f}function Sg(f,p,S,T){return f=Ho(22,f,T,p),f.elementType=A,f.lanes=S,f.stateNode={isHidden:!1},f}function xg(f,p,S){return f=Ho(6,f,null,p),f.lanes=S,f}function Tl(f,p,S){return p=Ho(4,f.children!==null?f.children:[],f.key,p),p.lanes=S,p.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},p}function th(f,p,S,T,L){this.tag=p,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Be,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ec(0),this.expirationTimes=Ec(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ec(0),this.identifierPrefix=T,this.onRecoverableError=L,bt&&(this.mutableSourceEagerHydrationData=null)}function A3(f,p,S,T,L,I,q,le,pe){return f=new th(f,p,S,le,pe),p===1?(p=1,I===!0&&(p|=8)):p=0,I=Ho(3,null,null,p),f.current=I,I.stateNode=f,I.memoizedState={element:T,isDehydrated:S,cache:null,transitions:null,pendingSuspenseBoundaries:null},n1(I),f}function j1(f){if(!f)return sa;f=f._reactInternals;e:{if(z(f)!==f||f.tag!==1)throw Error(a(170));var p=f;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(ui(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(a(171))}if(f.tag===1){var S=f.type;if(ui(S))return wu(f,S,p)}return p}function B1(f){var p=f._reactInternals;if(p===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=te(p),f===null?null:f.stateNode}function nh(f,p){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var S=f.retryLane;f.retryLane=S!==0&&S=Ue&&I>=jt&&L<=ft&&q<=ot){f.splice(p,1);break}else if(T!==Ue||S.width!==pe.width||otq){if(!(I!==jt||S.height!==pe.height||ftL)){Ue>T&&(pe.width+=Ue-T,pe.x=T),ftI&&(pe.height+=jt-I,pe.y=I),otS&&(S=q)),qfg&&(p.flags|=128,T=!0,Yc(L,!1),p.lanes=4194304)}else{if(!T)if(f=mn(I),f!==null){if(p.flags|=128,T=!0,f=f.updateQueue,f!==null&&(p.updateQueue=f,p.flags|=4),Yc(L,!0),L.tail===null&&L.tailMode==="hidden"&&!I.alternate&&!Wn)return wi(p),null}else 2*Kn()-L.renderingStartTime>fg&&S!==1073741824&&(p.flags|=128,T=!0,Yc(L,!1),p.lanes=4194304);L.isBackwards?(I.sibling=p.child,p.child=I):(f=L.last,f!==null?f.sibling=I:p.child=I,L.last=I)}return L.tail!==null?(p=L.tail,L.rendering=p,L.tail=p.sibling,L.renderingStartTime=Kn(),p.sibling=null,f=Ft.current,Tn(Ft,T?f&1|2:f&1),p):(wi(p),null);case 22:case 23:return rd(),S=p.memoizedState!==null,f!==null&&f.memoizedState!==null!==S&&(p.flags|=8192),S&&p.mode&1?po&1073741824&&(wi(p),$e&&p.subtreeFlags&6&&(p.flags|=8192)):wi(p),null;case 24:return null;case 25:return null}throw Error(a(156,p.tag))}function w1(f,p){switch(t1(p),p.tag){case 1:return ui(p.type)&&bs(),f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 3:return it(),Dn(li),Dn(Hr),a1(),f=p.flags,f&65536&&!(f&128)?(p.flags=f&-65537|128,p):null;case 5:return on(p),null;case 13:if(Dn(Ft),f=p.memoizedState,f!==null&&f.dehydrated!==null){if(p.alternate===null)throw Error(a(340));Ac()}return f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 19:return Dn(Ft),null;case 4:return it(),null;case 10:return Rf(p.type._context),null;case 22:case 23:return rd(),null;case 24:return null;default:return null}}var yl=!1,Wr=!1,Ew=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Kc(f,p){var S=f.ref;if(S!==null)if(typeof S=="function")try{S(null)}catch(T){Zn(f,p,T)}else S.current=null}function ga(f,p,S){try{S()}catch(T){Zn(f,p,T)}}var Jp=!1;function Au(f,p){for(Q(f.containerInfo),dt=p;dt!==null;)if(f=dt,p=f.child,(f.subtreeFlags&1028)!==0&&p!==null)p.return=f,dt=p;else for(;dt!==null;){f=dt;try{var S=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var T=S.memoizedProps,L=S.memoizedState,I=f.stateNode,q=I.getSnapshotBeforeUpdate(f.elementType===f.type?T:ca(f.type,T),L);I.__reactInternalSnapshotBeforeUpdate=q}break;case 3:$e&&ol(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(le){Zn(f,f.return,le)}if(p=f.sibling,p!==null){p.return=f.return,dt=p;break}dt=f.return}return S=Jp,Jp=!1,S}function Ci(f,p,S){var T=p.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var L=T=T.next;do{if((L.tag&f)===f){var I=L.destroy;L.destroy=void 0,I!==void 0&&ga(p,S,I)}L=L.next}while(L!==T)}}function eg(f,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var S=p=p.next;do{if((S.tag&f)===f){var T=S.create;S.destroy=T()}S=S.next}while(S!==p)}}function tg(f){var p=f.ref;if(p!==null){var S=f.stateNode;switch(f.tag){case 5:f=X(S);break;default:f=S}typeof p=="function"?p(f):p.current=f}}function C1(f){var p=f.alternate;p!==null&&(f.alternate=null,C1(p)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(p=f.stateNode,p!==null&&ct(p)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Xc(f){return f.tag===5||f.tag===3||f.tag===4}function ks(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Xc(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function ng(f,p,S){var T=f.tag;if(T===5||T===6)f=f.stateNode,p?Ze(S,f,p):At(S,f);else if(T!==4&&(f=f.child,f!==null))for(ng(f,p,S),f=f.sibling;f!==null;)ng(f,p,S),f=f.sibling}function _1(f,p,S){var T=f.tag;if(T===5||T===6)f=f.stateNode,p?Rn(S,f,p):Te(S,f);else if(T!==4&&(f=f.child,f!==null))for(_1(f,p,S),f=f.sibling;f!==null;)_1(f,p,S),f=f.sibling}var jr=null,ma=!1;function va(f,p,S){for(S=S.child;S!==null;)Ur(f,p,S),S=S.sibling}function Ur(f,p,S){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(gn,S)}catch{}switch(S.tag){case 5:Wr||Kc(S,p);case 6:if($e){var T=jr,L=ma;jr=null,va(f,p,S),jr=T,ma=L,jr!==null&&(ma?ht(jr,S.stateNode):xt(jr,S.stateNode))}else va(f,p,S);break;case 18:$e&&jr!==null&&(ma?X0(jr,S.stateNode):K0(jr,S.stateNode));break;case 4:$e?(T=jr,L=ma,jr=S.stateNode.containerInfo,ma=!0,va(f,p,S),jr=T,ma=L):(at&&(T=S.stateNode.containerInfo,L=$a(T),Sc(T,L)),va(f,p,S));break;case 0:case 11:case 14:case 15:if(!Wr&&(T=S.updateQueue,T!==null&&(T=T.lastEffect,T!==null))){L=T=T.next;do{var I=L,q=I.destroy;I=I.tag,q!==void 0&&(I&2||I&4)&&ga(S,p,q),L=L.next}while(L!==T)}va(f,p,S);break;case 1:if(!Wr&&(Kc(S,p),T=S.stateNode,typeof T.componentWillUnmount=="function"))try{T.props=S.memoizedProps,T.state=S.memoizedState,T.componentWillUnmount()}catch(le){Zn(S,p,le)}va(f,p,S);break;case 21:va(f,p,S);break;case 22:S.mode&1?(Wr=(T=Wr)||S.memoizedState!==null,va(f,p,S),Wr=T):va(f,p,S);break;default:va(f,p,S)}}function rg(f){var p=f.updateQueue;if(p!==null){f.updateQueue=null;var S=f.stateNode;S===null&&(S=f.stateNode=new Ew),p.forEach(function(T){var L=O3.bind(null,f,T);S.has(T)||(S.add(T),T.then(L,L))})}}function $o(f,p){var S=p.deletions;if(S!==null)for(var T=0;T";case sg:return":has("+(P1(f)||"")+")";case lg:return'[role="'+f.value+'"]';case ug:return'"'+f.value+'"';case Zc:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Qc(f,p){var S=[];f=[f,0];for(var T=0;TL&&(L=q),T&=~I}if(T=L,T=Kn()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*Pw(T/1960))-T,10f?16:f,Ot===null)var T=!1;else{if(f=Ot,Ot=null,hg=0,Ut&6)throw Error(a(331));var L=Ut;for(Ut|=4,dt=f.current;dt!==null;){var I=dt,q=I.child;if(dt.flags&16){var le=I.deletions;if(le!==null){for(var ge=0;geKn()-A1?_l(f,0):L1|=S),hi(f,p)}function D1(f,p){p===0&&(f.mode&1?(p=Ro,Ro<<=1,!(Ro&130023424)&&(Ro=4194304)):p=1);var S=ki();f=da(f,p),f!==null&&(Fa(f,p,S),hi(f,S))}function Lw(f){var p=f.memoizedState,S=0;p!==null&&(S=p.retryLane),D1(f,S)}function O3(f,p){var S=0;switch(f.tag){case 13:var T=f.stateNode,L=f.memoizedState;L!==null&&(S=L.retryLane);break;case 19:T=f.stateNode;break;default:throw Error(a(314))}T!==null&&T.delete(p),D1(f,S)}var N1;N1=function(f,p,S){if(f!==null)if(f.memoizedProps!==p.pendingProps||li.current)eo=!0;else{if(!(f.lanes&S)&&!(p.flags&128))return eo=!1,_w(f,p,S);eo=!!(f.flags&131072)}else eo=!1,Wn&&p.flags&1048576&&e1(p,Rr,p.index);switch(p.lanes=0,p.tag){case 2:var T=p.type;Ua(f,p),f=p.pendingProps;var L=cl(p,Hr.current);Mc(p,S),L=l1(null,p,T,f,L,S);var I=jc();return p.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,ui(T)?(I=!0,Ss(p)):I=!1,p.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,r1(p),L.updater=fa,p.stateNode=L,L._reactInternals=p,i1(p,T,f,S),p=ha(null,p,T,!0,I,S)):(p.tag=0,Wn&&I&&Di(p),Bi(null,p,L,S),p=p.child),p;case 16:T=p.elementType;e:{switch(Ua(f,p),f=p.pendingProps,L=T._init,T=L(T._payload),p.type=T,L=p.tag=Sg(T),f=ca(T,f),L){case 0:p=v1(null,p,T,f,S);break e;case 1:p=w3(null,p,T,f,S);break e;case 11:p=y3(null,p,T,f,S);break e;case 14:p=vl(null,p,T,ca(T.type,f),S);break e}throw Error(a(306,T,""))}return p;case 0:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),v1(f,p,T,L,S);case 1:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),w3(f,p,T,L,S);case 3:e:{if(C3(p),f===null)throw Error(a(387));T=p.pendingProps,I=p.memoizedState,L=I.element,o3(f,p),Wp(p,T,null,S);var q=p.memoizedState;if(T=q.element,bt&&I.isDehydrated)if(I={element:T,isDehydrated:!1,cache:q.cache,pendingSuspenseBoundaries:q.pendingSuspenseBoundaries,transitions:q.transitions},p.updateQueue.baseState=I,p.memoizedState=I,p.flags&256){L=Gc(Error(a(423)),p),p=_3(f,p,T,S,L);break e}else if(T!==L){L=Gc(Error(a(424)),p),p=_3(f,p,T,S,L);break e}else for(bt&&(No=H0(p.stateNode.containerInfo),Xn=p,Wn=!0,Qi=null,jo=!1),S=c3(p,null,T,S),p.child=S;S;)S.flags=S.flags&-3|4096,S=S.sibling;else{if(Ac(),T===L){p=_s(f,p,S);break e}Bi(f,p,T,S)}p=p.child}return p;case 5:return It(p),f===null&&Af(p),T=p.type,L=p.pendingProps,I=f!==null?f.memoizedProps:null,q=L.children,ze(T,L)?q=null:I!==null&&ze(T,I)&&(p.flags|=32),x3(f,p),Bi(f,p,q,S),p.child;case 6:return f===null&&Af(p),null;case 13:return k3(f,p,S);case 4:return ye(p,p.stateNode.containerInfo),T=p.pendingProps,f===null?p.child=Rc(p,null,T,S):Bi(f,p,T,S),p.child;case 11:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),y3(f,p,T,L,S);case 7:return Bi(f,p,p.pendingProps,S),p.child;case 8:return Bi(f,p,p.pendingProps.children,S),p.child;case 12:return Bi(f,p,p.pendingProps.children,S),p.child;case 10:e:{if(T=p.type._context,L=p.pendingProps,I=p.memoizedProps,q=L.value,i3(p,T,q),I!==null)if(Y(I.value,q)){if(I.children===L.children&&!li.current){p=_s(f,p,S);break e}}else for(I=p.child,I!==null&&(I.return=p);I!==null;){var le=I.dependencies;if(le!==null){q=I.child;for(var ge=le.firstContext;ge!==null;){if(ge.context===T){if(I.tag===1){ge=ws(-1,S&-S),ge.tag=2;var Ue=I.updateQueue;if(Ue!==null){Ue=Ue.shared;var ft=Ue.pending;ft===null?ge.next=ge:(ge.next=ft.next,ft.next=ge),Ue.pending=ge}}I.lanes|=S,ge=I.alternate,ge!==null&&(ge.lanes|=S),Df(I.return,S,p),le.lanes|=S;break}ge=ge.next}}else if(I.tag===10)q=I.type===p.type?null:I.child;else if(I.tag===18){if(q=I.return,q===null)throw Error(a(341));q.lanes|=S,le=q.alternate,le!==null&&(le.lanes|=S),Df(q,S,p),q=I.sibling}else q=I.child;if(q!==null)q.return=I;else for(q=I;q!==null;){if(q===p){q=null;break}if(I=q.sibling,I!==null){I.return=q.return,q=I;break}q=q.return}I=q}Bi(f,p,L.children,S),p=p.child}return p;case 9:return L=p.type,T=p.pendingProps.children,Mc(p,S),L=fo(L),T=T(L),p.flags|=1,Bi(f,p,T,S),p.child;case 14:return T=p.type,L=ca(T,p.pendingProps),L=ca(T.type,L),vl(f,p,T,L,S);case 15:return b3(f,p,p.type,p.pendingProps,S);case 17:return T=p.type,L=p.pendingProps,L=p.elementType===T?L:ca(T,L),Ua(f,p),p.tag=1,ui(T)?(f=!0,Ss(p)):f=!1,Mc(p,S),s3(p,T,L),i1(p,T,L,S),ha(null,p,T,!0,f,S);case 19:return P3(f,p,S);case 22:return S3(f,p,S)}throw Error(a(156,p.tag))};function zi(f,p){return Pc(f,p)}function Ga(f,p,S,T){this.tag=f,this.key=S,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ho(f,p,S,T){return new Ga(f,p,S,T)}function j1(f){return f=f.prototype,!(!f||!f.isReactComponent)}function Sg(f){if(typeof f=="function")return j1(f)?1:0;if(f!=null){if(f=f.$$typeof,f===x)return 11;if(f===_)return 14}return 2}function mo(f,p){var S=f.alternate;return S===null?(S=Ho(f.tag,p,f.key,f.mode),S.elementType=f.elementType,S.type=f.type,S.stateNode=f.stateNode,S.alternate=f,f.alternate=S):(S.pendingProps=p,S.type=f.type,S.flags=0,S.subtreeFlags=0,S.deletions=null),S.flags=f.flags&14680064,S.childLanes=f.childLanes,S.lanes=f.lanes,S.child=f.child,S.memoizedProps=f.memoizedProps,S.memoizedState=f.memoizedState,S.updateQueue=f.updateQueue,p=f.dependencies,S.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},S.sibling=f.sibling,S.index=f.index,S.ref=f.ref,S}function th(f,p,S,T,L,I){var q=2;if(T=f,typeof f=="function")j1(f)&&(q=1);else if(typeof f=="string")q=5;else e:switch(f){case d:return Pl(S.children,L,I,p);case h:q=8,L|=8;break;case m:return f=Ho(12,S,p,L|2),f.elementType=m,f.lanes=I,f;case k:return f=Ho(13,S,p,L),f.elementType=k,f.lanes=I,f;case E:return f=Ho(19,S,p,L),f.elementType=E,f.lanes=I,f;case A:return xg(S,L,I,p);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case y:q=10;break e;case b:q=9;break e;case x:q=11;break e;case _:q=14;break e;case P:q=16,T=null;break e}throw Error(a(130,f==null?f:typeof f,""))}return p=Ho(q,S,p,L),p.elementType=f,p.type=T,p.lanes=I,p}function Pl(f,p,S,T){return f=Ho(7,f,T,p),f.lanes=S,f}function xg(f,p,S,T){return f=Ho(22,f,T,p),f.elementType=A,f.lanes=S,f.stateNode={isHidden:!1},f}function wg(f,p,S){return f=Ho(6,f,null,p),f.lanes=S,f}function Tl(f,p,S){return p=Ho(4,f.children!==null?f.children:[],f.key,p),p.lanes=S,p.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},p}function nh(f,p,S,T,L){this.tag=p,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Be,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ec(0),this.expirationTimes=Ec(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ec(0),this.identifierPrefix=T,this.onRecoverableError=L,bt&&(this.mutableSourceEagerHydrationData=null)}function M3(f,p,S,T,L,I,q,le,ge){return f=new nh(f,p,S,le,ge),p===1?(p=1,I===!0&&(p|=8)):p=0,I=Ho(3,null,null,p),f.current=I,I.stateNode=f,I.memoizedState={element:T,isDehydrated:S,cache:null,transitions:null,pendingSuspenseBoundaries:null},r1(I),f}function B1(f){if(!f)return sa;f=f._reactInternals;e:{if(z(f)!==f||f.tag!==1)throw Error(a(170));var p=f;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(ui(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(a(171))}if(f.tag===1){var S=f.type;if(ui(S))return wu(f,S,p)}return p}function $1(f){var p=f._reactInternals;if(p===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=te(p),f===null?null:f.stateNode}function rh(f,p){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var S=f.retryLane;f.retryLane=S!==0&&S=Ue&&I>=Bt&&L<=ft&&q<=ot){f.splice(p,1);break}else if(T!==Ue||S.width!==ge.width||otq){if(!(I!==Bt||S.height!==ge.height||ftL)){Ue>T&&(ge.width+=Ue-T,ge.x=T),ftI&&(ge.height+=Bt-I,ge.y=I),otS&&(S=q)),q ")+` No matching component was found for: - `)+f.join(" > ")}return null},n.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return X(f.child.stateNode);default:return f.child.stateNode}},n.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:wg,findFiberByHostInstance:f.findFiberByHostInstance||F1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(p.isDisabled||!p.supportsFiber)f=!0;else{try{gn=p.inject(f),Xt=p}catch{}f=!!p.checkDCE}}return f},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(f,p,S,T){if(!ae)throw Error(a(363));f=P1(f,p);var L=Dt(f,S,T).disconnect;return{disconnect:function(){L()}}},n.registerMutableSourceForHydration=function(f,p){var S=p._getVersion;S=S(p._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[p,S]:f.mutableSourceEagerHydrationData.push(p,S)},n.runWithPriority=function(f,p){var S=Kt;try{return Kt=f,p()}finally{Kt=S}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(f,p,S,T){var L=p.current,I=_i(),q=qr(L);return S=j1(S),p.context===null?p.context=S:p.pendingContext=S,p=ws(I,q),p.payload={element:f},T=T===void 0?null:T,T!==null&&(p.callback=T),f=gl(L,p,q),f!==null&&(zo(f,L,q,I),Hp(f,L,q)),q},n};(function(e){e.exports=ROe})(IOe);const DOe=v_(t_);var fS={},NOe={get exports(){return fS},set exports(e){fS=e}},_p={};/** + `)+f.join(" > ")}return null},n.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return X(f.child.stateNode);default:return f.child.stateNode}},n.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:Cg,findFiberByHostInstance:f.findFiberByHostInstance||F1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(p.isDisabled||!p.supportsFiber)f=!0;else{try{gn=p.inject(f),Xt=p}catch{}f=!!p.checkDCE}}return f},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(f,p,S,T){if(!ae)throw Error(a(363));f=T1(f,p);var L=Nt(f,S,T).disconnect;return{disconnect:function(){L()}}},n.registerMutableSourceForHydration=function(f,p){var S=p._getVersion;S=S(p._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[p,S]:f.mutableSourceEagerHydrationData.push(p,S)},n.runWithPriority=function(f,p){var S=Kt;try{return Kt=f,p()}finally{Kt=S}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(f,p,S,T){var L=p.current,I=ki(),q=qr(L);return S=B1(S),p.context===null?p.context=S:p.pendingContext=S,p=ws(I,q),p.payload={element:f},T=T===void 0?null:T,T!==null&&(p.callback=T),f=gl(L,p,q),f!==null&&(zo(f,L,q,I),Vp(f,L,q)),q},n};(function(e){e.exports=DOe})(ROe);const NOe=v_(t_);var fS={},jOe={get exports(){return fS},set exports(e){fS=e}},kp={};/** * @license React * react-reconciler-constants.production.min.js * @@ -545,14 +545,14 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */_p.ConcurrentRoot=1;_p.ContinuousEventPriority=4;_p.DefaultEventPriority=16;_p.DiscreteEventPriority=1;_p.IdleEventPriority=536870912;_p.LegacyRoot=0;(function(e){e.exports=_p})(NOe);const sN={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let lN=!1,uN=!1;const lT=".react-konva-event",jOe=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. + */kp.ConcurrentRoot=1;kp.ContinuousEventPriority=4;kp.DefaultEventPriority=16;kp.DiscreteEventPriority=1;kp.IdleEventPriority=536870912;kp.LegacyRoot=0;(function(e){e.exports=kp})(jOe);const sN={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let lN=!1,uN=!1;const lT=".react-konva-event",BOe=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. Position of a node will be changed during drag&drop, so you should update state of the react app as well. Consider to add onDragMove or onDragEnd events. For more info see: https://github.com/konvajs/react-konva/issues/256 -`,BOe=`ReactKonva: You are using "zIndex" attribute for a Konva node. +`,$Oe=`ReactKonva: You are using "zIndex" attribute for a Konva node. react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. For more info see: https://github.com/konvajs/react-konva/issues/194 -`,FOe={};function dw(e,t,n=FOe){if(!lN&&"zIndex"in t&&(console.warn(BOe),lN=!0),!uN&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(jOe),uN=!0)}for(var o in n)if(!sN[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var d=t._useStrictMode,h={},m=!1;const y={};for(var o in t)if(!sN[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(y[l]=t[o])}!a&&(t[o]!==n[o]||d&&t[o]!==e.getAttr(o))&&(m=!0,h[o]=t[o])}m&&(e.setAttrs(h),yf(e));for(var l in y)e.on(l+lT,y[l])}function yf(e){if(!gt.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const HY={},$Oe={};rp.Node.prototype._applyProps=dw;function zOe(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),yf(e)}function HOe(e,t,n){let r=rp[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=rp.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return dw(l,o),l}function VOe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function WOe(e,t,n){return!1}function UOe(e){return e}function GOe(){return null}function qOe(){return null}function YOe(e,t,n,r){return $Oe}function KOe(){}function XOe(e){}function ZOe(e,t){return!1}function QOe(){return HY}function JOe(){return HY}const eMe=setTimeout,tMe=clearTimeout,nMe=-1;function rMe(e,t){return!1}const iMe=!1,oMe=!0,aMe=!0;function sMe(e,t){t.parent===e?t.moveToTop():e.add(t),yf(e)}function lMe(e,t){t.parent===e?t.moveToTop():e.add(t),yf(e)}function VY(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),yf(e)}function uMe(e,t,n){VY(e,t,n)}function cMe(e,t){t.destroy(),t.off(lT),yf(e)}function dMe(e,t){t.destroy(),t.off(lT),yf(e)}function fMe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function hMe(e,t,n){}function pMe(e,t,n,r,i){dw(e,i,r)}function gMe(e){e.hide(),yf(e)}function mMe(e){}function vMe(e,t){(t.visible==null||t.visible)&&e.show()}function yMe(e,t){}function bMe(e){}function SMe(){}const xMe=()=>fS.DefaultEventPriority,wMe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:sMe,appendChildToContainer:lMe,appendInitialChild:zOe,cancelTimeout:tMe,clearContainer:bMe,commitMount:hMe,commitTextUpdate:fMe,commitUpdate:pMe,createInstance:HOe,createTextInstance:VOe,detachDeletedInstance:SMe,finalizeInitialChildren:WOe,getChildHostContext:JOe,getCurrentEventPriority:xMe,getPublicInstance:UOe,getRootHostContext:QOe,hideInstance:gMe,hideTextInstance:mMe,idlePriority:zh.unstable_IdlePriority,insertBefore:VY,insertInContainerBefore:uMe,isPrimaryRenderer:iMe,noTimeout:nMe,now:zh.unstable_now,prepareForCommit:GOe,preparePortalMount:qOe,prepareUpdate:YOe,removeChild:cMe,removeChildFromContainer:dMe,resetAfterCommit:KOe,resetTextContent:XOe,run:zh.unstable_runWithPriority,scheduleTimeout:eMe,shouldDeprioritizeSubtree:ZOe,shouldSetTextContent:rMe,supportsMutation:aMe,unhideInstance:vMe,unhideTextInstance:yMe,warnsIfNotActing:oMe},Symbol.toStringTag,{value:"Module"}));var CMe=Object.defineProperty,_Me=Object.defineProperties,kMe=Object.getOwnPropertyDescriptors,cN=Object.getOwnPropertySymbols,EMe=Object.prototype.hasOwnProperty,PMe=Object.prototype.propertyIsEnumerable,dN=(e,t,n)=>t in e?CMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fN=(e,t)=>{for(var n in t||(t={}))EMe.call(t,n)&&dN(e,n,t[n]);if(cN)for(var n of cN(t))PMe.call(t,n)&&dN(e,n,t[n]);return e},TMe=(e,t)=>_Me(e,kMe(t));function uT(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=uT(r,t,n);if(i)return i;r=t?null:r.sibling}}function WY(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const cT=WY(w.createContext(null));class UY extends w.Component{render(){return w.createElement(cT.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:LMe,ReactCurrentDispatcher:AMe}=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function OMe(){const e=w.useContext(cT);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=w.useId();return w.useMemo(()=>{var r;return(r=LMe.current)!=null?r:uT(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const mv=[],hN=new WeakMap;function MMe(){var e;const t=OMe();mv.splice(0,mv.length),uT(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==cT&&mv.push(WY(i))});for(const n of mv){const r=(e=AMe.current)==null?void 0:e.readContext(n);hN.set(n,r)}return w.useMemo(()=>mv.reduce((n,r)=>i=>w.createElement(n,null,w.createElement(r.Provider,TMe(fN({},i),{value:hN.get(r)}))),n=>w.createElement(UY,fN({},n))),[])}function IMe(e){const t=N.useRef();return N.useLayoutEffect(()=>{t.current=e}),t.current}const RMe=e=>{const t=N.useRef(),n=N.useRef(),r=N.useRef(),i=IMe(e),o=MMe(),a=s=>{const{forwardedRef:l}=e;l&&(typeof l=="function"?l(s):l.current=s)};return N.useLayoutEffect(()=>(n.current=new rp.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=jv.createContainer(n.current,fS.LegacyRoot,!1,null),jv.updateContainer(N.createElement(o,{},e.children),r.current),()=>{rp.isBrowser&&(a(null),jv.updateContainer(null,r.current,null),n.current.destroy())}),[]),N.useLayoutEffect(()=>{a(n.current),dw(n.current,e,i),jv.updateContainer(N.createElement(o,{},e.children),r.current,null)}),N.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},vv="Layer",uc="Group",cc="Rect",ch="Circle",hS="Line",GY="Image",DMe="Transformer",jv=DOe(wMe);jv.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:N.version,rendererPackageName:"react-konva"});const NMe=N.forwardRef((e,t)=>N.createElement(UY,{},N.createElement(RMe,{...e,forwardedRef:t}))),jMe=lt([ln,Ir],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),BMe=()=>{const e=Oe(),{tool:t,isStaging:n,isMovingBoundingBox:r}=he(jMe);return{handleDragStart:w.useCallback(()=>{(t==="move"||n)&&!r&&e(K5(!0))},[e,r,n,t]),handleDragMove:w.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(uU(o))},[e,r,n,t]),handleDragEnd:w.useCallback(()=>{(t==="move"||n)&&!r&&e(K5(!1))},[e,r,n,t])}},FMe=lt([ln,Mr,Ir],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),$Me=()=>{const e=Oe(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=he(FMe),s=w.useRef(null),l=JG(),u=()=>e(uP());et(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const d=()=>e(Fy(!o));et(["h"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[o]),et(["n"],()=>{e(Z5(!a))},{enabled:!0,preventDefault:!0},[a]),et("esc",()=>{e(Fxe())},{enabled:()=>!0,preventDefault:!0}),et("shift+h",()=>{e(Gxe(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),et(["space"],h=>{h.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(ru("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(ru(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},dT=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},qY=()=>{const e=Oe(),t=nl(),n=JG();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=Wg.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(Vxe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(Mxe())}}},zMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HMe=e=>{const t=Oe(),{tool:n,isStaging:r}=he(zMe),{commitColorUnderCursor:i}=qY();return w.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(K5(!0));return}if(n==="colorPicker"){i();return}const a=dT(e.current);a&&(o.evt.preventDefault(),t(eU(!0)),t(Oxe([a.x,a.y])))},[e,n,r,t,i])},VMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WMe=(e,t,n)=>{const r=Oe(),{isDrawing:i,tool:o,isStaging:a}=he(VMe),{updateColorUnderCursor:s}=qY();return w.useCallback(()=>{if(!e.current)return;const l=dT(e.current);if(l){if(r(Wxe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(ZW([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},UMe=()=>{const e=Oe();return w.useCallback(()=>{e(Dxe())},[e])},GMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),qMe=(e,t)=>{const n=Oe(),{tool:r,isDrawing:i,isStaging:o}=he(GMe);return w.useCallback(()=>{if(r==="move"||o){n(K5(!1));return}if(!t.current&&i&&e.current){const a=dT(e.current);if(!a)return;n(ZW([a.x,a.y]))}else t.current=!1;n(eU(!1))},[t,n,i,o,e,r])},YMe=lt([ln],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KMe=e=>{const t=Oe(),{isMoveStageKeyHeld:n,stageScale:r}=he(YMe);return w.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=ke.clamp(r*Sxe**s,xxe,wxe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(Yxe(l)),t(uU(u))},[e,n,r,t])},XMe=lt(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ZMe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(XMe);return v.jsxs(uc,{children:[v.jsx(cc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),v.jsx(cc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},QMe=lt([ln],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),JMe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},eIe=()=>{const{colorMode:e}=gy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=he(QMe),[i,o]=w.useState([]),a=w.useCallback(s=>s/t,[t]);return w.useLayoutEffect(()=>{const s=JMe[e],{width:l,height:u}=r,{x:d,y:h}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(d),y:a(h)}},y={x:Math.ceil(a(d)/64)*64,y:Math.ceil(a(h)/64)*64},b={x1:-y.x,y1:-y.y,x2:a(l)-y.x+64,y2:a(u)-y.y+64},k={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},E=k.x2-k.x1,_=k.y2-k.y1,P=Math.round(E/64)+1,A=Math.round(_/64)+1,M=ke.range(0,P).map(D=>v.jsx(hS,{x:k.x1+D*64,y:k.y1,points:[0,0,0,_],stroke:s,strokeWidth:1},`x_${D}`)),R=ke.range(0,A).map(D=>v.jsx(hS,{x:k.x1,y:k.y1+D*64,points:[0,0,E,0],stroke:s,strokeWidth:1},`y_${D}`));o(M.concat(R))},[t,n,r,e,a]),v.jsx(uc,{children:i})},tIe=lt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),nIe=e=>{const{...t}=e,n=he(tIe),[r,i]=w.useState(null);if(w.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?v.jsx(GY,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},Uh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},rIe=lt(ln,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:Uh(t)}}),pN=e=>`data:image/svg+xml;utf8, +`,FOe={};function dw(e,t,n=FOe){if(!lN&&"zIndex"in t&&(console.warn($Oe),lN=!0),!uN&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(BOe),uN=!0)}for(var o in n)if(!sN[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var d=t._useStrictMode,h={},m=!1;const y={};for(var o in t)if(!sN[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(y[l]=t[o])}!a&&(t[o]!==n[o]||d&&t[o]!==e.getAttr(o))&&(m=!0,h[o]=t[o])}m&&(e.setAttrs(h),bf(e));for(var l in y)e.on(l+lT,y[l])}function bf(e){if(!gt.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const HY={},zOe={};ip.Node.prototype._applyProps=dw;function HOe(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),bf(e)}function VOe(e,t,n){let r=ip[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=ip.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return dw(l,o),l}function WOe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function UOe(e,t,n){return!1}function GOe(e){return e}function qOe(){return null}function YOe(){return null}function KOe(e,t,n,r){return zOe}function XOe(){}function ZOe(e){}function QOe(e,t){return!1}function JOe(){return HY}function eMe(){return HY}const tMe=setTimeout,nMe=clearTimeout,rMe=-1;function iMe(e,t){return!1}const oMe=!1,aMe=!0,sMe=!0;function lMe(e,t){t.parent===e?t.moveToTop():e.add(t),bf(e)}function uMe(e,t){t.parent===e?t.moveToTop():e.add(t),bf(e)}function VY(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),bf(e)}function cMe(e,t,n){VY(e,t,n)}function dMe(e,t){t.destroy(),t.off(lT),bf(e)}function fMe(e,t){t.destroy(),t.off(lT),bf(e)}function hMe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function pMe(e,t,n){}function gMe(e,t,n,r,i){dw(e,i,r)}function mMe(e){e.hide(),bf(e)}function vMe(e){}function yMe(e,t){(t.visible==null||t.visible)&&e.show()}function bMe(e,t){}function SMe(e){}function xMe(){}const wMe=()=>fS.DefaultEventPriority,CMe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:lMe,appendChildToContainer:uMe,appendInitialChild:HOe,cancelTimeout:nMe,clearContainer:SMe,commitMount:pMe,commitTextUpdate:hMe,commitUpdate:gMe,createInstance:VOe,createTextInstance:WOe,detachDeletedInstance:xMe,finalizeInitialChildren:UOe,getChildHostContext:eMe,getCurrentEventPriority:wMe,getPublicInstance:GOe,getRootHostContext:JOe,hideInstance:mMe,hideTextInstance:vMe,idlePriority:Hh.unstable_IdlePriority,insertBefore:VY,insertInContainerBefore:cMe,isPrimaryRenderer:oMe,noTimeout:rMe,now:Hh.unstable_now,prepareForCommit:qOe,preparePortalMount:YOe,prepareUpdate:KOe,removeChild:dMe,removeChildFromContainer:fMe,resetAfterCommit:XOe,resetTextContent:ZOe,run:Hh.unstable_runWithPriority,scheduleTimeout:tMe,shouldDeprioritizeSubtree:QOe,shouldSetTextContent:iMe,supportsMutation:sMe,unhideInstance:yMe,unhideTextInstance:bMe,warnsIfNotActing:aMe},Symbol.toStringTag,{value:"Module"}));var _Me=Object.defineProperty,kMe=Object.defineProperties,EMe=Object.getOwnPropertyDescriptors,cN=Object.getOwnPropertySymbols,PMe=Object.prototype.hasOwnProperty,TMe=Object.prototype.propertyIsEnumerable,dN=(e,t,n)=>t in e?_Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fN=(e,t)=>{for(var n in t||(t={}))PMe.call(t,n)&&dN(e,n,t[n]);if(cN)for(var n of cN(t))TMe.call(t,n)&&dN(e,n,t[n]);return e},LMe=(e,t)=>kMe(e,EMe(t));function uT(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=uT(r,t,n);if(i)return i;r=t?null:r.sibling}}function WY(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const cT=WY(w.createContext(null));class UY extends w.Component{render(){return w.createElement(cT.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:AMe,ReactCurrentDispatcher:OMe}=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function MMe(){const e=w.useContext(cT);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=w.useId();return w.useMemo(()=>{var r;return(r=AMe.current)!=null?r:uT(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const yv=[],hN=new WeakMap;function IMe(){var e;const t=MMe();yv.splice(0,yv.length),uT(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==cT&&yv.push(WY(i))});for(const n of yv){const r=(e=OMe.current)==null?void 0:e.readContext(n);hN.set(n,r)}return w.useMemo(()=>yv.reduce((n,r)=>i=>w.createElement(n,null,w.createElement(r.Provider,LMe(fN({},i),{value:hN.get(r)}))),n=>w.createElement(UY,fN({},n))),[])}function RMe(e){const t=N.useRef();return N.useLayoutEffect(()=>{t.current=e}),t.current}const DMe=e=>{const t=N.useRef(),n=N.useRef(),r=N.useRef(),i=RMe(e),o=IMe(),a=s=>{const{forwardedRef:l}=e;l&&(typeof l=="function"?l(s):l.current=s)};return N.useLayoutEffect(()=>(n.current=new ip.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=$v.createContainer(n.current,fS.LegacyRoot,!1,null),$v.updateContainer(N.createElement(o,{},e.children),r.current),()=>{ip.isBrowser&&(a(null),$v.updateContainer(null,r.current,null),n.current.destroy())}),[]),N.useLayoutEffect(()=>{a(n.current),dw(n.current,e,i),$v.updateContainer(N.createElement(o,{},e.children),r.current,null)}),N.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},bv="Layer",uc="Group",cc="Rect",dh="Circle",hS="Line",GY="Image",NMe="Transformer",$v=NOe(CMe);$v.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:N.version,rendererPackageName:"react-konva"});const jMe=N.forwardRef((e,t)=>N.createElement(UY,{},N.createElement(DMe,{...e,forwardedRef:t}))),BMe=lt([ln,Ir],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),$Me=()=>{const e=Oe(),{tool:t,isStaging:n,isMovingBoundingBox:r}=pe(BMe);return{handleDragStart:w.useCallback(()=>{(t==="move"||n)&&!r&&e(K5(!0))},[e,r,n,t]),handleDragMove:w.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(uU(o))},[e,r,n,t]),handleDragEnd:w.useCallback(()=>{(t==="move"||n)&&!r&&e(K5(!1))},[e,r,n,t])}},FMe=lt([ln,Mr,Ir],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),zMe=()=>{const e=Oe(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=pe(FMe),s=w.useRef(null),l=JG(),u=()=>e(uP());et(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const d=()=>e(zy(!o));et(["h"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[o]),et(["n"],()=>{e(Z5(!a))},{enabled:!0,preventDefault:!0},[a]),et("esc",()=>{e($xe())},{enabled:()=>!0,preventDefault:!0}),et("shift+h",()=>{e(Gxe(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),et(["space"],h=>{h.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(ru("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(ru(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},dT=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},qY=()=>{const e=Oe(),t=nl(),n=JG();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=Gg.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(Vxe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(Mxe())}}},HMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VMe=e=>{const t=Oe(),{tool:n,isStaging:r}=pe(HMe),{commitColorUnderCursor:i}=qY();return w.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(K5(!0));return}if(n==="colorPicker"){i();return}const a=dT(e.current);a&&(o.evt.preventDefault(),t(eU(!0)),t(Oxe([a.x,a.y])))},[e,n,r,t,i])},WMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),UMe=(e,t,n)=>{const r=Oe(),{isDrawing:i,tool:o,isStaging:a}=pe(WMe),{updateColorUnderCursor:s}=qY();return w.useCallback(()=>{if(!e.current)return;const l=dT(e.current);if(l){if(r(Wxe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(ZW([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},GMe=()=>{const e=Oe();return w.useCallback(()=>{e(Dxe())},[e])},qMe=lt([Mr,ln,Ir],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),YMe=(e,t)=>{const n=Oe(),{tool:r,isDrawing:i,isStaging:o}=pe(qMe);return w.useCallback(()=>{if(r==="move"||o){n(K5(!1));return}if(!t.current&&i&&e.current){const a=dT(e.current);if(!a)return;n(ZW([a.x,a.y]))}else t.current=!1;n(eU(!1))},[t,n,i,o,e,r])},KMe=lt([ln],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),XMe=e=>{const t=Oe(),{isMoveStageKeyHeld:n,stageScale:r}=pe(KMe);return w.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=ke.clamp(r*Sxe**s,xxe,wxe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(Yxe(l)),t(uU(u))},[e,n,r,t])},ZMe=lt(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),QMe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=pe(ZMe);return v.jsxs(uc,{children:[v.jsx(cc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),v.jsx(cc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},JMe=lt([ln],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),eIe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},tIe=()=>{const{colorMode:e}=vy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=pe(JMe),[i,o]=w.useState([]),a=w.useCallback(s=>s/t,[t]);return w.useLayoutEffect(()=>{const s=eIe[e],{width:l,height:u}=r,{x:d,y:h}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(d),y:a(h)}},y={x:Math.ceil(a(d)/64)*64,y:Math.ceil(a(h)/64)*64},b={x1:-y.x,y1:-y.y,x2:a(l)-y.x+64,y2:a(u)-y.y+64},k={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},E=k.x2-k.x1,_=k.y2-k.y1,P=Math.round(E/64)+1,A=Math.round(_/64)+1,M=ke.range(0,P).map(D=>v.jsx(hS,{x:k.x1+D*64,y:k.y1,points:[0,0,0,_],stroke:s,strokeWidth:1},`x_${D}`)),R=ke.range(0,A).map(D=>v.jsx(hS,{x:k.x1,y:k.y1+D*64,points:[0,0,E,0],stroke:s,strokeWidth:1},`y_${D}`));o(M.concat(R))},[t,n,r,e,a]),v.jsx(uc,{children:i})},nIe=lt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),rIe=e=>{const{...t}=e,n=pe(nIe),[r,i]=w.useState(null);if(w.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?v.jsx(GY,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},Gh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},iIe=lt(ln,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:Gh(t)}}),pN=e=>`data:image/svg+xml;utf8, @@ -630,9 +630,9 @@ For more info see: https://github.com/konvajs/react-konva/issues/194 -`.replaceAll("black",e),iIe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(rIe),[a,s]=w.useState(null),[l,u]=w.useState(0),d=w.useRef(null),h=w.useCallback(()=>{u(l+1),setTimeout(h,500)},[l]);return w.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=pN(n)},[a,n]),w.useEffect(()=>{a&&(a.src=pN(n))},[a,n]),w.useEffect(()=>{const m=setInterval(()=>u(y=>(y+1)%5),50);return()=>clearInterval(m)},[]),!a||!ke.isNumber(r.x)||!ke.isNumber(r.y)||!ke.isNumber(o)||!ke.isNumber(i.width)||!ke.isNumber(i.height)?null:v.jsx(cc,{ref:d,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:ke.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},oIe=lt([ln],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),aIe=e=>{const{...t}=e,{objects:n}=he(oIe);return v.jsx(uc,{listening:!1,...t,children:n.filter(lP).map((r,i)=>v.jsx(hS,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})};var dh=w,sIe=function(t,n,r){const i=dh.useRef("loading"),o=dh.useRef(),[a,s]=dh.useState(0),l=dh.useRef(),u=dh.useRef(),d=dh.useRef();return(l.current!==t||u.current!==n||d.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,d.current=r),dh.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function m(){i.current="loaded",o.current=h,s(Math.random())}function y(){i.current="failed",o.current=void 0,s(Math.random())}return h.addEventListener("load",m),h.addEventListener("error",y),n&&(h.crossOrigin=n),r&&(h.referrerpolicy=r),h.src=t,function(){h.removeEventListener("load",m),h.removeEventListener("error",y)}},[t,n,r]),[o.current,i.current]};const YY=e=>{const{url:t,x:n,y:r}=e,[i]=sIe(t);return v.jsx(GY,{x:n,y:r,image:i,listening:!1})},lIe=lt([ln],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),uIe=()=>{const{objects:e}=he(lIe);return e?v.jsx(uc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(Y5(t))return v.jsx(YY,{x:t.x,y:t.y,url:t.image.url},n);if(kxe(t)){const r=v.jsx(hS,{points:t.points,stroke:t.color?Uh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?v.jsx(uc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(Exe(t))return v.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Uh(t.color)},n);if(Pxe(t))return v.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},cIe=lt([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),dIe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=he(cIe);return v.jsxs(uc,{...t,children:[r&&n&&v.jsx(YY,{url:n.image.url,x:o,y:a}),i&&v.jsxs(uc,{children:[v.jsx(cc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),v.jsx(cc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},fIe=lt([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),hIe=()=>{const e=Oe(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=he(fIe),{t:o}=Ge(),a=w.useCallback(()=>{e(WI(!0))},[e]),s=w.useCallback(()=>{e(WI(!1))},[e]);et(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),et(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),et(["enter"],()=>{d()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(jxe()),u=()=>e(Nxe()),d=()=>e(Ixe());return r?v.jsx(je,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{tooltip:`${o("unifiedcanvas:previous")} (Left)`,"aria-label":`${o("unifiedcanvas:previous")} (Left)`,icon:v.jsx(mEe,{}),onClick:l,"data-selected":!0,isDisabled:t}),v.jsx(Je,{tooltip:`${o("unifiedcanvas:next")} (Right)`,"aria-label":`${o("unifiedcanvas:next")} (Right)`,icon:v.jsx(vEe,{}),onClick:u,"data-selected":!0,isDisabled:n}),v.jsx(Je,{tooltip:`${o("unifiedcanvas:accept")} (Enter)`,"aria-label":`${o("unifiedcanvas:accept")} (Enter)`,icon:v.jsx(RP,{}),onClick:d,"data-selected":!0}),v.jsx(Je,{tooltip:o("unifiedcanvas:showHide"),"aria-label":o("unifiedcanvas:showHide"),"data-alert":!i,icon:i?v.jsx(_Ee,{}):v.jsx(CEe,{}),onClick:()=>e(qxe(!i)),"data-selected":!0}),v.jsx(Je,{tooltip:o("unifiedcanvas:saveToGallery"),"aria-label":o("unifiedcanvas:saveToGallery"),icon:v.jsx(NP,{}),onClick:()=>e(r_e(r.image.url)),"data-selected":!0}),v.jsx(Je,{tooltip:o("unifiedcanvas:discardAll"),"aria-label":o("unifiedcanvas:discardAll"),icon:v.jsx(Uy,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(Rxe()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},mm=e=>Math.round(e*100)/100,pIe=lt([ln],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${mm(n)}, ${mm(r)})`}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function gIe(){const{cursorCoordinatesString:e}=he(pIe),{t}=Ge();return v.jsx("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const mIe=lt([ln],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:d},stageScale:h,shouldShowCanvasDebugInfo:m,layer:y,boundingBoxScaleMethod:b,shouldPreserveMaskedArea:x}=e;let k="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(k="var(--status-working-color)"),{activeLayerColor:y==="mask"?"var(--status-working-color)":"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:k,boundingBoxCoordinatesString:`(${mm(u)}, ${mm(d)})`,boundingBoxDimensionsString:`${o}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${mm(r)}×${mm(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none",shouldPreserveMaskedArea:x}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),vIe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:d,shouldShowBoundingBox:h,shouldPreserveMaskedArea:m}=he(mIe),{t:y}=Ge();return v.jsxs("div",{className:"canvas-status-text",children:[v.jsx("div",{style:{color:e},children:`${y("unifiedcanvas:activeLayer")}: ${t}`}),v.jsx("div",{children:`${y("unifiedcanvas:canvasScale")}: ${u}%`}),m&&v.jsx("div",{style:{color:"var(--status-working-color)"},children:"Preserve Masked Area: On"}),h&&v.jsx("div",{style:{color:n},children:`${y("unifiedcanvas:boundingBox")}: ${i}`}),a&&v.jsx("div",{style:{color:n},children:`${y("unifiedcanvas:scaledBoundingBox")}: ${o}`}),d&&v.jsxs(v.Fragment,{children:[v.jsx("div",{children:`${y("unifiedcanvas:boundingBoxPosition")}: ${r}`}),v.jsx("div",{children:`${y("unifiedcanvas:canvasDimensions")}: ${l}`}),v.jsx("div",{children:`${y("unifiedcanvas:canvasPosition")}: ${s}`}),v.jsx(gIe,{})]})]})},yIe=lt(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),bIe=e=>{const{...t}=e,n=Oe(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:d,hitStrokeWidth:h}=he(yIe),m=w.useRef(null),y=w.useRef(null),[b,x]=w.useState(!1);w.useEffect(()=>{var te;!m.current||!y.current||(m.current.nodes([y.current]),(te=m.current.getLayer())==null||te.batchDraw())},[]);const k=64*l,E=w.useCallback(te=>{if(!u){n(CC({x:Math.floor(te.target.x()),y:Math.floor(te.target.y())}));return}const G=te.target.x(),F=te.target.y(),W=Yl(G,64),X=Yl(F,64);te.target.x(W),te.target.y(X),n(CC({x:W,y:X}))},[n,u]),_=w.useCallback(()=>{if(!y.current)return;const te=y.current,G=te.scaleX(),F=te.scaleY(),W=Math.round(te.width()*G),X=Math.round(te.height()*F),Z=Math.round(te.x()),U=Math.round(te.y());n(Av({width:W,height:X})),n(CC({x:u?Ld(Z,64):Z,y:u?Ld(U,64):U})),te.scaleX(1),te.scaleY(1)},[n,u]),P=w.useCallback((te,G,F)=>{const W=te.x%k,X=te.y%k;return{x:Ld(G.x,k)+W,y:Ld(G.y,k)+X}},[k]),A=()=>{n(kC(!0))},M=()=>{n(kC(!1)),n(_C(!1)),n(Pb(!1)),x(!1)},R=()=>{n(_C(!0))},D=()=>{n(kC(!1)),n(_C(!1)),n(Pb(!1)),x(!1)},j=()=>{x(!0)},z=()=>{!s&&!a&&x(!1)},H=()=>{n(Pb(!0))},K=()=>{n(Pb(!1))};return v.jsxs(uc,{...t,children:[v.jsx(cc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:H,onMouseOver:H,onMouseLeave:K,onMouseOut:K}),v.jsx(cc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:h,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onDragMove:E,onMouseDown:R,onMouseOut:z,onMouseOver:j,onMouseEnter:j,onMouseUp:D,onTransform:_,onTransformEnd:M,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),v.jsx(DMe,{anchorCornerRadius:3,anchorDragBoundFunc:P,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:d==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onMouseDown:A,onMouseUp:M,onTransformEnd:M,ref:m,rotateEnabled:!1})]})},SIe=lt(ln,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:d,stageScale:h,stageDimensions:m,boundingBoxCoordinates:y,boundingBoxDimensions:b,shouldRestrictStrokesToBox:x}=e,k=x?{clipX:y.x,clipY:y.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:HI/h,colorPickerInnerRadius:(HI-h8+1)/h,maskColorString:Uh({...i,a:.5}),brushColorString:Uh(o),colorPickerColorString:Uh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||d||!t)&&l,strokeWidth:1.5/h,dotRadius:1.5/h,clip:k}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),xIe=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:d,brushColorString:h,colorPickerColorString:m,colorPickerInnerRadius:y,colorPickerOuterRadius:b,clip:x}=he(SIe);return l?v.jsxs(uc,{listening:!1,...x,...t,children:[a==="colorPicker"?v.jsxs(v.Fragment,{children:[v.jsx(ch,{x:n,y:r,radius:b,stroke:h,strokeWidth:h8,strokeScaleEnabled:!1}),v.jsx(ch,{x:n,y:r,radius:y,stroke:m,strokeWidth:h8,strokeScaleEnabled:!1})]}):v.jsxs(v.Fragment,{children:[v.jsx(ch,{x:n,y:r,radius:i,fill:s==="mask"?o:h,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),v.jsx(ch,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:d*2,strokeEnabled:!0,listening:!1}),v.jsx(ch,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),v.jsx(ch,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),v.jsx(ch,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},wIe=lt([ln,Ir],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:d,isMovingStage:h,shouldShowIntermediates:m,shouldShowGrid:y,shouldRestrictStrokesToBox:b}=e;let x="none";return d==="move"||t?h?x="grabbing":x="grab":o?x=void 0:b&&!a&&(x="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:y,stageCoordinates:u,stageCursor:x,stageDimensions:l,stageScale:r,tool:d,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KY=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:d}=he(wIe);$Me();const h=w.useRef(null),m=w.useRef(null),y=w.useCallback(z=>{N8e(z),h.current=z},[]),b=w.useCallback(z=>{D8e(z),m.current=z},[]),x=w.useRef({x:0,y:0}),k=w.useRef(!1),E=KMe(h),_=HMe(h),P=qMe(h,k),A=WMe(h,k,x),M=UMe(),{handleDragStart:R,handleDragMove:D,handleDragEnd:j}=BMe();return v.jsx("div",{className:"inpainting-canvas-container",children:v.jsxs("div",{className:"inpainting-canvas-wrapper",children:[v.jsxs(NMe,{tabIndex:-1,ref:y,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:_,onTouchMove:A,onTouchEnd:P,onMouseDown:_,onMouseLeave:M,onMouseMove:A,onMouseUp:P,onDragStart:R,onDragMove:D,onDragEnd:j,onContextMenu:z=>z.evt.preventDefault(),onWheel:E,draggable:(l==="move"||u)&&!t,children:[v.jsx(vv,{id:"grid",visible:r,children:v.jsx(eIe,{})}),v.jsx(vv,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:v.jsx(uIe,{})}),v.jsxs(vv,{id:"mask",visible:e,listening:!1,children:[v.jsx(aIe,{visible:!0,listening:!1}),v.jsx(iIe,{listening:!1})]}),v.jsx(vv,{children:v.jsx(ZMe,{})}),v.jsxs(vv,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&v.jsx(xIe,{visible:l!=="move",listening:!1}),v.jsx(dIe,{visible:u}),d&&v.jsx(nIe,{}),v.jsx(bIe,{visible:n&&!u})]})]}),v.jsx(vIe,{}),v.jsx(hIe,{})]})})},CIe=lt(ln,Iq,Mr,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),XY=()=>{const e=Oe(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=he(CIe),o=w.useRef(null);return w.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(Hxe({width:a,height:s})),e(i?$xe():Bx()),e(vi(!1))},0)},[e,r,t,n,i]),v.jsx("div",{ref:o,className:"inpainting-canvas-area",children:v.jsx(ky,{thickness:"2px",speed:"1s",size:"xl"})})},_Ie=lt([ln,Mr,or],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function ZY(){const e=Oe(),{canRedo:t,activeTabName:n}=he(_Ie),{t:r}=Ge(),i=()=>{e(Bxe())};return et(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),v.jsx(Je,{"aria-label":`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,icon:v.jsx(DEe,{}),onClick:i,isDisabled:!t})}const kIe=lt([ln,Mr,or],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function QY(){const e=Oe(),{t}=Ge(),{canUndo:n,activeTabName:r}=he(kIe),i=()=>{e(Kxe())};return et(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:undo")} (Ctrl+Z)`,tooltip:`${t("unifiedcanvas:undo")} (Ctrl+Z)`,icon:v.jsx(FEe,{}),onClick:i,isDisabled:!n})}const EIe=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");o&&(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},PIe=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},TIe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:a,y:s,width:l,height:u},h=e.toDataURL(d);return e.scale(i),{dataURL:h,boundingBox:{x:o.x,y:o.y,width:l,height:u}}},LIe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Od=(e=LIe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(yCe("Exporting Image")),t(fm(!1));const u=n(),{stageScale:d,boundingBoxCoordinates:h,boundingBoxDimensions:m,stageCoordinates:y}=u.canvas,b=nl();if(!b){t(ns(!1)),t(fm(!0));return}const{dataURL:x,boundingBox:k}=TIe(b,d,y,i?{...h,...m}:void 0);if(!x){t(ns(!1)),t(fm(!0));return}const E=new FormData;E.append("data",JSON.stringify({dataURL:x,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const P=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:E})).json(),{url:A,width:M,height:R}=P,D={uuid:pm(),category:o?"result":"user",...P};a&&(PIe(A),t(Oh({title:zt.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(EIe(A,M,R),t(Oh({title:zt.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(dm({image:D,category:"result"})),t(Oh({title:zt.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(Uxe({kind:"image",layer:"base",...k,image:D})),t(Oh({title:zt.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(ns(!1)),t(B4(zt.t("common:statusConnected"))),t(fm(!0))};function AIe(){const e=he(Ir),t=nl(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Oe(),{t:o}=Ge();et(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Od({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return v.jsx(Je,{"aria-label":`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:v.jsx(u0,{}),onClick:a,isDisabled:e})}function OIe(){const e=Oe(),{t}=Ge(),n=nl(),r=he(Ir),i=he(s=>s.system.isProcessing),o=he(s=>s.canvas.shouldCropToBoundingBoxOnSave);et(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Od({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return v.jsx(Je,{"aria-label":`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:v.jsx(DP,{}),onClick:a,isDisabled:r})}function MIe(){const e=he(Ir),{openUploader:t}=TP(),{t:n}=Ge();return v.jsx(Je,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:v.jsx(tw,{}),onClick:t,isDisabled:e})}const IIe=lt([ln,Ir],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function RIe(){const e=Oe(),{t}=Ge(),{layer:n,isMaskEnabled:r,isStaging:i}=he(IIe),o=()=>{e(X5(n==="mask"?"base":"mask"))};et(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(X5(l)),l==="mask"&&!r&&e(Fy(!0))};return v.jsx(rl,{tooltip:`${t("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:qW,onChange:a,isDisabled:i})}function DIe(){const e=Oe(),{t}=Ge(),n=nl(),r=he(Ir),i=he(a=>a.system.isProcessing);et(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Od({cropVisible:!1,shouldSetAsInitialImage:!0}))};return v.jsx(Je,{"aria-label":`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:v.jsx(Oq,{}),onClick:o,isDisabled:r})}function NIe(){const e=he(o=>o.canvas.tool),t=he(Ir),n=Oe(),{t:r}=Ge();et(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(ru("move"));return v.jsx(Je,{"aria-label":`${r("unifiedcanvas:move")} (V)`,tooltip:`${r("unifiedcanvas:move")} (V)`,icon:v.jsx(kq,{}),"data-selected":e==="move"||t,onClick:i})}function jIe(){const e=he(i=>i.ui.shouldPinParametersPanel),t=Oe(),{t:n}=Ge(),r=()=>{t(Zu(!0)),e&&setTimeout(()=>t(vi(!0)),400)};return v.jsxs(je,{flexDirection:"column",gap:"0.5rem",children:[v.jsx(Je,{tooltip:`${n("parameters:showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters:showOptionsPanel"),onClick:r,children:v.jsx(jP,{})}),v.jsx(je,{children:v.jsx(rT,{iconButton:!0})}),v.jsx(je,{children:v.jsx(tT,{width:"100%",height:"40px"})})]})}function BIe(){const e=Oe(),{t}=Ge(),n=he(Ir),r=()=>{e(cP()),e(Bx())};return v.jsx(Je,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:v.jsx(xp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function JY(e,t,n=250){const[r,i]=w.useState(0);return w.useEffect(()=>{const o=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(o)},[r,e,t,n]),()=>i(o=>o+1)}function FIe(){const e=nl(),t=Oe(),{t:n}=Ge();et(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=JY(()=>i(!1),()=>i(!0)),i=(o=!1)=>{const a=nl();if(!a)return;const s=a.getClientRect({skipTransform:!0});t(JW({contentRect:s,shouldScaleTo1:o}))};return v.jsx(Je,{"aria-label":`${n("unifiedcanvas:resetView")} (R)`,tooltip:`${n("unifiedcanvas:resetView")} (R)`,icon:v.jsx(Pq,{}),onClick:r})}function $Ie(){const e=he(Ir),t=nl(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Oe(),{t:o}=Ge();et(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Od({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return v.jsx(Je,{"aria-label":`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:v.jsx(NP,{}),onClick:a,isDisabled:e})}const zIe=lt([ln,Ir,or],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HIe=()=>{const e=Oe(),{t}=Ge(),{tool:n,isStaging:r}=he(zIe);et(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),et(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),et(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),et(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),et(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(ru("brush")),o=()=>e(ru("eraser")),a=()=>e(ru("colorPicker")),s=()=>e(XW()),l=()=>e(KW());return v.jsxs(je,{flexDirection:"column",gap:"0.5rem",children:[v.jsxs(oo,{children:[v.jsx(Je,{"aria-label":`${t("unifiedcanvas:brush")} (B)`,tooltip:`${t("unifiedcanvas:brush")} (B)`,icon:v.jsx(Mq,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:eraser")} (E)`,tooltip:`${t("unifiedcanvas:eraser")} (B)`,icon:v.jsx(Tq,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),v.jsxs(oo,{children:[v.jsx(Je,{"aria-label":`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:v.jsx(Aq,{}),isDisabled:r,onClick:s}),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:v.jsx(Uy,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:colorPicker")} (C)`,tooltip:`${t("unifiedcanvas:colorPicker")} (C)`,icon:v.jsx(Lq,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},fw=Ae((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:d,onClose:h}=qh(),m=w.useRef(null),y=()=>{r(),h()},b=()=>{o&&o(),h()};return v.jsxs(v.Fragment,{children:[w.cloneElement(l,{onClick:d,ref:t}),v.jsx(zV,{isOpen:u,leastDestructiveRef:m,onClose:h,children:v.jsx(Qd,{children:v.jsxs(HV,{className:"modal",children:[v.jsx(k0,{fontSize:"lg",fontWeight:"bold",children:s}),v.jsx(a0,{children:a}),v.jsxs(wx,{children:[v.jsx(ls,{ref:m,onClick:b,className:"modal-close-btn",children:i}),v.jsx(ls,{colorScheme:"red",onClick:y,ml:3,children:n})]})]})})})]})}),eK=()=>{const e=he(Ir),t=Oe(),{t:n}=Ge(),r=()=>{t(i_e()),t(cP()),t(QW())};return v.jsxs(fw,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:v.jsx(nr,{leftIcon:v.jsx(xp,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[v.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),v.jsx("br",{}),v.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},tK=()=>{const e=he(Ir),t=Oe(),{t:n}=Ge();return v.jsxs(fw,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:()=>t(QW()),acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:v.jsx(nr,{size:"sm",leftIcon:v.jsx(xp,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[v.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),v.jsx("br",{}),v.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},VIe=lt([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WIe=()=>{const e=Oe(),{t}=Ge(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=he(VIe);return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:v.jsx(BP,{})}),children:v.jsxs(je,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:o,onChange:a=>e(lU(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:a=>e(nU(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:a=>e(rU(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:a=>e(aU(a.target.checked))}),v.jsx(tK,{}),v.jsx(eK,{})]})})},UIe=()=>{const e=he(t=>t.ui.shouldShowParametersPanel);return v.jsxs(je,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[v.jsx(RIe,{}),v.jsx(HIe,{}),v.jsxs(je,{gap:"0.5rem",children:[v.jsx(NIe,{}),v.jsx(FIe,{})]}),v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(DIe,{}),v.jsx($Ie,{})]}),v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(AIe,{}),v.jsx(OIe,{})]}),v.jsxs(je,{gap:"0.5rem",children:[v.jsx(QY,{}),v.jsx(ZY,{})]}),v.jsxs(je,{gap:"0.5rem",children:[v.jsx(MIe,{}),v.jsx(BIe,{})]}),v.jsx(WIe,{}),!e&&v.jsx(jIe,{})]})};function GIe(){const e=Oe(),t=he(i=>i.canvas.brushSize),{t:n}=Ge(),r=he(Ir);return et(["BracketLeft"],()=>{e(zm(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),et(["BracketRight"],()=>{e(zm(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),v.jsx(so,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:i=>e(zm(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function hw(){return(hw=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function n_(e){var t=w.useRef(e),n=w.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var f0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:k.buttons>0)&&i.current?o(gN(i.current,k,s.current)):x(!1)},b=function(){return x(!1)};function x(k){var E=l.current,_=r_(i.current),P=k?_.addEventListener:_.removeEventListener;P(E?"touchmove":"mousemove",y),P(E?"touchend":"mouseup",b)}return[function(k){var E=k.nativeEvent,_=i.current;if(_&&(mN(E),!function(A,M){return M&&!g2(A)}(E,l.current)&&_)){if(g2(E)){l.current=!0;var P=E.changedTouches||[];P.length&&(s.current=P[0].identifier)}_.focus(),o(gN(_,E,s.current)),x(!0)}},function(k){var E=k.which||k.keyCode;E<37||E>40||(k.preventDefault(),a({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},x]},[a,o]),d=u[0],h=u[1],m=u[2];return w.useEffect(function(){return m},[m]),N.createElement("div",hw({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),pw=function(e){return e.filter(Boolean).join(" ")},hT=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=pw(["react-colorful__pointer",e.className]);return N.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},N.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Po=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},rK=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Po(e.h),s:Po(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Po(i/2),a:Po(r,2)}},i_=function(e){var t=rK(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},YC=function(e){var t=rK(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},qIe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:Po(255*[r,s,a,a,l,r][u]),g:Po(255*[l,r,r,s,a,a][u]),b:Po(255*[a,a,l,r,r,s][u]),a:Po(i,2)}},YIe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Po(60*(s<0?s+6:s)),s:Po(o?a/o*100:0),v:Po(o/255*100),a:i}},KIe=N.memo(function(e){var t=e.hue,n=e.onChange,r=pw(["react-colorful__hue",e.className]);return N.createElement("div",{className:r},N.createElement(fT,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:f0(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Po(t),"aria-valuemax":"360","aria-valuemin":"0"},N.createElement(hT,{className:"react-colorful__hue-pointer",left:t/360,color:i_({h:t,s:100,v:100,a:1})})))}),XIe=N.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:i_({h:t.h,s:100,v:100,a:1})};return N.createElement("div",{className:"react-colorful__saturation",style:r},N.createElement(fT,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:f0(t.s+100*i.left,0,100),v:f0(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Po(t.s)+"%, Brightness "+Po(t.v)+"%"},N.createElement(hT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:i_(t)})))}),iK=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function ZIe(e,t,n){var r=n_(n),i=w.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=w.useRef({color:t,hsva:o});w.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),w.useEffect(function(){var u;iK(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=w.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var QIe=typeof window<"u"?w.useLayoutEffect:w.useEffect,JIe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},vN=new Map,eRe=function(e){QIe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!vN.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,vN.set(t,n);var r=JIe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},tRe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+YC(Object.assign({},n,{a:0}))+", "+YC(Object.assign({},n,{a:1}))+")"},o=pw(["react-colorful__alpha",t]),a=Po(100*n.a);return N.createElement("div",{className:o},N.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),N.createElement(fT,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:f0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},N.createElement(hT,{className:"react-colorful__alpha-pointer",left:n.a,color:YC(n)})))},nRe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=nK(e,["className","colorModel","color","onChange"]),s=w.useRef(null);eRe(s);var l=ZIe(n,i,o),u=l[0],d=l[1],h=pw(["react-colorful",t]);return N.createElement("div",hw({},a,{ref:s,className:h}),N.createElement(XIe,{hsva:u,onChange:d}),N.createElement(KIe,{hue:u.h,onChange:d}),N.createElement(tRe,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},rRe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:YIe,fromHsva:qIe,equal:iK},iRe=function(e){return N.createElement(nRe,hw({},e,{colorModel:rRe}))};const pS=e=>{const{styleClass:t,...n}=e;return v.jsx(iRe,{className:`invokeai__color-picker ${t}`,...n})},oRe=lt([ln,Ir],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function aRe(){const e=Oe(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=he(oRe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return et(["shift+BracketLeft"],()=>{e($m({...t,a:ke.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),et(["shift+BracketRight"],()=>{e($m({...t,a:ke.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Eo,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:v.jsxs(je,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&v.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e($m(a))}),r==="mask"&&v.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(tU(a))})]})})}function oK(){return v.jsxs(je,{columnGap:"1rem",alignItems:"center",children:[v.jsx(GIe,{}),v.jsx(aRe,{})]})}function sRe(){const e=Oe(),t=he(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ge();return v.jsx(er,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:r=>e(cU(r.target.checked))})}function lRe(){return v.jsxs(je,{gap:"1rem",alignItems:"center",children:[v.jsx(oK,{}),v.jsx(sRe,{})]})}function uRe(){const e=Oe(),{t}=Ge(),n=()=>e(uP());return v.jsx(nr,{size:"sm",leftIcon:v.jsx(xp,{}),onClick:n,tooltip:`${t("unifiedcanvas:clearMask")} (Shift+C)`,children:t("unifiedcanvas:betaClear")})}function cRe(){const e=he(i=>i.canvas.isMaskEnabled),t=Oe(),{t:n}=Ge(),r=()=>t(Fy(!e));return v.jsx(er,{label:`${n("unifiedcanvas:enableMask")} (H)`,isChecked:e,onChange:r})}function dRe(){const e=Oe(),{t}=Ge(),n=he(r=>r.canvas.shouldPreserveMaskedArea);return v.jsx(er,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:r=>e(oU(r.target.checked))})}function fRe(){return v.jsxs(je,{gap:"1rem",alignItems:"center",children:[v.jsx(oK,{}),v.jsx(cRe,{}),v.jsx(dRe,{}),v.jsx(uRe,{})]})}function hRe(){const e=he(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Oe(),{t:n}=Ge();return v.jsx(er,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:r=>t(iU(r.target.checked))})}function pRe(){const e=he(r=>r.canvas.shouldShowGrid),t=Oe(),{t:n}=Ge();return v.jsx(er,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:r=>t(sU(r.target.checked))})}function gRe(){const e=he(i=>i.canvas.shouldSnapToGrid),t=Oe(),{t:n}=Ge(),r=i=>t(Z5(i.target.checked));return v.jsx(er,{label:`${n("unifiedcanvas:snapToGrid")} (N)`,isChecked:e,onChange:r})}function mRe(){return v.jsxs(je,{alignItems:"center",gap:"1rem",children:[v.jsx(pRe,{}),v.jsx(gRe,{}),v.jsx(hRe,{})]})}const vRe=lt([ln],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function yRe(){const{tool:e,layer:t}=he(vRe);return v.jsxs(je,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&v.jsx(lRe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&v.jsx(fRe,{}),e=="move"&&v.jsx(mRe,{})]})}const bRe=lt([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),SRe=()=>{const e=Oe(),{doesCanvasNeedScaling:t}=he(bRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),v.jsx("div",{className:"workarea-single-view",children:v.jsxs(je,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[v.jsx(UIe,{}),v.jsxs(je,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[v.jsx(yRe,{}),t?v.jsx(XY,{}):v.jsx(KY,{})]})]})})},xRe=lt([ln,Ir],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:Uh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),wRe=()=>{const e=Oe(),{t}=Ge(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=he(xRe);et(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),et(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),et(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(X5(n==="mask"?"base":"mask"))},l=()=>e(uP()),u=()=>e(Fy(!i));return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(oo,{children:v.jsx(Je,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:v.jsx(LEe,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:v.jsxs(je,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:`${t("unifiedcanvas:enableMask")} (H)`,isChecked:i,onChange:u}),v.jsx(er,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:o,onChange:d=>e(oU(d.target.checked))}),v.jsx(pS,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:d=>e(tU(d))}),v.jsxs(nr,{size:"sm",leftIcon:v.jsx(xp,{}),onClick:l,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},CRe=lt([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),_Re=()=>{const e=Oe(),{t}=Ge(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=he(CRe);et(["n"],()=>{e(Z5(!l))},{enabled:!0,preventDefault:!0},[l]);const d=h=>e(Z5(h.target.checked));return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:v.jsx(BP,{})}),children:v.jsxs(je,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:s,onChange:h=>e(lU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showGrid"),isChecked:a,onChange:h=>e(sU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:snapToGrid"),isChecked:l,onChange:d}),v.jsx(er,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:h=>e(iU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:h=>e(nU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:h=>e(rU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:u,onChange:h=>e(cU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:o,onChange:h=>e(aU(h.target.checked))}),v.jsx(tK,{}),v.jsx(eK,{})]})})},kRe=lt([ln,Ir,or],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ERe=()=>{const e=Oe(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=he(kRe),{t:o}=Ge();et(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),et(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),et(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),et(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),et(["delete","backspace"],()=>{d()},{enabled:()=>!i,preventDefault:!0}),et(["BracketLeft"],()=>{e(zm(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),et(["BracketRight"],()=>{e(zm(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),et(["shift+BracketLeft"],()=>{e($m({...n,a:ke.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),et(["shift+BracketRight"],()=>{e($m({...n,a:ke.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(ru("brush")),s=()=>e(ru("eraser")),l=()=>e(ru("colorPicker")),u=()=>e(XW()),d=()=>e(KW());return v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${o("unifiedcanvas:brush")} (B)`,tooltip:`${o("unifiedcanvas:brush")} (B)`,icon:v.jsx(Mq,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:eraser")} (E)`,tooltip:`${o("unifiedcanvas:eraser")} (E)`,icon:v.jsx(Tq,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:v.jsx(Aq,{}),isDisabled:i,onClick:u}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:v.jsx(Uy,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:colorPicker")} (C)`,tooltip:`${o("unifiedcanvas:colorPicker")} (C)`,icon:v.jsx(Lq,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":o("unifiedcanvas:brushOptions"),tooltip:o("unifiedcanvas:brushOptions"),icon:v.jsx(jP,{})}),children:v.jsxs(je,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[v.jsx(je,{gap:"1rem",justifyContent:"space-between",children:v.jsx(so,{label:o("unifiedcanvas:brushSize"),value:r,withInput:!0,onChange:h=>e(zm(h)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),v.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:h=>e($m(h))})]})})]})},PRe=lt([or,ln,Ir],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),TRe=()=>{const e=Oe(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=he(PRe),s=nl(),{t:l}=Ge(),{openUploader:u}=TP();et(["v"],()=>{d()},{enabled:()=>!n,preventDefault:!0},[]),et(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[s]),et(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["shift+s"],()=>{x()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["meta+c","ctrl+c"],()=>{k()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["shift+d"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]);const d=()=>e(ru("move")),h=JY(()=>m(!1),()=>m(!0)),m=(P=!1)=>{const A=nl();if(!A)return;const M=A.getClientRect({skipTransform:!0});e(JW({contentRect:M,shouldScaleTo1:P}))},y=()=>{e(cP()),e(Bx())},b=()=>{e(Od({cropVisible:!1,shouldSetAsInitialImage:!0}))},x=()=>{e(Od({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},k=()=>{e(Od({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},E=()=>{e(Od({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},_=P=>{const A=P.target.value;e(X5(A)),A==="mask"&&!r&&e(Fy(!0))};return v.jsxs("div",{className:"inpainting-settings",children:[v.jsx(rl,{tooltip:`${l("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:qW,onChange:_,isDisabled:n}),v.jsx(wRe,{}),v.jsx(ERe,{}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${l("unifiedcanvas:move")} (V)`,tooltip:`${l("unifiedcanvas:move")} (V)`,icon:v.jsx(kq,{}),"data-selected":o==="move"||n,onClick:d}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:resetView")} (R)`,tooltip:`${l("unifiedcanvas:resetView")} (R)`,icon:v.jsx(Pq,{}),onClick:h})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:v.jsx(Oq,{}),onClick:b,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:v.jsx(NP,{}),onClick:x,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:v.jsx(u0,{}),onClick:k,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:v.jsx(DP,{}),onClick:E,isDisabled:n})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(QY,{}),v.jsx(ZY,{})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${l("common:upload")}`,tooltip:`${l("common:upload")}`,icon:v.jsx(tw,{}),onClick:u,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:clearCanvas")}`,tooltip:`${l("unifiedcanvas:clearCanvas")}`,icon:v.jsx(xp,{}),onClick:y,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),v.jsx(oo,{isAttached:!0,children:v.jsx(_Re,{})})]})},LRe=lt([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ARe=()=>{const e=Oe(),{doesCanvasNeedScaling:t}=he(LRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),v.jsx("div",{className:"workarea-single-view",children:v.jsx("div",{className:"workarea-split-view-left",children:v.jsxs("div",{className:"inpainting-main-area",children:[v.jsx(TRe,{}),v.jsx("div",{className:"inpainting-canvas-area",children:t?v.jsx(XY,{}):v.jsx(KY,{})})]})})})},ORe=lt(ln,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),MRe=()=>{const e=Oe(),{boundingBoxDimensions:t}=he(ORe),{t:n}=Ge(),r=s=>{e(Av({...t,width:Math.floor(s)}))},i=s=>{e(Av({...t,height:Math.floor(s)}))},o=()=>{e(Av({...t,width:Math.floor(512)}))},a=()=>{e(Av({...t,height:Math.floor(512)}))};return v.jsxs(je,{direction:"column",gap:"1rem",children:[v.jsx(so,{label:n("parameters:width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:o}),v.jsx(so,{label:n("parameters:height"),min:64,max:1024,step:64,value:t.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:a})]})},IRe=lt([nT,or,ln],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),RRe=()=>{const e=Oe(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=he(IRe),{t:s}=Ge(),l=y=>{e(Tb({...a,width:Math.floor(y)}))},u=y=>{e(Tb({...a,height:Math.floor(y)}))},d=()=>{e(Tb({...a,width:Math.floor(512)}))},h=()=>{e(Tb({...a,height:Math.floor(512)}))},m=y=>{e(zxe(y.target.value))};return v.jsxs(je,{direction:"column",gap:"1rem",children:[v.jsx(rl,{label:s("parameters:scaleBeforeProcessing"),validValues:_xe,value:i,onChange:m}),v.jsx(so,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:d}),v.jsx(so,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:h}),v.jsx(rl,{label:s("parameters:infillMethod"),value:n,validValues:r,onChange:y=>e(xU(y.target.value))}),v.jsx(so,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("parameters:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:y=>{e(XI(y))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(XI(32))}})]})};function DRe(){const e=Oe(),t=he(r=>r.generation.seamBlur),{t:n}=Ge();return v.jsx(so,{sliderMarkRightOffset:-4,label:n("parameters:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(GI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(GI(16))}})}function NRe(){const e=Oe(),{t}=Ge(),n=he(r=>r.generation.seamSize);return v.jsx(so,{sliderMarkRightOffset:-6,label:t("parameters:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(qI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(qI(96))})}function jRe(){const{t:e}=Ge(),t=he(r=>r.generation.seamSteps),n=Oe();return v.jsx(so,{sliderMarkRightOffset:-4,label:e("parameters:seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(YI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(YI(30))}})}function BRe(){const e=Oe(),{t}=Ge(),n=he(r=>r.generation.seamStrength);return v.jsx(so,{sliderMarkRightOffset:-7,label:t("parameters:seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(KI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(KI(.7))}})}const FRe=()=>v.jsxs(je,{direction:"column",gap:"1rem",children:[v.jsx(NRe,{}),v.jsx(DRe,{}),v.jsx(BRe,{}),v.jsx(jRe,{})]});function $Re(){const{t:e}=Ge(),t={boundingBox:{header:`${e("parameters:boundingBoxHeader")}`,feature:ao.BOUNDING_BOX,content:v.jsx(MRe,{})},seamCorrection:{header:`${e("parameters:seamCorrectionHeader")}`,feature:ao.SEAM_CORRECTION,content:v.jsx(FRe,{})},infillAndScaling:{header:`${e("parameters:infillScalingHeader")}`,feature:ao.INFILL_AND_SCALING,content:v.jsx(RRe,{})},seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:v.jsx(XP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:v.jsx(QP,{}),additionalHeaderComponents:v.jsx(ZP,{})}};return v.jsxs(sT,{children:[v.jsxs(je,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(aT,{}),v.jsx(oT,{})]}),v.jsx(iT,{}),v.jsx(JP,{}),v.jsx(jY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),v.jsx(eT,{accordionInfo:t})]})}function zRe(){const e=he(t=>t.ui.shouldUseCanvasBetaLayout);return v.jsx(KP,{optionsPanel:v.jsx($Re,{}),styleClass:"inpainting-workarea-overrides",children:e?v.jsx(SRe,{}):v.jsx(ARe,{})})}const ts={txt2img:{title:v.jsx(S_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(MOe,{}),tooltip:"Text To Image"},img2img:{title:v.jsx(v_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(kOe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:v.jsx(w_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(zRe,{}),tooltip:"Unified Canvas"},nodes:{title:v.jsx(y_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(h_e,{}),tooltip:"Nodes"},postprocess:{title:v.jsx(b_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(p_e,{}),tooltip:"Post Processing"},training:{title:v.jsx(x_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(g_e,{}),tooltip:"Training"}};function HRe(){ts.txt2img.tooltip=zt.t("common:text2img"),ts.img2img.tooltip=zt.t("common:img2img"),ts.unifiedCanvas.tooltip=zt.t("common:unifiedCanvas"),ts.nodes.tooltip=zt.t("common:nodes"),ts.postprocess.tooltip=zt.t("common:postProcessing"),ts.training.tooltip=zt.t("common:training")}function VRe(){const e=he(f_e),t=he(o=>o.lightbox.isLightboxOpen);m_e(HRe);const n=Oe();et("1",()=>{n(Yo(0))}),et("2",()=>{n(Yo(1))}),et("3",()=>{n(Yo(2))}),et("4",()=>{n(Yo(3))}),et("5",()=>{n(Yo(4))}),et("6",()=>{n(Yo(5))}),et("z",()=>{n(Hm(!t))},[t]);const r=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(v.jsx(uo,{hasArrow:!0,label:ts[a].tooltip,placement:"right",children:v.jsx(vW,{children:ts[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(v.jsx(gW,{className:"app-tabs-panel",children:ts[a].workarea},a))}),o};return v.jsxs(pW,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(Yo(o))},children:[v.jsx("div",{className:"app-tabs-list",children:r()}),v.jsx(mW,{className:"app-tabs-panels",children:t?v.jsx(zAe,{}):i()})]})}var WRe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Ky(e,t){var n=URe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function URe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=WRe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var GRe=[".DS_Store","Thumbs.db"];function qRe(e){return S0(this,void 0,void 0,function(){return x0(this,function(t){return gS(e)&&YRe(e.dataTransfer)?[2,QRe(e.dataTransfer,e.type)]:KRe(e)?[2,XRe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,ZRe(e)]:[2,[]]})})}function YRe(e){return gS(e)}function KRe(e){return gS(e)&&gS(e.target)}function gS(e){return typeof e=="object"&&e!==null}function XRe(e){return o_(e.target.files).map(function(t){return Ky(t)})}function ZRe(e){return S0(this,void 0,void 0,function(){var t;return x0(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Ky(r)})]}})})}function QRe(e,t){return S0(this,void 0,void 0,function(){var n,r;return x0(this,function(i){switch(i.label){case 0:return e.items?(n=o_(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(JRe))]):[3,2];case 1:return r=i.sent(),[2,yN(aK(r))];case 2:return[2,yN(o_(e.files).map(function(o){return Ky(o)}))]}})})}function yN(e){return e.filter(function(t){return GRe.indexOf(t.name)===-1})}function o_(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,CN(n)];if(e.sizen)return[!1,CN(n)]}return[!0,null]}function Ch(e){return e!=null}function gDe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=cK(l,n),d=cy(u,1),h=d[0],m=dK(l,r,i),y=cy(m,1),b=y[0],x=s?s(l):null;return h&&b&&!x})}function mS(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function e4(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function kN(e){e.preventDefault()}function mDe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function vDe(e){return e.indexOf("Edge/")!==-1}function yDe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return mDe(e)||vDe(e)}function Dl(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DDe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var pT=w.forwardRef(function(e,t){var n=e.children,r=vS(e,_De),i=mK(r),o=i.open,a=vS(i,kDe);return w.useImperativeHandle(t,function(){return{open:o}},[o]),N.createElement(w.Fragment,null,n(_r(_r({},a),{},{open:o})))});pT.displayName="Dropzone";var gK={disabled:!1,getFilesFromEvent:qRe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};pT.defaultProps=gK;pT.propTypes={children:jn.func,accept:jn.objectOf(jn.arrayOf(jn.string)),multiple:jn.bool,preventDropOnDocument:jn.bool,noClick:jn.bool,noKeyboard:jn.bool,noDrag:jn.bool,noDragEventsBubbling:jn.bool,minSize:jn.number,maxSize:jn.number,maxFiles:jn.number,disabled:jn.bool,getFilesFromEvent:jn.func,onFileDialogCancel:jn.func,onFileDialogOpen:jn.func,useFsAccessApi:jn.bool,autoFocus:jn.bool,onDragEnter:jn.func,onDragLeave:jn.func,onDragOver:jn.func,onDrop:jn.func,onDropAccepted:jn.func,onDropRejected:jn.func,onError:jn.func,validator:jn.func};var u_={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function mK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_r(_r({},gK),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,h=t.onDragOver,m=t.onDrop,y=t.onDropAccepted,b=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,E=t.useFsAccessApi,_=t.autoFocus,P=t.preventDropOnDocument,A=t.noClick,M=t.noKeyboard,R=t.noDrag,D=t.noDragEventsBubbling,j=t.onError,z=t.validator,H=w.useMemo(function(){return xDe(n)},[n]),K=w.useMemo(function(){return SDe(n)},[n]),te=w.useMemo(function(){return typeof k=="function"?k:PN},[k]),G=w.useMemo(function(){return typeof x=="function"?x:PN},[x]),F=w.useRef(null),W=w.useRef(null),X=w.useReducer(NDe,u_),Z=KC(X,2),U=Z[0],Q=Z[1],re=U.isFocused,fe=U.isFileDialogActive,Ee=w.useRef(typeof window<"u"&&window.isSecureContext&&E&&bDe()),be=function(){!Ee.current&&fe&&setTimeout(function(){if(W.current){var Ne=W.current.files;Ne.length||(Q({type:"closeDialog"}),G())}},300)};w.useEffect(function(){return window.addEventListener("focus",be,!1),function(){window.removeEventListener("focus",be,!1)}},[W,fe,G,Ee]);var ye=w.useRef([]),ze=function(Ne){F.current&&F.current.contains(Ne.target)||(Ne.preventDefault(),ye.current=[])};w.useEffect(function(){return P&&(document.addEventListener("dragover",kN,!1),document.addEventListener("drop",ze,!1)),function(){P&&(document.removeEventListener("dragover",kN),document.removeEventListener("drop",ze))}},[F,P]),w.useEffect(function(){return!r&&_&&F.current&&F.current.focus(),function(){}},[F,_,r]);var Me=w.useCallback(function(xe){j?j(xe):console.error(xe)},[j]),rt=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe),ye.current=[].concat(TDe(ye.current),[xe.target]),e4(xe)&&Promise.resolve(i(xe)).then(function(Ne){if(!(mS(xe)&&!D)){var Ct=Ne.length,Dt=Ct>0&&gDe({files:Ne,accept:H,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:z}),Te=Ct>0&&!Dt;Q({isDragAccept:Dt,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),u&&u(xe)}}).catch(function(Ne){return Me(Ne)})},[i,u,Me,D,H,a,o,s,l,z]),We=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe);var Ne=e4(xe);if(Ne&&xe.dataTransfer)try{xe.dataTransfer.dropEffect="copy"}catch{}return Ne&&h&&h(xe),!1},[h,D]),Be=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe);var Ne=ye.current.filter(function(Dt){return F.current&&F.current.contains(Dt)}),Ct=Ne.indexOf(xe.target);Ct!==-1&&Ne.splice(Ct,1),ye.current=Ne,!(Ne.length>0)&&(Q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),e4(xe)&&d&&d(xe))},[F,d,D]),wt=w.useCallback(function(xe,Ne){var Ct=[],Dt=[];xe.forEach(function(Te){var At=cK(Te,H),He=KC(At,2),vt=He[0],nn=He[1],Rn=dK(Te,a,o),Ze=KC(Rn,2),xt=Ze[0],ht=Ze[1],Ht=z?z(Te):null;if(vt&&xt&&!Ht)Ct.push(Te);else{var rn=[nn,ht];Ht&&(rn=rn.concat(Ht)),Dt.push({file:Te,errors:rn.filter(function(gr){return gr})})}}),(!s&&Ct.length>1||s&&l>=1&&Ct.length>l)&&(Ct.forEach(function(Te){Dt.push({file:Te,errors:[pDe]})}),Ct.splice(0)),Q({acceptedFiles:Ct,fileRejections:Dt,type:"setFiles"}),m&&m(Ct,Dt,Ne),Dt.length>0&&b&&b(Dt,Ne),Ct.length>0&&y&&y(Ct,Ne)},[Q,s,H,a,o,l,m,y,b,z]),Fe=w.useCallback(function(xe){xe.preventDefault(),xe.persist(),ae(xe),ye.current=[],e4(xe)&&Promise.resolve(i(xe)).then(function(Ne){mS(xe)&&!D||wt(Ne,xe)}).catch(function(Ne){return Me(Ne)}),Q({type:"reset"})},[i,wt,Me,D]),at=w.useCallback(function(){if(Ee.current){Q({type:"openDialog"}),te();var xe={multiple:s,types:K};window.showOpenFilePicker(xe).then(function(Ne){return i(Ne)}).then(function(Ne){wt(Ne,null),Q({type:"closeDialog"})}).catch(function(Ne){wDe(Ne)?(G(Ne),Q({type:"closeDialog"})):CDe(Ne)?(Ee.current=!1,W.current?(W.current.value=null,W.current.click()):Me(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Me(Ne)});return}W.current&&(Q({type:"openDialog"}),te(),W.current.value=null,W.current.click())},[Q,te,G,E,wt,Me,K,s]),bt=w.useCallback(function(xe){!F.current||!F.current.isEqualNode(xe.target)||(xe.key===" "||xe.key==="Enter"||xe.keyCode===32||xe.keyCode===13)&&(xe.preventDefault(),at())},[F,at]),Le=w.useCallback(function(){Q({type:"focus"})},[]),ut=w.useCallback(function(){Q({type:"blur"})},[]),Mt=w.useCallback(function(){A||(yDe()?setTimeout(at,0):at())},[A,at]),ct=function(Ne){return r?null:Ne},_t=function(Ne){return M?null:ct(Ne)},un=function(Ne){return R?null:ct(Ne)},ae=function(Ne){D&&Ne.stopPropagation()},De=w.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=xe.refKey,Ct=Ne===void 0?"ref":Ne,Dt=xe.role,Te=xe.onKeyDown,At=xe.onFocus,He=xe.onBlur,vt=xe.onClick,nn=xe.onDragEnter,Rn=xe.onDragOver,Ze=xe.onDragLeave,xt=xe.onDrop,ht=vS(xe,EDe);return _r(_r(l_({onKeyDown:_t(Dl(Te,bt)),onFocus:_t(Dl(At,Le)),onBlur:_t(Dl(He,ut)),onClick:ct(Dl(vt,Mt)),onDragEnter:un(Dl(nn,rt)),onDragOver:un(Dl(Rn,We)),onDragLeave:un(Dl(Ze,Be)),onDrop:un(Dl(xt,Fe)),role:typeof Dt=="string"&&Dt!==""?Dt:"presentation"},Ct,F),!r&&!M?{tabIndex:0}:{}),ht)}},[F,bt,Le,ut,Mt,rt,We,Be,Fe,M,R,r]),Ke=w.useCallback(function(xe){xe.stopPropagation()},[]),Xe=w.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=xe.refKey,Ct=Ne===void 0?"ref":Ne,Dt=xe.onChange,Te=xe.onClick,At=vS(xe,PDe),He=l_({accept:H,multiple:s,type:"file",style:{display:"none"},onChange:ct(Dl(Dt,Fe)),onClick:ct(Dl(Te,Ke)),tabIndex:-1},Ct,W);return _r(_r({},He),At)}},[W,n,s,Fe,r]);return _r(_r({},U),{},{isFocused:re&&!r,getRootProps:De,getInputProps:Xe,rootRef:F,inputRef:W,open:ct(at)})}function NDe(e,t){switch(t.type){case"focus":return _r(_r({},e),{},{isFocused:!0});case"blur":return _r(_r({},e),{},{isFocused:!1});case"openDialog":return _r(_r({},u_),{},{isFileDialogActive:!0});case"closeDialog":return _r(_r({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _r(_r({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _r(_r({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return _r({},u_);default:return e}}function PN(){}const jDe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return et("esc",()=>{i(!1)}),v.jsxs("div",{className:"dropzone-container",children:[t&&v.jsx("div",{className:"dropzone-overlay is-drag-accept",children:v.jsxs(Bh,{size:"lg",children:["Upload Image",r]})}),n&&v.jsxs("div",{className:"dropzone-overlay is-drag-reject",children:[v.jsx(Bh,{size:"lg",children:"Invalid Upload"}),v.jsx(Bh,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},BDe=e=>{const{children:t}=e,n=Oe(),r=he(Mr),i=By({}),{t:o}=Ge(),[a,s]=w.useState(!1),{setOpenUploader:l}=TP(),u=w.useCallback(P=>{s(!0);const A=P.errors.reduce((M,R)=>`${M} -${R.message}`,"");i({title:o("toast:uploadFailed"),description:A,status:"error",isClosable:!0})},[o,i]),d=w.useCallback(async P=>{n(SD({imageFile:P}))},[n]),h=w.useCallback((P,A)=>{A.forEach(M=>{u(M)}),P.forEach(M=>{d(M)})},[d,u]),{getRootProps:m,getInputProps:y,isDragAccept:b,isDragReject:x,isDragActive:k,open:E}=mK({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:()=>s(!0),maxFiles:1});l(E),w.useEffect(()=>{const P=A=>{var j;const M=(j=A.clipboardData)==null?void 0:j.items;if(!M)return;const R=[];for(const z of M)z.kind==="file"&&["image/png","image/jpg"].includes(z.type)&&R.push(z);if(!R.length)return;if(A.stopImmediatePropagation(),R.length>1){i({description:o("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=R[0].getAsFile();if(!D){i({description:o("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(SD({imageFile:D}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[o,n,i,r]);const _=["img2img","unifiedCanvas"].includes(r)?` to ${ts[r].tooltip}`:"";return v.jsx(PP.Provider,{value:E,children:v.jsxs("div",{...m({style:{}}),onKeyDown:P=>{P.key},children:[v.jsx("input",{...y()}),t,k&&a&&v.jsx(jDe,{isDragAccept:b,isDragReject:x,overlaySecondaryText:_,setIsHandlingUpload:s})]})})},FDe=lt(or,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),$De=lt(or,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),zDe=()=>{const e=Oe(),t=he(FDe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=he($De),[o,a]=w.useState(!0),s=w.useRef(null);w.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(ZU()),e(LC(!n))};et("`",()=>{e(LC(!n))},[n]),et("esc",()=>{e(LC(!1))});const u=()=>{s.current&&o&&s.current.scrollTop{const{timestamp:m,message:y,level:b}=d;return v.jsxs("div",{className:`console-entry console-${b}-color`,children:[v.jsxs("p",{className:"console-timestamp",children:[m,":"]}),v.jsx("p",{className:"console-message",children:y})]},h)})})}),n&&v.jsx(uo,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:v.jsx(us,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:v.jsx(gEe,{}),onClick:()=>a(!o)})}),v.jsx(uo,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:v.jsx(us,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?v.jsx(AEe,{}):v.jsx(Eq,{}),onClick:l})})]})},HDe=lt(or,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VDe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=he(HDe),i=t?Math.round(t*100/n):0;return v.jsx(KV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function WDe(e){const{title:t,hotkey:n,description:r}=e;return v.jsxs("div",{className:"hotkey-modal-item",children:[v.jsxs("div",{className:"hotkey-info",children:[v.jsx("p",{className:"hotkey-title",children:t}),r&&v.jsx("p",{className:"hotkey-description",children:r})]}),v.jsx("div",{className:"hotkey-key",children:n})]})}function UDe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=qh(),{t:i}=Ge(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=d=>{const h=[];return d.forEach((m,y)=>{h.push(v.jsx(WDe,{title:m.title,description:m.desc,hotkey:m.hotkey},y))}),v.jsx("div",{className:"hotkey-modal-category",children:h})};return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:n}),v.jsxs(Zd,{isOpen:t,onClose:r,children:[v.jsx(Qd,{}),v.jsxs(ep,{className:" modal hotkeys-modal",children:[v.jsx(Iy,{className:"modal-close-btn"}),v.jsx("h1",{children:"Keyboard Shorcuts"}),v.jsx("div",{className:"hotkeys-modal-items",children:v.jsxs(dk,{allowMultiple:!0,children:[v.jsxs(Xg,{children:[v.jsxs(Yg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:appHotkeys")}),v.jsx(Kg,{})]}),v.jsx(Zg,{children:u(o)})]}),v.jsxs(Xg,{children:[v.jsxs(Yg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:generalHotkeys")}),v.jsx(Kg,{})]}),v.jsx(Zg,{children:u(a)})]}),v.jsxs(Xg,{children:[v.jsxs(Yg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:galleryHotkeys")}),v.jsx(Kg,{})]}),v.jsx(Zg,{children:u(s)})]}),v.jsxs(Xg,{children:[v.jsxs(Yg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),v.jsx(Kg,{})]}),v.jsx(Zg,{children:u(l)})]})]})})]})]})]})}var TN=Array.isArray,LN=Object.keys,GDe=Object.prototype.hasOwnProperty,qDe=typeof Element<"u";function c_(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=TN(e),r=TN(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!c_(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var h=LN(e);if(o=h.length,o!==LN(t).length)return!1;for(i=o;i--!==0;)if(!GDe.call(t,h[i]))return!1;if(qDe&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=h[i],!(a==="_owner"&&e.$$typeof)&&!c_(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var yd=function(t,n){try{return c_(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},YDe=function(t){return KDe(t)&&!XDe(t)};function KDe(e){return!!e&&typeof e=="object"}function XDe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||JDe(e)}var ZDe=typeof Symbol=="function"&&Symbol.for,QDe=ZDe?Symbol.for("react.element"):60103;function JDe(e){return e.$$typeof===QDe}function eNe(e){return Array.isArray(e)?[]:{}}function yS(e,t){return t.clone!==!1&&t.isMergeableObject(e)?dy(eNe(e),e,t):e}function tNe(e,t,n){return e.concat(t).map(function(r){return yS(r,n)})}function nNe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=yS(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=yS(t[i],n):r[i]=dy(e[i],t[i],n)}),r}function dy(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||tNe,n.isMergeableObject=n.isMergeableObject||YDe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):nNe(e,t,n):yS(t,n)}dy.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return dy(r,i,n)},{})};var d_=dy,rNe=typeof global=="object"&&global&&global.Object===Object&&global;const vK=rNe;var iNe=typeof self=="object"&&self&&self.Object===Object&&self,oNe=vK||iNe||Function("return this")();const yu=oNe;var aNe=yu.Symbol;const rf=aNe;var yK=Object.prototype,sNe=yK.hasOwnProperty,lNe=yK.toString,yv=rf?rf.toStringTag:void 0;function uNe(e){var t=sNe.call(e,yv),n=e[yv];try{e[yv]=void 0;var r=!0}catch{}var i=lNe.call(e);return r&&(t?e[yv]=n:delete e[yv]),i}var cNe=Object.prototype,dNe=cNe.toString;function fNe(e){return dNe.call(e)}var hNe="[object Null]",pNe="[object Undefined]",AN=rf?rf.toStringTag:void 0;function kp(e){return e==null?e===void 0?pNe:hNe:AN&&AN in Object(e)?uNe(e):fNe(e)}function bK(e,t){return function(n){return e(t(n))}}var gNe=bK(Object.getPrototypeOf,Object);const gT=gNe;function Ep(e){return e!=null&&typeof e=="object"}var mNe="[object Object]",vNe=Function.prototype,yNe=Object.prototype,SK=vNe.toString,bNe=yNe.hasOwnProperty,SNe=SK.call(Object);function ON(e){if(!Ep(e)||kp(e)!=mNe)return!1;var t=gT(e);if(t===null)return!0;var n=bNe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&SK.call(n)==SNe}function xNe(){this.__data__=[],this.size=0}function xK(e,t){return e===t||e!==e&&t!==t}function gw(e,t){for(var n=e.length;n--;)if(xK(e[n][0],t))return n;return-1}var wNe=Array.prototype,CNe=wNe.splice;function _Ne(e){var t=this.__data__,n=gw(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():CNe.call(t,n,1),--this.size,!0}function kNe(e){var t=this.__data__,n=gw(t,e);return n<0?void 0:t[n][1]}function ENe(e){return gw(this.__data__,e)>-1}function PNe(e,t){var n=this.__data__,r=gw(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function bc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=Rje}var Dje="[object Arguments]",Nje="[object Array]",jje="[object Boolean]",Bje="[object Date]",Fje="[object Error]",$je="[object Function]",zje="[object Map]",Hje="[object Number]",Vje="[object Object]",Wje="[object RegExp]",Uje="[object Set]",Gje="[object String]",qje="[object WeakMap]",Yje="[object ArrayBuffer]",Kje="[object DataView]",Xje="[object Float32Array]",Zje="[object Float64Array]",Qje="[object Int8Array]",Jje="[object Int16Array]",eBe="[object Int32Array]",tBe="[object Uint8Array]",nBe="[object Uint8ClampedArray]",rBe="[object Uint16Array]",iBe="[object Uint32Array]",lr={};lr[Xje]=lr[Zje]=lr[Qje]=lr[Jje]=lr[eBe]=lr[tBe]=lr[nBe]=lr[rBe]=lr[iBe]=!0;lr[Dje]=lr[Nje]=lr[Yje]=lr[jje]=lr[Kje]=lr[Bje]=lr[Fje]=lr[$je]=lr[zje]=lr[Hje]=lr[Vje]=lr[Wje]=lr[Uje]=lr[Gje]=lr[qje]=!1;function oBe(e){return Ep(e)&&TK(e.length)&&!!lr[kp(e)]}function mT(e){return function(t){return e(t)}}var LK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,m2=LK&&typeof module=="object"&&module&&!module.nodeType&&module,aBe=m2&&m2.exports===LK,ZC=aBe&&vK.process,sBe=function(){try{var e=m2&&m2.require&&m2.require("util").types;return e||ZC&&ZC.binding&&ZC.binding("util")}catch{}}();const h0=sBe;var jN=h0&&h0.isTypedArray,lBe=jN?mT(jN):oBe;const uBe=lBe;var cBe=Object.prototype,dBe=cBe.hasOwnProperty;function AK(e,t){var n=Zy(e),r=!n&&kje(e),i=!n&&!r&&PK(e),o=!n&&!r&&!i&&uBe(e),a=n||r||i||o,s=a?Sje(e.length,String):[],l=s.length;for(var u in e)(t||dBe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ije(u,l)))&&s.push(u);return s}var fBe=Object.prototype;function vT(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||fBe;return e===n}var hBe=bK(Object.keys,Object);const pBe=hBe;var gBe=Object.prototype,mBe=gBe.hasOwnProperty;function vBe(e){if(!vT(e))return pBe(e);var t=[];for(var n in Object(e))mBe.call(e,n)&&n!="constructor"&&t.push(n);return t}function OK(e){return e!=null&&TK(e.length)&&!wK(e)}function yT(e){return OK(e)?AK(e):vBe(e)}function yBe(e,t){return e&&vw(t,yT(t),e)}function bBe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var SBe=Object.prototype,xBe=SBe.hasOwnProperty;function wBe(e){if(!Xy(e))return bBe(e);var t=vT(e),n=[];for(var r in e)r=="constructor"&&(t||!xBe.call(e,r))||n.push(r);return n}function bT(e){return OK(e)?AK(e,!0):wBe(e)}function CBe(e,t){return e&&vw(t,bT(t),e)}var MK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,BN=MK&&typeof module=="object"&&module&&!module.nodeType&&module,_Be=BN&&BN.exports===MK,FN=_Be?yu.Buffer:void 0,$N=FN?FN.allocUnsafe:void 0;function kBe(e,t){if(t)return e.slice();var n=e.length,r=$N?$N(n):new e.constructor(n);return e.copy(r),r}function IK(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function nj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var rj=function(t){return Array.isArray(t)&&t.length===0},qo=function(t){return typeof t=="function"},yw=function(t){return t!==null&&typeof t=="object"},C$e=function(t){return String(Math.floor(Number(t)))===t},QC=function(t){return Object.prototype.toString.call(t)==="[object String]"},WK=function(t){return w.Children.count(t)===0},JC=function(t){return yw(t)&&qo(t.then)};function Wi(e,t,n,r){r===void 0&&(r=0);for(var i=VK(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function UK(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?De.map(function(Xe){return j(Xe,Wi(ae,Xe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ke).then(function(Xe){return Xe.reduce(function(xe,Ne,Ct){return Ne==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ne&&(xe=au(xe,De[Ct],Ne)),xe},{})})},[j]),H=w.useCallback(function(ae){return Promise.all([z(ae),m.validationSchema?D(ae):{},m.validate?R(ae):{}]).then(function(De){var Ke=De[0],Xe=De[1],xe=De[2],Ne=d_.all([Ke,Xe,xe],{arrayMerge:L$e});return Ne})},[m.validate,m.validationSchema,z,R,D]),K=Xa(function(ae){return ae===void 0&&(ae=A.values),M({type:"SET_ISVALIDATING",payload:!0}),H(ae).then(function(De){return E.current&&(M({type:"SET_ISVALIDATING",payload:!1}),M({type:"SET_ERRORS",payload:De})),De})});w.useEffect(function(){a&&E.current===!0&&yd(y.current,m.initialValues)&&K(y.current)},[a,K]);var te=w.useCallback(function(ae){var De=ae&&ae.values?ae.values:y.current,Ke=ae&&ae.errors?ae.errors:b.current?b.current:m.initialErrors||{},Xe=ae&&ae.touched?ae.touched:x.current?x.current:m.initialTouched||{},xe=ae&&ae.status?ae.status:k.current?k.current:m.initialStatus;y.current=De,b.current=Ke,x.current=Xe,k.current=xe;var Ne=function(){M({type:"RESET_FORM",payload:{isSubmitting:!!ae&&!!ae.isSubmitting,errors:Ke,touched:Xe,status:xe,values:De,isValidating:!!ae&&!!ae.isValidating,submitCount:ae&&ae.submitCount&&typeof ae.submitCount=="number"?ae.submitCount:0}})};if(m.onReset){var Ct=m.onReset(A.values,Fe);JC(Ct)?Ct.then(Ne):Ne()}else Ne()},[m.initialErrors,m.initialStatus,m.initialTouched]);w.useEffect(function(){E.current===!0&&!yd(y.current,m.initialValues)&&(u&&(y.current=m.initialValues,te()),a&&K(y.current))},[u,m.initialValues,te,a,K]),w.useEffect(function(){u&&E.current===!0&&!yd(b.current,m.initialErrors)&&(b.current=m.initialErrors||fh,M({type:"SET_ERRORS",payload:m.initialErrors||fh}))},[u,m.initialErrors]),w.useEffect(function(){u&&E.current===!0&&!yd(x.current,m.initialTouched)&&(x.current=m.initialTouched||t4,M({type:"SET_TOUCHED",payload:m.initialTouched||t4}))},[u,m.initialTouched]),w.useEffect(function(){u&&E.current===!0&&!yd(k.current,m.initialStatus)&&(k.current=m.initialStatus,M({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var G=Xa(function(ae){if(_.current[ae]&&qo(_.current[ae].validate)){var De=Wi(A.values,ae),Ke=_.current[ae].validate(De);return JC(Ke)?(M({type:"SET_ISVALIDATING",payload:!0}),Ke.then(function(Xe){return Xe}).then(function(Xe){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Xe}}),M({type:"SET_ISVALIDATING",payload:!1})})):(M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Ke}}),Promise.resolve(Ke))}else if(m.validationSchema)return M({type:"SET_ISVALIDATING",payload:!0}),D(A.values,ae).then(function(Xe){return Xe}).then(function(Xe){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Xe[ae]}}),M({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),F=w.useCallback(function(ae,De){var Ke=De.validate;_.current[ae]={validate:Ke}},[]),W=w.useCallback(function(ae){delete _.current[ae]},[]),X=Xa(function(ae,De){M({type:"SET_TOUCHED",payload:ae});var Ke=De===void 0?i:De;return Ke?K(A.values):Promise.resolve()}),Z=w.useCallback(function(ae){M({type:"SET_ERRORS",payload:ae})},[]),U=Xa(function(ae,De){var Ke=qo(ae)?ae(A.values):ae;M({type:"SET_VALUES",payload:Ke});var Xe=De===void 0?n:De;return Xe?K(Ke):Promise.resolve()}),Q=w.useCallback(function(ae,De){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:De}})},[]),re=Xa(function(ae,De,Ke){M({type:"SET_FIELD_VALUE",payload:{field:ae,value:De}});var Xe=Ke===void 0?n:Ke;return Xe?K(au(A.values,ae,De)):Promise.resolve()}),fe=w.useCallback(function(ae,De){var Ke=De,Xe=ae,xe;if(!QC(ae)){ae.persist&&ae.persist();var Ne=ae.target?ae.target:ae.currentTarget,Ct=Ne.type,Dt=Ne.name,Te=Ne.id,At=Ne.value,He=Ne.checked,vt=Ne.outerHTML,nn=Ne.options,Rn=Ne.multiple;Ke=De||Dt||Te,Xe=/number|range/.test(Ct)?(xe=parseFloat(At),isNaN(xe)?"":xe):/checkbox/.test(Ct)?O$e(Wi(A.values,Ke),He,At):nn&&Rn?A$e(nn):At}Ke&&re(Ke,Xe)},[re,A.values]),Ee=Xa(function(ae){if(QC(ae))return function(De){return fe(De,ae)};fe(ae)}),be=Xa(function(ae,De,Ke){De===void 0&&(De=!0),M({type:"SET_FIELD_TOUCHED",payload:{field:ae,value:De}});var Xe=Ke===void 0?i:Ke;return Xe?K(A.values):Promise.resolve()}),ye=w.useCallback(function(ae,De){ae.persist&&ae.persist();var Ke=ae.target,Xe=Ke.name,xe=Ke.id,Ne=Ke.outerHTML,Ct=De||Xe||xe;be(Ct,!0)},[be]),ze=Xa(function(ae){if(QC(ae))return function(De){return ye(De,ae)};ye(ae)}),Me=w.useCallback(function(ae){qo(ae)?M({type:"SET_FORMIK_STATE",payload:ae}):M({type:"SET_FORMIK_STATE",payload:function(){return ae}})},[]),rt=w.useCallback(function(ae){M({type:"SET_STATUS",payload:ae})},[]),We=w.useCallback(function(ae){M({type:"SET_ISSUBMITTING",payload:ae})},[]),Be=Xa(function(){return M({type:"SUBMIT_ATTEMPT"}),K().then(function(ae){var De=ae instanceof Error,Ke=!De&&Object.keys(ae).length===0;if(Ke){var Xe;try{if(Xe=at(),Xe===void 0)return}catch(xe){throw xe}return Promise.resolve(Xe).then(function(xe){return E.current&&M({type:"SUBMIT_SUCCESS"}),xe}).catch(function(xe){if(E.current)throw M({type:"SUBMIT_FAILURE"}),xe})}else if(E.current&&(M({type:"SUBMIT_FAILURE"}),De))throw ae})}),wt=Xa(function(ae){ae&&ae.preventDefault&&qo(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&qo(ae.stopPropagation)&&ae.stopPropagation(),Be().catch(function(De){console.warn("Warning: An unhandled error was caught from submitForm()",De)})}),Fe={resetForm:te,validateForm:K,validateField:G,setErrors:Z,setFieldError:Q,setFieldTouched:be,setFieldValue:re,setStatus:rt,setSubmitting:We,setTouched:X,setValues:U,setFormikState:Me,submitForm:Be},at=Xa(function(){return d(A.values,Fe)}),bt=Xa(function(ae){ae&&ae.preventDefault&&qo(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&qo(ae.stopPropagation)&&ae.stopPropagation(),te()}),Le=w.useCallback(function(ae){return{value:Wi(A.values,ae),error:Wi(A.errors,ae),touched:!!Wi(A.touched,ae),initialValue:Wi(y.current,ae),initialTouched:!!Wi(x.current,ae),initialError:Wi(b.current,ae)}},[A.errors,A.touched,A.values]),ut=w.useCallback(function(ae){return{setValue:function(Ke,Xe){return re(ae,Ke,Xe)},setTouched:function(Ke,Xe){return be(ae,Ke,Xe)},setError:function(Ke){return Q(ae,Ke)}}},[re,be,Q]),Mt=w.useCallback(function(ae){var De=yw(ae),Ke=De?ae.name:ae,Xe=Wi(A.values,Ke),xe={name:Ke,value:Xe,onChange:Ee,onBlur:ze};if(De){var Ne=ae.type,Ct=ae.value,Dt=ae.as,Te=ae.multiple;Ne==="checkbox"?Ct===void 0?xe.checked=!!Xe:(xe.checked=!!(Array.isArray(Xe)&&~Xe.indexOf(Ct)),xe.value=Ct):Ne==="radio"?(xe.checked=Xe===Ct,xe.value=Ct):Dt==="select"&&Te&&(xe.value=xe.value||[],xe.multiple=!0)}return xe},[ze,Ee,A.values]),ct=w.useMemo(function(){return!yd(y.current,A.values)},[y.current,A.values]),_t=w.useMemo(function(){return typeof s<"u"?ct?A.errors&&Object.keys(A.errors).length===0:s!==!1&&qo(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,ct,A.errors,m]),un=qn({},A,{initialValues:y.current,initialErrors:b.current,initialTouched:x.current,initialStatus:k.current,handleBlur:ze,handleChange:Ee,handleReset:bt,handleSubmit:wt,resetForm:te,setErrors:Z,setFormikState:Me,setFieldTouched:be,setFieldValue:re,setFieldError:Q,setStatus:rt,setSubmitting:We,setTouched:X,setValues:U,submitForm:Be,validateForm:K,validateField:G,isValid:_t,dirty:ct,unregisterField:W,registerField:F,getFieldProps:Mt,getFieldMeta:Le,getFieldHelpers:ut,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return un}function Qy(e){var t=E$e(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return w.useImperativeHandle(o,function(){return t}),w.createElement(_$e,{value:t},n?w.createElement(n,t):i?i(t):r?qo(r)?r(t):WK(r)?null:w.Children.only(r):null)}function P$e(e){var t={};if(e.inner){if(e.inner.length===0)return au(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Wi(t,a.path)||(t=au(t,a.path,a.message))}}return t}function T$e(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=m_(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function m_(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||ON(i)?m_(i):i!==""?i:void 0}):ON(e[r])?t[r]=m_(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function L$e(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?d_(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=d_(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function A$e(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function O$e(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var M$e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function Xa(e){var t=w.useRef(e);return M$e(function(){t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(qn({},t,{length:n+1}))}else return[]},j$e=function(e){w$e(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,d=l.formik.setFormikState;d(function(h){var m=typeof s=="function"?s:o,y=typeof a=="function"?a:o,b=au(h.values,u,o(Wi(h.values,u))),x=s?m(Wi(h.errors,u)):void 0,k=a?y(Wi(h.touched,u)):void 0;return rj(x)&&(x=void 0),rj(k)&&(k=void 0),qn({},h,{values:b,errors:s?au(h.errors,u,x):h.errors,touched:a?au(h.touched,u,k):h.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(p0(a),[x$e(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return D$e(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return R$e(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return e7(s,o,a)},function(s){return e7(s,o,null)},function(s){return e7(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return N$e(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(nj(i)),i.pop=i.pop.bind(nj(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!yd(Wi(i.formik.values,i.name),Wi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?p0(a):[];return o||(o=s[i]),qo(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,d=o.formik,h=Mh(d,["validate","validationSchema"]),m=qn({},i,{form:h,name:u});return a?w.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):WK(l)?null:w.Children.only(l):null},t}(w.Component);j$e.defaultProps={validateOnChange:!0};function B$e(e){const{model:t}=e,r=he(b=>b.system.model_list)[t],i=Oe(),{t:o}=Ge(),a=he(b=>b.system.isProcessing),s=he(b=>b.system.isConnected),[l,u]=w.useState("same"),[d,h]=w.useState("");w.useEffect(()=>{u("same")},[t]);const m=()=>{u("same")},y=()=>{const b={model_name:t,save_location:l,custom_location:l==="custom"&&d!==""?d:null};i(ns(!0)),i(n_e(b))};return v.jsxs(fw,{title:`${o("modelmanager:convert")} ${t}`,acceptCallback:y,cancelCallback:m,acceptButtonText:`${o("modelmanager:convert")}`,triggerComponent:v.jsxs(nr,{size:"sm","aria-label":o("modelmanager:convertToDiffusers"),isDisabled:r.status==="active"||a||!s,className:" modal-close-btn",marginRight:"2rem",children:["🧨 ",o("modelmanager:convertToDiffusers")]}),motionPreset:"slideInBottom",children:[v.jsxs(je,{flexDirection:"column",rowGap:4,children:[v.jsx(Yt,{children:o("modelmanager:convertToDiffusersHelpText1")}),v.jsxs(w$,{children:[v.jsx(xv,{children:o("modelmanager:convertToDiffusersHelpText2")}),v.jsx(xv,{children:o("modelmanager:convertToDiffusersHelpText3")}),v.jsx(xv,{children:o("modelmanager:convertToDiffusersHelpText4")}),v.jsx(xv,{children:o("modelmanager:convertToDiffusersHelpText5")})]}),v.jsx(Yt,{children:o("modelmanager:convertToDiffusersHelpText6")})]}),v.jsxs(je,{flexDir:"column",gap:4,children:[v.jsxs(je,{marginTop:"1rem",flexDir:"column",gap:2,children:[v.jsx(Yt,{fontWeight:"bold",children:"Save Location"}),v.jsx(HE,{value:l,onChange:b=>u(b),children:v.jsxs(je,{gap:4,children:[v.jsx(Td,{value:"same",children:o("modelmanager:sameFolder")}),v.jsx(Td,{value:"root",children:o("modelmanager:invokeRoot")}),v.jsx(Td,{value:"custom",children:o("modelmanager:custom")})]})})]}),l==="custom"&&v.jsxs(je,{flexDirection:"column",rowGap:2,children:[v.jsx(Yt,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:o("modelmanager:customSaveLocation")}),v.jsx(fr,{value:d,onChange:b=>{b.target.value!==""&&h(b.target.value)},width:"25rem"})]})]})]})}const F$e=lt([or],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ij=64,oj=2048;function $$e(){const{openModel:e,model_list:t}=he(F$e),n=he(l=>l.system.isProcessing),r=Oe(),{t:i}=Ge(),[o,a]=w.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});w.useEffect(()=>{var l,u,d,h,m,y,b;if(e){const x=ke.pickBy(t,(k,E)=>ke.isEqual(E,e));a({name:e,description:(l=x[e])==null?void 0:l.description,config:(u=x[e])==null?void 0:u.config,weights:(d=x[e])==null?void 0:d.weights,vae:(h=x[e])==null?void 0:h.vae,width:(m=x[e])==null?void 0:m.width,height:(y=x[e])==null?void 0:y.height,default:(b=x[e])==null?void 0:b.default,format:"ckpt"})}},[t,e]);const s=l=>{r(Vy({...l,width:Number(l.width),height:Number(l.height)}))};return e?v.jsxs(je,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[v.jsxs(je,{alignItems:"center",gap:4,justifyContent:"space-between",children:[v.jsx(Yt,{fontSize:"lg",fontWeight:"bold",children:e}),v.jsx(B$e,{model:e})]}),v.jsx(je,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:v.jsx(Qy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>v.jsx("form",{onSubmit:l,children:v.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[v.jsxs(fn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?v.jsx(cr,{children:u.description}):v.jsx(ur,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.config&&d.config,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"config",name:"config",type:"text",width:"lg"}),u.config&&d.config?v.jsx(cr,{children:u.config}):v.jsx(ur,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.weights&&d.weights,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"weights",name:"weights",type:"text",width:"lg"}),u.weights&&d.weights?v.jsx(cr,{children:u.weights}):v.jsx(ur,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.vae&&d.vae,children:[v.jsx(En,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae",name:"vae",type:"text",width:"lg"}),u.vae&&d.vae?v.jsx(cr,{children:u.vae}):v.jsx(ur,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(Ey,{width:"100%",children:[v.jsxs(fn,{isInvalid:!!u.width&&d.width,children:[v.jsx(En,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"width",name:"width",children:({field:h,form:m})=>v.jsx(ia,{id:"width",name:"width",min:ij,max:oj,step:64,value:m.values.width,onChange:y=>m.setFieldValue(h.name,Number(y))})}),u.width&&d.width?v.jsx(cr,{children:u.width}):v.jsx(ur,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.height&&d.height,children:[v.jsx(En,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"height",name:"height",children:({field:h,form:m})=>v.jsx(ia,{id:"height",name:"height",min:ij,max:oj,step:64,value:m.values.height,onChange:y=>m.setFieldValue(h.name,Number(y))})}),u.height&&d.height?v.jsx(cr,{children:u.height}):v.jsx(ur,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):v.jsx(je,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:v.jsx(Yt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const z$e=lt([or],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function H$e(){const{openModel:e,model_list:t}=he(z$e),n=he(l=>l.system.isProcessing),r=Oe(),{t:i}=Ge(),[o,a]=w.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});w.useEffect(()=>{var l,u,d,h,m,y,b,x,k,E,_,P,A,M,R,D;if(e){const j=ke.pickBy(t,(z,H)=>ke.isEqual(H,e));a({name:e,description:(l=j[e])==null?void 0:l.description,path:(u=j[e])!=null&&u.path&&((d=j[e])==null?void 0:d.path)!=="None"?(h=j[e])==null?void 0:h.path:"",repo_id:(m=j[e])!=null&&m.repo_id&&((y=j[e])==null?void 0:y.repo_id)!=="None"?(b=j[e])==null?void 0:b.repo_id:"",vae:{repo_id:(k=(x=j[e])==null?void 0:x.vae)!=null&&k.repo_id?(_=(E=j[e])==null?void 0:E.vae)==null?void 0:_.repo_id:"",path:(A=(P=j[e])==null?void 0:P.vae)!=null&&A.path?(R=(M=j[e])==null?void 0:M.vae)==null?void 0:R.path:""},default:(D=j[e])==null?void 0:D.default,format:"diffusers"})}},[t,e]);const s=l=>{const u=l;l.path===""&&delete u.path,l.repo_id===""&&delete u.repo_id,l.vae.path===""&&delete u.vae.path,l.vae.repo_id===""&&delete u.vae.repo_id,r(Vy(l))};return e?v.jsxs(je,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[v.jsx(je,{alignItems:"center",children:v.jsx(Yt,{fontSize:"lg",fontWeight:"bold",children:e})}),v.jsx(je,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:v.jsx(Qy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>{var h,m,y,b,x,k,E,_,P,A;return v.jsx("form",{onSubmit:l,children:v.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[v.jsxs(fn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?v.jsx(cr,{children:u.description}):v.jsx(ur,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.path&&d.path,isRequired:!0,children:[v.jsx(En,{htmlFor:"path",fontSize:"sm",children:i("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"path",name:"path",type:"text",width:"lg"}),u.path&&d.path?v.jsx(cr,{children:u.path}):v.jsx(ur,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.repo_id&&d.repo_id,children:[v.jsx(En,{htmlFor:"repo_id",fontSize:"sm",children:i("modelmanager:repo_id")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"repo_id",name:"repo_id",type:"text",width:"lg"}),u.repo_id&&d.repo_id?v.jsx(cr,{children:u.repo_id}):v.jsx(ur,{margin:0,children:i("modelmanager:repoIDValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!((h=u.vae)!=null&&h.path)&&((m=d.vae)==null?void 0:m.path),children:[v.jsx(En,{htmlFor:"vae.path",fontSize:"sm",children:i("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.path",name:"vae.path",type:"text",width:"lg"}),(y=u.vae)!=null&&y.path&&((b=d.vae)!=null&&b.path)?v.jsx(cr,{children:(x=u.vae)==null?void 0:x.path}):v.jsx(ur,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!((k=u.vae)!=null&&k.repo_id)&&((E=d.vae)==null?void 0:E.repo_id),children:[v.jsx(En,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelmanager:vaeRepoID")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"lg"}),(_=u.vae)!=null&&_.repo_id&&((P=d.vae)!=null&&P.repo_id)?v.jsx(cr,{children:(A=u.vae)==null?void 0:A.repo_id}):v.jsx(ur,{margin:0,children:i("modelmanager:vaeRepoIDValidationMsg")})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})}})})]}):v.jsx(je,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:v.jsx(Yt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const qK=lt([or],e=>{const{model_list:t}=e,n=[];return ke.forEach(t,r=>{n.push(r.weights)}),n});function V$e(){const{t:e}=Ge();return v.jsx(Eo,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function aj({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=he(qK),i=o=>{t.includes(o.target.value)?n(ke.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return v.jsxs(Eo,{position:"relative",children:[r.includes(e.location)?v.jsx(V$e,{}):null,v.jsx(er,{value:e.name,label:v.jsx(v.Fragment,{children:v.jsxs(yn,{alignItems:"start",children:[v.jsx("p",{style:{fontWeight:"bold"},children:e.name}),v.jsx("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function W$e(){const e=Oe(),{t}=Ge(),n=he(P=>P.system.searchFolder),r=he(P=>P.system.foundModels),i=he(qK),o=he(P=>P.ui.shouldShowExistingModelsInSearch),a=he(P=>P.system.isProcessing),[s,l]=N.useState([]),[u,d]=N.useState("v1"),[h,m]=N.useState(""),y=()=>{e(QU(null)),e(JU(null)),l([])},b=P=>{e(yD(P.checkpointFolder))},x=()=>{l([]),r&&r.forEach(P=>{i.includes(P.location)||l(A=>[...A,P.name])})},k=()=>{l([])},E=()=>{const P=r==null?void 0:r.filter(M=>s.includes(M.name)),A={v1:"configs/stable-diffusion/v1-inference.yaml",v2:"configs/stable-diffusion/v2-inference-v.yaml",inpainting:"configs/stable-diffusion/v1-inpainting-inference.yaml",custom:h};P==null||P.forEach(M=>{const R={name:M.name,description:"",config:A[u],weights:M.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(Vy(R))}),l([])},_=()=>{const P=[],A=[];return r&&r.forEach((M,R)=>{i.includes(M.location)?A.push(v.jsx(aj,{model:M,modelsToAdd:s,setModelsToAdd:l},R)):P.push(v.jsx(aj,{model:M,modelsToAdd:s,setModelsToAdd:l},R))}),v.jsxs(v.Fragment,{children:[P,o&&A]})};return v.jsxs(v.Fragment,{children:[n?v.jsxs(je,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[v.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),v.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),v.jsx(Je,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:v.jsx(Yx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(yD(n))}),v.jsx(Je,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:v.jsx(Uy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:y})]}):v.jsx(Qy,{initialValues:{checkpointFolder:""},onSubmit:P=>{b(P)},children:({handleSubmit:P})=>v.jsx("form",{onSubmit:P,children:v.jsxs(Ey,{columnGap:"0.5rem",children:[v.jsx(fn,{isRequired:!0,width:"max-content",children:v.jsx(dr,{as:fr,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),v.jsx(Je,{icon:v.jsx(iPe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&v.jsxs(je,{flexDirection:"column",rowGap:"1rem",children:[v.jsxs(je,{justifyContent:"space-between",alignItems:"center",children:[v.jsxs("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),v.jsxs("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),v.jsxs(je,{columnGap:"0.5rem",justifyContent:"space-between",children:[v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(nr,{isDisabled:s.length===r.length,onClick:x,children:t("modelmanager:selectAll")}),v.jsx(nr,{isDisabled:s.length===0,onClick:k,children:t("modelmanager:deselectAll")}),v.jsx(er,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(TCe(!o))})]}),v.jsx(nr,{isDisabled:s.length===0,onClick:E,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),v.jsxs(je,{gap:4,backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",flexDirection:"column",children:[v.jsxs(je,{gap:4,children:[v.jsx(Yt,{fontWeight:"bold",color:"var(--text-color-secondary)",children:"Pick Model Type:"}),v.jsx(HE,{value:u,onChange:P=>d(P),defaultValue:"v1",name:"model_type",children:v.jsxs(je,{gap:4,children:[v.jsx(Td,{value:"v1",children:t("modelmanager:v1")}),v.jsx(Td,{value:"v2",children:t("modelmanager:v2")}),v.jsx(Td,{value:"inpainting",children:t("modelmanager:inpainting")}),v.jsx(Td,{value:"custom",children:t("modelmanager:customConfig")})]})})]}),u==="custom"&&v.jsxs(je,{flexDirection:"column",rowGap:2,children:[v.jsx(Yt,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:t("modelmanager:pathToCustomConfig")}),v.jsx(fr,{value:h,onChange:P=>{P.target.value!==""&&m(P.target.value)},width:"42.5rem"})]})]}),v.jsxs(je,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&v.jsx(Yt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):v.jsx(Yt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),_()]})]})]})}const sj=64,lj=2048;function U$e(){const e=Oe(),{t}=Ge(),n=he(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(u){let d;return r(u)&&(d=t("modelmanager:cannotUseSpaces")),d}const o={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=u=>{e(Vy(u)),e(Wh(null))},[s,l]=N.useState(!1);return v.jsxs(v.Fragment,{children:[v.jsx(Je,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Wh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:v.jsx(lq,{})}),v.jsx(W$e,{}),v.jsx(er,{label:t("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&v.jsx(Qy,{initialValues:o,onSubmit:a,children:({handleSubmit:u,errors:d,touched:h})=>v.jsx("form",{onSubmit:u,children:v.jsxs(yn,{rowGap:"0.5rem",children:[v.jsx(Yt,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelmanager:manual")}),v.jsxs(fn,{isInvalid:!!d.name&&h.name,isRequired:!0,children:[v.jsx(En,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),d.name&&h.name?v.jsx(cr,{children:d.name}):v.jsx(ur,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.description&&h.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"2xl"}),d.description&&h.description?v.jsx(cr,{children:d.description}):v.jsx(ur,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.config&&h.config,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:config")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"config",name:"config",type:"text",width:"2xl"}),d.config&&h.config?v.jsx(cr,{children:d.config}):v.jsx(ur,{margin:0,children:t("modelmanager:configValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.weights&&h.weights,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"weights",name:"weights",type:"text",width:"2xl"}),d.weights&&h.weights?v.jsx(cr,{children:d.weights}):v.jsx(ur,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.vae&&h.vae,children:[v.jsx(En,{htmlFor:"vae",fontSize:"sm",children:t("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae",name:"vae",type:"text",width:"2xl"}),d.vae&&h.vae?v.jsx(cr,{children:d.vae}):v.jsx(ur,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(Ey,{width:"100%",children:[v.jsxs(fn,{isInvalid:!!d.width&&h.width,children:[v.jsx(En,{htmlFor:"width",fontSize:"sm",children:t("modelmanager:width")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"width",name:"width",children:({field:m,form:y})=>v.jsx(ia,{id:"width",name:"width",min:sj,max:lj,step:64,width:"90%",value:y.values.width,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.width&&h.width?v.jsx(cr,{children:d.width}):v.jsx(ur,{margin:0,children:t("modelmanager:widthValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.height&&h.height,children:[v.jsx(En,{htmlFor:"height",fontSize:"sm",children:t("modelmanager:height")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"height",name:"height",children:({field:m,form:y})=>v.jsx(ia,{id:"height",name:"height",min:sj,max:lj,width:"90%",step:64,value:y.values.height,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.height&&h.height?v.jsx(cr,{children:d.height}):v.jsx(ur,{margin:0,children:t("modelmanager:heightValidationMsg")})]})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})})]})}function n4({children:e}){return v.jsx(je,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:e})}function G$e(){const e=Oe(),{t}=Ge(),n=he(s=>s.system.isProcessing);function r(s){return/\s/.test(s)}function i(s){let l;return r(s)&&(l=t("modelmanager:cannotUseSpaces")),l}const o={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=s=>{const l=s;s.path===""&&delete l.path,s.repo_id===""&&delete l.repo_id,s.vae.path===""&&delete l.vae.path,s.vae.repo_id===""&&delete l.vae.repo_id,e(Vy(l)),e(Wh(null))};return v.jsxs(je,{children:[v.jsx(Je,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Wh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:v.jsx(lq,{})}),v.jsx(Qy,{initialValues:o,onSubmit:a,children:({handleSubmit:s,errors:l,touched:u})=>{var d,h,m,y,b,x,k,E,_,P;return v.jsx("form",{onSubmit:s,children:v.jsxs(yn,{rowGap:"0.5rem",children:[v.jsx(n4,{children:v.jsxs(fn,{isInvalid:!!l.name&&u.name,isRequired:!0,children:[v.jsx(En,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),l.name&&u.name?v.jsx(cr,{children:l.name}):v.jsx(ur,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]})}),v.jsx(n4,{children:v.jsxs(fn,{isInvalid:!!l.description&&u.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),l.description&&u.description?v.jsx(cr,{children:l.description}):v.jsx(ur,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]})}),v.jsxs(n4,{children:[v.jsx(Yt,{fontWeight:"bold",fontSize:"sm",children:t("modelmanager:formMessageDiffusersModelLocation")}),v.jsx(Yt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersModelLocationDesc")}),v.jsxs(fn,{isInvalid:!!l.path&&u.path,children:[v.jsx(En,{htmlFor:"path",fontSize:"sm",children:t("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"path",name:"path",type:"text",width:"2xl"}),l.path&&u.path?v.jsx(cr,{children:l.path}):v.jsx(ur,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!l.repo_id&&u.repo_id,children:[v.jsx(En,{htmlFor:"repo_id",fontSize:"sm",children:t("modelmanager:repo_id")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),l.repo_id&&u.repo_id?v.jsx(cr,{children:l.repo_id}):v.jsx(ur,{margin:0,children:t("modelmanager:repoIDValidationMsg")})]})]})]}),v.jsxs(n4,{children:[v.jsx(Yt,{fontWeight:"bold",children:t("modelmanager:formMessageDiffusersVAELocation")}),v.jsx(Yt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersVAELocationDesc")}),v.jsxs(fn,{isInvalid:!!((d=l.vae)!=null&&d.path)&&((h=u.vae)==null?void 0:h.path),children:[v.jsx(En,{htmlFor:"vae.path",fontSize:"sm",children:t("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(m=l.vae)!=null&&m.path&&((y=u.vae)!=null&&y.path)?v.jsx(cr,{children:(b=l.vae)==null?void 0:b.path}):v.jsx(ur,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!((x=l.vae)!=null&&x.repo_id)&&((k=u.vae)==null?void 0:k.repo_id),children:[v.jsx(En,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelmanager:vaeRepoID")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(E=l.vae)!=null&&E.repo_id&&((_=u.vae)!=null&&_.repo_id)?v.jsx(cr,{children:(P=l.vae)==null?void 0:P.repo_id}):v.jsx(ur,{margin:0,children:t("modelmanager:vaeRepoIDValidationMsg")})]})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function uj({text:e,onClick:t}){return v.jsx(je,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:t,children:v.jsx(Yt,{fontWeight:"bold",children:e})})}function q$e(){const{isOpen:e,onOpen:t,onClose:n}=qh(),r=he(s=>s.ui.addNewModelUIOption),i=Oe(),{t:o}=Ge(),a=()=>{n(),i(Wh(null))};return v.jsxs(v.Fragment,{children:[v.jsx(nr,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:v.jsxs(je,{columnGap:"0.5rem",alignItems:"center",children:[v.jsx(Uy,{}),o("modelmanager:addNew")]})}),v.jsxs(Zd,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[v.jsx(Qd,{}),v.jsxs(ep,{className:"modal add-model-modal",fontFamily:"Inter",children:[v.jsx(k0,{children:o("modelmanager:addNewModel")}),v.jsx(Iy,{marginTop:"0.3rem"}),v.jsxs(a0,{className:"add-model-modal-body",children:[r==null&&v.jsxs(je,{columnGap:"1rem",children:[v.jsx(uj,{text:o("modelmanager:addCheckpointModel"),onClick:()=>i(Wh("ckpt"))}),v.jsx(uj,{text:o("modelmanager:addDiffuserModel"),onClick:()=>i(Wh("diffusers"))})]}),r=="ckpt"&&v.jsx(U$e,{}),r=="diffusers"&&v.jsx(G$e,{})]})]})]})]})}function r4(e){const{isProcessing:t,isConnected:n}=he(y=>y.system),r=he(y=>y.system.openModel),{t:i}=Ge(),o=Oe(),{name:a,status:s,description:l}=e,u=()=>{o(tq(a))},d=()=>{o(jR(a))},h=()=>{o(t_e(a)),o(jR(null))},m=()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}};return v.jsxs(je,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[v.jsx(Eo,{onClick:d,cursor:"pointer",children:v.jsx(uo,{label:l,hasArrow:!0,placement:"bottom",children:v.jsx(Yt,{fontWeight:"bold",children:a})})}),v.jsx(C$,{onClick:d,cursor:"pointer"}),v.jsxs(je,{gap:2,alignItems:"center",children:[v.jsx(Yt,{color:m(),children:s}),v.jsx(ls,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),v.jsx(Je,{icon:v.jsx(GEe,{}),size:"sm",onClick:d,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),v.jsx(fw,{title:i("modelmanager:deleteModel"),acceptCallback:h,acceptButtonText:i("modelmanager:delete"),triggerComponent:v.jsx(Je,{icon:v.jsx(UEe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:v.jsxs(je,{rowGap:"1rem",flexDirection:"column",children:[v.jsx("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),v.jsx("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const Y$e=lt(or,e=>ke.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function t7({label:e,isActive:t,onClick:n}){return v.jsx(nr,{onClick:n,isActive:t,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:e})}const K$e=()=>{const e=he(Y$e),[t,n]=w.useState(""),[r,i]=w.useState("all"),[o,a]=w.useTransition(),{t:s}=Ge(),l=d=>{a(()=>{n(d.target.value)})},u=w.useMemo(()=>{const d=[],h=[],m=[],y=[];return e.forEach((b,x)=>{b.name.toLowerCase().includes(t.toLowerCase())&&(m.push(v.jsx(r4,{name:b.name,status:b.status,description:b.description},x)),b.format===r&&y.push(v.jsx(r4,{name:b.name,status:b.status,description:b.description},x))),b.format!=="diffusers"?d.push(v.jsx(r4,{name:b.name,status:b.status,description:b.description},x)):h.push(v.jsx(r4,{name:b.name,status:b.status,description:b.description},x))}),t!==""?r==="all"?v.jsx(Eo,{marginTop:"1rem",children:m}):v.jsx(Eo,{marginTop:"1rem",children:y}):v.jsxs(je,{flexDirection:"column",rowGap:"1.5rem",children:[r==="all"&&v.jsxs(v.Fragment,{children:[v.jsxs(Eo,{children:[v.jsx(Yt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:s("modelmanager:checkpointModels")}),d]}),v.jsxs(Eo,{children:[v.jsx(Yt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:s("modelmanager:diffusersModels")}),h]})]}),r==="ckpt"&&v.jsx(je,{flexDirection:"column",marginTop:"1rem",children:d}),r==="diffusers"&&v.jsx(je,{flexDirection:"column",marginTop:"1rem",children:h})]})},[e,t,s,r]);return v.jsxs(je,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[v.jsxs(je,{justifyContent:"space-between",children:[v.jsx(Yt,{fontSize:"1.4rem",fontWeight:"bold",children:s("modelmanager:availableModels")}),v.jsx(q$e,{})]}),v.jsx(fr,{onChange:l,label:s("modelmanager:search")}),v.jsxs(je,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(t7,{label:s("modelmanager:allModels"),onClick:()=>i("all"),isActive:r==="all"}),v.jsx(t7,{label:s("modelmanager:checkpointModels"),onClick:()=>i("ckpt"),isActive:r==="ckpt"}),v.jsx(t7,{label:s("modelmanager:diffusersModels"),onClick:()=>i("diffusers"),isActive:r==="diffusers"})]}),u]})]})};function X$e({children:e}){const{isOpen:t,onOpen:n,onClose:r}=qh(),i=he(s=>s.system.model_list),o=he(s=>s.system.openModel),{t:a}=Ge();return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:n}),v.jsxs(Zd,{isOpen:t,onClose:r,size:"6xl",children:[v.jsx(Qd,{}),v.jsxs(ep,{className:"modal",fontFamily:"Inter",children:[v.jsx(Iy,{className:"modal-close-btn"}),v.jsx(k0,{fontWeight:"bold",children:a("modelmanager:modelManager")}),v.jsxs(je,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[v.jsx(K$e,{}),o&&i[o].format==="diffusers"?v.jsx(H$e,{}):v.jsx($$e,{})]})]})]})]})}const Z$e=lt([or],e=>{const{isProcessing:t,model_list:n}=e;return{models:ke.map(n,(i,o)=>o),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),Q$e=()=>{const e=Oe(),{models:t,isProcessing:n}=he(Z$e),r=he(oq),i=o=>{e(tq(o.target.value))};return v.jsx(je,{style:{paddingLeft:"0.3rem"},children:v.jsx(rl,{style:{fontSize:"0.8rem"},tooltip:r.description,isDisabled:n,value:r.name,validValues:t,onChange:i})})},J$e=lt([or,Sp],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:ke.map(o,(u,d)=>d),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),eze=({children:e})=>{const t=Oe(),{t:n}=Ge(),r=he(_=>_.generation.steps),{isOpen:i,onOpen:o,onClose:a}=qh(),{isOpen:s,onOpen:l,onClose:u}=qh(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:m,saveIntermediatesInterval:y,enableImageDebugging:b,shouldUseCanvasBetaLayout:x}=he(J$e),k=()=>{iq.purge().then(()=>{a(),l()})},E=_=>{_>r&&(_=r),_<1&&(_=1),t(pCe(_))};return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:o}),v.jsxs(Zd,{isOpen:i,onClose:a,size:"lg",children:[v.jsx(Qd,{}),v.jsxs(ep,{className:"modal settings-modal",children:[v.jsx(k0,{className:"settings-modal-header",children:n("common:settingsLabel")}),v.jsx(Iy,{className:"modal-close-btn"}),v.jsxs(a0,{className:"settings-modal-content",children:[v.jsxs("div",{className:"settings-modal-items",children:[v.jsxs("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[v.jsx(rl,{label:n("settings:displayInProgress"),validValues:C7e,value:d,onChange:_=>t(sCe(_.target.value))}),d==="full-res"&&v.jsx(ia,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:E,value:y,width:"auto",textAlign:"center"})]}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:_=>t(XU(_.target.checked))}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:_=>t(dCe(_.target.checked))}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:x,onChange:_=>t(PCe(_.target.checked))})]}),v.jsxs("div",{className:"settings-modal-items",children:[v.jsx("h2",{style:{fontWeight:"bold"},children:"Developer"}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:_=>t(gCe(_.target.checked))})]}),v.jsxs("div",{className:"settings-modal-reset",children:[v.jsx(Bh,{size:"md",children:n("settings:resetWebUI")}),v.jsx(ls,{colorScheme:"red",onClick:k,children:n("settings:resetWebUI")}),v.jsx(Yt,{children:n("settings:resetWebUIDesc1")}),v.jsx(Yt,{children:n("settings:resetWebUIDesc2")})]})]}),v.jsx(wx,{children:v.jsx(ls,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),v.jsxs(Zd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[v.jsx(Qd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),v.jsx(ep,{children:v.jsx(a0,{pb:6,pt:6,children:v.jsx(je,{justifyContent:"center",children:v.jsx(Yt,{fontSize:"lg",children:v.jsx(Yt,{children:n("settings:resetComplete")})})})})})]})]})},tze=lt(or,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),nze=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=he(tze),s=Oe(),{t:l}=Ge();let u;e&&!o?u="status-good":u="status-bad";let d=i;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(d)&&(u="status-working"),d&&t&&r>1&&(d=`${l(d)} (${n}/${r})`);const m=o&&!a?"Click to clear, check logs for details":void 0,y=o&&!a?"pointer":"initial",b=()=>{(o||!a)&&s(ZU())};return v.jsx(uo,{label:m,children:v.jsx(Yt,{cursor:y,onClick:b,className:`status ${u}`,children:l(d)})})};function rze(){const{t:e}=Ge(),{setColorMode:t,colorMode:n}=gy(),r=Oe(),i=he(l=>l.ui.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};w.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(wCe(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(v.jsx(nr,{style:{width:"6rem"},leftIcon:i===u?v.jsx(RP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(OEe,{})}),children:v.jsx(yn,{align:"stretch",children:s()})})}function ize(){const{t:e,i18n:t}=Ge(),n={en:e("common:langEnglish"),nl:e("common:langDutch"),fr:e("common:langFrench"),de:e("common:langGerman"),it:e("common:langItalian"),ja:e("common:langJapanese"),pl:e("common:langPolish"),pt_br:e("common:langBrPortuguese"),ru:e("common:langRussian"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish"),ua:e("common:langUkranian")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(v.jsx(nr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:v.jsx(TEe,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:v.jsx(yn,{children:r()})})}const oze=()=>{const{t:e}=Ge(),t=he(n=>n.system.app_version);return v.jsxs("div",{className:"site-header",children:[v.jsxs("div",{className:"site-header-left-side",children:[v.jsx("img",{src:zY,alt:"invoke-ai-logo"}),v.jsxs(je,{alignItems:"center",columnGap:"0.6rem",children:[v.jsxs(Yt,{fontSize:"1.4rem",children:["invoke ",v.jsx("strong",{children:"ai"})]}),v.jsx(Yt,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),v.jsxs("div",{className:"site-header-right-side",children:[v.jsx(nze,{}),v.jsx(Q$e,{}),v.jsx(X$e,{children:v.jsx(Je,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(SEe,{})})}),v.jsx(UDe,{children:v.jsx(Je,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(PEe,{})})}),v.jsx(rze,{}),v.jsx(ize,{}),v.jsx(Je,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Fh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:v.jsx(bEe,{})})}),v.jsx(Je,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Fh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:v.jsx(pEe,{})})}),v.jsx(Je,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Fh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:v.jsx(hEe,{})})}),v.jsx(eze,{children:v.jsx(Je,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:v.jsx(aPe,{})})})]})]})};function aze(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const sze=()=>{const e=Oe(),t=he(C_e),n=By();w.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(vCe())},[e,n,t])},YK=lt([wp,Sp,Mr],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:o,shouldUseCanvasBetaLayout:a}=t,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=e,d=a&&n==="unifiedCanvas",h=!d&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!d&&(!r||!i),shouldShowParametersPanelButton:h,shouldShowParametersPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),lze=()=>{const e=Oe(),{shouldShowParametersPanel:t,shouldShowParametersPanelButton:n,shouldShowProcessButtons:r,shouldPinParametersPanel:i,shouldShowGallery:o,shouldPinGallery:a}=he(YK),s=()=>{e(Zu(!0)),i&&setTimeout(()=>e(vi(!0)),400)};return et("f",()=>{o||t?(e(Zu(!1)),e(zd(!1))):(e(Zu(!0)),e(zd(!0))),(a||i)&&setTimeout(()=>e(vi(!0)),400)},[o,t]),n?v.jsxs("div",{className:"show-hide-button-options",children:[v.jsx(Je,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:v.jsx(jP,{})}),r&&v.jsxs(v.Fragment,{children:[v.jsx(rT,{iconButton:!0}),v.jsx(tT,{})]})]}):null},uze=()=>{const e=Oe(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowParametersPanel:i,shouldPinParametersPanel:o}=he(YK),a=()=>{e(zd(!0)),r&&e(vi(!0))};return et("f",()=>{t||i?(e(Zu(!1)),e(zd(!1))):(e(Zu(!0)),e(zd(!0))),(r||o)&&setTimeout(()=>e(vi(!0)),400)},[t,i]),n?v.jsx(Je,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:v.jsx($q,{})}):null};aze();const cze=()=>(sze(),v.jsxs("div",{className:"App",children:[v.jsxs(BDe,{children:[v.jsx(VDe,{}),v.jsxs("div",{className:"app-content",children:[v.jsx(oze,{}),v.jsx(VRe,{})]}),v.jsx("div",{className:"app-console",children:v.jsx(zDe,{})})]}),v.jsx(lze,{}),v.jsx(uze,{})]})),cj=()=>v.jsx(je,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:v.jsx(ky,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})});const dze=Fj({key:"invokeai-style-cache",prepend:!0});n8.createRoot(document.getElementById("root")).render(v.jsx(N.StrictMode,{children:v.jsx(W5e,{store:rq,children:v.jsx(TW,{loading:v.jsx(cj,{}),persistor:iq,children:v.jsx(ire,{value:dze,children:v.jsx(u5e,{children:v.jsx(N.Suspense,{fallback:v.jsx(cj,{}),children:v.jsx(cze,{})})})})})})})); +`.replaceAll("black",e),oIe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=pe(iIe),[a,s]=w.useState(null),[l,u]=w.useState(0),d=w.useRef(null),h=w.useCallback(()=>{u(l+1),setTimeout(h,500)},[l]);return w.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=pN(n)},[a,n]),w.useEffect(()=>{a&&(a.src=pN(n))},[a,n]),w.useEffect(()=>{const m=setInterval(()=>u(y=>(y+1)%5),50);return()=>clearInterval(m)},[]),!a||!ke.isNumber(r.x)||!ke.isNumber(r.y)||!ke.isNumber(o)||!ke.isNumber(i.width)||!ke.isNumber(i.height)?null:v.jsx(cc,{ref:d,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:ke.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},aIe=lt([ln],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),sIe=e=>{const{...t}=e,{objects:n}=pe(aIe);return v.jsx(uc,{listening:!1,...t,children:n.filter(lP).map((r,i)=>v.jsx(hS,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})};var fh=w,lIe=function(t,n,r){const i=fh.useRef("loading"),o=fh.useRef(),[a,s]=fh.useState(0),l=fh.useRef(),u=fh.useRef(),d=fh.useRef();return(l.current!==t||u.current!==n||d.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,d.current=r),fh.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function m(){i.current="loaded",o.current=h,s(Math.random())}function y(){i.current="failed",o.current=void 0,s(Math.random())}return h.addEventListener("load",m),h.addEventListener("error",y),n&&(h.crossOrigin=n),r&&(h.referrerpolicy=r),h.src=t,function(){h.removeEventListener("load",m),h.removeEventListener("error",y)}},[t,n,r]),[o.current,i.current]};const YY=e=>{const{url:t,x:n,y:r}=e,[i]=lIe(t);return v.jsx(GY,{x:n,y:r,image:i,listening:!1})},uIe=lt([ln],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),cIe=()=>{const{objects:e}=pe(uIe);return e?v.jsx(uc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(Y5(t))return v.jsx(YY,{x:t.x,y:t.y,url:t.image.url},n);if(kxe(t)){const r=v.jsx(hS,{points:t.points,stroke:t.color?Gh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?v.jsx(uc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(Exe(t))return v.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Gh(t.color)},n);if(Pxe(t))return v.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},dIe=lt([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),fIe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=pe(dIe);return v.jsxs(uc,{...t,children:[r&&n&&v.jsx(YY,{url:n.image.url,x:o,y:a}),i&&v.jsxs(uc,{children:[v.jsx(cc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),v.jsx(cc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},hIe=lt([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),pIe=()=>{const e=Oe(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=pe(hIe),{t:o}=Ge(),a=w.useCallback(()=>{e(WI(!0))},[e]),s=w.useCallback(()=>{e(WI(!1))},[e]);et(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),et(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),et(["enter"],()=>{d()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(jxe()),u=()=>e(Nxe()),d=()=>e(Ixe());return r?v.jsx(je,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:v.jsxs(ao,{isAttached:!0,children:[v.jsx(Je,{tooltip:`${o("unifiedcanvas:previous")} (Left)`,"aria-label":`${o("unifiedcanvas:previous")} (Left)`,icon:v.jsx(vEe,{}),onClick:l,"data-selected":!0,isDisabled:t}),v.jsx(Je,{tooltip:`${o("unifiedcanvas:next")} (Right)`,"aria-label":`${o("unifiedcanvas:next")} (Right)`,icon:v.jsx(yEe,{}),onClick:u,"data-selected":!0,isDisabled:n}),v.jsx(Je,{tooltip:`${o("unifiedcanvas:accept")} (Enter)`,"aria-label":`${o("unifiedcanvas:accept")} (Enter)`,icon:v.jsx(RP,{}),onClick:d,"data-selected":!0}),v.jsx(Je,{tooltip:o("unifiedcanvas:showHide"),"aria-label":o("unifiedcanvas:showHide"),"data-alert":!i,icon:i?v.jsx(kEe,{}):v.jsx(_Ee,{}),onClick:()=>e(qxe(!i)),"data-selected":!0}),v.jsx(Je,{tooltip:o("unifiedcanvas:saveToGallery"),"aria-label":o("unifiedcanvas:saveToGallery"),icon:v.jsx(NP,{}),onClick:()=>e(i_e(r.image.url)),"data-selected":!0}),v.jsx(Je,{tooltip:o("unifiedcanvas:discardAll"),"aria-label":o("unifiedcanvas:discardAll"),icon:v.jsx(qy,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(Rxe()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},vm=e=>Math.round(e*100)/100,gIe=lt([ln],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${vm(n)}, ${vm(r)})`}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function mIe(){const{cursorCoordinatesString:e}=pe(gIe),{t}=Ge();return v.jsx("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const vIe=lt([ln],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:d},stageScale:h,shouldShowCanvasDebugInfo:m,layer:y,boundingBoxScaleMethod:b,shouldPreserveMaskedArea:x}=e;let k="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(k="var(--status-working-color)"),{activeLayerColor:y==="mask"?"var(--status-working-color)":"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:k,boundingBoxCoordinatesString:`(${vm(u)}, ${vm(d)})`,boundingBoxDimensionsString:`${o}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${vm(r)}×${vm(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none",shouldPreserveMaskedArea:x}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),yIe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:d,shouldShowBoundingBox:h,shouldPreserveMaskedArea:m}=pe(vIe),{t:y}=Ge();return v.jsxs("div",{className:"canvas-status-text",children:[v.jsx("div",{style:{color:e},children:`${y("unifiedcanvas:activeLayer")}: ${t}`}),v.jsx("div",{children:`${y("unifiedcanvas:canvasScale")}: ${u}%`}),m&&v.jsx("div",{style:{color:"var(--status-working-color)"},children:"Preserve Masked Area: On"}),h&&v.jsx("div",{style:{color:n},children:`${y("unifiedcanvas:boundingBox")}: ${i}`}),a&&v.jsx("div",{style:{color:n},children:`${y("unifiedcanvas:scaledBoundingBox")}: ${o}`}),d&&v.jsxs(v.Fragment,{children:[v.jsx("div",{children:`${y("unifiedcanvas:boundingBoxPosition")}: ${r}`}),v.jsx("div",{children:`${y("unifiedcanvas:canvasDimensions")}: ${l}`}),v.jsx("div",{children:`${y("unifiedcanvas:canvasPosition")}: ${s}`}),v.jsx(mIe,{})]})]})},bIe=lt(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),SIe=e=>{const{...t}=e,n=Oe(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:d,hitStrokeWidth:h}=pe(bIe),m=w.useRef(null),y=w.useRef(null),[b,x]=w.useState(!1);w.useEffect(()=>{var te;!m.current||!y.current||(m.current.nodes([y.current]),(te=m.current.getLayer())==null||te.batchDraw())},[]);const k=64*l,E=w.useCallback(te=>{if(!u){n(CC({x:Math.floor(te.target.x()),y:Math.floor(te.target.y())}));return}const G=te.target.x(),$=te.target.y(),W=Yl(G,64),X=Yl($,64);te.target.x(W),te.target.y(X),n(CC({x:W,y:X}))},[n,u]),_=w.useCallback(()=>{if(!y.current)return;const te=y.current,G=te.scaleX(),$=te.scaleY(),W=Math.round(te.width()*G),X=Math.round(te.height()*$),Z=Math.round(te.x()),U=Math.round(te.y());n(Mv({width:W,height:X})),n(CC({x:u?Ld(Z,64):Z,y:u?Ld(U,64):U})),te.scaleX(1),te.scaleY(1)},[n,u]),P=w.useCallback((te,G,$)=>{const W=te.x%k,X=te.y%k;return{x:Ld(G.x,k)+W,y:Ld(G.y,k)+X}},[k]),A=()=>{n(kC(!0))},M=()=>{n(kC(!1)),n(_C(!1)),n(Lb(!1)),x(!1)},R=()=>{n(_C(!0))},D=()=>{n(kC(!1)),n(_C(!1)),n(Lb(!1)),x(!1)},j=()=>{x(!0)},z=()=>{!s&&!a&&x(!1)},H=()=>{n(Lb(!0))},K=()=>{n(Lb(!1))};return v.jsxs(uc,{...t,children:[v.jsx(cc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:H,onMouseOver:H,onMouseLeave:K,onMouseOut:K}),v.jsx(cc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:h,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onDragMove:E,onMouseDown:R,onMouseOut:z,onMouseOver:j,onMouseEnter:j,onMouseUp:D,onTransform:_,onTransformEnd:M,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),v.jsx(NMe,{anchorCornerRadius:3,anchorDragBoundFunc:P,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:d==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onMouseDown:A,onMouseUp:M,onTransformEnd:M,ref:m,rotateEnabled:!1})]})},xIe=lt(ln,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:d,stageScale:h,stageDimensions:m,boundingBoxCoordinates:y,boundingBoxDimensions:b,shouldRestrictStrokesToBox:x}=e,k=x?{clipX:y.x,clipY:y.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:HI/h,colorPickerInnerRadius:(HI-h8+1)/h,maskColorString:Gh({...i,a:.5}),brushColorString:Gh(o),colorPickerColorString:Gh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||d||!t)&&l,strokeWidth:1.5/h,dotRadius:1.5/h,clip:k}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),wIe=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:d,brushColorString:h,colorPickerColorString:m,colorPickerInnerRadius:y,colorPickerOuterRadius:b,clip:x}=pe(xIe);return l?v.jsxs(uc,{listening:!1,...x,...t,children:[a==="colorPicker"?v.jsxs(v.Fragment,{children:[v.jsx(dh,{x:n,y:r,radius:b,stroke:h,strokeWidth:h8,strokeScaleEnabled:!1}),v.jsx(dh,{x:n,y:r,radius:y,stroke:m,strokeWidth:h8,strokeScaleEnabled:!1})]}):v.jsxs(v.Fragment,{children:[v.jsx(dh,{x:n,y:r,radius:i,fill:s==="mask"?o:h,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),v.jsx(dh,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:d*2,strokeEnabled:!0,listening:!1}),v.jsx(dh,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),v.jsx(dh,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),v.jsx(dh,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},CIe=lt([ln,Ir],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:d,isMovingStage:h,shouldShowIntermediates:m,shouldShowGrid:y,shouldRestrictStrokesToBox:b}=e;let x="none";return d==="move"||t?h?x="grabbing":x="grab":o?x=void 0:b&&!a&&(x="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:y,stageCoordinates:u,stageCursor:x,stageDimensions:l,stageScale:r,tool:d,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),KY=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:d}=pe(CIe);zMe();const h=w.useRef(null),m=w.useRef(null),y=w.useCallback(z=>{j8e(z),h.current=z},[]),b=w.useCallback(z=>{N8e(z),m.current=z},[]),x=w.useRef({x:0,y:0}),k=w.useRef(!1),E=XMe(h),_=VMe(h),P=YMe(h,k),A=UMe(h,k,x),M=GMe(),{handleDragStart:R,handleDragMove:D,handleDragEnd:j}=$Me();return v.jsx("div",{className:"inpainting-canvas-container",children:v.jsxs("div",{className:"inpainting-canvas-wrapper",children:[v.jsxs(jMe,{tabIndex:-1,ref:y,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:_,onTouchMove:A,onTouchEnd:P,onMouseDown:_,onMouseLeave:M,onMouseMove:A,onMouseUp:P,onDragStart:R,onDragMove:D,onDragEnd:j,onContextMenu:z=>z.evt.preventDefault(),onWheel:E,draggable:(l==="move"||u)&&!t,children:[v.jsx(bv,{id:"grid",visible:r,children:v.jsx(tIe,{})}),v.jsx(bv,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:v.jsx(cIe,{})}),v.jsxs(bv,{id:"mask",visible:e,listening:!1,children:[v.jsx(sIe,{visible:!0,listening:!1}),v.jsx(oIe,{listening:!1})]}),v.jsx(bv,{children:v.jsx(QMe,{})}),v.jsxs(bv,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&v.jsx(wIe,{visible:l!=="move",listening:!1}),v.jsx(fIe,{visible:u}),d&&v.jsx(rIe,{}),v.jsx(SIe,{visible:n&&!u})]})]}),v.jsx(yIe,{}),v.jsx(pIe,{})]})})},_Ie=lt(ln,Iq,Mr,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),XY=()=>{const e=Oe(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=pe(_Ie),o=w.useRef(null);return w.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(Hxe({width:a,height:s})),e(i?Fxe():Bx()),e(vi(!1))},0)},[e,r,t,n,i]),v.jsx("div",{ref:o,className:"inpainting-canvas-area",children:v.jsx(Py,{thickness:"2px",speed:"1s",size:"xl"})})},kIe=lt([ln,Mr,or],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function ZY(){const e=Oe(),{canRedo:t,activeTabName:n}=pe(kIe),{t:r}=Ge(),i=()=>{e(Bxe())};return et(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),v.jsx(Je,{"aria-label":`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,icon:v.jsx(NEe,{}),onClick:i,isDisabled:!t})}const EIe=lt([ln,Mr,or],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function QY(){const e=Oe(),{t}=Ge(),{canUndo:n,activeTabName:r}=pe(EIe),i=()=>{e(Kxe())};return et(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:undo")} (Ctrl+Z)`,tooltip:`${t("unifiedcanvas:undo")} (Ctrl+Z)`,icon:v.jsx(FEe,{}),onClick:i,isDisabled:!n})}const PIe=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");o&&(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},TIe=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},LIe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:a,y:s,width:l,height:u},h=e.toDataURL(d);return e.scale(i),{dataURL:h,boundingBox:{x:o.x,y:o.y,width:l,height:u}}},AIe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Md=(e=AIe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(bCe("Exporting Image")),t(Mh(!1));const u=n(),{stageScale:d,boundingBoxCoordinates:h,boundingBoxDimensions:m,stageCoordinates:y}=u.canvas,b=nl();if(!b){t(ts(!1)),t(Mh(!0));return}const{dataURL:x,boundingBox:k}=LIe(b,d,y,i?{...h,...m}:void 0);if(!x){t(ts(!1)),t(Mh(!0));return}const E=new FormData;E.append("data",JSON.stringify({dataURL:x,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const P=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:E})).json(),{url:A,width:M,height:R}=P,D={uuid:gm(),category:o?"result":"user",...P};a&&(TIe(A),t(Ad({title:Dt.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(PIe(A,M,R),t(Ad({title:Dt.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(hm({image:D,category:"result"})),t(Ad({title:Dt.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(Uxe({kind:"image",layer:"base",...k,image:D})),t(Ad({title:Dt.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(ts(!1)),t(Wg(Dt.t("common:statusConnected"))),t(Mh(!0))};function OIe(){const e=pe(Ir),t=nl(),n=pe(s=>s.system.isProcessing),r=pe(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Oe(),{t:o}=Ge();et(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Md({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return v.jsx(Je,{"aria-label":`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:v.jsx(c0,{}),onClick:a,isDisabled:e})}function MIe(){const e=Oe(),{t}=Ge(),n=nl(),r=pe(Ir),i=pe(s=>s.system.isProcessing),o=pe(s=>s.canvas.shouldCropToBoundingBoxOnSave);et(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Md({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return v.jsx(Je,{"aria-label":`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:v.jsx(DP,{}),onClick:a,isDisabled:r})}function IIe(){const e=pe(Ir),{openUploader:t}=TP(),{t:n}=Ge();return v.jsx(Je,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:v.jsx(tw,{}),onClick:t,isDisabled:e})}const RIe=lt([ln,Ir],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function DIe(){const e=Oe(),{t}=Ge(),{layer:n,isMaskEnabled:r,isStaging:i}=pe(RIe),o=()=>{e(X5(n==="mask"?"base":"mask"))};et(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(X5(l)),l==="mask"&&!r&&e(zy(!0))};return v.jsx(rl,{tooltip:`${t("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:qW,onChange:a,isDisabled:i})}function NIe(){const e=Oe(),{t}=Ge(),n=nl(),r=pe(Ir),i=pe(a=>a.system.isProcessing);et(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Md({cropVisible:!1,shouldSetAsInitialImage:!0}))};return v.jsx(Je,{"aria-label":`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:v.jsx(Oq,{}),onClick:o,isDisabled:r})}function jIe(){const e=pe(o=>o.canvas.tool),t=pe(Ir),n=Oe(),{t:r}=Ge();et(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(ru("move"));return v.jsx(Je,{"aria-label":`${r("unifiedcanvas:move")} (V)`,tooltip:`${r("unifiedcanvas:move")} (V)`,icon:v.jsx(kq,{}),"data-selected":e==="move"||t,onClick:i})}function BIe(){const e=pe(i=>i.ui.shouldPinParametersPanel),t=Oe(),{t:n}=Ge(),r=()=>{t(Zu(!0)),e&&setTimeout(()=>t(vi(!0)),400)};return v.jsxs(je,{flexDirection:"column",gap:"0.5rem",children:[v.jsx(Je,{tooltip:`${n("parameters:showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters:showOptionsPanel"),onClick:r,children:v.jsx(jP,{})}),v.jsx(je,{children:v.jsx(rT,{iconButton:!0})}),v.jsx(je,{children:v.jsx(tT,{width:"100%",height:"40px"})})]})}function $Ie(){const e=Oe(),{t}=Ge(),n=pe(Ir),r=()=>{e(cP()),e(Bx())};return v.jsx(Je,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:v.jsx(wp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function JY(e,t,n=250){const[r,i]=w.useState(0);return w.useEffect(()=>{const o=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(o)},[r,e,t,n]),()=>i(o=>o+1)}function FIe(){const e=nl(),t=Oe(),{t:n}=Ge();et(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=JY(()=>i(!1),()=>i(!0)),i=(o=!1)=>{const a=nl();if(!a)return;const s=a.getClientRect({skipTransform:!0});t(JW({contentRect:s,shouldScaleTo1:o}))};return v.jsx(Je,{"aria-label":`${n("unifiedcanvas:resetView")} (R)`,tooltip:`${n("unifiedcanvas:resetView")} (R)`,icon:v.jsx(Pq,{}),onClick:r})}function zIe(){const e=pe(Ir),t=nl(),n=pe(s=>s.system.isProcessing),r=pe(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Oe(),{t:o}=Ge();et(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Md({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return v.jsx(Je,{"aria-label":`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:v.jsx(NP,{}),onClick:a,isDisabled:e})}const HIe=lt([ln,Ir,or],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),VIe=()=>{const e=Oe(),{t}=Ge(),{tool:n,isStaging:r}=pe(HIe);et(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),et(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),et(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),et(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),et(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(ru("brush")),o=()=>e(ru("eraser")),a=()=>e(ru("colorPicker")),s=()=>e(XW()),l=()=>e(KW());return v.jsxs(je,{flexDirection:"column",gap:"0.5rem",children:[v.jsxs(ao,{children:[v.jsx(Je,{"aria-label":`${t("unifiedcanvas:brush")} (B)`,tooltip:`${t("unifiedcanvas:brush")} (B)`,icon:v.jsx(Mq,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:eraser")} (E)`,tooltip:`${t("unifiedcanvas:eraser")} (B)`,icon:v.jsx(Tq,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),v.jsxs(ao,{children:[v.jsx(Je,{"aria-label":`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:v.jsx(Aq,{}),isDisabled:r,onClick:s}),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:v.jsx(qy,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),v.jsx(Je,{"aria-label":`${t("unifiedcanvas:colorPicker")} (C)`,tooltip:`${t("unifiedcanvas:colorPicker")} (C)`,icon:v.jsx(Lq,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},fw=Ae((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:d,onClose:h}=Yh(),m=w.useRef(null),y=()=>{r(),h()},b=()=>{o&&o(),h()};return v.jsxs(v.Fragment,{children:[w.cloneElement(l,{onClick:d,ref:t}),v.jsx(zV,{isOpen:u,leastDestructiveRef:m,onClose:h,children:v.jsx(Jd,{children:v.jsxs(HV,{className:"modal",children:[v.jsx(E0,{fontSize:"lg",fontWeight:"bold",children:s}),v.jsx(s0,{children:a}),v.jsxs(wx,{children:[v.jsx(ls,{ref:m,onClick:b,className:"modal-close-btn",children:i}),v.jsx(ls,{colorScheme:"red",onClick:y,ml:3,children:n})]})]})})})]})}),eK=()=>{const e=pe(Ir),t=Oe(),{t:n}=Ge(),r=()=>{t(o_e()),t(cP()),t(QW())};return v.jsxs(fw,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:v.jsx(nr,{leftIcon:v.jsx(wp,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[v.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),v.jsx("br",{}),v.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},tK=()=>{const e=pe(Ir),t=Oe(),{t:n}=Ge();return v.jsxs(fw,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:()=>t(QW()),acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:v.jsx(nr,{size:"sm",leftIcon:v.jsx(wp,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[v.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),v.jsx("br",{}),v.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},WIe=lt([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),UIe=()=>{const e=Oe(),{t}=Ge(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=pe(WIe);return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:v.jsx(BP,{})}),children:v.jsxs(je,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:o,onChange:a=>e(lU(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:a=>e(nU(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:a=>e(rU(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:a=>e(aU(a.target.checked))}),v.jsx(tK,{}),v.jsx(eK,{})]})})},GIe=()=>{const e=pe(t=>t.ui.shouldShowParametersPanel);return v.jsxs(je,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[v.jsx(DIe,{}),v.jsx(VIe,{}),v.jsxs(je,{gap:"0.5rem",children:[v.jsx(jIe,{}),v.jsx(FIe,{})]}),v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(NIe,{}),v.jsx(zIe,{})]}),v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(OIe,{}),v.jsx(MIe,{})]}),v.jsxs(je,{gap:"0.5rem",children:[v.jsx(QY,{}),v.jsx(ZY,{})]}),v.jsxs(je,{gap:"0.5rem",children:[v.jsx(IIe,{}),v.jsx($Ie,{})]}),v.jsx(UIe,{}),!e&&v.jsx(BIe,{})]})};function qIe(){const e=Oe(),t=pe(i=>i.canvas.brushSize),{t:n}=Ge(),r=pe(Ir);return et(["BracketLeft"],()=>{e(Hm(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),et(["BracketRight"],()=>{e(Hm(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),v.jsx(lo,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:i=>e(Hm(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function hw(){return(hw=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function n_(e){var t=w.useRef(e),n=w.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var h0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:k.buttons>0)&&i.current?o(gN(i.current,k,s.current)):x(!1)},b=function(){return x(!1)};function x(k){var E=l.current,_=r_(i.current),P=k?_.addEventListener:_.removeEventListener;P(E?"touchmove":"mousemove",y),P(E?"touchend":"mouseup",b)}return[function(k){var E=k.nativeEvent,_=i.current;if(_&&(mN(E),!function(A,M){return M&&!v2(A)}(E,l.current)&&_)){if(v2(E)){l.current=!0;var P=E.changedTouches||[];P.length&&(s.current=P[0].identifier)}_.focus(),o(gN(_,E,s.current)),x(!0)}},function(k){var E=k.which||k.keyCode;E<37||E>40||(k.preventDefault(),a({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},x]},[a,o]),d=u[0],h=u[1],m=u[2];return w.useEffect(function(){return m},[m]),N.createElement("div",hw({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),pw=function(e){return e.filter(Boolean).join(" ")},hT=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=pw(["react-colorful__pointer",e.className]);return N.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},N.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Po=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},rK=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Po(e.h),s:Po(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Po(i/2),a:Po(r,2)}},i_=function(e){var t=rK(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},YC=function(e){var t=rK(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},YIe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:Po(255*[r,s,a,a,l,r][u]),g:Po(255*[l,r,r,s,a,a][u]),b:Po(255*[a,a,l,r,r,s][u]),a:Po(i,2)}},KIe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Po(60*(s<0?s+6:s)),s:Po(o?a/o*100:0),v:Po(o/255*100),a:i}},XIe=N.memo(function(e){var t=e.hue,n=e.onChange,r=pw(["react-colorful__hue",e.className]);return N.createElement("div",{className:r},N.createElement(fT,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:h0(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Po(t),"aria-valuemax":"360","aria-valuemin":"0"},N.createElement(hT,{className:"react-colorful__hue-pointer",left:t/360,color:i_({h:t,s:100,v:100,a:1})})))}),ZIe=N.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:i_({h:t.h,s:100,v:100,a:1})};return N.createElement("div",{className:"react-colorful__saturation",style:r},N.createElement(fT,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:h0(t.s+100*i.left,0,100),v:h0(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Po(t.s)+"%, Brightness "+Po(t.v)+"%"},N.createElement(hT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:i_(t)})))}),iK=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function QIe(e,t,n){var r=n_(n),i=w.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=w.useRef({color:t,hsva:o});w.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),w.useEffect(function(){var u;iK(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=w.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var JIe=typeof window<"u"?w.useLayoutEffect:w.useEffect,eRe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},vN=new Map,tRe=function(e){JIe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!vN.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,vN.set(t,n);var r=eRe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},nRe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+YC(Object.assign({},n,{a:0}))+", "+YC(Object.assign({},n,{a:1}))+")"},o=pw(["react-colorful__alpha",t]),a=Po(100*n.a);return N.createElement("div",{className:o},N.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),N.createElement(fT,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:h0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},N.createElement(hT,{className:"react-colorful__alpha-pointer",left:n.a,color:YC(n)})))},rRe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=nK(e,["className","colorModel","color","onChange"]),s=w.useRef(null);tRe(s);var l=QIe(n,i,o),u=l[0],d=l[1],h=pw(["react-colorful",t]);return N.createElement("div",hw({},a,{ref:s,className:h}),N.createElement(ZIe,{hsva:u,onChange:d}),N.createElement(XIe,{hue:u.h,onChange:d}),N.createElement(nRe,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},iRe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:KIe,fromHsva:YIe,equal:iK},oRe=function(e){return N.createElement(rRe,hw({},e,{colorModel:iRe}))};const pS=e=>{const{styleClass:t,...n}=e;return v.jsx(oRe,{className:`invokeai__color-picker ${t}`,...n})},aRe=lt([ln,Ir],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function sRe(){const e=Oe(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=pe(aRe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return et(["shift+BracketLeft"],()=>{e(zm({...t,a:ke.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),et(["shift+BracketRight"],()=>{e(zm({...t,a:ke.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Eo,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:v.jsxs(je,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&v.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(zm(a))}),r==="mask"&&v.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(tU(a))})]})})}function oK(){return v.jsxs(je,{columnGap:"1rem",alignItems:"center",children:[v.jsx(qIe,{}),v.jsx(sRe,{})]})}function lRe(){const e=Oe(),t=pe(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ge();return v.jsx(er,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:r=>e(cU(r.target.checked))})}function uRe(){return v.jsxs(je,{gap:"1rem",alignItems:"center",children:[v.jsx(oK,{}),v.jsx(lRe,{})]})}function cRe(){const e=Oe(),{t}=Ge(),n=()=>e(uP());return v.jsx(nr,{size:"sm",leftIcon:v.jsx(wp,{}),onClick:n,tooltip:`${t("unifiedcanvas:clearMask")} (Shift+C)`,children:t("unifiedcanvas:betaClear")})}function dRe(){const e=pe(i=>i.canvas.isMaskEnabled),t=Oe(),{t:n}=Ge(),r=()=>t(zy(!e));return v.jsx(er,{label:`${n("unifiedcanvas:enableMask")} (H)`,isChecked:e,onChange:r})}function fRe(){const e=Oe(),{t}=Ge(),n=pe(r=>r.canvas.shouldPreserveMaskedArea);return v.jsx(er,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:r=>e(oU(r.target.checked))})}function hRe(){return v.jsxs(je,{gap:"1rem",alignItems:"center",children:[v.jsx(oK,{}),v.jsx(dRe,{}),v.jsx(fRe,{}),v.jsx(cRe,{})]})}function pRe(){const e=pe(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Oe(),{t:n}=Ge();return v.jsx(er,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:r=>t(iU(r.target.checked))})}function gRe(){const e=pe(r=>r.canvas.shouldShowGrid),t=Oe(),{t:n}=Ge();return v.jsx(er,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:r=>t(sU(r.target.checked))})}function mRe(){const e=pe(i=>i.canvas.shouldSnapToGrid),t=Oe(),{t:n}=Ge(),r=i=>t(Z5(i.target.checked));return v.jsx(er,{label:`${n("unifiedcanvas:snapToGrid")} (N)`,isChecked:e,onChange:r})}function vRe(){return v.jsxs(je,{alignItems:"center",gap:"1rem",children:[v.jsx(gRe,{}),v.jsx(mRe,{}),v.jsx(pRe,{})]})}const yRe=lt([ln],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function bRe(){const{tool:e,layer:t}=pe(yRe);return v.jsxs(je,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&v.jsx(uRe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&v.jsx(hRe,{}),e=="move"&&v.jsx(vRe,{})]})}const SRe=lt([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),xRe=()=>{const e=Oe(),{doesCanvasNeedScaling:t}=pe(SRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),v.jsx("div",{className:"workarea-single-view",children:v.jsxs(je,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[v.jsx(GIe,{}),v.jsxs(je,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[v.jsx(bRe,{}),t?v.jsx(XY,{}):v.jsx(KY,{})]})]})})},wRe=lt([ln,Ir],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:Gh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),CRe=()=>{const e=Oe(),{t}=Ge(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=pe(wRe);et(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),et(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),et(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(X5(n==="mask"?"base":"mask"))},l=()=>e(uP()),u=()=>e(zy(!i));return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(ao,{children:v.jsx(Je,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:v.jsx(AEe,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:v.jsxs(je,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:`${t("unifiedcanvas:enableMask")} (H)`,isChecked:i,onChange:u}),v.jsx(er,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:o,onChange:d=>e(oU(d.target.checked))}),v.jsx(pS,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:d=>e(tU(d))}),v.jsxs(nr,{size:"sm",leftIcon:v.jsx(wp,{}),onClick:l,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},_Re=lt([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),kRe=()=>{const e=Oe(),{t}=Ge(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=pe(_Re);et(["n"],()=>{e(Z5(!l))},{enabled:!0,preventDefault:!0},[l]);const d=h=>e(Z5(h.target.checked));return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:v.jsx(BP,{})}),children:v.jsxs(je,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:s,onChange:h=>e(lU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showGrid"),isChecked:a,onChange:h=>e(sU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:snapToGrid"),isChecked:l,onChange:d}),v.jsx(er,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:h=>e(iU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:h=>e(nU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:h=>e(rU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:u,onChange:h=>e(cU(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:o,onChange:h=>e(aU(h.target.checked))}),v.jsx(tK,{}),v.jsx(eK,{})]})})},ERe=lt([ln,Ir,or],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),PRe=()=>{const e=Oe(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=pe(ERe),{t:o}=Ge();et(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),et(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),et(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),et(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),et(["delete","backspace"],()=>{d()},{enabled:()=>!i,preventDefault:!0}),et(["BracketLeft"],()=>{e(Hm(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),et(["BracketRight"],()=>{e(Hm(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),et(["shift+BracketLeft"],()=>{e(zm({...n,a:ke.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),et(["shift+BracketRight"],()=>{e(zm({...n,a:ke.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(ru("brush")),s=()=>e(ru("eraser")),l=()=>e(ru("colorPicker")),u=()=>e(XW()),d=()=>e(KW());return v.jsxs(ao,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${o("unifiedcanvas:brush")} (B)`,tooltip:`${o("unifiedcanvas:brush")} (B)`,icon:v.jsx(Mq,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:eraser")} (E)`,tooltip:`${o("unifiedcanvas:eraser")} (E)`,icon:v.jsx(Tq,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:v.jsx(Aq,{}),isDisabled:i,onClick:u}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:v.jsx(qy,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),v.jsx(Je,{"aria-label":`${o("unifiedcanvas:colorPicker")} (C)`,tooltip:`${o("unifiedcanvas:colorPicker")} (C)`,icon:v.jsx(Lq,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":o("unifiedcanvas:brushOptions"),tooltip:o("unifiedcanvas:brushOptions"),icon:v.jsx(jP,{})}),children:v.jsxs(je,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[v.jsx(je,{gap:"1rem",justifyContent:"space-between",children:v.jsx(lo,{label:o("unifiedcanvas:brushSize"),value:r,withInput:!0,onChange:h=>e(Hm(h)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),v.jsx(pS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:h=>e(zm(h))})]})})]})},TRe=lt([or,ln,Ir],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),LRe=()=>{const e=Oe(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=pe(TRe),s=nl(),{t:l}=Ge(),{openUploader:u}=TP();et(["v"],()=>{d()},{enabled:()=>!n,preventDefault:!0},[]),et(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[s]),et(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["shift+s"],()=>{x()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["meta+c","ctrl+c"],()=>{k()},{enabled:()=>!n,preventDefault:!0},[s,t]),et(["shift+d"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]);const d=()=>e(ru("move")),h=JY(()=>m(!1),()=>m(!0)),m=(P=!1)=>{const A=nl();if(!A)return;const M=A.getClientRect({skipTransform:!0});e(JW({contentRect:M,shouldScaleTo1:P}))},y=()=>{e(cP()),e(Bx())},b=()=>{e(Md({cropVisible:!1,shouldSetAsInitialImage:!0}))},x=()=>{e(Md({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},k=()=>{e(Md({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},E=()=>{e(Md({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},_=P=>{const A=P.target.value;e(X5(A)),A==="mask"&&!r&&e(zy(!0))};return v.jsxs("div",{className:"inpainting-settings",children:[v.jsx(rl,{tooltip:`${l("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:qW,onChange:_,isDisabled:n}),v.jsx(CRe,{}),v.jsx(PRe,{}),v.jsxs(ao,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${l("unifiedcanvas:move")} (V)`,tooltip:`${l("unifiedcanvas:move")} (V)`,icon:v.jsx(kq,{}),"data-selected":o==="move"||n,onClick:d}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:resetView")} (R)`,tooltip:`${l("unifiedcanvas:resetView")} (R)`,icon:v.jsx(Pq,{}),onClick:h})]}),v.jsxs(ao,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:v.jsx(Oq,{}),onClick:b,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:v.jsx(NP,{}),onClick:x,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:v.jsx(c0,{}),onClick:k,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:v.jsx(DP,{}),onClick:E,isDisabled:n})]}),v.jsxs(ao,{isAttached:!0,children:[v.jsx(QY,{}),v.jsx(ZY,{})]}),v.jsxs(ao,{isAttached:!0,children:[v.jsx(Je,{"aria-label":`${l("common:upload")}`,tooltip:`${l("common:upload")}`,icon:v.jsx(tw,{}),onClick:u,isDisabled:n}),v.jsx(Je,{"aria-label":`${l("unifiedcanvas:clearCanvas")}`,tooltip:`${l("unifiedcanvas:clearCanvas")}`,icon:v.jsx(wp,{}),onClick:y,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),v.jsx(ao,{isAttached:!0,children:v.jsx(kRe,{})})]})},ARe=lt([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ORe=()=>{const e=Oe(),{doesCanvasNeedScaling:t}=pe(ARe);return w.useLayoutEffect(()=>{e(vi(!0));const n=ke.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),v.jsx("div",{className:"workarea-single-view",children:v.jsx("div",{className:"workarea-split-view-left",children:v.jsxs("div",{className:"inpainting-main-area",children:[v.jsx(LRe,{}),v.jsx("div",{className:"inpainting-canvas-area",children:t?v.jsx(XY,{}):v.jsx(KY,{})})]})})})},MRe=lt(ln,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),IRe=()=>{const e=Oe(),{boundingBoxDimensions:t}=pe(MRe),{t:n}=Ge(),r=s=>{e(Mv({...t,width:Math.floor(s)}))},i=s=>{e(Mv({...t,height:Math.floor(s)}))},o=()=>{e(Mv({...t,width:Math.floor(512)}))},a=()=>{e(Mv({...t,height:Math.floor(512)}))};return v.jsxs(je,{direction:"column",gap:"1rem",children:[v.jsx(lo,{label:n("parameters:width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:o}),v.jsx(lo,{label:n("parameters:height"),min:64,max:1024,step:64,value:t.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:a})]})},RRe=lt([nT,or,ln],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),DRe=()=>{const e=Oe(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=pe(RRe),{t:s}=Ge(),l=y=>{e(Ab({...a,width:Math.floor(y)}))},u=y=>{e(Ab({...a,height:Math.floor(y)}))},d=()=>{e(Ab({...a,width:Math.floor(512)}))},h=()=>{e(Ab({...a,height:Math.floor(512)}))},m=y=>{e(zxe(y.target.value))};return v.jsxs(je,{direction:"column",gap:"1rem",children:[v.jsx(rl,{label:s("parameters:scaleBeforeProcessing"),validValues:_xe,value:i,onChange:m}),v.jsx(lo,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:d}),v.jsx(lo,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:h}),v.jsx(rl,{label:s("parameters:infillMethod"),value:n,validValues:r,onChange:y=>e(xU(y.target.value))}),v.jsx(lo,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("parameters:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:y=>{e(XI(y))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(XI(32))}})]})};function NRe(){const e=Oe(),t=pe(r=>r.generation.seamBlur),{t:n}=Ge();return v.jsx(lo,{sliderMarkRightOffset:-4,label:n("parameters:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(GI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(GI(16))}})}function jRe(){const e=Oe(),{t}=Ge(),n=pe(r=>r.generation.seamSize);return v.jsx(lo,{sliderMarkRightOffset:-6,label:t("parameters:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(qI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(qI(96))})}function BRe(){const{t:e}=Ge(),t=pe(r=>r.generation.seamSteps),n=Oe();return v.jsx(lo,{sliderMarkRightOffset:-4,label:e("parameters:seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(YI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(YI(30))}})}function $Re(){const e=Oe(),{t}=Ge(),n=pe(r=>r.generation.seamStrength);return v.jsx(lo,{sliderMarkRightOffset:-7,label:t("parameters:seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(KI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(KI(.7))}})}const FRe=()=>v.jsxs(je,{direction:"column",gap:"1rem",children:[v.jsx(jRe,{}),v.jsx(NRe,{}),v.jsx($Re,{}),v.jsx(BRe,{})]});function zRe(){const{t:e}=Ge(),t={boundingBox:{header:`${e("parameters:boundingBoxHeader")}`,feature:so.BOUNDING_BOX,content:v.jsx(IRe,{})},seamCorrection:{header:`${e("parameters:seamCorrectionHeader")}`,feature:so.SEAM_CORRECTION,content:v.jsx(FRe,{})},infillAndScaling:{header:`${e("parameters:infillScalingHeader")}`,feature:so.INFILL_AND_SCALING,content:v.jsx(DRe,{})},seed:{header:`${e("parameters:seed")}`,feature:so.SEED,content:v.jsx(XP,{})},variations:{header:`${e("parameters:variations")}`,feature:so.VARIATIONS,content:v.jsx(QP,{}),additionalHeaderComponents:v.jsx(ZP,{})}};return v.jsxs(sT,{children:[v.jsxs(je,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(aT,{}),v.jsx(oT,{})]}),v.jsx(iT,{}),v.jsx(JP,{}),v.jsx(jY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),v.jsx(eT,{accordionInfo:t})]})}function HRe(){const e=pe(t=>t.ui.shouldUseCanvasBetaLayout);return v.jsx(KP,{optionsPanel:v.jsx(zRe,{}),styleClass:"inpainting-workarea-overrides",children:e?v.jsx(xRe,{}):v.jsx(ORe,{})})}const ns={txt2img:{title:v.jsx(x_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(IOe,{}),tooltip:"Text To Image"},img2img:{title:v.jsx(y_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(EOe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:v.jsx(C_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(HRe,{}),tooltip:"Unified Canvas"},nodes:{title:v.jsx(b_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(p_e,{}),tooltip:"Nodes"},postprocess:{title:v.jsx(S_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(g_e,{}),tooltip:"Post Processing"},training:{title:v.jsx(w_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(m_e,{}),tooltip:"Training"}};function VRe(){ns.txt2img.tooltip=Dt.t("common:text2img"),ns.img2img.tooltip=Dt.t("common:img2img"),ns.unifiedCanvas.tooltip=Dt.t("common:unifiedCanvas"),ns.nodes.tooltip=Dt.t("common:nodes"),ns.postprocess.tooltip=Dt.t("common:postProcessing"),ns.training.tooltip=Dt.t("common:training")}function WRe(){const e=pe(h_e),t=pe(o=>o.lightbox.isLightboxOpen);v_e(VRe);const n=Oe();et("1",()=>{n(Yo(0))}),et("2",()=>{n(Yo(1))}),et("3",()=>{n(Yo(2))}),et("4",()=>{n(Yo(3))}),et("5",()=>{n(Yo(4))}),et("6",()=>{n(Yo(5))}),et("z",()=>{n(Vm(!t))},[t]);const r=()=>{const o=[];return Object.keys(ns).forEach(a=>{o.push(v.jsx(yi,{hasArrow:!0,label:ns[a].tooltip,placement:"right",children:v.jsx(vW,{children:ns[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(ns).forEach(a=>{o.push(v.jsx(gW,{className:"app-tabs-panel",children:ns[a].workarea},a))}),o};return v.jsxs(pW,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(Yo(o))},children:[v.jsx("div",{className:"app-tabs-list",children:r()}),v.jsx(mW,{className:"app-tabs-panels",children:t?v.jsx(HAe,{}):i()})]})}var URe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Zy(e,t){var n=GRe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function GRe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=URe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var qRe=[".DS_Store","Thumbs.db"];function YRe(e){return x0(this,void 0,void 0,function(){return w0(this,function(t){return gS(e)&&KRe(e.dataTransfer)?[2,JRe(e.dataTransfer,e.type)]:XRe(e)?[2,ZRe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,QRe(e)]:[2,[]]})})}function KRe(e){return gS(e)}function XRe(e){return gS(e)&&gS(e.target)}function gS(e){return typeof e=="object"&&e!==null}function ZRe(e){return o_(e.target.files).map(function(t){return Zy(t)})}function QRe(e){return x0(this,void 0,void 0,function(){var t;return w0(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Zy(r)})]}})})}function JRe(e,t){return x0(this,void 0,void 0,function(){var n,r;return w0(this,function(i){switch(i.label){case 0:return e.items?(n=o_(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(eDe))]):[3,2];case 1:return r=i.sent(),[2,yN(aK(r))];case 2:return[2,yN(o_(e.files).map(function(o){return Zy(o)}))]}})})}function yN(e){return e.filter(function(t){return qRe.indexOf(t.name)===-1})}function o_(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,CN(n)];if(e.sizen)return[!1,CN(n)]}return[!0,null]}function _h(e){return e!=null}function mDe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=cK(l,n),d=fy(u,1),h=d[0],m=dK(l,r,i),y=fy(m,1),b=y[0],x=s?s(l):null;return h&&b&&!x})}function mS(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function t4(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function kN(e){e.preventDefault()}function vDe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function yDe(e){return e.indexOf("Edge/")!==-1}function bDe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return vDe(e)||yDe(e)}function Dl(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function NDe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var pT=w.forwardRef(function(e,t){var n=e.children,r=vS(e,kDe),i=mK(r),o=i.open,a=vS(i,EDe);return w.useImperativeHandle(t,function(){return{open:o}},[o]),N.createElement(w.Fragment,null,n(_r(_r({},a),{},{open:o})))});pT.displayName="Dropzone";var gK={disabled:!1,getFilesFromEvent:YRe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};pT.defaultProps=gK;pT.propTypes={children:jn.func,accept:jn.objectOf(jn.arrayOf(jn.string)),multiple:jn.bool,preventDropOnDocument:jn.bool,noClick:jn.bool,noKeyboard:jn.bool,noDrag:jn.bool,noDragEventsBubbling:jn.bool,minSize:jn.number,maxSize:jn.number,maxFiles:jn.number,disabled:jn.bool,getFilesFromEvent:jn.func,onFileDialogCancel:jn.func,onFileDialogOpen:jn.func,useFsAccessApi:jn.bool,autoFocus:jn.bool,onDragEnter:jn.func,onDragLeave:jn.func,onDragOver:jn.func,onDrop:jn.func,onDropAccepted:jn.func,onDropRejected:jn.func,onError:jn.func,validator:jn.func};var u_={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function mK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_r(_r({},gK),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,h=t.onDragOver,m=t.onDrop,y=t.onDropAccepted,b=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,E=t.useFsAccessApi,_=t.autoFocus,P=t.preventDropOnDocument,A=t.noClick,M=t.noKeyboard,R=t.noDrag,D=t.noDragEventsBubbling,j=t.onError,z=t.validator,H=w.useMemo(function(){return wDe(n)},[n]),K=w.useMemo(function(){return xDe(n)},[n]),te=w.useMemo(function(){return typeof k=="function"?k:PN},[k]),G=w.useMemo(function(){return typeof x=="function"?x:PN},[x]),$=w.useRef(null),W=w.useRef(null),X=w.useReducer(jDe,u_),Z=KC(X,2),U=Z[0],Q=Z[1],re=U.isFocused,he=U.isFileDialogActive,Ee=w.useRef(typeof window<"u"&&window.isSecureContext&&E&&SDe()),Ce=function(){!Ee.current&&he&&setTimeout(function(){if(W.current){var Ne=W.current.files;Ne.length||(Q({type:"closeDialog"}),G())}},300)};w.useEffect(function(){return window.addEventListener("focus",Ce,!1),function(){window.removeEventListener("focus",Ce,!1)}},[W,he,G,Ee]);var de=w.useRef([]),ze=function(Ne){$.current&&$.current.contains(Ne.target)||(Ne.preventDefault(),de.current=[])};w.useEffect(function(){return P&&(document.addEventListener("dragover",kN,!1),document.addEventListener("drop",ze,!1)),function(){P&&(document.removeEventListener("dragover",kN),document.removeEventListener("drop",ze))}},[$,P]),w.useEffect(function(){return!r&&_&&$.current&&$.current.focus(),function(){}},[$,_,r]);var Me=w.useCallback(function(Se){j?j(Se):console.error(Se)},[j]),rt=w.useCallback(function(Se){Se.preventDefault(),Se.persist(),ae(Se),de.current=[].concat(LDe(de.current),[Se.target]),t4(Se)&&Promise.resolve(i(Se)).then(function(Ne){if(!(mS(Se)&&!D)){var Ct=Ne.length,Nt=Ct>0&&mDe({files:Ne,accept:H,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:z}),Te=Ct>0&&!Nt;Q({isDragAccept:Nt,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),u&&u(Se)}}).catch(function(Ne){return Me(Ne)})},[i,u,Me,D,H,a,o,s,l,z]),We=w.useCallback(function(Se){Se.preventDefault(),Se.persist(),ae(Se);var Ne=t4(Se);if(Ne&&Se.dataTransfer)try{Se.dataTransfer.dropEffect="copy"}catch{}return Ne&&h&&h(Se),!1},[h,D]),Be=w.useCallback(function(Se){Se.preventDefault(),Se.persist(),ae(Se);var Ne=de.current.filter(function(Nt){return $.current&&$.current.contains(Nt)}),Ct=Ne.indexOf(Se.target);Ct!==-1&&Ne.splice(Ct,1),de.current=Ne,!(Ne.length>0)&&(Q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),t4(Se)&&d&&d(Se))},[$,d,D]),wt=w.useCallback(function(Se,Ne){var Ct=[],Nt=[];Se.forEach(function(Te){var At=cK(Te,H),He=KC(At,2),vt=He[0],nn=He[1],Rn=dK(Te,a,o),Ze=KC(Rn,2),xt=Ze[0],ht=Ze[1],Ht=z?z(Te):null;if(vt&&xt&&!Ht)Ct.push(Te);else{var rn=[nn,ht];Ht&&(rn=rn.concat(Ht)),Nt.push({file:Te,errors:rn.filter(function(gr){return gr})})}}),(!s&&Ct.length>1||s&&l>=1&&Ct.length>l)&&(Ct.forEach(function(Te){Nt.push({file:Te,errors:[gDe]})}),Ct.splice(0)),Q({acceptedFiles:Ct,fileRejections:Nt,type:"setFiles"}),m&&m(Ct,Nt,Ne),Nt.length>0&&b&&b(Nt,Ne),Ct.length>0&&y&&y(Ct,Ne)},[Q,s,H,a,o,l,m,y,b,z]),$e=w.useCallback(function(Se){Se.preventDefault(),Se.persist(),ae(Se),de.current=[],t4(Se)&&Promise.resolve(i(Se)).then(function(Ne){mS(Se)&&!D||wt(Ne,Se)}).catch(function(Ne){return Me(Ne)}),Q({type:"reset"})},[i,wt,Me,D]),at=w.useCallback(function(){if(Ee.current){Q({type:"openDialog"}),te();var Se={multiple:s,types:K};window.showOpenFilePicker(Se).then(function(Ne){return i(Ne)}).then(function(Ne){wt(Ne,null),Q({type:"closeDialog"})}).catch(function(Ne){CDe(Ne)?(G(Ne),Q({type:"closeDialog"})):_De(Ne)?(Ee.current=!1,W.current?(W.current.value=null,W.current.click()):Me(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Me(Ne)});return}W.current&&(Q({type:"openDialog"}),te(),W.current.value=null,W.current.click())},[Q,te,G,E,wt,Me,K,s]),bt=w.useCallback(function(Se){!$.current||!$.current.isEqualNode(Se.target)||(Se.key===" "||Se.key==="Enter"||Se.keyCode===32||Se.keyCode===13)&&(Se.preventDefault(),at())},[$,at]),Le=w.useCallback(function(){Q({type:"focus"})},[]),ut=w.useCallback(function(){Q({type:"blur"})},[]),Mt=w.useCallback(function(){A||(bDe()?setTimeout(at,0):at())},[A,at]),ct=function(Ne){return r?null:Ne},_t=function(Ne){return M?null:ct(Ne)},un=function(Ne){return R?null:ct(Ne)},ae=function(Ne){D&&Ne.stopPropagation()},De=w.useMemo(function(){return function(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=Se.refKey,Ct=Ne===void 0?"ref":Ne,Nt=Se.role,Te=Se.onKeyDown,At=Se.onFocus,He=Se.onBlur,vt=Se.onClick,nn=Se.onDragEnter,Rn=Se.onDragOver,Ze=Se.onDragLeave,xt=Se.onDrop,ht=vS(Se,PDe);return _r(_r(l_({onKeyDown:_t(Dl(Te,bt)),onFocus:_t(Dl(At,Le)),onBlur:_t(Dl(He,ut)),onClick:ct(Dl(vt,Mt)),onDragEnter:un(Dl(nn,rt)),onDragOver:un(Dl(Rn,We)),onDragLeave:un(Dl(Ze,Be)),onDrop:un(Dl(xt,$e)),role:typeof Nt=="string"&&Nt!==""?Nt:"presentation"},Ct,$),!r&&!M?{tabIndex:0}:{}),ht)}},[$,bt,Le,ut,Mt,rt,We,Be,$e,M,R,r]),Ke=w.useCallback(function(Se){Se.stopPropagation()},[]),Xe=w.useMemo(function(){return function(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=Se.refKey,Ct=Ne===void 0?"ref":Ne,Nt=Se.onChange,Te=Se.onClick,At=vS(Se,TDe),He=l_({accept:H,multiple:s,type:"file",style:{display:"none"},onChange:ct(Dl(Nt,$e)),onClick:ct(Dl(Te,Ke)),tabIndex:-1},Ct,W);return _r(_r({},He),At)}},[W,n,s,$e,r]);return _r(_r({},U),{},{isFocused:re&&!r,getRootProps:De,getInputProps:Xe,rootRef:$,inputRef:W,open:ct(at)})}function jDe(e,t){switch(t.type){case"focus":return _r(_r({},e),{},{isFocused:!0});case"blur":return _r(_r({},e),{},{isFocused:!1});case"openDialog":return _r(_r({},u_),{},{isFileDialogActive:!0});case"closeDialog":return _r(_r({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _r(_r({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _r(_r({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return _r({},u_);default:return e}}function PN(){}const BDe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return et("esc",()=>{i(!1)}),v.jsxs("div",{className:"dropzone-container",children:[t&&v.jsx("div",{className:"dropzone-overlay is-drag-accept",children:v.jsxs($h,{size:"lg",children:["Upload Image",r]})}),n&&v.jsxs("div",{className:"dropzone-overlay is-drag-reject",children:[v.jsx($h,{size:"lg",children:"Invalid Upload"}),v.jsx($h,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},$De=e=>{const{children:t}=e,n=Oe(),r=pe(Mr),i=Fy({}),{t:o}=Ge(),[a,s]=w.useState(!1),{setOpenUploader:l}=TP(),u=w.useCallback(P=>{s(!0);const A=P.errors.reduce((M,R)=>`${M} +${R.message}`,"");i({title:o("toast:uploadFailed"),description:A,status:"error",isClosable:!0})},[o,i]),d=w.useCallback(async P=>{n(SD({imageFile:P}))},[n]),h=w.useCallback((P,A)=>{A.forEach(M=>{u(M)}),P.forEach(M=>{d(M)})},[d,u]),{getRootProps:m,getInputProps:y,isDragAccept:b,isDragReject:x,isDragActive:k,open:E}=mK({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:()=>s(!0),maxFiles:1});l(E),w.useEffect(()=>{const P=A=>{var j;const M=(j=A.clipboardData)==null?void 0:j.items;if(!M)return;const R=[];for(const z of M)z.kind==="file"&&["image/png","image/jpg"].includes(z.type)&&R.push(z);if(!R.length)return;if(A.stopImmediatePropagation(),R.length>1){i({description:o("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=R[0].getAsFile();if(!D){i({description:o("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(SD({imageFile:D}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[o,n,i,r]);const _=["img2img","unifiedCanvas"].includes(r)?` to ${ns[r].tooltip}`:"";return v.jsx(PP.Provider,{value:E,children:v.jsxs("div",{...m({style:{}}),onKeyDown:P=>{P.key},children:[v.jsx("input",{...y()}),t,k&&a&&v.jsx(BDe,{isDragAccept:b,isDragReject:x,overlaySecondaryText:_,setIsHandlingUpload:s})]})})},FDe=lt(or,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),zDe=lt(or,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),HDe=()=>{const e=Oe(),t=pe(FDe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=pe(zDe),[o,a]=w.useState(!0),s=w.useRef(null);w.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(ZU()),e(LC(!n))};et("`",()=>{e(LC(!n))},[n]),et("esc",()=>{e(LC(!1))});const u=()=>{s.current&&o&&s.current.scrollTop{const{timestamp:m,message:y,level:b}=d;return v.jsxs("div",{className:`console-entry console-${b}-color`,children:[v.jsxs("p",{className:"console-timestamp",children:[m,":"]}),v.jsx("p",{className:"console-message",children:y})]},h)})})}),n&&v.jsx(yi,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:v.jsx(us,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:v.jsx(mEe,{}),onClick:()=>a(!o)})}),v.jsx(yi,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:v.jsx(us,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?v.jsx(OEe,{}):v.jsx(Eq,{}),onClick:l})})]})},VDe=lt(or,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),WDe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=pe(VDe),i=t?Math.round(t*100/n):0;return v.jsx(KV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function UDe(e){const{title:t,hotkey:n,description:r}=e;return v.jsxs("div",{className:"hotkey-modal-item",children:[v.jsxs("div",{className:"hotkey-info",children:[v.jsx("p",{className:"hotkey-title",children:t}),r&&v.jsx("p",{className:"hotkey-description",children:r})]}),v.jsx("div",{className:"hotkey-key",children:n})]})}function GDe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Yh(),{t:i}=Ge(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=d=>{const h=[];return d.forEach((m,y)=>{h.push(v.jsx(UDe,{title:m.title,description:m.desc,hotkey:m.hotkey},y))}),v.jsx("div",{className:"hotkey-modal-category",children:h})};return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:n}),v.jsxs(Qd,{isOpen:t,onClose:r,children:[v.jsx(Jd,{}),v.jsxs(tp,{className:" modal hotkeys-modal",children:[v.jsx(Dy,{className:"modal-close-btn"}),v.jsx("h1",{children:"Keyboard Shorcuts"}),v.jsx("div",{className:"hotkeys-modal-items",children:v.jsxs(dk,{allowMultiple:!0,children:[v.jsxs(Qg,{children:[v.jsxs(Xg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:appHotkeys")}),v.jsx(Zg,{})]}),v.jsx(Jg,{children:u(o)})]}),v.jsxs(Qg,{children:[v.jsxs(Xg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:generalHotkeys")}),v.jsx(Zg,{})]}),v.jsx(Jg,{children:u(a)})]}),v.jsxs(Qg,{children:[v.jsxs(Xg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:galleryHotkeys")}),v.jsx(Zg,{})]}),v.jsx(Jg,{children:u(s)})]}),v.jsxs(Qg,{children:[v.jsxs(Xg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),v.jsx(Zg,{})]}),v.jsx(Jg,{children:u(l)})]})]})})]})]})]})}var TN=Array.isArray,LN=Object.keys,qDe=Object.prototype.hasOwnProperty,YDe=typeof Element<"u";function c_(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=TN(e),r=TN(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!c_(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var h=LN(e);if(o=h.length,o!==LN(t).length)return!1;for(i=o;i--!==0;)if(!qDe.call(t,h[i]))return!1;if(YDe&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=h[i],!(a==="_owner"&&e.$$typeof)&&!c_(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var yd=function(t,n){try{return c_(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},KDe=function(t){return XDe(t)&&!ZDe(t)};function XDe(e){return!!e&&typeof e=="object"}function ZDe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||eNe(e)}var QDe=typeof Symbol=="function"&&Symbol.for,JDe=QDe?Symbol.for("react.element"):60103;function eNe(e){return e.$$typeof===JDe}function tNe(e){return Array.isArray(e)?[]:{}}function yS(e,t){return t.clone!==!1&&t.isMergeableObject(e)?hy(tNe(e),e,t):e}function nNe(e,t,n){return e.concat(t).map(function(r){return yS(r,n)})}function rNe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=yS(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=yS(t[i],n):r[i]=hy(e[i],t[i],n)}),r}function hy(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||nNe,n.isMergeableObject=n.isMergeableObject||KDe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):rNe(e,t,n):yS(t,n)}hy.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return hy(r,i,n)},{})};var d_=hy,iNe=typeof global=="object"&&global&&global.Object===Object&&global;const vK=iNe;var oNe=typeof self=="object"&&self&&self.Object===Object&&self,aNe=vK||oNe||Function("return this")();const yu=aNe;var sNe=yu.Symbol;const of=sNe;var yK=Object.prototype,lNe=yK.hasOwnProperty,uNe=yK.toString,Sv=of?of.toStringTag:void 0;function cNe(e){var t=lNe.call(e,Sv),n=e[Sv];try{e[Sv]=void 0;var r=!0}catch{}var i=uNe.call(e);return r&&(t?e[Sv]=n:delete e[Sv]),i}var dNe=Object.prototype,fNe=dNe.toString;function hNe(e){return fNe.call(e)}var pNe="[object Null]",gNe="[object Undefined]",AN=of?of.toStringTag:void 0;function Ep(e){return e==null?e===void 0?gNe:pNe:AN&&AN in Object(e)?cNe(e):hNe(e)}function bK(e,t){return function(n){return e(t(n))}}var mNe=bK(Object.getPrototypeOf,Object);const gT=mNe;function Pp(e){return e!=null&&typeof e=="object"}var vNe="[object Object]",yNe=Function.prototype,bNe=Object.prototype,SK=yNe.toString,SNe=bNe.hasOwnProperty,xNe=SK.call(Object);function ON(e){if(!Pp(e)||Ep(e)!=vNe)return!1;var t=gT(e);if(t===null)return!0;var n=SNe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&SK.call(n)==xNe}function wNe(){this.__data__=[],this.size=0}function xK(e,t){return e===t||e!==e&&t!==t}function gw(e,t){for(var n=e.length;n--;)if(xK(e[n][0],t))return n;return-1}var CNe=Array.prototype,_Ne=CNe.splice;function kNe(e){var t=this.__data__,n=gw(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():_Ne.call(t,n,1),--this.size,!0}function ENe(e){var t=this.__data__,n=gw(t,e);return n<0?void 0:t[n][1]}function PNe(e){return gw(this.__data__,e)>-1}function TNe(e,t){var n=this.__data__,r=gw(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function bc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=Dje}var Nje="[object Arguments]",jje="[object Array]",Bje="[object Boolean]",$je="[object Date]",Fje="[object Error]",zje="[object Function]",Hje="[object Map]",Vje="[object Number]",Wje="[object Object]",Uje="[object RegExp]",Gje="[object Set]",qje="[object String]",Yje="[object WeakMap]",Kje="[object ArrayBuffer]",Xje="[object DataView]",Zje="[object Float32Array]",Qje="[object Float64Array]",Jje="[object Int8Array]",eBe="[object Int16Array]",tBe="[object Int32Array]",nBe="[object Uint8Array]",rBe="[object Uint8ClampedArray]",iBe="[object Uint16Array]",oBe="[object Uint32Array]",lr={};lr[Zje]=lr[Qje]=lr[Jje]=lr[eBe]=lr[tBe]=lr[nBe]=lr[rBe]=lr[iBe]=lr[oBe]=!0;lr[Nje]=lr[jje]=lr[Kje]=lr[Bje]=lr[Xje]=lr[$je]=lr[Fje]=lr[zje]=lr[Hje]=lr[Vje]=lr[Wje]=lr[Uje]=lr[Gje]=lr[qje]=lr[Yje]=!1;function aBe(e){return Pp(e)&&TK(e.length)&&!!lr[Ep(e)]}function mT(e){return function(t){return e(t)}}var LK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,y2=LK&&typeof module=="object"&&module&&!module.nodeType&&module,sBe=y2&&y2.exports===LK,ZC=sBe&&vK.process,lBe=function(){try{var e=y2&&y2.require&&y2.require("util").types;return e||ZC&&ZC.binding&&ZC.binding("util")}catch{}}();const p0=lBe;var jN=p0&&p0.isTypedArray,uBe=jN?mT(jN):aBe;const cBe=uBe;var dBe=Object.prototype,fBe=dBe.hasOwnProperty;function AK(e,t){var n=Jy(e),r=!n&&Eje(e),i=!n&&!r&&PK(e),o=!n&&!r&&!i&&cBe(e),a=n||r||i||o,s=a?xje(e.length,String):[],l=s.length;for(var u in e)(t||fBe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Rje(u,l)))&&s.push(u);return s}var hBe=Object.prototype;function vT(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||hBe;return e===n}var pBe=bK(Object.keys,Object);const gBe=pBe;var mBe=Object.prototype,vBe=mBe.hasOwnProperty;function yBe(e){if(!vT(e))return gBe(e);var t=[];for(var n in Object(e))vBe.call(e,n)&&n!="constructor"&&t.push(n);return t}function OK(e){return e!=null&&TK(e.length)&&!wK(e)}function yT(e){return OK(e)?AK(e):yBe(e)}function bBe(e,t){return e&&vw(t,yT(t),e)}function SBe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var xBe=Object.prototype,wBe=xBe.hasOwnProperty;function CBe(e){if(!Qy(e))return SBe(e);var t=vT(e),n=[];for(var r in e)r=="constructor"&&(t||!wBe.call(e,r))||n.push(r);return n}function bT(e){return OK(e)?AK(e,!0):CBe(e)}function _Be(e,t){return e&&vw(t,bT(t),e)}var MK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,BN=MK&&typeof module=="object"&&module&&!module.nodeType&&module,kBe=BN&&BN.exports===MK,$N=kBe?yu.Buffer:void 0,FN=$N?$N.allocUnsafe:void 0;function EBe(e,t){if(t)return e.slice();var n=e.length,r=FN?FN(n):new e.constructor(n);return e.copy(r),r}function IK(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function nj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var rj=function(t){return Array.isArray(t)&&t.length===0},qo=function(t){return typeof t=="function"},yw=function(t){return t!==null&&typeof t=="object"},_Fe=function(t){return String(Math.floor(Number(t)))===t},QC=function(t){return Object.prototype.toString.call(t)==="[object String]"},WK=function(t){return w.Children.count(t)===0},JC=function(t){return yw(t)&&qo(t.then)};function qi(e,t,n,r){r===void 0&&(r=0);for(var i=VK(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function UK(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?De.map(function(Xe){return j(Xe,qi(ae,Xe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ke).then(function(Xe){return Xe.reduce(function(Se,Ne,Ct){return Ne==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ne&&(Se=au(Se,De[Ct],Ne)),Se},{})})},[j]),H=w.useCallback(function(ae){return Promise.all([z(ae),m.validationSchema?D(ae):{},m.validate?R(ae):{}]).then(function(De){var Ke=De[0],Xe=De[1],Se=De[2],Ne=d_.all([Ke,Xe,Se],{arrayMerge:AFe});return Ne})},[m.validate,m.validationSchema,z,R,D]),K=Xa(function(ae){return ae===void 0&&(ae=A.values),M({type:"SET_ISVALIDATING",payload:!0}),H(ae).then(function(De){return E.current&&(M({type:"SET_ISVALIDATING",payload:!1}),M({type:"SET_ERRORS",payload:De})),De})});w.useEffect(function(){a&&E.current===!0&&yd(y.current,m.initialValues)&&K(y.current)},[a,K]);var te=w.useCallback(function(ae){var De=ae&&ae.values?ae.values:y.current,Ke=ae&&ae.errors?ae.errors:b.current?b.current:m.initialErrors||{},Xe=ae&&ae.touched?ae.touched:x.current?x.current:m.initialTouched||{},Se=ae&&ae.status?ae.status:k.current?k.current:m.initialStatus;y.current=De,b.current=Ke,x.current=Xe,k.current=Se;var Ne=function(){M({type:"RESET_FORM",payload:{isSubmitting:!!ae&&!!ae.isSubmitting,errors:Ke,touched:Xe,status:Se,values:De,isValidating:!!ae&&!!ae.isValidating,submitCount:ae&&ae.submitCount&&typeof ae.submitCount=="number"?ae.submitCount:0}})};if(m.onReset){var Ct=m.onReset(A.values,$e);JC(Ct)?Ct.then(Ne):Ne()}else Ne()},[m.initialErrors,m.initialStatus,m.initialTouched]);w.useEffect(function(){E.current===!0&&!yd(y.current,m.initialValues)&&(u&&(y.current=m.initialValues,te()),a&&K(y.current))},[u,m.initialValues,te,a,K]),w.useEffect(function(){u&&E.current===!0&&!yd(b.current,m.initialErrors)&&(b.current=m.initialErrors||hh,M({type:"SET_ERRORS",payload:m.initialErrors||hh}))},[u,m.initialErrors]),w.useEffect(function(){u&&E.current===!0&&!yd(x.current,m.initialTouched)&&(x.current=m.initialTouched||n4,M({type:"SET_TOUCHED",payload:m.initialTouched||n4}))},[u,m.initialTouched]),w.useEffect(function(){u&&E.current===!0&&!yd(k.current,m.initialStatus)&&(k.current=m.initialStatus,M({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var G=Xa(function(ae){if(_.current[ae]&&qo(_.current[ae].validate)){var De=qi(A.values,ae),Ke=_.current[ae].validate(De);return JC(Ke)?(M({type:"SET_ISVALIDATING",payload:!0}),Ke.then(function(Xe){return Xe}).then(function(Xe){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Xe}}),M({type:"SET_ISVALIDATING",payload:!1})})):(M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Ke}}),Promise.resolve(Ke))}else if(m.validationSchema)return M({type:"SET_ISVALIDATING",payload:!0}),D(A.values,ae).then(function(Xe){return Xe}).then(function(Xe){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:Xe[ae]}}),M({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),$=w.useCallback(function(ae,De){var Ke=De.validate;_.current[ae]={validate:Ke}},[]),W=w.useCallback(function(ae){delete _.current[ae]},[]),X=Xa(function(ae,De){M({type:"SET_TOUCHED",payload:ae});var Ke=De===void 0?i:De;return Ke?K(A.values):Promise.resolve()}),Z=w.useCallback(function(ae){M({type:"SET_ERRORS",payload:ae})},[]),U=Xa(function(ae,De){var Ke=qo(ae)?ae(A.values):ae;M({type:"SET_VALUES",payload:Ke});var Xe=De===void 0?n:De;return Xe?K(Ke):Promise.resolve()}),Q=w.useCallback(function(ae,De){M({type:"SET_FIELD_ERROR",payload:{field:ae,value:De}})},[]),re=Xa(function(ae,De,Ke){M({type:"SET_FIELD_VALUE",payload:{field:ae,value:De}});var Xe=Ke===void 0?n:Ke;return Xe?K(au(A.values,ae,De)):Promise.resolve()}),he=w.useCallback(function(ae,De){var Ke=De,Xe=ae,Se;if(!QC(ae)){ae.persist&&ae.persist();var Ne=ae.target?ae.target:ae.currentTarget,Ct=Ne.type,Nt=Ne.name,Te=Ne.id,At=Ne.value,He=Ne.checked,vt=Ne.outerHTML,nn=Ne.options,Rn=Ne.multiple;Ke=De||Nt||Te,Xe=/number|range/.test(Ct)?(Se=parseFloat(At),isNaN(Se)?"":Se):/checkbox/.test(Ct)?MFe(qi(A.values,Ke),He,At):nn&&Rn?OFe(nn):At}Ke&&re(Ke,Xe)},[re,A.values]),Ee=Xa(function(ae){if(QC(ae))return function(De){return he(De,ae)};he(ae)}),Ce=Xa(function(ae,De,Ke){De===void 0&&(De=!0),M({type:"SET_FIELD_TOUCHED",payload:{field:ae,value:De}});var Xe=Ke===void 0?i:Ke;return Xe?K(A.values):Promise.resolve()}),de=w.useCallback(function(ae,De){ae.persist&&ae.persist();var Ke=ae.target,Xe=Ke.name,Se=Ke.id,Ne=Ke.outerHTML,Ct=De||Xe||Se;Ce(Ct,!0)},[Ce]),ze=Xa(function(ae){if(QC(ae))return function(De){return de(De,ae)};de(ae)}),Me=w.useCallback(function(ae){qo(ae)?M({type:"SET_FORMIK_STATE",payload:ae}):M({type:"SET_FORMIK_STATE",payload:function(){return ae}})},[]),rt=w.useCallback(function(ae){M({type:"SET_STATUS",payload:ae})},[]),We=w.useCallback(function(ae){M({type:"SET_ISSUBMITTING",payload:ae})},[]),Be=Xa(function(){return M({type:"SUBMIT_ATTEMPT"}),K().then(function(ae){var De=ae instanceof Error,Ke=!De&&Object.keys(ae).length===0;if(Ke){var Xe;try{if(Xe=at(),Xe===void 0)return}catch(Se){throw Se}return Promise.resolve(Xe).then(function(Se){return E.current&&M({type:"SUBMIT_SUCCESS"}),Se}).catch(function(Se){if(E.current)throw M({type:"SUBMIT_FAILURE"}),Se})}else if(E.current&&(M({type:"SUBMIT_FAILURE"}),De))throw ae})}),wt=Xa(function(ae){ae&&ae.preventDefault&&qo(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&qo(ae.stopPropagation)&&ae.stopPropagation(),Be().catch(function(De){console.warn("Warning: An unhandled error was caught from submitForm()",De)})}),$e={resetForm:te,validateForm:K,validateField:G,setErrors:Z,setFieldError:Q,setFieldTouched:Ce,setFieldValue:re,setStatus:rt,setSubmitting:We,setTouched:X,setValues:U,setFormikState:Me,submitForm:Be},at=Xa(function(){return d(A.values,$e)}),bt=Xa(function(ae){ae&&ae.preventDefault&&qo(ae.preventDefault)&&ae.preventDefault(),ae&&ae.stopPropagation&&qo(ae.stopPropagation)&&ae.stopPropagation(),te()}),Le=w.useCallback(function(ae){return{value:qi(A.values,ae),error:qi(A.errors,ae),touched:!!qi(A.touched,ae),initialValue:qi(y.current,ae),initialTouched:!!qi(x.current,ae),initialError:qi(b.current,ae)}},[A.errors,A.touched,A.values]),ut=w.useCallback(function(ae){return{setValue:function(Ke,Xe){return re(ae,Ke,Xe)},setTouched:function(Ke,Xe){return Ce(ae,Ke,Xe)},setError:function(Ke){return Q(ae,Ke)}}},[re,Ce,Q]),Mt=w.useCallback(function(ae){var De=yw(ae),Ke=De?ae.name:ae,Xe=qi(A.values,Ke),Se={name:Ke,value:Xe,onChange:Ee,onBlur:ze};if(De){var Ne=ae.type,Ct=ae.value,Nt=ae.as,Te=ae.multiple;Ne==="checkbox"?Ct===void 0?Se.checked=!!Xe:(Se.checked=!!(Array.isArray(Xe)&&~Xe.indexOf(Ct)),Se.value=Ct):Ne==="radio"?(Se.checked=Xe===Ct,Se.value=Ct):Nt==="select"&&Te&&(Se.value=Se.value||[],Se.multiple=!0)}return Se},[ze,Ee,A.values]),ct=w.useMemo(function(){return!yd(y.current,A.values)},[y.current,A.values]),_t=w.useMemo(function(){return typeof s<"u"?ct?A.errors&&Object.keys(A.errors).length===0:s!==!1&&qo(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,ct,A.errors,m]),un=qn({},A,{initialValues:y.current,initialErrors:b.current,initialTouched:x.current,initialStatus:k.current,handleBlur:ze,handleChange:Ee,handleReset:bt,handleSubmit:wt,resetForm:te,setErrors:Z,setFormikState:Me,setFieldTouched:Ce,setFieldValue:re,setFieldError:Q,setStatus:rt,setSubmitting:We,setTouched:X,setValues:U,submitForm:Be,validateForm:K,validateField:G,isValid:_t,dirty:ct,unregisterField:W,registerField:$,getFieldProps:Mt,getFieldMeta:Le,getFieldHelpers:ut,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return un}function e3(e){var t=PFe(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return w.useImperativeHandle(o,function(){return t}),w.createElement(kFe,{value:t},n?w.createElement(n,t):i?i(t):r?qo(r)?r(t):WK(r)?null:w.Children.only(r):null)}function TFe(e){var t={};if(e.inner){if(e.inner.length===0)return au(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;qi(t,a.path)||(t=au(t,a.path,a.message))}}return t}function LFe(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=m_(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function m_(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||ON(i)?m_(i):i!==""?i:void 0}):ON(e[r])?t[r]=m_(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function AFe(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?d_(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=d_(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function OFe(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function MFe(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var IFe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function Xa(e){var t=w.useRef(e);return IFe(function(){t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(qn({},t,{length:n+1}))}else return[]},BFe=function(e){CFe(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,d=l.formik.setFormikState;d(function(h){var m=typeof s=="function"?s:o,y=typeof a=="function"?a:o,b=au(h.values,u,o(qi(h.values,u))),x=s?m(qi(h.errors,u)):void 0,k=a?y(qi(h.touched,u)):void 0;return rj(x)&&(x=void 0),rj(k)&&(k=void 0),qn({},h,{values:b,errors:s?au(h.errors,u,x):h.errors,touched:a?au(h.touched,u,k):h.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(g0(a),[wFe(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return NFe(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return DFe(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return e7(s,o,a)},function(s){return e7(s,o,null)},function(s){return e7(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return jFe(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(nj(i)),i.pop=i.pop.bind(nj(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!yd(qi(i.formik.values,i.name),qi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?g0(a):[];return o||(o=s[i]),qo(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,d=o.formik,h=Ih(d,["validate","validationSchema"]),m=qn({},i,{form:h,name:u});return a?w.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):WK(l)?null:w.Children.only(l):null},t}(w.Component);BFe.defaultProps={validateOnChange:!0};function $Fe(e){const{model:t}=e,r=pe(b=>b.system.model_list)[t],i=Oe(),{t:o}=Ge(),a=pe(b=>b.system.isProcessing),s=pe(b=>b.system.isConnected),[l,u]=w.useState("same"),[d,h]=w.useState("");w.useEffect(()=>{u("same")},[t]);const m=()=>{u("same")},y=()=>{i(r_e({model_name:t,save_location:l,custom_location:l==="custom"&&d!==""?d:null}))};return v.jsxs(fw,{title:`${o("modelmanager:convert")} ${t}`,acceptCallback:y,cancelCallback:m,acceptButtonText:`${o("modelmanager:convert")}`,triggerComponent:v.jsxs(nr,{size:"sm","aria-label":o("modelmanager:convertToDiffusers"),isDisabled:r.status==="active"||a||!s,className:" modal-close-btn",marginRight:"2rem",children:["🧨 ",o("modelmanager:convertToDiffusers")]}),motionPreset:"slideInBottom",children:[v.jsxs(je,{flexDirection:"column",rowGap:4,children:[v.jsx(Yt,{children:o("modelmanager:convertToDiffusersHelpText1")}),v.jsxs(wF,{children:[v.jsx(Cv,{children:o("modelmanager:convertToDiffusersHelpText2")}),v.jsx(Cv,{children:o("modelmanager:convertToDiffusersHelpText3")}),v.jsx(Cv,{children:o("modelmanager:convertToDiffusersHelpText4")}),v.jsx(Cv,{children:o("modelmanager:convertToDiffusersHelpText5")})]}),v.jsx(Yt,{children:o("modelmanager:convertToDiffusersHelpText6")})]}),v.jsxs(je,{flexDir:"column",gap:4,children:[v.jsxs(je,{marginTop:"1rem",flexDir:"column",gap:2,children:[v.jsx(Yt,{fontWeight:"bold",children:o("modelmanager:convertToDiffusersSaveLocation")}),v.jsx(HE,{value:l,onChange:b=>u(b),children:v.jsxs(je,{gap:4,children:[v.jsx(Td,{value:"same",children:v.jsx(yi,{label:"Save converted model in the same folder",children:o("modelmanager:sameFolder")})}),v.jsx(Td,{value:"root",children:v.jsx(yi,{label:"Save converted model in the InvokeAI root folder",children:o("modelmanager:invokeRoot")})}),v.jsx(Td,{value:"custom",children:v.jsx(yi,{label:"Save converted model in a custom folder",children:o("modelmanager:custom")})})]})})]}),l==="custom"&&v.jsxs(je,{flexDirection:"column",rowGap:2,children:[v.jsx(Yt,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:o("modelmanager:customSaveLocation")}),v.jsx(fr,{value:d,onChange:b=>{b.target.value!==""&&h(b.target.value)},width:"25rem"})]})]})]})}const FFe=lt([or],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),ij=64,oj=2048;function zFe(){const{openModel:e,model_list:t}=pe(FFe),n=pe(l=>l.system.isProcessing),r=Oe(),{t:i}=Ge(),[o,a]=w.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});w.useEffect(()=>{var l,u,d,h,m,y,b;if(e){const x=ke.pickBy(t,(k,E)=>ke.isEqual(E,e));a({name:e,description:(l=x[e])==null?void 0:l.description,config:(u=x[e])==null?void 0:u.config,weights:(d=x[e])==null?void 0:d.weights,vae:(h=x[e])==null?void 0:h.vae,width:(m=x[e])==null?void 0:m.width,height:(y=x[e])==null?void 0:y.height,default:(b=x[e])==null?void 0:b.default,format:"ckpt"})}},[t,e]);const s=l=>{r(Uy({...l,width:Number(l.width),height:Number(l.height)}))};return e?v.jsxs(je,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[v.jsxs(je,{alignItems:"center",gap:4,justifyContent:"space-between",children:[v.jsx(Yt,{fontSize:"lg",fontWeight:"bold",children:e}),v.jsx($Fe,{model:e})]}),v.jsx(je,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:v.jsx(e3,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>v.jsx("form",{onSubmit:l,children:v.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[v.jsxs(fn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?v.jsx(cr,{children:u.description}):v.jsx(ur,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.config&&d.config,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"config",name:"config",type:"text",width:"lg"}),u.config&&d.config?v.jsx(cr,{children:u.config}):v.jsx(ur,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.weights&&d.weights,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"weights",name:"weights",type:"text",width:"lg"}),u.weights&&d.weights?v.jsx(cr,{children:u.weights}):v.jsx(ur,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.vae&&d.vae,children:[v.jsx(En,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae",name:"vae",type:"text",width:"lg"}),u.vae&&d.vae?v.jsx(cr,{children:u.vae}):v.jsx(ur,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(Ty,{width:"100%",children:[v.jsxs(fn,{isInvalid:!!u.width&&d.width,children:[v.jsx(En,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"width",name:"width",children:({field:h,form:m})=>v.jsx(ia,{id:"width",name:"width",min:ij,max:oj,step:64,value:m.values.width,onChange:y=>m.setFieldValue(h.name,Number(y))})}),u.width&&d.width?v.jsx(cr,{children:u.width}):v.jsx(ur,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.height&&d.height,children:[v.jsx(En,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"height",name:"height",children:({field:h,form:m})=>v.jsx(ia,{id:"height",name:"height",min:ij,max:oj,step:64,value:m.values.height,onChange:y=>m.setFieldValue(h.name,Number(y))})}),u.height&&d.height?v.jsx(cr,{children:u.height}):v.jsx(ur,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):v.jsx(je,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:v.jsx(Yt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const HFe=lt([or],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function VFe(){const{openModel:e,model_list:t}=pe(HFe),n=pe(l=>l.system.isProcessing),r=Oe(),{t:i}=Ge(),[o,a]=w.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});w.useEffect(()=>{var l,u,d,h,m,y,b,x,k,E,_,P,A,M,R,D;if(e){const j=ke.pickBy(t,(z,H)=>ke.isEqual(H,e));a({name:e,description:(l=j[e])==null?void 0:l.description,path:(u=j[e])!=null&&u.path&&((d=j[e])==null?void 0:d.path)!=="None"?(h=j[e])==null?void 0:h.path:"",repo_id:(m=j[e])!=null&&m.repo_id&&((y=j[e])==null?void 0:y.repo_id)!=="None"?(b=j[e])==null?void 0:b.repo_id:"",vae:{repo_id:(k=(x=j[e])==null?void 0:x.vae)!=null&&k.repo_id?(_=(E=j[e])==null?void 0:E.vae)==null?void 0:_.repo_id:"",path:(A=(P=j[e])==null?void 0:P.vae)!=null&&A.path?(R=(M=j[e])==null?void 0:M.vae)==null?void 0:R.path:""},default:(D=j[e])==null?void 0:D.default,format:"diffusers"})}},[t,e]);const s=l=>{const u=l;l.path===""&&delete u.path,l.repo_id===""&&delete u.repo_id,l.vae.path===""&&delete u.vae.path,l.vae.repo_id===""&&delete u.vae.repo_id,r(Uy(l))};return e?v.jsxs(je,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[v.jsx(je,{alignItems:"center",children:v.jsx(Yt,{fontSize:"lg",fontWeight:"bold",children:e})}),v.jsx(je,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:v.jsx(e3,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>{var h,m,y,b,x,k,E,_,P,A;return v.jsx("form",{onSubmit:l,children:v.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[v.jsxs(fn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?v.jsx(cr,{children:u.description}):v.jsx(ur,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.path&&d.path,isRequired:!0,children:[v.jsx(En,{htmlFor:"path",fontSize:"sm",children:i("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"path",name:"path",type:"text",width:"lg"}),u.path&&d.path?v.jsx(cr,{children:u.path}):v.jsx(ur,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!u.repo_id&&d.repo_id,children:[v.jsx(En,{htmlFor:"repo_id",fontSize:"sm",children:i("modelmanager:repo_id")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"repo_id",name:"repo_id",type:"text",width:"lg"}),u.repo_id&&d.repo_id?v.jsx(cr,{children:u.repo_id}):v.jsx(ur,{margin:0,children:i("modelmanager:repoIDValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!((h=u.vae)!=null&&h.path)&&((m=d.vae)==null?void 0:m.path),children:[v.jsx(En,{htmlFor:"vae.path",fontSize:"sm",children:i("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.path",name:"vae.path",type:"text",width:"lg"}),(y=u.vae)!=null&&y.path&&((b=d.vae)!=null&&b.path)?v.jsx(cr,{children:(x=u.vae)==null?void 0:x.path}):v.jsx(ur,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!((k=u.vae)!=null&&k.repo_id)&&((E=d.vae)==null?void 0:E.repo_id),children:[v.jsx(En,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelmanager:vaeRepoID")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"lg"}),(_=u.vae)!=null&&_.repo_id&&((P=d.vae)!=null&&P.repo_id)?v.jsx(cr,{children:(A=u.vae)==null?void 0:A.repo_id}):v.jsx(ur,{margin:0,children:i("modelmanager:vaeRepoIDValidationMsg")})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})}})})]}):v.jsx(je,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:v.jsx(Yt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const qK=lt([or],e=>{const{model_list:t}=e,n=[];return ke.forEach(t,r=>{n.push(r.weights)}),n});function WFe(){const{t:e}=Ge();return v.jsx(Eo,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function aj({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=pe(qK),i=o=>{t.includes(o.target.value)?n(ke.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return v.jsxs(Eo,{position:"relative",children:[r.includes(e.location)?v.jsx(WFe,{}):null,v.jsx(er,{value:e.name,label:v.jsx(v.Fragment,{children:v.jsxs(yn,{alignItems:"start",children:[v.jsx("p",{style:{fontWeight:"bold"},children:e.name}),v.jsx("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function UFe(){const e=Oe(),{t}=Ge(),n=pe(P=>P.system.searchFolder),r=pe(P=>P.system.foundModels),i=pe(qK),o=pe(P=>P.ui.shouldShowExistingModelsInSearch),a=pe(P=>P.system.isProcessing),[s,l]=N.useState([]),[u,d]=N.useState("v1"),[h,m]=N.useState(""),y=()=>{e(QU(null)),e(JU(null)),l([])},b=P=>{e(yD(P.checkpointFolder))},x=()=>{l([]),r&&r.forEach(P=>{i.includes(P.location)||l(A=>[...A,P.name])})},k=()=>{l([])},E=()=>{const P=r==null?void 0:r.filter(M=>s.includes(M.name)),A={v1:"configs/stable-diffusion/v1-inference.yaml",v2:"configs/stable-diffusion/v2-inference-v.yaml",inpainting:"configs/stable-diffusion/v1-inpainting-inference.yaml",custom:h};P==null||P.forEach(M=>{const R={name:M.name,description:"",config:A[u],weights:M.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(Uy(R))}),l([])},_=()=>{const P=[],A=[];return r&&r.forEach((M,R)=>{i.includes(M.location)?A.push(v.jsx(aj,{model:M,modelsToAdd:s,setModelsToAdd:l},R)):P.push(v.jsx(aj,{model:M,modelsToAdd:s,setModelsToAdd:l},R))}),v.jsxs(v.Fragment,{children:[P,o&&A]})};return v.jsxs(v.Fragment,{children:[n?v.jsxs(je,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[v.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),v.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),v.jsx(Je,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:v.jsx(Yx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(yD(n))}),v.jsx(Je,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:v.jsx(qy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:y})]}):v.jsx(e3,{initialValues:{checkpointFolder:""},onSubmit:P=>{b(P)},children:({handleSubmit:P})=>v.jsx("form",{onSubmit:P,children:v.jsxs(Ty,{columnGap:"0.5rem",children:[v.jsx(fn,{isRequired:!0,width:"max-content",children:v.jsx(dr,{as:fr,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),v.jsx(Je,{icon:v.jsx(oPe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&v.jsxs(je,{flexDirection:"column",rowGap:"1rem",children:[v.jsxs(je,{justifyContent:"space-between",alignItems:"center",children:[v.jsxs("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),v.jsxs("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),v.jsxs(je,{columnGap:"0.5rem",justifyContent:"space-between",children:[v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(nr,{isDisabled:s.length===r.length,onClick:x,children:t("modelmanager:selectAll")}),v.jsx(nr,{isDisabled:s.length===0,onClick:k,children:t("modelmanager:deselectAll")}),v.jsx(er,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(LCe(!o))})]}),v.jsx(nr,{isDisabled:s.length===0,onClick:E,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),v.jsxs(je,{gap:4,backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",flexDirection:"column",children:[v.jsxs(je,{gap:4,children:[v.jsx(Yt,{fontWeight:"bold",color:"var(--text-color-secondary)",children:"Pick Model Type:"}),v.jsx(HE,{value:u,onChange:P=>d(P),defaultValue:"v1",name:"model_type",children:v.jsxs(je,{gap:4,children:[v.jsx(Td,{value:"v1",children:t("modelmanager:v1")}),v.jsx(Td,{value:"v2",children:t("modelmanager:v2")}),v.jsx(Td,{value:"inpainting",children:t("modelmanager:inpainting")}),v.jsx(Td,{value:"custom",children:t("modelmanager:customConfig")})]})})]}),u==="custom"&&v.jsxs(je,{flexDirection:"column",rowGap:2,children:[v.jsx(Yt,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:t("modelmanager:pathToCustomConfig")}),v.jsx(fr,{value:h,onChange:P=>{P.target.value!==""&&m(P.target.value)},width:"42.5rem"})]})]}),v.jsxs(je,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&v.jsx(Yt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):v.jsx(Yt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),_()]})]})]})}const sj=64,lj=2048;function GFe(){const e=Oe(),{t}=Ge(),n=pe(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(u){let d;return r(u)&&(d=t("modelmanager:cannotUseSpaces")),d}const o={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=u=>{e(Uy(u)),e(Uh(null))},[s,l]=N.useState(!1);return v.jsxs(v.Fragment,{children:[v.jsx(Je,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Uh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:v.jsx(lq,{})}),v.jsx(UFe,{}),v.jsx(er,{label:t("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&v.jsx(e3,{initialValues:o,onSubmit:a,children:({handleSubmit:u,errors:d,touched:h})=>v.jsx("form",{onSubmit:u,children:v.jsxs(yn,{rowGap:"0.5rem",children:[v.jsx(Yt,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelmanager:manual")}),v.jsxs(fn,{isInvalid:!!d.name&&h.name,isRequired:!0,children:[v.jsx(En,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),d.name&&h.name?v.jsx(cr,{children:d.name}):v.jsx(ur,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.description&&h.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"2xl"}),d.description&&h.description?v.jsx(cr,{children:d.description}):v.jsx(ur,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.config&&h.config,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:config")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"config",name:"config",type:"text",width:"2xl"}),d.config&&h.config?v.jsx(cr,{children:d.config}):v.jsx(ur,{margin:0,children:t("modelmanager:configValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.weights&&h.weights,isRequired:!0,children:[v.jsx(En,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"weights",name:"weights",type:"text",width:"2xl"}),d.weights&&h.weights?v.jsx(cr,{children:d.weights}):v.jsx(ur,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.vae&&h.vae,children:[v.jsx(En,{htmlFor:"vae",fontSize:"sm",children:t("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae",name:"vae",type:"text",width:"2xl"}),d.vae&&h.vae?v.jsx(cr,{children:d.vae}):v.jsx(ur,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(Ty,{width:"100%",children:[v.jsxs(fn,{isInvalid:!!d.width&&h.width,children:[v.jsx(En,{htmlFor:"width",fontSize:"sm",children:t("modelmanager:width")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"width",name:"width",children:({field:m,form:y})=>v.jsx(ia,{id:"width",name:"width",min:sj,max:lj,step:64,width:"90%",value:y.values.width,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.width&&h.width?v.jsx(cr,{children:d.width}):v.jsx(ur,{margin:0,children:t("modelmanager:widthValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!d.height&&h.height,children:[v.jsx(En,{htmlFor:"height",fontSize:"sm",children:t("modelmanager:height")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"height",name:"height",children:({field:m,form:y})=>v.jsx(ia,{id:"height",name:"height",min:sj,max:lj,width:"90%",step:64,value:y.values.height,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.height&&h.height?v.jsx(cr,{children:d.height}):v.jsx(ur,{margin:0,children:t("modelmanager:heightValidationMsg")})]})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})})]})}function r4({children:e}){return v.jsx(je,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:e})}function qFe(){const e=Oe(),{t}=Ge(),n=pe(s=>s.system.isProcessing);function r(s){return/\s/.test(s)}function i(s){let l;return r(s)&&(l=t("modelmanager:cannotUseSpaces")),l}const o={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=s=>{const l=s;s.path===""&&delete l.path,s.repo_id===""&&delete l.repo_id,s.vae.path===""&&delete l.vae.path,s.vae.repo_id===""&&delete l.vae.repo_id,e(Uy(l)),e(Uh(null))};return v.jsxs(je,{children:[v.jsx(Je,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Uh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:v.jsx(lq,{})}),v.jsx(e3,{initialValues:o,onSubmit:a,children:({handleSubmit:s,errors:l,touched:u})=>{var d,h,m,y,b,x,k,E,_,P;return v.jsx("form",{onSubmit:s,children:v.jsxs(yn,{rowGap:"0.5rem",children:[v.jsx(r4,{children:v.jsxs(fn,{isInvalid:!!l.name&&u.name,isRequired:!0,children:[v.jsx(En,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),l.name&&u.name?v.jsx(cr,{children:l.name}):v.jsx(ur,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]})}),v.jsx(r4,{children:v.jsxs(fn,{isInvalid:!!l.description&&u.description,isRequired:!0,children:[v.jsx(En,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),l.description&&u.description?v.jsx(cr,{children:l.description}):v.jsx(ur,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]})}),v.jsxs(r4,{children:[v.jsx(Yt,{fontWeight:"bold",fontSize:"sm",children:t("modelmanager:formMessageDiffusersModelLocation")}),v.jsx(Yt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersModelLocationDesc")}),v.jsxs(fn,{isInvalid:!!l.path&&u.path,children:[v.jsx(En,{htmlFor:"path",fontSize:"sm",children:t("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"path",name:"path",type:"text",width:"2xl"}),l.path&&u.path?v.jsx(cr,{children:l.path}):v.jsx(ur,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!l.repo_id&&u.repo_id,children:[v.jsx(En,{htmlFor:"repo_id",fontSize:"sm",children:t("modelmanager:repo_id")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),l.repo_id&&u.repo_id?v.jsx(cr,{children:l.repo_id}):v.jsx(ur,{margin:0,children:t("modelmanager:repoIDValidationMsg")})]})]})]}),v.jsxs(r4,{children:[v.jsx(Yt,{fontWeight:"bold",children:t("modelmanager:formMessageDiffusersVAELocation")}),v.jsx(Yt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersVAELocationDesc")}),v.jsxs(fn,{isInvalid:!!((d=l.vae)!=null&&d.path)&&((h=u.vae)==null?void 0:h.path),children:[v.jsx(En,{htmlFor:"vae.path",fontSize:"sm",children:t("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(m=l.vae)!=null&&m.path&&((y=u.vae)!=null&&y.path)?v.jsx(cr,{children:(b=l.vae)==null?void 0:b.path}):v.jsx(ur,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(fn,{isInvalid:!!((x=l.vae)!=null&&x.repo_id)&&((k=u.vae)==null?void 0:k.repo_id),children:[v.jsx(En,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelmanager:vaeRepoID")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:fr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(E=l.vae)!=null&&E.repo_id&&((_=u.vae)!=null&&_.repo_id)?v.jsx(cr,{children:(P=l.vae)==null?void 0:P.repo_id}):v.jsx(ur,{margin:0,children:t("modelmanager:vaeRepoIDValidationMsg")})]})]})]}),v.jsx(nr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function uj({text:e,onClick:t}){return v.jsx(je,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:t,children:v.jsx(Yt,{fontWeight:"bold",children:e})})}function YFe(){const{isOpen:e,onOpen:t,onClose:n}=Yh(),r=pe(s=>s.ui.addNewModelUIOption),i=Oe(),{t:o}=Ge(),a=()=>{n(),i(Uh(null))};return v.jsxs(v.Fragment,{children:[v.jsx(nr,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:v.jsxs(je,{columnGap:"0.5rem",alignItems:"center",children:[v.jsx(qy,{}),o("modelmanager:addNew")]})}),v.jsxs(Qd,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[v.jsx(Jd,{}),v.jsxs(tp,{className:"modal add-model-modal",fontFamily:"Inter",children:[v.jsx(E0,{children:o("modelmanager:addNewModel")}),v.jsx(Dy,{marginTop:"0.3rem"}),v.jsxs(s0,{className:"add-model-modal-body",children:[r==null&&v.jsxs(je,{columnGap:"1rem",children:[v.jsx(uj,{text:o("modelmanager:addCheckpointModel"),onClick:()=>i(Uh("ckpt"))}),v.jsx(uj,{text:o("modelmanager:addDiffuserModel"),onClick:()=>i(Uh("diffusers"))})]}),r=="ckpt"&&v.jsx(GFe,{}),r=="diffusers"&&v.jsx(qFe,{})]})]})]})]})}function i4(e){const{isProcessing:t,isConnected:n}=pe(y=>y.system),r=pe(y=>y.system.openModel),{t:i}=Ge(),o=Oe(),{name:a,status:s,description:l}=e,u=()=>{o(tq(a))},d=()=>{o(jR(a))},h=()=>{o(n_e(a)),o(jR(null))},m=()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}};return v.jsxs(je,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[v.jsx(Eo,{onClick:d,cursor:"pointer",children:v.jsx(yi,{label:l,hasArrow:!0,placement:"bottom",children:v.jsx(Yt,{fontWeight:"bold",children:a})})}),v.jsx(CF,{onClick:d,cursor:"pointer"}),v.jsxs(je,{gap:2,alignItems:"center",children:[v.jsx(Yt,{color:m(),children:s}),v.jsx(ls,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),v.jsx(Je,{icon:v.jsx(qEe,{}),size:"sm",onClick:d,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),v.jsx(fw,{title:i("modelmanager:deleteModel"),acceptCallback:h,acceptButtonText:i("modelmanager:delete"),triggerComponent:v.jsx(Je,{icon:v.jsx(GEe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:v.jsxs(je,{rowGap:"1rem",flexDirection:"column",children:[v.jsx("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),v.jsx("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const KFe=lt(or,e=>ke.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:ke.isEqual}});function t7({label:e,isActive:t,onClick:n}){return v.jsx(nr,{onClick:n,isActive:t,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:e})}const XFe=()=>{const e=pe(KFe),[t,n]=w.useState(""),[r,i]=w.useState("all"),[o,a]=w.useTransition(),{t:s}=Ge(),l=d=>{a(()=>{n(d.target.value)})},u=w.useMemo(()=>{const d=[],h=[],m=[],y=[];return e.forEach((b,x)=>{b.name.toLowerCase().includes(t.toLowerCase())&&(m.push(v.jsx(i4,{name:b.name,status:b.status,description:b.description},x)),b.format===r&&y.push(v.jsx(i4,{name:b.name,status:b.status,description:b.description},x))),b.format!=="diffusers"?d.push(v.jsx(i4,{name:b.name,status:b.status,description:b.description},x)):h.push(v.jsx(i4,{name:b.name,status:b.status,description:b.description},x))}),t!==""?r==="all"?v.jsx(Eo,{marginTop:"1rem",children:m}):v.jsx(Eo,{marginTop:"1rem",children:y}):v.jsxs(je,{flexDirection:"column",rowGap:"1.5rem",children:[r==="all"&&v.jsxs(v.Fragment,{children:[v.jsxs(Eo,{children:[v.jsx(Yt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:s("modelmanager:checkpointModels")}),d]}),v.jsxs(Eo,{children:[v.jsx(Yt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:s("modelmanager:diffusersModels")}),h]})]}),r==="ckpt"&&v.jsx(je,{flexDirection:"column",marginTop:"1rem",children:d}),r==="diffusers"&&v.jsx(je,{flexDirection:"column",marginTop:"1rem",children:h})]})},[e,t,s,r]);return v.jsxs(je,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[v.jsxs(je,{justifyContent:"space-between",children:[v.jsx(Yt,{fontSize:"1.4rem",fontWeight:"bold",children:s("modelmanager:availableModels")}),v.jsx(YFe,{})]}),v.jsx(fr,{onChange:l,label:s("modelmanager:search")}),v.jsxs(je,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[v.jsxs(je,{columnGap:"0.5rem",children:[v.jsx(t7,{label:s("modelmanager:allModels"),onClick:()=>i("all"),isActive:r==="all"}),v.jsx(t7,{label:s("modelmanager:checkpointModels"),onClick:()=>i("ckpt"),isActive:r==="ckpt"}),v.jsx(t7,{label:s("modelmanager:diffusersModels"),onClick:()=>i("diffusers"),isActive:r==="diffusers"})]}),u]})]})};function ZFe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Yh(),i=pe(s=>s.system.model_list),o=pe(s=>s.system.openModel),{t:a}=Ge();return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:n}),v.jsxs(Qd,{isOpen:t,onClose:r,size:"6xl",children:[v.jsx(Jd,{}),v.jsxs(tp,{className:"modal",fontFamily:"Inter",children:[v.jsx(Dy,{className:"modal-close-btn"}),v.jsx(E0,{fontWeight:"bold",children:a("modelmanager:modelManager")}),v.jsxs(je,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[v.jsx(XFe,{}),o&&i[o].format==="diffusers"?v.jsx(VFe,{}):v.jsx(zFe,{})]})]})]})]})}const QFe=lt([or],e=>{const{isProcessing:t,model_list:n}=e;return{models:ke.map(n,(i,o)=>o),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),JFe=()=>{const e=Oe(),{models:t,isProcessing:n}=pe(QFe),r=pe(oq),i=o=>{e(tq(o.target.value))};return v.jsx(je,{style:{paddingLeft:"0.3rem"},children:v.jsx(rl,{style:{fontSize:"0.8rem"},tooltip:r.description,isDisabled:n,value:r.name,validValues:t,onChange:i})})},eze=lt([or,xp],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:ke.map(o,(u,d)=>d),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),tze=({children:e})=>{const t=Oe(),{t:n}=Ge(),r=pe(_=>_.generation.steps),{isOpen:i,onOpen:o,onClose:a}=Yh(),{isOpen:s,onOpen:l,onClose:u}=Yh(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:m,saveIntermediatesInterval:y,enableImageDebugging:b,shouldUseCanvasBetaLayout:x}=pe(eze),k=()=>{iq.purge().then(()=>{a(),l()})},E=_=>{_>r&&(_=r),_<1&&(_=1),t(gCe(_))};return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:o}),v.jsxs(Qd,{isOpen:i,onClose:a,size:"lg",children:[v.jsx(Jd,{}),v.jsxs(tp,{className:"modal settings-modal",children:[v.jsx(E0,{className:"settings-modal-header",children:n("common:settingsLabel")}),v.jsx(Dy,{className:"modal-close-btn"}),v.jsxs(s0,{className:"settings-modal-content",children:[v.jsxs("div",{className:"settings-modal-items",children:[v.jsxs("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[v.jsx(rl,{label:n("settings:displayInProgress"),validValues:_7e,value:d,onChange:_=>t(sCe(_.target.value))}),d==="full-res"&&v.jsx(ia,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:E,value:y,width:"auto",textAlign:"center"})]}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:_=>t(XU(_.target.checked))}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:_=>t(dCe(_.target.checked))}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:x,onChange:_=>t(TCe(_.target.checked))})]}),v.jsxs("div",{className:"settings-modal-items",children:[v.jsx("h2",{style:{fontWeight:"bold"},children:"Developer"}),v.jsx(Us,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:_=>t(mCe(_.target.checked))})]}),v.jsxs("div",{className:"settings-modal-reset",children:[v.jsx($h,{size:"md",children:n("settings:resetWebUI")}),v.jsx(ls,{colorScheme:"red",onClick:k,children:n("settings:resetWebUI")}),v.jsx(Yt,{children:n("settings:resetWebUIDesc1")}),v.jsx(Yt,{children:n("settings:resetWebUIDesc2")})]})]}),v.jsx(wx,{children:v.jsx(ls,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),v.jsxs(Qd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[v.jsx(Jd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),v.jsx(tp,{children:v.jsx(s0,{pb:6,pt:6,children:v.jsx(je,{justifyContent:"center",children:v.jsx(Yt,{fontSize:"lg",children:v.jsx(Yt,{children:n("settings:resetComplete")})})})})})]})]})},nze=lt(or,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),rze=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=pe(nze),s=Oe(),{t:l}=Ge();let u;e&&!o?u="status-good":u="status-bad";let d=i;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(d)&&(u="status-working"),d&&t&&r>1&&(d=`${l(d)} (${n}/${r})`);const m=o&&!a?"Click to clear, check logs for details":void 0,y=o&&!a?"pointer":"initial",b=()=>{(o||!a)&&s(ZU())};return v.jsx(yi,{label:m,children:v.jsx(Yt,{cursor:y,onClick:b,className:`status ${u}`,children:l(d)})})};function ize(){const{t:e}=Ge(),{setColorMode:t,colorMode:n}=vy(),r=Oe(),i=pe(l=>l.ui.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};w.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(CCe(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(v.jsx(nr,{style:{width:"6rem"},leftIcon:i===u?v.jsx(RP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(MEe,{})}),children:v.jsx(yn,{align:"stretch",children:s()})})}function oze(){const{t:e,i18n:t}=Ge(),n={en:e("common:langEnglish"),nl:e("common:langDutch"),fr:e("common:langFrench"),de:e("common:langGerman"),it:e("common:langItalian"),ja:e("common:langJapanese"),pl:e("common:langPolish"),pt_br:e("common:langBrPortuguese"),ru:e("common:langRussian"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish"),ua:e("common:langUkranian")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(v.jsx(nr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return v.jsx(Js,{trigger:"hover",triggerComponent:v.jsx(Je,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:v.jsx(LEe,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:v.jsx(yn,{children:r()})})}const aze=()=>{const{t:e}=Ge(),t=pe(n=>n.system.app_version);return v.jsxs("div",{className:"site-header",children:[v.jsxs("div",{className:"site-header-left-side",children:[v.jsx("img",{src:zY,alt:"invoke-ai-logo"}),v.jsxs(je,{alignItems:"center",columnGap:"0.6rem",children:[v.jsxs(Yt,{fontSize:"1.4rem",children:["invoke ",v.jsx("strong",{children:"ai"})]}),v.jsx(Yt,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),v.jsxs("div",{className:"site-header-right-side",children:[v.jsx(rze,{}),v.jsx(JFe,{}),v.jsx(ZFe,{children:v.jsx(Je,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(xEe,{})})}),v.jsx(GDe,{children:v.jsx(Je,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(TEe,{})})}),v.jsx(ize,{}),v.jsx(oze,{}),v.jsx(Je,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Fh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:v.jsx(SEe,{})})}),v.jsx(Je,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Fh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:v.jsx(gEe,{})})}),v.jsx(Je,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Fh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:v.jsx(pEe,{})})}),v.jsx(tze,{children:v.jsx(Je,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:v.jsx(sPe,{})})})]})]})};function sze(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const lze=()=>{const e=Oe(),t=pe(__e),n=Fy();w.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(yCe())},[e,n,t])},YK=lt([Cp,xp,Mr],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:o,shouldUseCanvasBetaLayout:a}=t,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=e,d=a&&n==="unifiedCanvas",h=!d&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!d&&(!r||!i),shouldShowParametersPanelButton:h,shouldShowParametersPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:ke.isEqual}}),uze=()=>{const e=Oe(),{shouldShowParametersPanel:t,shouldShowParametersPanelButton:n,shouldShowProcessButtons:r,shouldPinParametersPanel:i,shouldShowGallery:o,shouldPinGallery:a}=pe(YK),s=()=>{e(Zu(!0)),i&&setTimeout(()=>e(vi(!0)),400)};return et("f",()=>{o||t?(e(Zu(!1)),e(Hd(!1))):(e(Zu(!0)),e(Hd(!0))),(a||i)&&setTimeout(()=>e(vi(!0)),400)},[o,t]),n?v.jsxs("div",{className:"show-hide-button-options",children:[v.jsx(Je,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:v.jsx(jP,{})}),r&&v.jsxs(v.Fragment,{children:[v.jsx(rT,{iconButton:!0}),v.jsx(tT,{})]})]}):null},cze=()=>{const e=Oe(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowParametersPanel:i,shouldPinParametersPanel:o}=pe(YK),a=()=>{e(Hd(!0)),r&&e(vi(!0))};return et("f",()=>{t||i?(e(Zu(!1)),e(Hd(!1))):(e(Zu(!0)),e(Hd(!0))),(r||o)&&setTimeout(()=>e(vi(!0)),400)},[t,i]),n?v.jsx(Je,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:v.jsx(Fq,{})}):null};sze();const dze=()=>(lze(),v.jsxs("div",{className:"App",children:[v.jsxs($De,{children:[v.jsx(WDe,{}),v.jsxs("div",{className:"app-content",children:[v.jsx(aze,{}),v.jsx(WRe,{})]}),v.jsx("div",{className:"app-console",children:v.jsx(HDe,{})})]}),v.jsx(uze,{}),v.jsx(cze,{})]})),cj=()=>v.jsx(je,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:v.jsx(Py,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})});const fze=$j({key:"invokeai-style-cache",prepend:!0});n8.createRoot(document.getElementById("root")).render(v.jsx(N.StrictMode,{children:v.jsx(W5e,{store:rq,children:v.jsx(TW,{loading:v.jsx(cj,{}),persistor:iq,children:v.jsx(ire,{value:fze,children:v.jsx(u5e,{children:v.jsx(N.Suspense,{fallback:v.jsx(cj,{}),children:v.jsx(dze,{})})})})})})})); diff --git a/invokeai/frontend/dist/index.html b/invokeai/frontend/dist/index.html index 8fc02c019c..9cb8f6254e 100644 --- a/invokeai/frontend/dist/index.html +++ b/invokeai/frontend/dist/index.html @@ -5,7 +5,7 @@ InvokeAI - A Stable Diffusion Toolkit - + diff --git a/invokeai/frontend/dist/locales/common/en.json b/invokeai/frontend/dist/locales/common/en.json index 7d38074520..dae6032dba 100644 --- a/invokeai/frontend/dist/locales/common/en.json +++ b/invokeai/frontend/dist/locales/common/en.json @@ -58,5 +58,7 @@ "statusUpscaling": "Upscaling", "statusUpscalingESRGAN": "Upscaling (ESRGAN)", "statusLoadingModel": "Loading Model", - "statusModelChanged": "Model Changed" + "statusModelChanged": "Model Changed", + "statusConvertingModel": "Converting Model", + "statusModelConverted": "Model Converted" } diff --git a/invokeai/frontend/dist/locales/modelmanager/en-US.json b/invokeai/frontend/dist/locales/modelmanager/en-US.json index f90fe59ca5..a58592bd2f 100644 --- a/invokeai/frontend/dist/locales/modelmanager/en-US.json +++ b/invokeai/frontend/dist/locales/modelmanager/en-US.json @@ -70,7 +70,7 @@ "convertToDiffusersHelpText2": "This process will replace your Model Manager entry with the Diffusers version of the same model.", "convertToDiffusersHelpText3": "Your checkpoint file on the disk will NOT be deleted or modified in anyway. You can add your checkpoint to the Model Manager again if you want to.", "convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.", - "convertToDiffusersHelpText5": "This process will create a Diffusers version of this model in the same directory as your checkpoint. Please make sure you have enough disk space.", + "convertToDiffusersHelpText5": "Please make sure you have enough disk space. Models generally vary between 4GB-7GB in size.", "convertToDiffusersHelpText6": "Do you wish to convert this model?", "v1": "v1", "v2": "v2", diff --git a/invokeai/frontend/dist/locales/modelmanager/en.json b/invokeai/frontend/dist/locales/modelmanager/en.json index 6d6481085c..be4830799f 100644 --- a/invokeai/frontend/dist/locales/modelmanager/en.json +++ b/invokeai/frontend/dist/locales/modelmanager/en.json @@ -70,16 +70,18 @@ "convertToDiffusersHelpText2": "This process will replace your Model Manager entry with the Diffusers version of the same model.", "convertToDiffusersHelpText3": "Your checkpoint file on the disk will NOT be deleted or modified in anyway. You can add your checkpoint to the Model Manager again if you want to.", "convertToDiffusersHelpText4": "This is a one time process only. It might take around 30s-60s depending on the specifications of your computer.", - "convertToDiffusersHelpText5": "This process will create a Diffusers version of this model in the same directory as your checkpoint. Please make sure you have enough disk space.", + "convertToDiffusersHelpText5": "Please make sure you have enough disk space. Models generally vary between 4GB-7GB in size.", "convertToDiffusersHelpText6": "Do you wish to convert this model?", + "convertToDiffusersSaveLocation": "Save Location", "v1": "v1", "v2": "v2", "inpainting": "v1 Inpainting", - "customConfig": "Custom Config", + "customConfig": "Custom Config", "pathToCustomConfig": "Path To Custom Config", "statusConverting": "Converting", - "sameFolder": "Same Folder", - "invokeRoot": "Invoke Models", + "modelConverted": "Model Converted", + "sameFolder": "Same folder", + "invokeRoot": "InvokeAI folder", "custom": "Custom", "customSaveLocation": "Custom Save Location" } diff --git a/invokeai/frontend/stats.html b/invokeai/frontend/stats.html index 466f841ddb..1c2fbac2dc 100644 --- a/invokeai/frontend/stats.html +++ b/invokeai/frontend/stats.html @@ -6157,7 +6157,7 @@ var drawChart = (function (exports) {